KhronosGroup / KhronosGroup/glslang
HLSL - cannot work with structured buffers of member variables
- Dominant language
- C++
- Stars
- 3.6k
- Forks
- 989
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 31
Description
The following HLSL code does not compile with glslang:
---8<---
struct TestB
{
int test;
};
struct TestA
{
StructuredBuffer TestB;
};
struct SkyLightingParams
{
TestA testA;
StructuredBuffer GetTestB() { return testA.TestB; }
};
float4 ShadeVertex(in uint vertexIndex : VERTEXID) : VS_OUT_POSITION
{
return float4(0,0,0,0);
}
---8<---
The error returned is:
'this' : cannot access member variables (static member function?)
Contributor guide
Research direction
Start by reproducing the HLSL snippet with glslang and confirm the reported member-variable diagnostic. Trace the HLSL handling for StructuredBuffer members and member functions; done means the example compiles correctly and a regression test covers this case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100