You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is on the line with the assignment to SV_TARGET0. 'uc_idx' should be used to index into the 'uc_values' array, but instead is indexing the first member of the structure in that array.
I believe the correct translation should be:
SV_TARGET0 = uc_values[int(u_xlatu0)].value0;
I'm not very familiar with the code, but after stepping through my test case, it seems like this involves ShaderInfo::GetShaderVarIndexedFullName not taking into account Operand::m_suboperands. When decoding the shader, the operand has a fixed immediate value of 0 from the 'r0.x + 0' expression but also a relative value from the 'r0.x' portion. This could all be wrong though, as I'm not very familiar with the code. :)
The blob was generated with: "fxc.exe" /T ps_4_1 test.fs.hlsl"
HLSLcc was run with LANG_440 set and the following flags:
HLSLCC_FLAG_UNIFORM_BUFFER_OBJECT | HLSLCC_FLAG_INOUT_SEMANTIC_NAMES | HLSLCC_FLAG_COMBINE_TEXTURE_SAMPLERS | HLSLCC_FLAG_NVN_TARGET
Let me know if I can provide any additional information!
The text was updated successfully, but these errors were encountered:
I'm having this issue as well when indexing into a UBO. It's easy enough to fix by hand, but that kind of defeats the purpose.
`
struct LightData
{
float4 l_Position;
float4 l_Direction;
float4 l_Color;
float4 l_Params;
};
cbuffer LightBuffer
{
LightData g_Light[64];
};
...
for(int i = 0; i < min(NumLights, 64); ++i)
{
float3 lightDir = g_Light[i].l_Direction;
...`
The loop compiles into u_xlat4.xyz = g_Light[0].l_Direction[u_xlati17].xyz;
where it should compile into u_xlat4.xyz = g_Light[u_xlati17].l_Direction.xyz;
The shader was compiled under LANG_430 with only HLSLCC_FLAG_UNIFORM_BUFFER_OBJECT enabled.
I'm having an issue with a conversion from an HLSL blob to GLSL v440 when indexing into a structure.
This is the original source:
This is the HLSL blob generated by FXC:
and this is the GLSL that is generated:
The issue is on the line with the assignment to SV_TARGET0. 'uc_idx' should be used to index into the 'uc_values' array, but instead is indexing the first member of the structure in that array.
I believe the correct translation should be:
I'm not very familiar with the code, but after stepping through my test case, it seems like this involves ShaderInfo::GetShaderVarIndexedFullName not taking into account Operand::m_suboperands. When decoding the shader, the operand has a fixed immediate value of 0 from the 'r0.x + 0' expression but also a relative value from the 'r0.x' portion. This could all be wrong though, as I'm not very familiar with the code. :)
The blob was generated with: "fxc.exe" /T ps_4_1 test.fs.hlsl"
HLSLcc was run with LANG_440 set and the following flags:
HLSLCC_FLAG_UNIFORM_BUFFER_OBJECT | HLSLCC_FLAG_INOUT_SEMANTIC_NAMES | HLSLCC_FLAG_COMBINE_TEXTURE_SAMPLERS | HLSLCC_FLAG_NVN_TARGET
Let me know if I can provide any additional information!
The text was updated successfully, but these errors were encountered: