summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2013-02-23 20:52:42 -0600
committerJordan Woyak <jordan.woyak@gmail.com>2013-02-23 20:54:30 -0600
commit52dacaa3e3ca5cfd6ca0e524a5e5e3ff843cba02 (patch)
tree6d8939f84ae990e6713d97eb9744d40c71a59551 /Source
parent0a05fcade460c32ea766819a1b437658e7298f1b (diff)
Make the posmtx vertex attribute an int instead of converting to and from a float.
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/VideoCommon/Src/VertexShaderGen.cpp6
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp2
2 files changed, 2 insertions, 6 deletions
diff --git a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp
index 506f44c14f..c8de1e952b 100644
--- a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp
+++ b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp
@@ -194,7 +194,7 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE ApiType)
{
WRITE(p, "ATTRIN float4 rawpos; // ATTR%d,\n", SHADER_POSITION_ATTRIB);
if (components & VB_HAS_POSMTXIDX)
- WRITE(p, "ATTRIN float fposmtx; // ATTR%d,\n", SHADER_POSMTX_ATTRIB);
+ WRITE(p, "ATTRIN int posmtx; // ATTR%d,\n", SHADER_POSMTX_ATTRIB);
if (components & VB_HAS_NRM0)
WRITE(p, "ATTRIN float3 rawnorm0; // ATTR%d,\n", SHADER_NORM0_ATTRIB);
if (components & VB_HAS_NRM1)
@@ -275,10 +275,6 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE ApiType)
{
WRITE(p, "int posmtx = blend_indices.x * 255.0f;\n");
}
- else
- {
- WRITE(p, "int posmtx = int(fposmtx);\n");
- }
WRITE(p, "float4 pos = float4(dot(" I_TRANSFORMMATRICES"[posmtx], rawpos), dot(" I_TRANSFORMMATRICES"[posmtx+1], rawpos), dot(" I_TRANSFORMMATRICES"[posmtx+2], rawpos), 1);\n");
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp b/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp
index 954a92b126..54f57d1e35 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp
@@ -100,7 +100,7 @@ void GLVertexFormat::Initialize(const PortableVertexDeclaration &_vtx_decl)
if (vtx_decl.posmtx_offset != -1) {
glEnableVertexAttribArray(SHADER_POSMTX_ATTRIB);
- glVertexAttribPointer(SHADER_POSMTX_ATTRIB, 4, GL_UNSIGNED_BYTE, GL_FALSE, vtx_decl.stride, (u8*)NULL + vtx_decl.posmtx_offset);
+ glVertexAttribIPointer(SHADER_POSMTX_ATTRIB, 1, GL_UNSIGNED_BYTE, vtx_decl.stride, (u8*)NULL + vtx_decl.posmtx_offset);
}
vm->m_last_vao = VAO;