diff --git a/code/renderergl2/glsl/calclevels4x_fp.glsl b/code/renderergl2/glsl/calclevels4x_fp.glsl index 8246c4b3..c2597681 100644 --- a/code/renderergl2/glsl/calclevels4x_fp.glsl +++ b/code/renderergl2/glsl/calclevels4x_fp.glsl @@ -56,5 +56,5 @@ void main() current.y *= 0.0625; #endif - gl_FragColor = vec4(current, 1.0f); + gl_FragColor = vec4(current, 1.0); } diff --git a/code/renderergl2/glsl/ssao_fp.glsl b/code/renderergl2/glsl/ssao_fp.glsl index d4c43063..f3054404 100644 --- a/code/renderergl2/glsl/ssao_fp.glsl +++ b/code/renderergl2/glsl/ssao_fp.glsl @@ -61,7 +61,7 @@ float ambientOcclusion(sampler2D depthMap, const vec2 tex, const float zFarDivZN poissonDisc[7] = vec2(-0.5579782, 0.7491854); poissonDisc[8] = vec2(0.7320465, 0.6317794); - float result = 0; + float result = 0.0; float sampleZ = getLinearDepth(depthMap, tex, zFarDivZNear); float scaleZ = zFarDivZNear * sampleZ; diff --git a/code/renderergl2/tr_backend.c b/code/renderergl2/tr_backend.c index 955bb70e..df54528b 100644 --- a/code/renderergl2/tr_backend.c +++ b/code/renderergl2/tr_backend.c @@ -58,7 +58,7 @@ void GL_BindToTMU( image_t *image, int tmu ) ri.Printf(PRINT_WARNING, "GL_BindToTMU: NULL image\n"); } - GL_BindMultiTexture(GL_TEXTURE0_ARB + tmu, target, texture); + GL_BindMultiTexture(GL_TEXTURE0 + tmu, target, texture); } @@ -435,7 +435,6 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) { int oldSort; double originalTime; FBO_t* fbo = NULL; - qboolean inQuery = qfalse; // save original time for entity shader offsets originalTime = backEnd.refdef.floatTime; @@ -593,10 +592,6 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) { RB_EndSurface(); } - if (inQuery) { - qglEndQuery(GL_SAMPLES_PASSED); - } - if (glRefConfig.framebufferObject) FBO_Bind(fbo); @@ -657,7 +652,6 @@ void RB_SetGL2D (void) { GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA ); GL_Cull( CT_TWO_SIDED ); - qglDisable( GL_CLIP_PLANE0 ); // set time for 2D shaders backEnd.refdef.time = ri.Milliseconds(); diff --git a/code/renderergl2/tr_cmds.c b/code/renderergl2/tr_cmds.c index 2aefb4c9..38ba45d2 100644 --- a/code/renderergl2/tr_cmds.c +++ b/code/renderergl2/tr_cmds.c @@ -203,11 +203,11 @@ void R_AddCapShadowmapCmd( int map, int cubeSide ) { /* ============= -R_PostProcessingCmd +R_AddPostProcessCmd ============= */ -void R_AddPostProcessCmd( ) { +void R_AddPostProcessCmd( void ) { postProcessCommand_t *cmd; cmd = R_GetCommandBuffer( sizeof( *cmd ) ); diff --git a/code/renderergl2/tr_dsa.c b/code/renderergl2/tr_dsa.c index a9d07568..e43df0bb 100644 --- a/code/renderergl2/tr_dsa.c +++ b/code/renderergl2/tr_dsa.c @@ -35,7 +35,7 @@ static struct } glDsaState; -void GL_BindNullTextures() +void GL_BindNullTextures(void) { int i; @@ -141,7 +141,7 @@ GLvoid APIENTRY GLDSA_GenerateTextureMipmapEXT(GLuint texture, GLenum target) qglGenerateMipmap(target); } -void GL_BindNullProgram() +void GL_BindNullProgram(void) { qglUseProgram(0); glDsaState.program = 0; @@ -205,7 +205,7 @@ GLvoid APIENTRY GLDSA_ProgramUniformMatrix4fvEXT(GLuint program, GLint location, qglUniformMatrix4fv(location, count, transpose, value); } -void GL_BindNullFramebuffers() +void GL_BindNullFramebuffers(void) { qglBindFramebuffer(GL_FRAMEBUFFER, 0); glDsaState.drawFramebuffer = glDsaState.readFramebuffer = 0; diff --git a/code/renderergl2/tr_extensions.c b/code/renderergl2/tr_extensions.c index 9e5a2939..ebc985a9 100644 --- a/code/renderergl2/tr_extensions.c +++ b/code/renderergl2/tr_extensions.c @@ -30,7 +30,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "tr_local.h" #include "tr_dsa.h" -void GLimp_InitExtraExtensions() +void GLimp_InitExtraExtensions(void) { char *extension; const char* result[3] = { "...ignoring %s\n", "...using %s\n", "...%s not found\n" }; diff --git a/code/renderergl2/tr_flares.c b/code/renderergl2/tr_flares.c index 54853cad..fc83df7b 100644 --- a/code/renderergl2/tr_flares.c +++ b/code/renderergl2/tr_flares.c @@ -526,10 +526,6 @@ void RB_RenderFlares (void) { return; // none visible } - if ( backEnd.viewParms.isPortal ) { - qglDisable (GL_CLIP_PLANE0); - } - Mat4Copy(glState.projection, oldprojection); Mat4Copy(glState.modelview, oldmodelview); Mat4Identity(matrix); diff --git a/code/renderergl2/tr_glsl.c b/code/renderergl2/tr_glsl.c index 5de135be..596e27ee 100644 --- a/code/renderergl2/tr_glsl.c +++ b/code/renderergl2/tr_glsl.c @@ -331,17 +331,6 @@ static void GLSL_GetShaderHeader( GLenum shaderType, const GLchar *extra, char * AGEN_LIGHTING_SPECULAR, AGEN_PORTAL)); - Q_strcat(dest, size, - va("#ifndef texenv_t\n" - "#define texenv_t\n" - "#define TEXENV_MODULATE %i\n" - "#define TEXENV_ADD %i\n" - "#define TEXENV_REPLACE %i\n" - "#endif\n", - GL_MODULATE, - GL_ADD, - GL_REPLACE)); - fbufWidthScale = 1.0f / ((float)glConfig.vidWidth); fbufHeightScale = 1.0f / ((float)glConfig.vidHeight); Q_strcat(dest, size, diff --git a/code/renderergl2/tr_scene.c b/code/renderergl2/tr_scene.c index ff0a22e2..aea153e1 100644 --- a/code/renderergl2/tr_scene.c +++ b/code/renderergl2/tr_scene.c @@ -435,7 +435,7 @@ void RE_BeginScene(const refdef_t *fd) } -void RE_EndScene() +void RE_EndScene(void) { // the next scene rendered in this frame will tack on after this one r_firstSceneDrawSurf = tr.refdef.numDrawSurfs; diff --git a/code/renderergl2/tr_shadows.c b/code/renderergl2/tr_shadows.c index 17fd731c..697800c1 100644 --- a/code/renderergl2/tr_shadows.c +++ b/code/renderergl2/tr_shadows.c @@ -261,7 +261,6 @@ void RB_ShadowFinish( void ) { qglEnable( GL_STENCIL_TEST ); qglStencilFunc( GL_NOTEQUAL, 0, 255 ); - qglDisable (GL_CLIP_PLANE0); GL_Cull( CT_TWO_SIDED ); GL_BindToTMU( tr.whiteImage, TB_COLORMAP ); diff --git a/code/renderergl2/tr_vbo.c b/code/renderergl2/tr_vbo.c index bc37ff02..df64f8bc 100644 --- a/code/renderergl2/tr_vbo.c +++ b/code/renderergl2/tr_vbo.c @@ -751,7 +751,7 @@ void VaoCache_Commit(void) if (indexSet < vc.surfaceIndexSets + vc.numSurfaces) { tess.firstIndex = indexSet->bufferOffset / sizeof(glIndex_t); - //ri.Printf(PRINT_ALL, "firstIndex %d numIndexes %d as %d\n", tess.firstIndex, tess.numIndexes, batchLength - vc.batchLengths); + //ri.Printf(PRINT_ALL, "firstIndex %d numIndexes %d as %d\n", tess.firstIndex, tess.numIndexes, (int)(batchLength - vc.batchLengths)); //ri.Printf(PRINT_ALL, "vc.numSurfaces %d vc.numBatches %d\n", vc.numSurfaces, vc.numBatches); } // If not, rebuffer the batch @@ -792,7 +792,7 @@ void VaoCache_Commit(void) vcq.indexCommitSize += indexesSize; } - //ri.Printf(PRINT_ALL, "committing %d to %d, %d to %d as %d\n", vcq.vertexCommitSize, vc.vertexOffset, vcq.indexCommitSize, vc.indexOffset, batchLength - vc.batchLengths); + //ri.Printf(PRINT_ALL, "committing %d to %d, %d to %d as %d\n", vcq.vertexCommitSize, vc.vertexOffset, vcq.indexCommitSize, vc.indexOffset, (int)(batchLength - vc.batchLengths)); if (vcq.vertexCommitSize) { @@ -812,9 +812,6 @@ void VaoCache_Commit(void) void VaoCache_Init(void) { - srfVert_t vert; - int dataSize; - vc.vao = R_CreateVao("VaoCache", NULL, VAOCACHE_VERTEX_BUFFER_SIZE, NULL, VAOCACHE_INDEX_BUFFER_SIZE, VAO_USAGE_DYNAMIC); vc.vao->attribs[ATTR_INDEX_POSITION].enabled = 1; @@ -849,21 +846,21 @@ void VaoCache_Init(void) vc.vao->attribs[ATTR_INDEX_LIGHTDIRECTION].normalized = GL_TRUE; vc.vao->attribs[ATTR_INDEX_COLOR].normalized = GL_TRUE; - vc.vao->attribs[ATTR_INDEX_POSITION].offset = 0; dataSize = sizeof(vert.xyz); - vc.vao->attribs[ATTR_INDEX_TEXCOORD].offset = dataSize; dataSize += sizeof(vert.st); - vc.vao->attribs[ATTR_INDEX_LIGHTCOORD].offset = dataSize; dataSize += sizeof(vert.lightmap); - vc.vao->attribs[ATTR_INDEX_NORMAL].offset = dataSize; dataSize += sizeof(vert.normal); - vc.vao->attribs[ATTR_INDEX_TANGENT].offset = dataSize; dataSize += sizeof(vert.tangent); - vc.vao->attribs[ATTR_INDEX_LIGHTDIRECTION].offset = dataSize; dataSize += sizeof(vert.lightdir); - vc.vao->attribs[ATTR_INDEX_COLOR].offset = dataSize; dataSize += sizeof(vert.color); + vc.vao->attribs[ATTR_INDEX_POSITION].offset = offsetof(srfVert_t, xyz); + vc.vao->attribs[ATTR_INDEX_TEXCOORD].offset = offsetof(srfVert_t, st); + vc.vao->attribs[ATTR_INDEX_LIGHTCOORD].offset = offsetof(srfVert_t, lightmap); + vc.vao->attribs[ATTR_INDEX_NORMAL].offset = offsetof(srfVert_t, normal); + vc.vao->attribs[ATTR_INDEX_TANGENT].offset = offsetof(srfVert_t, tangent); + vc.vao->attribs[ATTR_INDEX_LIGHTDIRECTION].offset = offsetof(srfVert_t, lightdir); + vc.vao->attribs[ATTR_INDEX_COLOR].offset = offsetof(srfVert_t, color); - vc.vao->attribs[ATTR_INDEX_POSITION].stride = dataSize; - vc.vao->attribs[ATTR_INDEX_TEXCOORD].stride = dataSize; - vc.vao->attribs[ATTR_INDEX_LIGHTCOORD].stride = dataSize; - vc.vao->attribs[ATTR_INDEX_NORMAL].stride = dataSize; - vc.vao->attribs[ATTR_INDEX_TANGENT].stride = dataSize; - vc.vao->attribs[ATTR_INDEX_LIGHTDIRECTION].stride = dataSize; - vc.vao->attribs[ATTR_INDEX_COLOR].stride = dataSize; + vc.vao->attribs[ATTR_INDEX_POSITION].stride = sizeof(srfVert_t); + vc.vao->attribs[ATTR_INDEX_TEXCOORD].stride = sizeof(srfVert_t); + vc.vao->attribs[ATTR_INDEX_LIGHTCOORD].stride = sizeof(srfVert_t); + vc.vao->attribs[ATTR_INDEX_NORMAL].stride = sizeof(srfVert_t); + vc.vao->attribs[ATTR_INDEX_TANGENT].stride = sizeof(srfVert_t); + vc.vao->attribs[ATTR_INDEX_LIGHTDIRECTION].stride = sizeof(srfVert_t); + vc.vao->attribs[ATTR_INDEX_COLOR].stride = sizeof(srfVert_t); Vao_SetVertexPointers(vc.vao); @@ -888,7 +885,7 @@ void VaoCache_CheckAdd(qboolean *endSurface, qboolean *recycleVertexBuffer, qboo if (vc.vao->vertexesSize < vc.vertexOffset + vcq.vertexCommitSize + vertexesSize) { - //ri.Printf(PRINT_ALL, "out of space in vertex cache: %d < %d + %d + %d\n", vc.vao->vertexesSize, vc.vertexOffset, vc.vertexCommitSize, vertexesSize); + //ri.Printf(PRINT_ALL, "out of space in vertex cache: %d < %d + %d + %d\n", vc.vao->vertexesSize, vc.vertexOffset, vcq.vertexCommitSize, vertexesSize); *recycleVertexBuffer = qtrue; *recycleIndexBuffer = qtrue; *endSurface = qtrue; @@ -966,6 +963,6 @@ void VaoCache_AddSurface(srfVert_t *verts, int numVerts, glIndex_t *indexes, int queueEntry->numIndexes = numIndexes; vcq.numSurfaces++; - vcq.vertexCommitSize += sizeof(srfVert_t) * numVerts;; + vcq.vertexCommitSize += sizeof(srfVert_t) * numVerts; vcq.indexCommitSize += sizeof(glIndex_t) * numIndexes; }