fix warnings

This commit is contained in:
degasus 2013-01-11 21:24:59 +01:00
parent 8651b34e22
commit 2838077313
6 changed files with 15 additions and 12 deletions

View File

@ -28,6 +28,9 @@
#include "GLUtil.h"
// this should be removed in future, but as long as glsl is unstable, we should really read this messages
#define DEBUG_GLSL
GLWindow GLWin;
cInterfaceBase *GLInterface;
@ -70,14 +73,14 @@ GLuint OpenGL_CompileProgram ( const char* vertexShader, const char* fragmentSha
GLuint vertexShaderID = glCreateShader(GL_VERTEX_SHADER);
GLuint fragmentShaderID = glCreateShader(GL_FRAGMENT_SHADER);
GLuint programID = glCreateProgram();
GLint Result = GL_FALSE;
char stringBuffer[1024];
GLsizei stringBufferUsage = 0;
// compile vertex shader
glShaderSource(vertexShaderID, 1, &vertexShader, NULL);
glCompileShader(vertexShaderID);
#if defined(_DEBUG) || defined(DEBUGFAST) || defined(DEBUG_GLSL)
GLint Result = GL_FALSE;
char stringBuffer[1024];
GLsizei stringBufferUsage = 0;
glGetShaderiv(vertexShaderID, GL_COMPILE_STATUS, &Result);
glGetShaderInfoLog(vertexShaderID, 1024, &stringBufferUsage, stringBuffer);
if(Result && stringBufferUsage) {

View File

@ -107,7 +107,7 @@ void ProgramShaderCache::SetProgramBindings ( ProgramShaderCache::PCacheEntry& e
}
// Need to set some attribute locations
glBindAttribLocation(entry.prog_id, SHADER_POSITION_ATTRIB, "vposition");
glBindAttribLocation(entry.prog_id, SHADER_POSITION_ATTRIB, "rawpos");
glBindAttribLocation(entry.prog_id, SHADER_POSMTX_ATTRIB, "fposmtx");
glBindAttribLocation(entry.prog_id, SHADER_TEXTURE0_ATTRIB, "texture0");
glBindAttribLocation(entry.prog_id, SHADER_COLOR0_ATTRIB, "color0");

View File

@ -131,11 +131,11 @@ const u8 rasters[char_count][char_height] = {
static const char *s_vertexShaderSrc =
"#version 130\n"
"uniform vec2 charSize;\n"
"in vec2 vposition;\n"
"in vec2 rawpos;\n"
"in vec2 texture0;\n"
"out vec2 uv0;\n"
"void main(void) {\n"
" gl_Position = vec4(vposition,0,1);\n"
" gl_Position = vec4(rawpos,0,1);\n"
" uv0 = texture0 * charSize;\n"
"}\n";

View File

@ -397,11 +397,11 @@ Renderer::Renderer()
);
VertexShaderCache::CompileVertexShader(s_ShowEFBCopyRegions_VS,
"#version 130\n"
"in vec2 vposition;\n"
"in vec2 rawpos;\n"
"in vec3 color0;\n"
"out vec4 c;\n"
"void main(void) {\n"
" gl_Position = vec4(vposition,0,1);\n"
" gl_Position = vec4(rawpos,0,1);\n"
" c = vec4(color0, 1.0);\n"
"}\n"
);

View File

@ -538,13 +538,13 @@ TextureCache::TextureCache()
const char *VProgram =
"#version 130\n"
"in vec2 vposition;\n"
"in vec2 rawpos;\n"
"in vec2 texture0;\n"
"out vec2 uv0;\n"
"void main()\n"
"{\n"
" uv0 = texture0;\n"
" gl_Position = vec4(vposition,0,1);\n"
" gl_Position = vec4(rawpos,0,1);\n"
"}\n";
if (!VertexShaderCache::CompileVertexShader(s_vProgram, VProgram))
ERROR_LOG(VIDEO, "Failed to create texture converter vertex program.");

View File

@ -114,13 +114,13 @@ void CreatePrograms()
const char *VProgram =
"#version 130\n"
"in vec2 vposition;\n"
"in vec2 rawpos;\n"
"in vec2 texture0;\n"
"out vec2 uv0;\n"
"void main()\n"
"{\n"
" uv0 = texture0;\n"
" gl_Position = vec4(vposition,0,1);\n"
" gl_Position = vec4(rawpos,0,1);\n"
"}\n";
if (!VertexShaderCache::CompileVertexShader(s_vProgram, VProgram))
ERROR_LOG(VIDEO, "Failed to create texture converter vertex program.");