mirror of
https://github.com/RPCS3/glslang.git
synced 2024-11-23 19:29:44 +00:00
HLSL: implemented c register handling
Adjusted a test not to use c register for a structured buffer, they are supposed to use t registers Added comments with hints for what are the register types are used for.
This commit is contained in:
parent
7274bbc27c
commit
31cd98c7b2
@ -5,7 +5,7 @@ struct sb_t
|
|||||||
bool test2;
|
bool test2;
|
||||||
}; // stride = 20
|
}; // stride = 20
|
||||||
|
|
||||||
StructuredBuffer<sb_t> sbuf : register(c10);
|
StructuredBuffer<sb_t> sbuf : register(t10);
|
||||||
StructuredBuffer<float> sbuf2;
|
StructuredBuffer<float> sbuf2;
|
||||||
|
|
||||||
float4 main(uint pos : FOO) : SV_Target0
|
float4 main(uint pos : FOO) : SV_Target0
|
||||||
|
@ -6066,13 +6066,22 @@ void HlslParseContext::handleRegister(const TSourceLoc& loc, TQualifier& qualifi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: learn what all these really mean and how they interact with regNumber and subComponent
|
// more information about register types see
|
||||||
|
// https://docs.microsoft.com/en-us/windows/desktop/direct3dhlsl/dx-graphics-hlsl-variable-register
|
||||||
const std::vector<std::string>& resourceInfo = intermediate.getResourceSetBinding();
|
const std::vector<std::string>& resourceInfo = intermediate.getResourceSetBinding();
|
||||||
switch (std::tolower(desc[0])) {
|
switch (std::tolower(desc[0])) {
|
||||||
case 'b':
|
|
||||||
case 't':
|
|
||||||
case 'c':
|
case 'c':
|
||||||
|
// c register is the register slot in the global const buffer
|
||||||
|
// each slot is a vector of 4 32 bit components
|
||||||
|
qualifier.layoutOffset = regNumber * 4 * 4;
|
||||||
|
break;
|
||||||
|
// const buffer register slot
|
||||||
|
case 'b':
|
||||||
|
// textrues and structured buffers
|
||||||
|
case 't':
|
||||||
|
// samplers
|
||||||
case 's':
|
case 's':
|
||||||
|
// uav resources
|
||||||
case 'u':
|
case 'u':
|
||||||
// if nothing else has set the binding, do so now
|
// if nothing else has set the binding, do so now
|
||||||
// (other mechanisms override this one)
|
// (other mechanisms override this one)
|
||||||
|
Loading…
Reference in New Issue
Block a user