1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-25 12:12:50 +01:00

rsx/vp: Fix SNORM16 vertex decoding

This commit is contained in:
Eladash 2022-08-02 23:07:49 +03:00 committed by kd-11
parent cd2adbad9a
commit b3162bd41c

View File

@ -267,7 +267,7 @@ namespace glsl
"vec4 fetch_attribute(const in attribute_desc desc, const in int vertex_id, usamplerBuffer input_stream)\n"
"{\n"
" const int elem_size_table[] = { 2, 4, 2, 1, 2, 4, 1 };\n"
" const float scaling_table[] = { 32768., 1., 1., 255., 1., 32767., 1. };\n"
" const float scaling_table[] = { 65535., 1., 1., 255., 1., 32767., 1. };\n"
" const int elem_size = elem_size_table[desc.type];\n"
" const vec4 scale = scaling_table[desc.type].xxxx;\n\n"
@ -298,6 +298,11 @@ namespace glsl
" if (desc.type == VTX_FMT_SNORM16 || desc.type == VTX_FMT_SINT16)\n"
" {\n"
" ret = sext(ivec4(result));\n"
" if (desc.type == VTX_FMT_SNORM16)\n"
" {\n"
" ret = ret * 2. + 1.;\n"
" }\n"
" }\n"
" else if (desc.type == VTX_FMT_FLOAT32)\n"
" {\n"