[SPIR-V][vk::SampledTexture] #8. Support vk::SampledTexture2DArray type. #8188
[SPIR-V][vk::SampledTexture] #8. Support vk::SampledTexture2DArray type. #8188s-perron merged 2 commits intomicrosoft:mainfrom
vk::SampledTexture2DArray type. #8188Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the Vulkan vk::SampledTexture support in the SPIR-V path by adding the vk::SampledTexture2DArray object type (with 3-component coordinates) and wiring it through semantic analysis, type lowering, and SPIR-V emission, along with new/updated CodeGenSPIRV tests.
Changes:
- Add
vk::SampledTexture2DArrayas a legal intrinsic/object type and expose its method set in the HCT database. - Update SPIR-V type lowering and codegen to recognize sampled-texture objects (including array form) for sampling/gathering and indexing (
operator[]/.mips[]). - Add and update CodeGenSPIRV tests to validate sampling, gather, load, dimensions, and indexing for
vk::SampledTexture2Dandvk::SampledTexture2DArray.
Reviewed changes
Copilot reviewed 41 out of 41 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| utils/hct/hctdb.py | Allow VkSampledTexture2DArray in the intrinsic object-type matcher. |
| utils/hct/gen_intrin_main.txt | Define method sets for VkSampledTexture2D (expanded) and new VkSampledTexture2DArray. |
| include/dxc/dxcapi.internal.h | Add LICOMPTYPE_VK_SAMPLED_TEXTURE2D_ARRAY enum entry and bump count. |
| tools/clang/lib/Sema/SemaHLSL.cpp | Add basic kind/type plumbing, resource-kind mapping, and method dispatch for SampledTexture2DArray. |
| tools/clang/lib/SPIRV/AstTypeProbe.cpp | Treat vk::SampledTexture2DArray as a sampled texture for SPIR-V codegen decisions. |
| tools/clang/lib/SPIRV/LowerTypeVisitor.cpp | Lower vk::SampledTexture2DArray to an arrayed 2D sampled image type. |
| tools/clang/lib/SPIRV/SpirvEmitter.cpp | Extend sampling/gather/indexing paths to work with sampled-texture objects and optional arg parsing. |
| tools/clang/lib/AST/ASTContextHLSL.cpp | Remove now-stale TODO comment about only supporting SampledTexture2D. |
| tools/clang/test/CodeGenSPIRV/vk.sampledtexture.sample.hlsl | Update/extend sample coverage to include SampledTexture2DArray. |
| tools/clang/test/CodeGenSPIRV/vk.sampledtexture.gather.hlsl | Update/extend gather coverage to include SampledTexture2DArray. |
| tools/clang/test/CodeGenSPIRV/vk.sampledtexture.load.hlsl | Extend load coverage to include SampledTexture2DArray. |
| tools/clang/test/CodeGenSPIRV/vk.sampledtexture.get-dimensions.hlsl | Extend GetDimensions coverage to include array elements/levels for sampled textures. |
| tools/clang/test/CodeGenSPIRV/vk.sampledtexture.calculate-lod.hlsl | Add CalculateLevelOfDetail coverage for SampledTexture2DArray. |
| tools/clang/test/CodeGenSPIRV/vk.sampledtexture.calculate-lod-unclamped.hlsl | Add CalculateLevelOfDetailUnclamped coverage for SampledTexture2DArray. |
| tools/clang/test/CodeGenSPIRV/vk.sampledtexture.sample-level.hlsl | New: SampleLevel coverage (2D + array). |
| tools/clang/test/CodeGenSPIRV/vk.sampledtexture.sample-grad.hlsl | New: SampleGrad coverage (2D + array). |
| tools/clang/test/CodeGenSPIRV/vk.sampledtexture.sample-cmp.hlsl | New: SampleCmp coverage (2D + array). |
| tools/clang/test/CodeGenSPIRV/vk.sampledtexture.sample-cmp-level-zero.hlsl | New: SampleCmpLevelZero coverage (2D + array). |
| tools/clang/test/CodeGenSPIRV/vk.sampledtexture.sample-cmp-grad.hlsl | New: SampleCmpGrad coverage. |
| tools/clang/test/CodeGenSPIRV/vk.sampledtexture.sample-cmp-bias.hlsl | New: SampleCmpBias coverage. |
| tools/clang/test/CodeGenSPIRV/vk.sampledtexture.sample-bias.hlsl | New: SampleBias coverage (2D + array). |
| tools/clang/test/CodeGenSPIRV/vk.sampledtexture.cmp-level.hlsl | New: SampleCmpLevel coverage (2D + array). |
| tools/clang/test/CodeGenSPIRV/vk.sampledtexture.access.hlsl | New: operator[] coverage for sampled textures (2D + array). |
| tools/clang/test/CodeGenSPIRV/vk.sampledtexture.mips-access.hlsl | New: .mips[] indexing coverage for sampled textures (2D + array). |
| tools/clang/test/CodeGenSPIRV/vk.sampledtexture.gather-red.hlsl | New: GatherRed coverage (2D + array). |
| tools/clang/test/CodeGenSPIRV/vk.sampledtexture.gather-green.hlsl | New: GatherGreen coverage (2D + array). |
| tools/clang/test/CodeGenSPIRV/vk.sampledtexture.gather-blue.hlsl | New: GatherBlue coverage (2D + array). |
| tools/clang/test/CodeGenSPIRV/vk.sampledtexture.gather-alpha.hlsl | New: GatherAlpha coverage (2D + array). |
| tools/clang/test/CodeGenSPIRV/vk.sampledtexture.gather-cmp.hlsl | New: GatherCmp coverage (2D + array). |
| tools/clang/test/CodeGenSPIRV/vk.sampledtexture.gather-cmp-red.hlsl | New: GatherCmpRed coverage (2D + array). |
| tools/clang/test/CodeGenSPIRV/vk.sampledtexture.gather-cmp-green.hlsl | New: negative test for Vulkan-missing GatherCmpGreen. |
| tools/clang/test/CodeGenSPIRV/vk.sampledtexture.gather-cmp-blue.hlsl | New: negative test for Vulkan-missing GatherCmpBlue. |
| tools/clang/test/CodeGenSPIRV/vk.sampledtexture.gather-cmp-alpha.hlsl | New: negative test for Vulkan-missing GatherCmpAlpha. |
| tools/clang/test/CodeGenSPIRV/texture.sample.hlsl | Adjust CHECK ordering for clamp load vs image/sampler load. |
| tools/clang/test/CodeGenSPIRV/texture.sample-grad.hlsl | Adjust CHECK ordering for clamp load vs image/sampler load. |
| tools/clang/test/CodeGenSPIRV/texture.sample-cmp.hlsl | Adjust CHECK ordering for clamp load vs image/sampler/comparator load. |
| tools/clang/test/CodeGenSPIRV/texture.sample-bias.hlsl | Adjust CHECK ordering for clamp load vs image/sampler load. |
| tools/clang/test/CodeGenSPIRV/texture.array.sample.hlsl | Adjust CHECK ordering for clamp load vs image/sampler load. |
| tools/clang/test/CodeGenSPIRV/texture.array.sample-grad.hlsl | Adjust CHECK ordering for clamp load vs image/sampler load. |
| tools/clang/test/CodeGenSPIRV/texture.array.sample-cmp.hlsl | Adjust CHECK ordering for clamp load vs image/sampler/comparator load. |
| tools/clang/test/CodeGenSPIRV/texture.array.sample-bias.hlsl | Adjust CHECK ordering for clamp load vs image/sampler load. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tools/clang/test/CodeGenSPIRV/vk.sampledtexture.sample-level.hlsl
Outdated
Show resolved
Hide resolved
0f256ae to
9db3dfa
Compare
9db3dfa to
16294e5
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 30 out of 30 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tools/clang/test/CodeGenSPIRV/vk.sampledtexture.get-dimensions.hlsl
Outdated
Show resolved
Hide resolved
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
(also updated all the PRs to wrap the texture type under |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Part of #7979
vk::SampledTexture2DArraytakes coordinate of vector size 3.The function definitions are equivalent to that of
Texture2DArray, just withoutSamplerargument.