summaryrefslogtreecommitdiffstats
path: root/docs/user-guide
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-03-18 11:12:12 -0700
committerGitHub <noreply@github.com>2024-03-18 11:12:12 -0700
commit2d41012ed2649093a58433eae60419d24073da90 (patch)
tree606d557ac44172f85fd6bdf22fd20b3ed3d8466d /docs/user-guide
parent667e209bc714761eb2f48b65f0153574bd0b65f2 (diff)
Update 09-reflection.md (#3787)
Diffstat (limited to 'docs/user-guide')
-rw-r--r--docs/user-guide/09-reflection.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/user-guide/09-reflection.md b/docs/user-guide/09-reflection.md
index 7e4efe23b..cef2f0b10 100644
--- a/docs/user-guide/09-reflection.md
+++ b/docs/user-guide/09-reflection.md
@@ -71,7 +71,7 @@ In the simple case, we can query this information directly:
```c++
slang::ParameterCategory category = parameter->getCategory();
unsigned index = parameter->getBindingIndex();
-unsigned space = parameter->getBindingSpace() + parameter->getOffset(SLANG_PARAMETER_CATEGORY_REGISTER_SPACE);
+unsigned space = parameter->getBindingSpace() + parameter->getOffset(SLANG_PARAMETER_CATEGORY_SUB_ELEMENT_REGISTER_SPACE);
```
For a simple global-scope "resource" parameter (e.g., HLSL `Texture2D t : register(t3)`) the `category` tells what kind of resource the parameter consumes (e.g., `slang::ParameterCategory::ShaderResource`), the `index` gives the register number (`3`), and `space` gives the register "space" (`0`) as added for D3D12.
@@ -95,7 +95,7 @@ for(unsigned cc = 0; cc < categoryCount; cc++)
size_t offsetForCategory = parameter->getOffset(category);
size_t spaceForCategory = parameter->getBindingSpace(category)
- + parameter->getOffset(SLANG_PARAMETER_CATEGORY_REGISTER_SPACE);
+ + parameter->getOffset(SLANG_PARAMETER_CATEGORY_SUB_ELEMENT_REGISTER_SPACE);
// ...
}