summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--source/slang/slang-reflection-json.cpp4
-rw-r--r--tests/bindings/hlsl-to-vulkan-array.hlsl.expected10
-rw-r--r--tests/bindings/hlsl-to-vulkan-combined.hlsl.expected16
-rw-r--r--tests/bindings/hlsl-to-vulkan-global.hlsl.expected10
-rw-r--r--tests/bindings/hlsl-to-vulkan-shift-implicit.hlsl.expected20
-rw-r--r--tests/bindings/hlsl-to-vulkan-shift.hlsl.expected20
-rw-r--r--tests/cross-compile/cpp-resource-reflection.slang.64.expected6
-rw-r--r--tests/hlsl-intrinsic/sampler-feedback/sampler-feedback-basic.slang.expected12
-rw-r--r--tests/reflection/arrays.hlsl.expected30
-rw-r--r--tests/reflection/binding-gl.hlsl.expected30
-rw-r--r--tests/reflection/binding-push-constant-gl.hlsl.expected30
-rw-r--r--tests/reflection/cross-compile.slang.expected10
-rw-r--r--tests/reflection/default-space.slang.expected30
-rw-r--r--tests/reflection/explicit-register-space.slang.expected10
-rw-r--r--tests/reflection/global-type-params.slang.expected10
-rw-r--r--tests/reflection/multi-file.hlsl.expected50
-rw-r--r--tests/reflection/parameter-block-explicit-space.slang.expected60
-rw-r--r--tests/reflection/parameter-block.slang.1.expected30
-rw-r--r--tests/reflection/parameter-block.slang.2.expected30
-rw-r--r--tests/reflection/parameter-block.slang.expected30
-rw-r--r--tests/reflection/reflect-imported-code.hlsl.expected20
-rw-r--r--tests/reflection/reflection0.hlsl.expected10
-rw-r--r--tests/reflection/resource-in-cbuffer.hlsl.expected20
-rw-r--r--tests/reflection/shared-modifier.hlsl.expected10
-rw-r--r--tests/reflection/texture-resource-type.slang21
-rw-r--r--tests/reflection/texture-resource-type.slang.expected220
-rw-r--r--tests/reflection/unbounded-arrays.hlsl.1.expected60
-rw-r--r--tests/reflection/used-parameters.slang.expected40
28 files changed, 787 insertions, 62 deletions
diff --git a/source/slang/slang-reflection-json.cpp b/source/slang/slang-reflection-json.cpp
index 993832ad6..4e8b6b2a4 100644
--- a/source/slang/slang-reflection-json.cpp
+++ b/source/slang/slang-reflection-json.cpp
@@ -514,6 +514,10 @@ static void emitReflectionTypeInfoJSON(PrettyWriter& writer, slang::TypeReflecti
break;
case SLANG_STRUCTURED_BUFFER:
+ case SLANG_TEXTURE_1D:
+ case SLANG_TEXTURE_2D:
+ case SLANG_TEXTURE_3D:
+ case SLANG_TEXTURE_CUBE:
if (auto resultType = type->getResourceResultType())
{
writer.maybeComma();
diff --git a/tests/bindings/hlsl-to-vulkan-array.hlsl.expected b/tests/bindings/hlsl-to-vulkan-array.hlsl.expected
index c5d71a65f..b8deb1314 100644
--- a/tests/bindings/hlsl-to-vulkan-array.hlsl.expected
+++ b/tests/bindings/hlsl-to-vulkan-array.hlsl.expected
@@ -22,7 +22,15 @@ standard output = {
"name": "tex",
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
},
"binding": {"kind": "shaderResource", "index": 0}
},
diff --git a/tests/bindings/hlsl-to-vulkan-combined.hlsl.expected b/tests/bindings/hlsl-to-vulkan-combined.hlsl.expected
index 1194d50b4..32c99bd78 100644
--- a/tests/bindings/hlsl-to-vulkan-combined.hlsl.expected
+++ b/tests/bindings/hlsl-to-vulkan-combined.hlsl.expected
@@ -9,7 +9,11 @@ standard output = {
"binding": {"kind": "descriptorTableSlot", "index": 0},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
}
},
{
@@ -17,7 +21,15 @@ standard output = {
"binding": {"kind": "descriptorTableSlot", "index": 1},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
}
],
diff --git a/tests/bindings/hlsl-to-vulkan-global.hlsl.expected b/tests/bindings/hlsl-to-vulkan-global.hlsl.expected
index 7fe1f8e42..8d3a19458 100644
--- a/tests/bindings/hlsl-to-vulkan-global.hlsl.expected
+++ b/tests/bindings/hlsl-to-vulkan-global.hlsl.expected
@@ -25,7 +25,15 @@ standard output = {
"binding": {"kind": "descriptorTableSlot", "index": 0},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
diff --git a/tests/bindings/hlsl-to-vulkan-shift-implicit.hlsl.expected b/tests/bindings/hlsl-to-vulkan-shift-implicit.hlsl.expected
index a873b4149..85d13552a 100644
--- a/tests/bindings/hlsl-to-vulkan-shift-implicit.hlsl.expected
+++ b/tests/bindings/hlsl-to-vulkan-shift-implicit.hlsl.expected
@@ -9,7 +9,15 @@ standard output = {
"binding": {"kind": "shaderResource", "index": 10},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
@@ -81,7 +89,15 @@ standard output = {
"binding": {"kind": "shaderResource", "index": 11},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
diff --git a/tests/bindings/hlsl-to-vulkan-shift.hlsl.expected b/tests/bindings/hlsl-to-vulkan-shift.hlsl.expected
index 23e2b1bda..fd54b9692 100644
--- a/tests/bindings/hlsl-to-vulkan-shift.hlsl.expected
+++ b/tests/bindings/hlsl-to-vulkan-shift.hlsl.expected
@@ -9,7 +9,15 @@ standard output = {
"binding": {"kind": "shaderResource", "index": 5},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
@@ -81,7 +89,15 @@ standard output = {
"binding": {"kind": "shaderResource", "space": 2, "index": 7},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
diff --git a/tests/cross-compile/cpp-resource-reflection.slang.64.expected b/tests/cross-compile/cpp-resource-reflection.slang.64.expected
index b863827e9..4ded43e3e 100644
--- a/tests/cross-compile/cpp-resource-reflection.slang.64.expected
+++ b/tests/cross-compile/cpp-resource-reflection.slang.64.expected
@@ -95,7 +95,11 @@ standard output = {
"binding": {"kind": "uniform", "offset": 24, "size": 8},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
}
},
{
diff --git a/tests/hlsl-intrinsic/sampler-feedback/sampler-feedback-basic.slang.expected b/tests/hlsl-intrinsic/sampler-feedback/sampler-feedback-basic.slang.expected
index 246402818..fe6eb1335 100644
--- a/tests/hlsl-intrinsic/sampler-feedback/sampler-feedback-basic.slang.expected
+++ b/tests/hlsl-intrinsic/sampler-feedback/sampler-feedback-basic.slang.expected
@@ -67,7 +67,11 @@ standard output = {
"binding": {"kind": "shaderResource", "index": 0},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
}
},
{
@@ -76,7 +80,11 @@ standard output = {
"type": {
"kind": "resource",
"baseShape": "texture2D",
- "array": true
+ "array": true,
+ "resultType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
}
},
{
diff --git a/tests/reflection/arrays.hlsl.expected b/tests/reflection/arrays.hlsl.expected
index f53d63723..3e0bd6723 100644
--- a/tests/reflection/arrays.hlsl.expected
+++ b/tests/reflection/arrays.hlsl.expected
@@ -90,7 +90,15 @@ standard output = {
"binding": {"kind": "shaderResource", "index": 0},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
@@ -101,7 +109,15 @@ standard output = {
"elementCount": 16,
"elementType": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
}
},
@@ -110,7 +126,15 @@ standard output = {
"binding": {"kind": "shaderResource", "index": 17},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
diff --git a/tests/reflection/binding-gl.hlsl.expected b/tests/reflection/binding-gl.hlsl.expected
index 73c4da3ae..67df7c267 100644
--- a/tests/reflection/binding-gl.hlsl.expected
+++ b/tests/reflection/binding-gl.hlsl.expected
@@ -90,7 +90,15 @@ standard output = {
"binding": {"kind": "descriptorTableSlot", "space": 2, "index": 1},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
@@ -98,7 +106,15 @@ standard output = {
"binding": {"kind": "descriptorTableSlot", "space": 3, "index": 2},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
@@ -106,7 +122,15 @@ standard output = {
"binding": {"kind": "descriptorTableSlot", "index": 0},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
diff --git a/tests/reflection/binding-push-constant-gl.hlsl.expected b/tests/reflection/binding-push-constant-gl.hlsl.expected
index 6570625e9..7321c5fac 100644
--- a/tests/reflection/binding-push-constant-gl.hlsl.expected
+++ b/tests/reflection/binding-push-constant-gl.hlsl.expected
@@ -147,7 +147,15 @@ standard output = {
"binding": {"kind": "descriptorTableSlot", "space": 2, "index": 1},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
@@ -155,7 +163,15 @@ standard output = {
"binding": {"kind": "descriptorTableSlot", "space": 3, "index": 2},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
@@ -163,7 +179,15 @@ standard output = {
"binding": {"kind": "descriptorTableSlot", "index": 0},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
diff --git a/tests/reflection/cross-compile.slang.expected b/tests/reflection/cross-compile.slang.expected
index f85e4e0e9..2cd77fee2 100644
--- a/tests/reflection/cross-compile.slang.expected
+++ b/tests/reflection/cross-compile.slang.expected
@@ -9,7 +9,15 @@ standard output = {
"binding": {"kind": "descriptorTableSlot", "index": 0},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
diff --git a/tests/reflection/default-space.slang.expected b/tests/reflection/default-space.slang.expected
index c6ec6c19f..17cc32736 100644
--- a/tests/reflection/default-space.slang.expected
+++ b/tests/reflection/default-space.slang.expected
@@ -9,7 +9,15 @@ standard output = {
"binding": {"kind": "shaderResource", "space": 99, "index": 0},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
@@ -25,7 +33,15 @@ standard output = {
"name": "b",
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
},
"binding": {"kind": "shaderResource", "index": 0}
}
@@ -43,7 +59,15 @@ standard output = {
"name": "b",
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
},
"binding": {"kind": "shaderResource", "index": 0}
}
diff --git a/tests/reflection/explicit-register-space.slang.expected b/tests/reflection/explicit-register-space.slang.expected
index 725318084..a43efd2bd 100644
--- a/tests/reflection/explicit-register-space.slang.expected
+++ b/tests/reflection/explicit-register-space.slang.expected
@@ -9,7 +9,15 @@ standard output = {
"binding": {"kind": "shaderResource", "space": 2, "index": 1},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
}
],
diff --git a/tests/reflection/global-type-params.slang.expected b/tests/reflection/global-type-params.slang.expected
index 0da9c975e..07180b7ea 100644
--- a/tests/reflection/global-type-params.slang.expected
+++ b/tests/reflection/global-type-params.slang.expected
@@ -71,7 +71,15 @@ standard output = {
"binding": {"kind": "shaderResource", "index": 0},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
diff --git a/tests/reflection/multi-file.hlsl.expected b/tests/reflection/multi-file.hlsl.expected
index 0472a0b0a..804e5874f 100644
--- a/tests/reflection/multi-file.hlsl.expected
+++ b/tests/reflection/multi-file.hlsl.expected
@@ -9,7 +9,15 @@ standard output = {
"binding": {"kind": "shaderResource", "index": 0},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
@@ -135,7 +143,15 @@ standard output = {
"binding": {"kind": "shaderResource", "index": 1},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
@@ -261,7 +277,15 @@ standard output = {
"binding": {"kind": "shaderResource", "index": 2},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
@@ -387,7 +411,15 @@ standard output = {
"binding": {"kind": "shaderResource", "index": 3},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
@@ -395,7 +427,15 @@ standard output = {
"binding": {"kind": "shaderResource", "index": 4},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
}
],
diff --git a/tests/reflection/parameter-block-explicit-space.slang.expected b/tests/reflection/parameter-block-explicit-space.slang.expected
index 908029839..347f0fd5c 100644
--- a/tests/reflection/parameter-block-explicit-space.slang.expected
+++ b/tests/reflection/parameter-block-explicit-space.slang.expected
@@ -29,7 +29,15 @@ standard output = {
"name": "at1",
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
},
"binding": {"kind": "shaderResource", "index": 0}
},
@@ -37,7 +45,15 @@ standard output = {
"name": "at2",
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
},
"binding": {"kind": "shaderResource", "index": 1}
},
@@ -77,7 +93,15 @@ standard output = {
"name": "at1",
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
},
"binding": {"kind": "shaderResource", "index": 0}
},
@@ -85,7 +109,15 @@ standard output = {
"name": "at2",
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
},
"binding": {"kind": "shaderResource", "index": 1}
},
@@ -131,7 +163,15 @@ standard output = {
"name": "bt",
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
},
"binding": {"kind": "shaderResource", "index": 0}
},
@@ -171,7 +211,15 @@ standard output = {
"name": "bt",
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
},
"binding": {"kind": "shaderResource", "index": 0}
},
diff --git a/tests/reflection/parameter-block.slang.1.expected b/tests/reflection/parameter-block.slang.1.expected
index 5b1b45624..59fe15787 100644
--- a/tests/reflection/parameter-block.slang.1.expected
+++ b/tests/reflection/parameter-block.slang.1.expected
@@ -20,7 +20,15 @@ standard output = {
"name": "t",
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
},
"binding": {"kind": "shaderResource", "index": 0}
},
@@ -45,7 +53,15 @@ standard output = {
"name": "t",
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
},
"binding": {"kind": "shaderResource", "index": 0}
},
@@ -70,7 +86,15 @@ standard output = {
"binding": {"kind": "shaderResource", "index": 1},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
}
],
diff --git a/tests/reflection/parameter-block.slang.2.expected b/tests/reflection/parameter-block.slang.2.expected
index 31477df38..ef7b21e1a 100644
--- a/tests/reflection/parameter-block.slang.2.expected
+++ b/tests/reflection/parameter-block.slang.2.expected
@@ -17,7 +17,15 @@ standard output = {
"name": "t",
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
},
"binding": {"kind": "shaderResource", "index": 0}
},
@@ -42,7 +50,15 @@ standard output = {
"name": "t",
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
},
"binding": {"kind": "shaderResource", "index": 0}
},
@@ -67,7 +83,15 @@ standard output = {
"binding": {"kind": "shaderResource", "index": 0},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
}
],
diff --git a/tests/reflection/parameter-block.slang.expected b/tests/reflection/parameter-block.slang.expected
index 48b1bccbd..f3c31d4a9 100644
--- a/tests/reflection/parameter-block.slang.expected
+++ b/tests/reflection/parameter-block.slang.expected
@@ -17,7 +17,15 @@ standard output = {
"name": "t",
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
},
"binding": {"kind": "descriptorTableSlot", "index": 0}
},
@@ -42,7 +50,15 @@ standard output = {
"name": "t",
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
},
"binding": {"kind": "descriptorTableSlot", "index": 0}
},
@@ -64,7 +80,15 @@ standard output = {
"binding": {"kind": "descriptorTableSlot", "index": 0},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
}
],
diff --git a/tests/reflection/reflect-imported-code.hlsl.expected b/tests/reflection/reflect-imported-code.hlsl.expected
index cff6c50bb..8a906d0f7 100644
--- a/tests/reflection/reflect-imported-code.hlsl.expected
+++ b/tests/reflection/reflect-imported-code.hlsl.expected
@@ -9,7 +9,15 @@ standard output = {
"binding": {"kind": "shaderResource", "index": 0},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
@@ -63,7 +71,15 @@ standard output = {
"binding": {"kind": "shaderResource", "index": 1},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
diff --git a/tests/reflection/reflection0.hlsl.expected b/tests/reflection/reflection0.hlsl.expected
index 10f228cb1..f435aa829 100644
--- a/tests/reflection/reflection0.hlsl.expected
+++ b/tests/reflection/reflection0.hlsl.expected
@@ -9,7 +9,15 @@ standard output = {
"binding": {"kind": "shaderResource", "index": 0},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
diff --git a/tests/reflection/resource-in-cbuffer.hlsl.expected b/tests/reflection/resource-in-cbuffer.hlsl.expected
index 7d4251684..f85a5fb59 100644
--- a/tests/reflection/resource-in-cbuffer.hlsl.expected
+++ b/tests/reflection/resource-in-cbuffer.hlsl.expected
@@ -32,7 +32,15 @@ standard output = {
"name": "myTexture",
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
},
"binding": {"kind": "shaderResource", "index": 0}
},
@@ -76,7 +84,15 @@ standard output = {
"name": "myTexture",
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
},
"binding": {"kind": "shaderResource", "index": 0}
},
diff --git a/tests/reflection/shared-modifier.hlsl.expected b/tests/reflection/shared-modifier.hlsl.expected
index 61774ed19..252c764d2 100644
--- a/tests/reflection/shared-modifier.hlsl.expected
+++ b/tests/reflection/shared-modifier.hlsl.expected
@@ -9,7 +9,15 @@ standard output = {
"binding": {"kind": "shaderResource", "index": 0},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
diff --git a/tests/reflection/texture-resource-type.slang b/tests/reflection/texture-resource-type.slang
new file mode 100644
index 000000000..2455ba611
--- /dev/null
+++ b/tests/reflection/texture-resource-type.slang
@@ -0,0 +1,21 @@
+// texture-resource-type.slang
+
+// Tests reflection of inner texture type.
+
+//TEST:REFLECTION:-stage compute -entry main -target hlsl
+
+Texture2D NoParameters;
+Texture2D<float> FloatTexture;
+Texture2D<float2> FloatTwoTexture;
+Texture2D<float4> FloatFourTexture;
+Texture2D<int> IntTexture;
+Texture2D<int2> IntTwoTexture;
+Texture2D<int4> IntFourTexture;
+Texture2D<uint> UintTexture;
+Texture2D<uint2> UintTwoTexture;
+Texture2D<uint4> UintFourTexture;
+
+[numthreads(1, 1, 1)]
+void main(uint3 dispatchThreadID : SV_DispatchThreadID)
+{
+}
diff --git a/tests/reflection/texture-resource-type.slang.expected b/tests/reflection/texture-resource-type.slang.expected
new file mode 100644
index 000000000..48d1f0f79
--- /dev/null
+++ b/tests/reflection/texture-resource-type.slang.expected
@@ -0,0 +1,220 @@
+result code = 0
+standard error = {
+}
+standard output = {
+{
+ "parameters": [
+ {
+ "name": "NoParameters",
+ "binding": {"kind": "shaderResource", "index": 0},
+ "type": {
+ "kind": "resource",
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
+ }
+ },
+ {
+ "name": "FloatTexture",
+ "binding": {"kind": "shaderResource", "index": 1},
+ "type": {
+ "kind": "resource",
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
+ },
+ {
+ "name": "FloatTwoTexture",
+ "binding": {"kind": "shaderResource", "index": 2},
+ "type": {
+ "kind": "resource",
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 2,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
+ }
+ },
+ {
+ "name": "FloatFourTexture",
+ "binding": {"kind": "shaderResource", "index": 3},
+ "type": {
+ "kind": "resource",
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
+ }
+ },
+ {
+ "name": "IntTexture",
+ "binding": {"kind": "shaderResource", "index": 4},
+ "type": {
+ "kind": "resource",
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "scalar",
+ "scalarType": "int32"
+ }
+ }
+ },
+ {
+ "name": "IntTwoTexture",
+ "binding": {"kind": "shaderResource", "index": 5},
+ "type": {
+ "kind": "resource",
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 2,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "int32"
+ }
+ }
+ }
+ },
+ {
+ "name": "IntFourTexture",
+ "binding": {"kind": "shaderResource", "index": 6},
+ "type": {
+ "kind": "resource",
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "int32"
+ }
+ }
+ }
+ },
+ {
+ "name": "UintTexture",
+ "binding": {"kind": "shaderResource", "index": 7},
+ "type": {
+ "kind": "resource",
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "scalar",
+ "scalarType": "uint32"
+ }
+ }
+ },
+ {
+ "name": "UintTwoTexture",
+ "binding": {"kind": "shaderResource", "index": 8},
+ "type": {
+ "kind": "resource",
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 2,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "uint32"
+ }
+ }
+ }
+ },
+ {
+ "name": "UintFourTexture",
+ "binding": {"kind": "shaderResource", "index": 9},
+ "type": {
+ "kind": "resource",
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "uint32"
+ }
+ }
+ }
+ }
+ ],
+ "entryPoints": [
+ {
+ "name": "main",
+ "stage": "compute",
+ "parameters": [
+ {
+ "name": "dispatchThreadID",
+ "semanticName": "SV_DISPATCHTHREADID",
+ "type": {
+ "kind": "vector",
+ "elementCount": 3,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "uint32"
+ }
+ }
+ }
+ ],
+ "threadGroupSize": [1, 1, 1],
+ "bindings": [
+ {
+ "name": "NoParameters",
+ "binding": {"kind": "shaderResource", "index": 0, "used": 0}
+ },
+ {
+ "name": "FloatTexture",
+ "binding": {"kind": "shaderResource", "index": 1, "used": 0}
+ },
+ {
+ "name": "FloatTwoTexture",
+ "binding": {"kind": "shaderResource", "index": 2, "used": 0}
+ },
+ {
+ "name": "FloatFourTexture",
+ "binding": {"kind": "shaderResource", "index": 3, "used": 0}
+ },
+ {
+ "name": "IntTexture",
+ "binding": {"kind": "shaderResource", "index": 4, "used": 0}
+ },
+ {
+ "name": "IntTwoTexture",
+ "binding": {"kind": "shaderResource", "index": 5, "used": 0}
+ },
+ {
+ "name": "IntFourTexture",
+ "binding": {"kind": "shaderResource", "index": 6, "used": 0}
+ },
+ {
+ "name": "UintTexture",
+ "binding": {"kind": "shaderResource", "index": 7, "used": 0}
+ },
+ {
+ "name": "UintTwoTexture",
+ "binding": {"kind": "shaderResource", "index": 8, "used": 0}
+ },
+ {
+ "name": "UintFourTexture",
+ "binding": {"kind": "shaderResource", "index": 9, "used": 0}
+ }
+ ]
+ }
+ ]
+}
+}
diff --git a/tests/reflection/unbounded-arrays.hlsl.1.expected b/tests/reflection/unbounded-arrays.hlsl.1.expected
index c8d8f6bed..e4eb111ff 100644
--- a/tests/reflection/unbounded-arrays.hlsl.1.expected
+++ b/tests/reflection/unbounded-arrays.hlsl.1.expected
@@ -23,7 +23,15 @@ standard output = {
"elementCount": 0,
"elementType": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
}
},
@@ -32,7 +40,15 @@ standard output = {
"binding": {"kind": "shaderResource", "index": 0},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
@@ -40,7 +56,15 @@ standard output = {
"binding": {"kind": "shaderResource", "index": 1},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
@@ -51,7 +75,15 @@ standard output = {
"elementCount": 0,
"elementType": {
"kind": "resource",
- "baseShape": "textureCube"
+ "baseShape": "textureCube",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
}
},
@@ -60,7 +92,15 @@ standard output = {
"binding": {"kind": "shaderResource", "space": 1, "index": 0},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
@@ -77,7 +117,15 @@ standard output = {
"name": "t",
"type": {
"kind": "resource",
- "baseShape": "texture3D"
+ "baseShape": "texture3D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
},
"binding": {"kind": "shaderResource", "index": 0}
},
diff --git a/tests/reflection/used-parameters.slang.expected b/tests/reflection/used-parameters.slang.expected
index fb63e55f9..0a4fba104 100644
--- a/tests/reflection/used-parameters.slang.expected
+++ b/tests/reflection/used-parameters.slang.expected
@@ -107,7 +107,15 @@ standard output = {
"binding": {"kind": "shaderResource", "index": 0},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
@@ -115,7 +123,15 @@ standard output = {
"binding": {"kind": "shaderResource", "index": 1},
"type": {
"kind": "resource",
- "baseShape": "texture2D"
+ "baseShape": "texture2D",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
@@ -164,7 +180,15 @@ standard output = {
"type": {
"kind": "resource",
"baseShape": "texture2D",
- "access": "readWrite"
+ "access": "readWrite",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{
@@ -173,7 +197,15 @@ standard output = {
"type": {
"kind": "resource",
"baseShape": "texture2D",
- "access": "readWrite"
+ "access": "readWrite",
+ "resultType": {
+ "kind": "vector",
+ "elementCount": 4,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ }
}
},
{