rsx: Use unsigned variables to avoid sign problems when calculating stipple bits

This commit is contained in:
kd-11 2021-01-20 22:15:08 +03:00 committed by kd-11
parent 241989c5fa
commit b6b9085773
1 changed files with 6 additions and 6 deletions

View File

@ -436,13 +436,13 @@ namespace glsl
" if (_test_bit(rop_control, 9))\n"
" {\n"
" // Convert x,y to linear address\n"
" const ivec2 stipple_coord = ivec2(gl_FragCoord.xy) % ivec2(32, 32);\n"
" const int address = stipple_coord.y * 32 + stipple_coord.x;\n"
" const int bit_offset = (address & 31);\n"
" const int word_index = _get_bits(address, 7, 3);\n"
" const int sub_index = _get_bits(address, 5, 2);\n\n"
" const uvec2 stipple_coord = uvec2(gl_FragCoord.xy) % uvec2(32, 32);\n"
" const uint address = stipple_coord.y * 32u + stipple_coord.x;\n"
" const uint bit_offset = (address & 31u);\n"
" const uint word_index = _get_bits(address, 7, 3);\n"
" const uint sub_index = _get_bits(address, 5, 2);\n\n"
" if (_test_bit(stipple_pattern[word_index][sub_index], bit_offset))\n"
" if (!_test_bit(stipple_pattern[word_index][sub_index], int(bit_offset)))\n"
" {\n"
" _kill();\n"
" }\n"