Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add inner texture type to reflection json #6416

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions source/slang/slang-reflection-json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
10 changes: 9 additions & 1 deletion tests/bindings/hlsl-to-vulkan-array.hlsl.expected
Original file line number Diff line number Diff line change
Expand Up @@ -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}
},
Expand Down
16 changes: 14 additions & 2 deletions tests/bindings/hlsl-to-vulkan-combined.hlsl.expected
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,27 @@ standard output = {
"binding": {"kind": "descriptorTableSlot", "index": 0},
"type": {
"kind": "resource",
"baseShape": "texture2D"
"baseShape": "texture2D",
"resultType": {
"kind": "scalar",
"scalarType": "float32"
}
}
},
{
"name": "t1",
"binding": {"kind": "descriptorTableSlot", "index": 1},
"type": {
"kind": "resource",
"baseShape": "texture2D"
"baseShape": "texture2D",
"resultType": {
"kind": "vector",
"elementCount": 4,
"elementType": {
"kind": "scalar",
"scalarType": "float32"
}
}
}
}
],
Expand Down
10 changes: 9 additions & 1 deletion tests/bindings/hlsl-to-vulkan-global.hlsl.expected
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
},
{
Expand Down
20 changes: 18 additions & 2 deletions tests/bindings/hlsl-to-vulkan-shift-implicit.hlsl.expected
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
},
{
Expand Down Expand Up @@ -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"
}
}
}
},
{
Expand Down
20 changes: 18 additions & 2 deletions tests/bindings/hlsl-to-vulkan-shift.hlsl.expected
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
},
{
Expand Down Expand Up @@ -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"
}
}
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ standard output = {
"binding": {"kind": "shaderResource", "index": 0},
"type": {
"kind": "resource",
"baseShape": "texture2D"
"baseShape": "texture2D",
"resultType": {
"kind": "scalar",
"scalarType": "float32"
}
}
},
{
Expand All @@ -76,7 +80,11 @@ standard output = {
"type": {
"kind": "resource",
"baseShape": "texture2D",
"array": true
"array": true,
"resultType": {
"kind": "scalar",
"scalarType": "float32"
}
}
},
{
Expand Down
30 changes: 27 additions & 3 deletions tests/reflection/arrays.hlsl.expected
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
},
{
Expand All @@ -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"
}
}
}
}
},
Expand All @@ -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"
}
}
}
},
{
Expand Down
30 changes: 27 additions & 3 deletions tests/reflection/binding-gl.hlsl.expected
Original file line number Diff line number Diff line change
Expand Up @@ -90,23 +90,47 @@ 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"
}
}
}
},
{
"name": "ta",
"binding": {"kind": "descriptorTableSlot", "space": 3, "index": 2},
"type": {
"kind": "resource",
"baseShape": "texture2D"
"baseShape": "texture2D",
"resultType": {
"kind": "vector",
"elementCount": 4,
"elementType": {
"kind": "scalar",
"scalarType": "float32"
}
}
}
},
{
"name": "ty",
"binding": {"kind": "descriptorTableSlot", "index": 0},
"type": {
"kind": "resource",
"baseShape": "texture2D"
"baseShape": "texture2D",
"resultType": {
"kind": "vector",
"elementCount": 4,
"elementType": {
"kind": "scalar",
"scalarType": "float32"
}
}
}
},
{
Expand Down
30 changes: 27 additions & 3 deletions tests/reflection/binding-push-constant-gl.hlsl.expected
Original file line number Diff line number Diff line change
Expand Up @@ -147,23 +147,47 @@ 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"
}
}
}
},
{
"name": "ta",
"binding": {"kind": "descriptorTableSlot", "space": 3, "index": 2},
"type": {
"kind": "resource",
"baseShape": "texture2D"
"baseShape": "texture2D",
"resultType": {
"kind": "vector",
"elementCount": 4,
"elementType": {
"kind": "scalar",
"scalarType": "float32"
}
}
}
},
{
"name": "ty",
"binding": {"kind": "descriptorTableSlot", "index": 0},
"type": {
"kind": "resource",
"baseShape": "texture2D"
"baseShape": "texture2D",
"resultType": {
"kind": "vector",
"elementCount": 4,
"elementType": {
"kind": "scalar",
"scalarType": "float32"
}
}
}
},
{
Expand Down
10 changes: 9 additions & 1 deletion tests/reflection/cross-compile.slang.expected
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
},
{
Expand Down
Loading
Loading