OpenGL2: Misc fixes and cleanup

Fix two constants in GLSL shaders. Remove f suffix from float and fix
int to float assignment. They were causing shader compile errors in
OpenGL ES 2 context.

Remove disabling clip plane. Clip plane is unused and never enabled in
the opengl2 renderer. Remove disabling it to avoid causing a GL error
when using OpenGL 3.2 core profile or OpenGL ES.

Make VAO cache vertex stride be size of srfVert_t since that is what
is uploaded to the GPU. No behavior change. There is a disabled debug
id in srfVert_t though which if enabled changes srfVert_t size.
This commit is contained in:
Zack Middleton 2018-07-20 23:40:35 -05:00
parent 14cc4cc6cb
commit 39e2113c73
11 changed files with 28 additions and 53 deletions

View file

@ -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();