diff options
author | bunnei <bunneidev@gmail.com> | 2015-10-21 06:03:22 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2015-10-22 03:59:47 +0200 |
commit | e7b1f2ae0af304abea3fb9a5b658abb92737caaa (patch) | |
tree | 01667cf803dc91dbb4f6c123b27f177d8ac3eec3 | |
parent | gl_shader_gen: Various cleanups to shader generation. (diff) | |
download | yuzu-e7b1f2ae0af304abea3fb9a5b658abb92737caaa.tar yuzu-e7b1f2ae0af304abea3fb9a5b658abb92737caaa.tar.gz yuzu-e7b1f2ae0af304abea3fb9a5b658abb92737caaa.tar.bz2 yuzu-e7b1f2ae0af304abea3fb9a5b658abb92737caaa.tar.lz yuzu-e7b1f2ae0af304abea3fb9a5b658abb92737caaa.tar.xz yuzu-e7b1f2ae0af304abea3fb9a5b658abb92737caaa.tar.zst yuzu-e7b1f2ae0af304abea3fb9a5b658abb92737caaa.zip |
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 12 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_util.cpp | 6 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_util.h | 8 |
3 files changed, 14 insertions, 12 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 4ae42f226..d1def2f3b 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -61,12 +61,12 @@ void RasterizerOpenGL::InitObjects() { glVertexAttribPointer(GLShader::ATTRIBUTE_COLOR, 4, GL_FLOAT, GL_FALSE, sizeof(HardwareVertex), (GLvoid*)offsetof(HardwareVertex, color)); glEnableVertexAttribArray(GLShader::ATTRIBUTE_COLOR); - glVertexAttribPointer(GLShader::ATTRIBUTE_TEXCOORDS + 0, 2, GL_FLOAT, GL_FALSE, sizeof(HardwareVertex), (GLvoid*)offsetof(HardwareVertex, tex_coord0)); - glVertexAttribPointer(GLShader::ATTRIBUTE_TEXCOORDS + 1, 2, GL_FLOAT, GL_FALSE, sizeof(HardwareVertex), (GLvoid*)offsetof(HardwareVertex, tex_coord1)); - glVertexAttribPointer(GLShader::ATTRIBUTE_TEXCOORDS + 2, 2, GL_FLOAT, GL_FALSE, sizeof(HardwareVertex), (GLvoid*)offsetof(HardwareVertex, tex_coord2)); - glEnableVertexAttribArray(GLShader::ATTRIBUTE_TEXCOORDS + 0); - glEnableVertexAttribArray(GLShader::ATTRIBUTE_TEXCOORDS + 1); - glEnableVertexAttribArray(GLShader::ATTRIBUTE_TEXCOORDS + 2); + glVertexAttribPointer(GLShader::ATTRIBUTE_TEXCOORD0, 2, GL_FLOAT, GL_FALSE, sizeof(HardwareVertex), (GLvoid*)offsetof(HardwareVertex, tex_coord0)); + glVertexAttribPointer(GLShader::ATTRIBUTE_TEXCOORD1, 2, GL_FLOAT, GL_FALSE, sizeof(HardwareVertex), (GLvoid*)offsetof(HardwareVertex, tex_coord1)); + glVertexAttribPointer(GLShader::ATTRIBUTE_TEXCOORD2, 2, GL_FLOAT, GL_FALSE, sizeof(HardwareVertex), (GLvoid*)offsetof(HardwareVertex, tex_coord2)); + glEnableVertexAttribArray(GLShader::ATTRIBUTE_TEXCOORD0); + glEnableVertexAttribArray(GLShader::ATTRIBUTE_TEXCOORD1); + glEnableVertexAttribArray(GLShader::ATTRIBUTE_TEXCOORD2); SetShader(); diff --git a/src/video_core/renderer_opengl/gl_shader_util.cpp b/src/video_core/renderer_opengl/gl_shader_util.cpp index 2fa0ceb3e..735c86d22 100644 --- a/src/video_core/renderer_opengl/gl_shader_util.cpp +++ b/src/video_core/renderer_opengl/gl_shader_util.cpp @@ -68,9 +68,9 @@ GLuint LoadProgram(const char* vertex_shader, const char* fragment_shader) { glBindAttribLocation(program_id, Attributes::ATTRIBUTE_POSITION, "vert_position"); glBindAttribLocation(program_id, Attributes::ATTRIBUTE_COLOR, "vert_color"); - glBindAttribLocation(program_id, Attributes::ATTRIBUTE_TEXCOORDS + 0, "vert_texcoord0"); - glBindAttribLocation(program_id, Attributes::ATTRIBUTE_TEXCOORDS + 1, "vert_texcoord1"); - glBindAttribLocation(program_id, Attributes::ATTRIBUTE_TEXCOORDS + 2, "vert_texcoord2"); + glBindAttribLocation(program_id, Attributes::ATTRIBUTE_TEXCOORD0, "vert_texcoord0"); + glBindAttribLocation(program_id, Attributes::ATTRIBUTE_TEXCOORD1, "vert_texcoord1"); + glBindAttribLocation(program_id, Attributes::ATTRIBUTE_TEXCOORD2, "vert_texcoord2"); glLinkProgram(program_id); diff --git a/src/video_core/renderer_opengl/gl_shader_util.h b/src/video_core/renderer_opengl/gl_shader_util.h index 4d3791d50..046aae14f 100644 --- a/src/video_core/renderer_opengl/gl_shader_util.h +++ b/src/video_core/renderer_opengl/gl_shader_util.h @@ -9,9 +9,11 @@ namespace GLShader { enum Attributes { - ATTRIBUTE_POSITION = 0, - ATTRIBUTE_COLOR = 1, - ATTRIBUTE_TEXCOORDS = 2, + ATTRIBUTE_POSITION, + ATTRIBUTE_COLOR, + ATTRIBUTE_TEXCOORD0, + ATTRIBUTE_TEXCOORD1, + ATTRIBUTE_TEXCOORD2, }; /** |