VideoCommon: Fix VS point/line on older GLSL

This commit is contained in:
TellowKrinkle 2023-10-24 23:18:01 -05:00
parent 60e3b4c093
commit 323aea60d6
2 changed files with 5 additions and 5 deletions

View File

@ -101,7 +101,7 @@ SSBO_BINDING(1) readonly restrict buffer Vertices {{
out.Write(R"( out.Write(R"(
uint4 load_input_uint4_ubyte4(uint vtx_offset, uint attr_offset) {{ uint4 load_input_uint4_ubyte4(uint vtx_offset, uint attr_offset) {{
uint value = vertex_buffer[vtx_offset + attr_offset]; uint value = vertex_buffer[vtx_offset + attr_offset];
return uint4(value & 0xff, (value >> 8) & 0xff, (value >> 16) & 0xff, value >> 24); return uint4(value & 0xffu, (value >> 8) & 0xffu, (value >> 16) & 0xffu, value >> 24);
}} }}
float4 load_input_float4_ubyte4(uint vtx_offset, uint attr_offset) {{ float4 load_input_float4_ubyte4(uint vtx_offset, uint attr_offset) {{

View File

@ -149,7 +149,7 @@ ShaderCode GenerateVertexShaderCode(APIType api_type, const ShaderHostConfig& ho
// Can't use float3, etc because we want 4-byte alignment // Can't use float3, etc because we want 4-byte alignment
out.Write( out.Write(
"uint4 unpack_ubyte4(uint value) {{\n" "uint4 unpack_ubyte4(uint value) {{\n"
" return uint4(value & 0xff, (value >> 8) & 0xff, (value >> 16) & 0xff, value >> 24);\n" " return uint4(value & 0xffu, (value >> 8) & 0xffu, (value >> 16) & 0xffu, value >> 24);\n"
"}}\n\n" "}}\n\n"
"struct InputData {{\n"); "struct InputData {{\n");
if (uid_data->components & VB_HAS_POSMTXIDX) if (uid_data->components & VB_HAS_POSMTXIDX)
@ -271,7 +271,7 @@ ShaderCode GenerateVertexShaderCode(APIType api_type, const ShaderHostConfig& ho
if (api_type == APIType::D3D) if (api_type == APIType::D3D)
out.Write("uint vertex_id = (gl_VertexID >> 2) + base_vertex;\n"); out.Write("uint vertex_id = (gl_VertexID >> 2) + base_vertex;\n");
else else
out.Write("uint vertex_id = gl_VertexID >> 2;\n"); out.Write("uint vertex_id = uint(gl_VertexID) >> 2u;\n");
out.Write("InputData i = input_buffer[vertex_id];\n" out.Write("InputData i = input_buffer[vertex_id];\n"
"{}", "{}",
input_extract.GetBuffer()); input_extract.GetBuffer());
@ -524,9 +524,9 @@ ShaderCode GenerateVertexShaderCode(APIType api_type, const ShaderHostConfig& ho
out.Write("// Line expansion\n" out.Write("// Line expansion\n"
"uint other_id = vertex_id;\n" "uint other_id = vertex_id;\n"
"if (is_bottom) {{\n" "if (is_bottom) {{\n"
" other_id -= 1;\n" " other_id -= 1u;\n"
"}} else {{\n" "}} else {{\n"
" other_id += 1;\n" " other_id += 1u;\n"
"}}\n" "}}\n"
"InputData other = input_buffer[other_id];\n"); "InputData other = input_buffer[other_id];\n");
if (uid_data->position_has_3_elems) if (uid_data->position_has_3_elems)