diff options
| author | Copilot <198982749+Copilot@users.noreply.github.com> | 2025-07-24 22:45:11 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-25 05:45:11 +0000 |
| commit | c5091f0ae3a8b816af893e84ef289f745acf39dc (patch) | |
| tree | 2a544b068bf5e5070da06e06ec0052d7300b9fe6 /source | |
| parent | 528ca0d0e55df88a9a97ba071ae803a62a34ae5a (diff) | |
Add combined texture-sampler flag to reflection API to differentiate Texture2D from Sampler2D (#7901)
* Initial plan
* Add SLANG_TEXTURE_COMBINED_FLAG to differentiate combined texture-samplers
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Fix regression in hlsl-to-vulkan-combined test by updating expected output
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-ast-type.cpp | 2 | ||||
| -rw-r--r-- | source/slang/slang-reflection-json.cpp | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/source/slang/slang-ast-type.cpp b/source/slang/slang-ast-type.cpp index 5056e5407..8a224b305 100644 --- a/source/slang/slang-ast-type.cpp +++ b/source/slang/slang-ast-type.cpp @@ -1118,6 +1118,8 @@ SlangResourceShape ResourceType::getShape() baseShape = (SlangResourceShape)((uint32_t)baseShape | SLANG_TEXTURE_SHADOW_FLAG); if (isFeedback()) baseShape = (SlangResourceShape)((uint32_t)baseShape | SLANG_TEXTURE_FEEDBACK_FLAG); + if (isCombined()) + baseShape = (SlangResourceShape)((uint32_t)baseShape | SLANG_TEXTURE_COMBINED_FLAG); return baseShape; } diff --git a/source/slang/slang-reflection-json.cpp b/source/slang/slang-reflection-json.cpp index 72855a9b1..ee11b061a 100644 --- a/source/slang/slang-reflection-json.cpp +++ b/source/slang/slang-reflection-json.cpp @@ -496,6 +496,11 @@ static void emitReflectionResourceTypeBaseInfoJSON( writer.maybeComma(); writer << "\"feedback\": true"; } + if (shape & SLANG_TEXTURE_COMBINED_FLAG) + { + writer.maybeComma(); + writer << "\"combined\": true"; + } if (access != SLANG_RESOURCE_ACCESS_READ) { |
