summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorTony Wasserka <neobrainx@gmail.com>2014-05-01 10:52:18 +0200
committerTony Wasserka <neobrainx@gmail.com>2014-05-01 10:52:18 +0200
commit2cf8f55ad35da2344dabb72ec0683988ddc52ef5 (patch)
tree3dd292db992e652ba7d8974360f9fa28149fcec7 /Source/Core
parentc5d506142f9259c7e31c60b3acebe0738d1001fb (diff)
parent2d8cfb89d777ac36d3dcca8976caa2f7804ab43c (diff)
Merge pull request #310 from Sonicadvance1/Integer-posmtx
Change over to use integer posmtx in our vertex shaders
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp1
-rw-r--r--Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp2
-rw-r--r--Source/Core/VideoCommon/VertexLoader.cpp2
-rw-r--r--Source/Core/VideoCommon/VertexShaderGen.cpp6
4 files changed, 5 insertions, 6 deletions
diff --git a/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp b/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp
index 7c6bb7aeff..f6fd98a48a 100644
--- a/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp
+++ b/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp
@@ -1604,6 +1604,7 @@ namespace GLExtensions
"GL_ARB_sync",
"GL_ARB_ES2_compatibility",
"VERSION_GLES3",
+ "VERSION_3_0",
};
for (auto it : gles3exts)
m_extension_list[it] = true;
diff --git a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp
index 7cf40eed34..90b86194e1 100644
--- a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp
+++ b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp
@@ -102,7 +102,7 @@ void SHADER::SetProgramBindings()
// Need to set some attribute locations
glBindAttribLocation(glprogid, SHADER_POSITION_ATTRIB, "rawpos");
- glBindAttribLocation(glprogid, SHADER_POSMTX_ATTRIB, "fposmtx");
+ glBindAttribLocation(glprogid, SHADER_POSMTX_ATTRIB, "posmtx");
glBindAttribLocation(glprogid, SHADER_COLOR0_ATTRIB, "color0");
glBindAttribLocation(glprogid, SHADER_COLOR1_ATTRIB, "color1");
diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp
index e9288aac29..80fbf08cb5 100644
--- a/Source/Core/VideoCommon/VertexLoader.cpp
+++ b/Source/Core/VideoCommon/VertexLoader.cpp
@@ -753,7 +753,7 @@ void VertexLoader::CompileVertexTranslator()
vtx_decl.posmtx.enable = true;
vtx_decl.posmtx.offset = nat_offset;
vtx_decl.posmtx.type = VAR_UNSIGNED_BYTE;
- vtx_decl.posmtx.integer = false;
+ vtx_decl.posmtx.integer = true;
nat_offset += 4;
}
diff --git a/Source/Core/VideoCommon/VertexShaderGen.cpp b/Source/Core/VideoCommon/VertexShaderGen.cpp
index 7d0dc878cd..41549609c7 100644
--- a/Source/Core/VideoCommon/VertexShaderGen.cpp
+++ b/Source/Core/VideoCommon/VertexShaderGen.cpp
@@ -109,7 +109,7 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ
{
out.Write("in float4 rawpos; // ATTR%d,\n", SHADER_POSITION_ATTRIB);
if (components & VB_HAS_POSMTXIDX)
- out.Write("in float fposmtx; // ATTR%d,\n", SHADER_POSMTX_ATTRIB);
+ out.Write("in int posmtx; // ATTR%d,\n", SHADER_POSMTX_ATTRIB);
if (components & VB_HAS_NRM0)
out.Write("in float3 rawnorm0; // ATTR%d,\n", SHADER_NORM0_ATTRIB);
if (components & VB_HAS_NRM1)
@@ -168,7 +168,7 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ
out.Write(" float%d tex%d : TEXCOORD%d,\n", hastexmtx ? 3 : 2, i, i);
}
if (components & VB_HAS_POSMTXIDX)
- out.Write(" float fposmtx : BLENDINDICES,\n");
+ out.Write(" int posmtx : BLENDINDICES,\n");
out.Write(" float4 rawpos : POSITION) {\n");
}
out.Write("VS_OUTPUT o;\n");
@@ -176,8 +176,6 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ
// transforms
if (components & VB_HAS_POSMTXIDX)
{
- out.Write("int posmtx = int(fposmtx * 255.0);\n"); // TODO: Ugly, should use an integer instead
-
if (is_writing_shadercode && (DriverDetails::HasBug(DriverDetails::BUG_NODYNUBOACCESS) && !DriverDetails::HasBug(DriverDetails::BUG_ANNIHILATEDUBOS)) )
{
// This'll cause issues, but it can't be helped