From 46ff4dc3d35ecc3fcdd770b28565700a8553de84 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Mon, 27 Apr 2015 18:50:59 +0200 Subject: [PATCH] gsdx-ogl: hardware unit only support normalization of 4 bytes... (At least on recent AMD GPU) --- plugins/GSdx/GSDeviceOGL.cpp | 2 +- plugins/GSdx/res/glsl/tfx_vgs.glsl | 4 ++-- plugins/GSdx/res/glsl_source.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/GSdx/GSDeviceOGL.cpp b/plugins/GSdx/GSDeviceOGL.cpp index 75a84df2b6..e53d4421c2 100644 --- a/plugins/GSdx/GSDeviceOGL.cpp +++ b/plugins/GSdx/GSDeviceOGL.cpp @@ -208,7 +208,7 @@ bool GSDeviceOGL::Create(GSWnd* wnd) {2 , GL_UNSIGNED_SHORT , GL_FALSE , sizeof(GSVertex) , (const GLvoid*)(16) } , {1 , GL_UNSIGNED_INT , GL_FALSE , sizeof(GSVertex) , (const GLvoid*)(20) } , {2 , GL_UNSIGNED_SHORT , GL_FALSE , sizeof(GSVertex) , (const GLvoid*)(24) } , - {1 , GL_UNSIGNED_BYTE , GL_TRUE , sizeof(GSVertex) , (const GLvoid*)(28) } , + {4 , GL_UNSIGNED_BYTE , GL_TRUE , sizeof(GSVertex) , (const GLvoid*)(28) } , // Only 1 byte is useful but hardware unit only support 4B }; m_va = new GSVertexBufferStateOGL(sizeof(GSVertexPT1), il_convert, countof(il_convert)); diff --git a/plugins/GSdx/res/glsl/tfx_vgs.glsl b/plugins/GSdx/res/glsl/tfx_vgs.glsl index 13c6f7deed..c277c0fed3 100644 --- a/plugins/GSdx/res/glsl/tfx_vgs.glsl +++ b/plugins/GSdx/res/glsl/tfx_vgs.glsl @@ -14,7 +14,7 @@ layout(location = 3) in float i_q; layout(location = 4) in uvec2 i_p; layout(location = 5) in uint i_z; layout(location = 6) in uvec2 i_uv; -layout(location = 7) in float i_f; +layout(location = 7) in vec4 i_f; out SHADER { @@ -145,7 +145,7 @@ void vs_main() VSout_c = i_c; VSout_fc = i_c; - VSout_t.z = i_f; + VSout_t.z = i_f.x; } #endif diff --git a/plugins/GSdx/res/glsl_source.h b/plugins/GSdx/res/glsl_source.h index 401c324cde..7554e46029 100644 --- a/plugins/GSdx/res/glsl_source.h +++ b/plugins/GSdx/res/glsl_source.h @@ -465,7 +465,7 @@ static const char* tfx_vgs_glsl = "layout(location = 4) in uvec2 i_p;\n" "layout(location = 5) in uint i_z;\n" "layout(location = 6) in uvec2 i_uv;\n" - "layout(location = 7) in float i_f;\n" + "layout(location = 7) in vec4 i_f;\n" "\n" "out SHADER\n" "{\n" @@ -596,7 +596,7 @@ static const char* tfx_vgs_glsl = "\n" " VSout_c = i_c;\n" " VSout_fc = i_c;\n" - " VSout_t.z = i_f;\n" + " VSout_t.z = i_f.x;\n" "}\n" "\n" "#endif\n"