Cbuffer space and register reflection api problem. #8811
-
|
Hi, I have the following Slang code: struct FrameParams
{
float4x4 g_WorldViewProj;
};
ParameterBlock<FrameParams> frame;
uniform float foo;
uniform float bar;It compiles to this HLSL: struct FrameParams_0
{
float4x4 g_WorldViewProj_0;
};
#line 5
cbuffer frame_0 : register(b0, space1)
{
FrameParams_0 frame_0;
}
#line 5
struct GlobalParams_0
{
float foo_0;
float bar_0;
};
#line 5
cbuffer globalParams_0 : register(b0)
{
GlobalParams_0 globalParams_0;
}Then I use this code to collect reflection info: void CollectSets(slang::ProgramLayout* programLayout)
{
const uint32_t paramCount = programLayout->getParameterCount();
for (uint32_t i = 0; i < paramCount; i++)
{
auto param = programLayout->getParameterByIndex(i);
auto paramName = param->getName();
slang::ParameterCategory category = param->getCategory();
uint32_t binding = param->getBindingIndex();
uint32_t space = param->getBindingSpace();
std::cout << "Param " << i << ": " << paramName << std::endl;
std::cout << " Category: " << getParameterCategoryStr(category) << std::endl;
std::cout << " Binding: " << binding << std::endl;
std::cout << " Space: " << space << std::endl;
}
}The output looks like this: The reflection results don’t seem to match the generated HLSL at all. I can’t tell if this is a bug or if I’m using the reflection API incorrectly. What I expected to see: Could you please explain why the reflection gives everything in |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
ACK. I have found answer here #7646. This api confusing as hell. |
Beta Was this translation helpful? Give feedback.
ACK. I have found answer here #7646. This api confusing as hell.