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
Changes from 2 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
@@ -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();
30 changes: 27 additions & 3 deletions tests/reflection/arrays.hlsl.expected
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
},
{
30 changes: 27 additions & 3 deletions tests/reflection/binding-gl.hlsl.expected
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
},
{
30 changes: 27 additions & 3 deletions tests/reflection/binding-push-constant-gl.hlsl.expected
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
},
{
10 changes: 9 additions & 1 deletion tests/reflection/cross-compile.slang.expected
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
},
{
30 changes: 27 additions & 3 deletions tests/reflection/default-space.slang.expected
Original file line number Diff line number Diff line change
@@ -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}
}
10 changes: 9 additions & 1 deletion tests/reflection/explicit-register-space.slang.expected
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
],
10 changes: 9 additions & 1 deletion tests/reflection/global-type-params.slang.expected
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
},
{
50 changes: 45 additions & 5 deletions tests/reflection/multi-file.hlsl.expected
Original file line number Diff line number Diff line change
@@ -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,15 +411,31 @@ standard output = {
"binding": {"kind": "shaderResource", "index": 3},
"type": {
"kind": "resource",
"baseShape": "texture2D"
"baseShape": "texture2D",
"resultType": {
"kind": "vector",
"elementCount": 4,
"elementType": {
"kind": "scalar",
"scalarType": "float32"
}
}
}
},
{
"name": "sharedTF",
"binding": {"kind": "shaderResource", "index": 4},
"type": {
"kind": "resource",
"baseShape": "texture2D"
"baseShape": "texture2D",
"resultType": {
"kind": "vector",
"elementCount": 4,
"elementType": {
"kind": "scalar",
"scalarType": "float32"
}
}
}
}
],
Loading
Loading