Skip to content

Add Fetch and Size methods on samplers and storage textures - #103

Merged
SirLynix merged 4 commits into
NazaraEngine:mainfrom
ArthurVasseur:texel-fetch-size-queries
Sep 17, 2026
Merged

SirLynix merged 4 commits into
NazaraEngine:mainfrom
ArthurVasseur:texel-fetch-size-queries

Conversation

@ArthurVasseur

Copy link
Copy Markdown
Contributor

This MR adds texel fetching and texture size queries to NZSL, as new methods on samplers and storage textures.

Method Available on Signature GLSL SPIR-V
Fetch Samplers, except depth samplers and cubemaps Fetch(coords: vecN[i32], lod: i32) -> vec4[T] texelFetch OpImage + OpImageFetch (Lod operand)
Size Samplers Size(lod: i32) -> i32 / vecN[i32] textureSize OpImage + OpImageQuerySizeLod
Size Storage textures Size() -> i32 / vecN[i32] imageSize OpImageQuerySize

Type returned by Size:

  • i32 for 1D images
  • vec2[i32] for 1D arrays, 2D images and cubemaps
  • vec3[i32] for 2D arrays and 3D images

@codecov

codecov Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.52880% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.73%. Comparing base (e080108) to head (3965fea).

Files with missing lines Patch % Lines
...NZSL/Ast/Transformations/ValidationTransformer.cpp 70.00% 9 Missing ⚠️
src/NZSL/Ast/Utils.cpp 73.07% 7 Missing ⚠️
src/NZSL/SpirV/SpirvAstVisitor.cpp 93.47% 3 Missing ⚠️
src/NZSL/GlslWriter.cpp 93.33% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #103      +/-   ##
==========================================
+ Coverage   76.56%   76.73%   +0.16%     
==========================================
  Files         208      208              
  Lines       26342    26530     +188     
  Branches     8090     8036      -54     
==========================================
+ Hits        20170    20357     +187     
+ Misses       6056     6048       -8     
- Partials      116      125       +9     
Files with missing lines Coverage Δ
include/NZSL/SpirV/SpirvAstVisitor.hpp 100.00% <ø> (ø)
...Transformations/ConstantPropagationTransformer.cpp 69.86% <ø> (ø)
...rc/NZSL/Ast/Transformations/LiteralTransformer.cpp 81.18% <100.00%> (+0.21%) ⬆️
...rc/NZSL/Ast/Transformations/ResolveTransformer.cpp 83.70% <100.00%> (+0.06%) ⬆️
src/NZSL/LangWriter.cpp 88.39% <100.00%> (+0.20%) ⬆️
tests/src/Tests/ComputeTests.cpp 100.00% <100.00%> (ø)
tests/src/Tests/ErrorsTests.cpp 100.00% <ø> (ø)
tests/src/Tests/IdentifierTests.cpp 100.00% <100.00%> (ø)
src/NZSL/GlslWriter.cpp 84.22% <93.33%> (+0.12%) ⬆️
src/NZSL/SpirV/SpirvAstVisitor.cpp 84.75% <93.47%> (+0.35%) ⬆️
... and 2 more

... and 7 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e080108...3965fea. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ArthurVasseur
ArthurVasseur force-pushed the texel-fetch-size-queries branch from 3f4b466 to 3965fea Compare September 17, 2026 13:38

@SirLynix SirLynix left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SirLynix
SirLynix merged commit ffce3b5 into NazaraEngine:main Sep 17, 2026
56 of 64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants