summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--source/slang/slang-reflection.cpp20
-rw-r--r--tests/reflection/mix-explicit-and-implicit-spaces.slang.expected15
-rw-r--r--tests/reflection/parameter-block-explicit-space.slang.expected10
-rw-r--r--tests/reflection/resource-in-cbuffer.hlsl.expected6
4 files changed, 10 insertions, 41 deletions
diff --git a/source/slang/slang-reflection.cpp b/source/slang/slang-reflection.cpp
index 6d53e1a89..1daec501d 100644
--- a/source/slang/slang-reflection.cpp
+++ b/source/slang/slang-reflection.cpp
@@ -831,27 +831,11 @@ static SlangParameterCategory getParameterCategory(
return SLANG_PARAMETER_CATEGORY_MIXED;
}
-static TypeLayout* maybeGetContainerLayout(TypeLayout* typeLayout)
-{
- if (auto parameterGroupTypeLayout = as<ParameterGroupTypeLayout>(typeLayout))
- {
- auto containerTypeLayout = parameterGroupTypeLayout->containerVarLayout->typeLayout;
- if (containerTypeLayout->resourceInfos.getCount() != 0)
- {
- return containerTypeLayout;
- }
- }
-
- return typeLayout;
-}
-
SLANG_API SlangParameterCategory spReflectionTypeLayout_GetParameterCategory(SlangReflectionTypeLayout* inTypeLayout)
{
auto typeLayout = convert(inTypeLayout);
if(!typeLayout) return SLANG_PARAMETER_CATEGORY_NONE;
- typeLayout = maybeGetContainerLayout(typeLayout);
-
return getParameterCategory(typeLayout);
}
@@ -860,8 +844,6 @@ SLANG_API unsigned spReflectionTypeLayout_GetCategoryCount(SlangReflectionTypeLa
auto typeLayout = convert(inTypeLayout);
if(!typeLayout) return 0;
- typeLayout = maybeGetContainerLayout(typeLayout);
-
return (unsigned) typeLayout->resourceInfos.getCount();
}
@@ -870,8 +852,6 @@ SLANG_API SlangParameterCategory spReflectionTypeLayout_GetCategoryByIndex(Slang
auto typeLayout = convert(inTypeLayout);
if(!typeLayout) return SLANG_PARAMETER_CATEGORY_NONE;
- typeLayout = maybeGetContainerLayout(typeLayout);
-
return typeLayout->resourceInfos[index].kind;
}
diff --git a/tests/reflection/mix-explicit-and-implicit-spaces.slang.expected b/tests/reflection/mix-explicit-and-implicit-spaces.slang.expected
index 2e4ead342..63fe23551 100644
--- a/tests/reflection/mix-explicit-and-implicit-spaces.slang.expected
+++ b/tests/reflection/mix-explicit-and-implicit-spaces.slang.expected
@@ -6,10 +6,7 @@ standard output = {
"parameters": [
{
"name": "a",
- "bindings": [
- {"kind": "constantBuffer", "index": 0, "count": 0},
- {"kind": "registerSpace", "index": 0}
- ],
+ "binding": {"kind": "registerSpace", "index": 0},
"type": {
"kind": "parameterBlock",
"elementType": {
@@ -53,10 +50,7 @@ standard output = {
},
{
"name": "b",
- "bindings": [
- {"kind": "constantBuffer", "index": 0, "count": 0},
- {"kind": "registerSpace", "index": 1}
- ],
+ "binding": {"kind": "registerSpace", "index": 1},
"type": {
"kind": "parameterBlock",
"elementType": {
@@ -100,10 +94,7 @@ standard output = {
},
{
"name": "c",
- "bindings": [
- {"kind": "constantBuffer", "index": 0, "count": 0},
- {"kind": "registerSpace", "index": 2}
- ],
+ "binding": {"kind": "registerSpace", "index": 2},
"type": {
"kind": "parameterBlock",
"elementType": {
diff --git a/tests/reflection/parameter-block-explicit-space.slang.expected b/tests/reflection/parameter-block-explicit-space.slang.expected
index a96f95961..1aa41519d 100644
--- a/tests/reflection/parameter-block-explicit-space.slang.expected
+++ b/tests/reflection/parameter-block-explicit-space.slang.expected
@@ -6,10 +6,7 @@ standard output = {
"parameters": [
{
"name": "a",
- "bindings": [
- {"kind": "constantBuffer", "index": 0, "count": 0},
- {"kind": "registerSpace", "index": 2}
- ],
+ "binding": {"kind": "registerSpace", "index": 2},
"type": {
"kind": "parameterBlock",
"elementType": {
@@ -111,10 +108,7 @@ standard output = {
},
{
"name": "b",
- "bindings": [
- {"kind": "constantBuffer", "index": 0, "count": 0},
- {"kind": "registerSpace", "index": 3}
- ],
+ "binding": {"kind": "registerSpace", "index": 3},
"type": {
"kind": "parameterBlock",
"elementType": {
diff --git a/tests/reflection/resource-in-cbuffer.hlsl.expected b/tests/reflection/resource-in-cbuffer.hlsl.expected
index 03299a8e0..3be146d7c 100644
--- a/tests/reflection/resource-in-cbuffer.hlsl.expected
+++ b/tests/reflection/resource-in-cbuffer.hlsl.expected
@@ -6,7 +6,11 @@ standard output = {
"parameters": [
{
"name": "MyConstantBuffer",
- "binding": {"kind": "constantBuffer", "index": 0},
+ "bindings": [
+ {"kind": "constantBuffer", "index": 0},
+ {"kind": "shaderResource", "index": 0},
+ {"kind": "samplerState", "index": 0}
+ ],
"type": {
"kind": "constantBuffer",
"elementType": {