SPIRV-Cross/reference/opt/shaders-hlsl/vert/read-from-row-major-array.vert
Hans-Kristian Arntzen 226d837d7e HLSL: Use same logic as GLSL for picking cbuffer block name.
HLSL just picked the variable name which did not work as expected for
some users. Use the same logic as GLSL and set up declared_block_names,
so the actual name can be queried later.
2018-10-22 09:50:04 +02:00

37 lines
1.1 KiB
GLSL

cbuffer Block : register(b0)
{
column_major float2x3 _104_var[3][4] : packoffset(c0);
};
static float4 gl_Position;
static float4 a_position;
static float v_vtxResult;
struct SPIRV_Cross_Input
{
float4 a_position : TEXCOORD0;
};
struct SPIRV_Cross_Output
{
float v_vtxResult : TEXCOORD0;
float4 gl_Position : SV_Position;
};
void vert_main()
{
gl_Position = a_position;
v_vtxResult = ((float(abs(_104_var[0][0][0].x - 2.0f) < 0.0500000007450580596923828125f) * float(abs(_104_var[0][0][0].y - 6.0f) < 0.0500000007450580596923828125f)) * float(abs(_104_var[0][0][0].z - (-6.0f)) < 0.0500000007450580596923828125f)) * ((float(abs(_104_var[0][0][1].x) < 0.0500000007450580596923828125f) * float(abs(_104_var[0][0][1].y - 5.0f) < 0.0500000007450580596923828125f)) * float(abs(_104_var[0][0][1].z - 5.0f) < 0.0500000007450580596923828125f));
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
a_position = stage_input.a_position;
vert_main();
SPIRV_Cross_Output stage_output;
stage_output.gl_Position = gl_Position;
stage_output.v_vtxResult = v_vtxResult;
return stage_output;
}