@@ -74,6 +74,11 @@ static RESOURCE_DIMENSION GetResourceDimension(const diligent_spirv_cross::Compi
7474 default : return RESOURCE_DIM_UNDEFINED;
7575 }
7676 }
77+ else if (type.basetype == diligent_spirv_cross::SPIRType::BaseType::Struct)
78+ {
79+ // Uniform buffers and storage buffers are Struct types
80+ return RESOURCE_DIM_BUFFER;
81+ }
7782 else
7883 {
7984 return RESOURCE_DIM_UNDEFINED;
@@ -145,6 +150,27 @@ SPIRVShaderResourceAttribs::SPIRVShaderResourceAttribs(const char* _Name,
145150// clang-format on
146151{}
147152
153+ // Test-only constructor for creating reference resources
154+ SPIRVShaderResourceAttribs::SPIRVShaderResourceAttribs (const char * _Name,
155+ ResourceType _Type,
156+ Uint16 _ArraySize,
157+ RESOURCE_DIMENSION _ResourceDim,
158+ Uint8 _IsMS,
159+ Uint32 _BufferStaticSize,
160+ Uint32 _BufferStride) noexcept :
161+ // clang-format off
162+ Name {_Name},
163+ ArraySize {_ArraySize},
164+ Type {_Type},
165+ ResourceDim {static_cast <Uint8>(_ResourceDim)},
166+ IsMS {_IsMS},
167+ BindingDecorationOffset {0 }, // Not used in tests
168+ DescriptorSetDecorationOffset {0 }, // Not used in tests
169+ BufferStaticSize {_BufferStaticSize},
170+ BufferStride {_BufferStride}
171+ // clang-format on
172+ {}
173+
148174
149175SHADER_RESOURCE_TYPE SPIRVShaderResourceAttribs::GetShaderResourceType (ResourceType Type)
150176{
@@ -1039,9 +1065,19 @@ std::string SPIRVShaderResources::DumpResources() const
10391065 },
10401066 [&](const SPIRVShaderResourceAttribs& SepImg, Uint32) //
10411067 {
1042- VERIFY (SepImg.Type == SPIRVShaderResourceAttribs::ResourceType::SeparateImage, " Unexpected resource type" );
1043- ss << std::endl
1044- << std::setw (3 ) << ResNum << " Separate Img " ;
1068+ VERIFY (SepImg.Type == SPIRVShaderResourceAttribs::ResourceType::SeparateImage ||
1069+ SepImg.Type == SPIRVShaderResourceAttribs::ResourceType::UniformTexelBuffer,
1070+ " Unexpected resource type" );
1071+ if (SepImg.Type == SPIRVShaderResourceAttribs::ResourceType::UniformTexelBuffer)
1072+ {
1073+ ss << std::endl
1074+ << std::setw (3 ) << ResNum << " Uniform Txl Buff " ;
1075+ }
1076+ else
1077+ {
1078+ ss << std::endl
1079+ << std::setw (3 ) << ResNum << " Separate Img " ;
1080+ }
10451081 DumpResource (SepImg);
10461082 },
10471083 [&](const SPIRVShaderResourceAttribs& InptAtt, Uint32) //
0 commit comments