switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
// fetch current fbo here (default fbo is not 0 on some GLES devices)
CHECKGLERROR
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
break;
}
r_meshbuffer_t *buffer;
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
break;
}
continue;
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
break;
}
{
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
break;
}
{
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
CHECKGLERROR
qglFinish();CHECKGLERROR
// D3D Y coordinate is top to bottom, OpenGL is bottom to top, fix the D3D one
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
break;
}
m[15] = 1;
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
break;
}
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
CHECKGLERROR
qglViewport(v->x, v->y, v->width, v->height);CHECKGLERROR
GLuint status;
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
CHECKGLERROR
qglGenFramebuffers(1, (GLuint*)&temp);CHECKGLERROR
{
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
if (fbo)
{
// set up framebuffer object or render targets for the active rendering API
switch (vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
if (gl_state.framebufferobject != fbo)
{
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
CHECKGLERROR
qglColorMask(1, 1, 1, 1);CHECKGLERROR
gl_state.unit = num;
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
CHECKGLERROR
qglActiveTexture(GL_TEXTURE0 + gl_state.unit);CHECKGLERROR
blendenable = (gl_state.blendfunc1 != GL_ONE || gl_state.blendfunc2 != GL_ZERO);
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
CHECKGLERROR
if (qglBlendFuncSeparate)
gl_state.depthmask = state;
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
CHECKGLERROR
qglDepthMask(gl_state.depthmask);CHECKGLERROR
gl_state.depthtest = state;
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
CHECKGLERROR
if (gl_state.depthtest)
gl_state.depthfunc = state;
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
CHECKGLERROR
qglDepthFunc(gl_state.depthfunc);CHECKGLERROR
gl_state.depthrange[1] = farfrac;
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
CHECKGLERROR
#ifdef USE_GLES2
{
switch (vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
CHECKGLERROR
if (enable)
gl_state.polygonoffset[1] = depthoffset;
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
CHECKGLERROR
qglPolygonOffset(gl_state.polygonoffset[0], gl_state.polygonoffset[1]);CHECKGLERROR
return;
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
CHECKGLERROR
qglCullFace(gl_state.cullface);CHECKGLERROR
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
CHECKGLERROR
{
case RENDERPATH_GLES2:
break;
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
#ifdef GL_SAMPLE_ALPHA_TO_COVERAGE_ARB
// alpha to coverage turns the alpha value of the pixel into 0%, 25%, 50%, 75% or 100% by masking the multisample fragments accordingly
CHECKGLERROR
gl_state.colormask = state;
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
CHECKGLERROR
qglColorMask((GLboolean)r, (GLboolean)g, (GLboolean)b, (GLboolean)a);CHECKGLERROR
gl_state.color4f[3] = ca;
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
qglVertexAttrib4f(GLSLATTRIB_COLOR, cr, cg, cb, ca);CHECKGLERROR
break;
{
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
CHECKGLERROR
qglScissor(x, y,width,height);CHECKGLERROR
gl_state.scissortest = state;
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
CHECKGLERROR
if(gl_state.scissortest)
}
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
CHECKGLERROR
if (mask & GL_COLOR_BUFFER_BIT)
{
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
CHECKGLERROR
#ifndef GL_BGRA
{
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
CHECKGLERROR
if (bufferobject3s)
buffer->size = size;
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
if (!buffer->bufferobject)
qglGenBuffers(1, (GLuint *)&buffer->bufferobject);
return;
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
// GL clears the binding if we delete something bound
if (gl_state.uniformbufferobject == buffer->bufferobject)
{
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
if (gl_state.pointer_vertex_components != components || gl_state.pointer_vertex_gltype != gltype || gl_state.pointer_vertex_stride != stride || gl_state.pointer_vertex_pointer != pointer || gl_state.pointer_vertex_vertexbuffer != vertexbuffer || gl_state.pointer_vertex_offset != bufferoffset)
{
// the pointer only.
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
CHECKGLERROR
if (pointer)
// that involve a valid bufferobject also supply a texcoord array
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
CHECKGLERROR
if (pointer)
{
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
R_Mesh_TexBind(0, tex);
GL_ActiveTexture(0);CHECKGLERROR
return;
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
if (!tex)
{
{
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
qglBlendEquationEXT(GL_FUNC_REVERSE_SUBTRACT);CHECKGLERROR
break;
{
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
qglBlendEquationEXT(GL_FUNC_ADD);CHECKGLERROR
break;
ih = (int)(0.5 + height * ((float)r_refdef.view.height / vid_conheight.integer));
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
GL_Scissor(ix, vid.height - iy - ih, iw, ih);
break;
unsigned int i, limit;
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
{
r_glsl_permutation_t *p;
GL_AlphaToCoverage(false);
switch (vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
R_SetupShader_SetPermutationGLSL(SHADERMODE_GENERIC, permutation);
if (r_glsl_permutation->tex_Texture_First >= 0)
GL_AlphaToCoverage(false);
switch (vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
R_SetupShader_SetPermutationGLSL(SHADERMODE_DEPTH_OR_SHADOW, permutation);
#ifndef USE_GLES2 /* FIXME: GLES3 only */
permutation |= SHADERPERMUTATION_FOGALPHAHACK;
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
RSurf_PrepareVerticesForBatch(BATCHNEED_ARRAY_VERTEX | BATCHNEED_ARRAY_NORMAL | BATCHNEED_ARRAY_VECTOR | (rsurface.modellightmapcolor4f ? BATCHNEED_ARRAY_VERTEXCOLOR : 0) | BATCHNEED_ARRAY_TEXCOORD | (rsurface.uselightmaptexture ? BATCHNEED_ARRAY_LIGHTMAP : 0) | BATCHNEED_ALLOWMULTIDRAW, texturenumsurfaces, texturesurfacelist);
R_Mesh_VertexPointer( 3, GL_FLOAT, sizeof(float[3]), rsurface.batchvertex3f, rsurface.batchvertex3f_vertexbuffer, rsurface.batchvertex3f_bufferoffset);
Matrix4x4_ToArrayFloatGL(&viewtolight, viewtolight16f);
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
R_SetupShader_SetPermutationGLSL(mode, permutation);
if (r_glsl_permutation->loc_LightPosition >= 0) qglUniform3f( r_glsl_permutation->loc_LightPosition , viewlightorigin[0], viewlightorigin[1], viewlightorigin[2]);
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
Cvar_SetValueQuick(&r_textureunits, vid.texunits);
Cvar_SetValueQuick(&gl_combine, 1);
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
#if defined(GL_SAMPLES_PASSED_ARB) && !defined(USE_GLES2)
if (r_maxqueries)
CHECKGLERROR
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
if (r_glsl_permutation && r_glsl_permutation->loc_ModelViewProjectionMatrix >= 0) qglUniformMatrix4fv(r_glsl_permutation->loc_ModelViewProjectionMatrix, 1, false, gl_modelviewprojection16f);
if (r_glsl_permutation && r_glsl_permutation->loc_ModelViewMatrix >= 0) qglUniformMatrix4fv(r_glsl_permutation->loc_ModelViewMatrix, 1, false, gl_modelview16f);
GL_PolygonOffset(0, 0);
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
qglEnable(GL_POLYGON_OFFSET_FILL);CHECKGLERROR
break;
GL_PolygonOffset(r_refdef.polygonfactor, r_refdef.polygonoffset);
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
qglEnable(GL_POLYGON_OFFSET_FILL);CHECKGLERROR
break;
switch (vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
r_fb.usedepthtextures = r_usedepthtextures.integer != 0;
if (r_viewfbo.integer == 2) textype = TEXTYPE_COLORBUFFER16F;
if (r_viewfbo.integer == 3) textype = TEXTYPE_COLORBUFFER32F;
R_Mesh_PrepareVertices_Mesh_Arrays(4, r_screenvertex3f, NULL, NULL, NULL, NULL, r_fb.rt_screen->texcoord2f, bloomtexture ? r_fb.rt_bloom->texcoord2f : NULL);
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
permutation =
(r_fb.bloomwidth ? SHADERPERMUTATION_BLOOM : 0)
r_gpuskeletal = false;
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
r_gpuskeletal = r_glsl_skeletal.integer && !r_showsurfaces.integer;
case RENDERPATH_GLES2:
if(!vid_gammatables_trivial)
}
switch (vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
R_DrawTextureSurfaceList_GL20(texturenumsurfaces, texturesurfacelist, writedepth, prepass);
break;
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
if (glt->texnum)
{
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
// change all the existing mipmap texture objects
// FIXME: force renderer(/client/something?) restart instead?
{
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
// LordHavoc: allow any alignment
CHECKGLERROR
continue;
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
break;
}
continue;
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
break;
}
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
// ignore the first difference, any textures loaded by now probably had the same aniso value
if (first_time_aniso)
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
{
int oldbindtexnum;
// do the appropriate upload type...
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
if (glt->texnum) // not renderbuffers
{
// data may be NULL (blank texture for dynamic rendering)
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
CHECKGLERROR
qglGenTextures(1, (GLuint *)&glt->texnum);CHECKGLERROR
// data may be NULL (blank texture for dynamic rendering)
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
CHECKGLERROR
qglGenRenderbuffers(1, (GLuint *)&glt->renderbuffernum);CHECKGLERROR
// create the texture object
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
CHECKGLERROR
GL_ActiveTexture(0);
break;
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
if (bytesperblock)
{
// after upload we have to set some parameters...
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
#ifdef GL_TEXTURE_MAX_LEVEL
if (dds_miplevels >= 1 && !mipcomplete)
r_shadow_shadowmapborder = bound(1, r_shadow_shadowmapping_bordersize.integer, 16);
r_shadow_shadowmaptexturesize = bound(256, r_shadow_shadowmapping_texturesize.integer, (int)vid.maxtexturesize_2d);
r_shadow_shadowmapmaxsize = bound(r_shadow_shadowmapborder+2, r_shadow_shadowmapping_maxsize.integer, r_shadow_shadowmaptexturesize / 8);
- r_shadow_shadowmapvsdct = r_shadow_shadowmapping_vsdct.integer != 0 && vid.renderpath == RENDERPATH_GL20;
+ r_shadow_shadowmapvsdct = r_shadow_shadowmapping_vsdct.integer != 0 && vid.renderpath == RENDERPATH_GL32;
r_shadow_shadowmapfilterquality = r_shadow_shadowmapping_filterquality.integer;
r_shadow_shadowmapshadowsampler = r_shadow_shadowmapping_useshadowsampler.integer != 0;
r_shadow_shadowmapdepthbits = r_shadow_shadowmapping_depthbits.integer;
{
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
if(r_shadow_shadowmapfilterquality < 0)
{
if (!r_fb.usedepthtextures)
// these out per frame...
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
r_shadow_bouncegrid_state.allowdirectionalshading = true;
r_shadow_bouncegrid_state.capable = true;
break;
GL_ColorMask(0, 0, 0, 0);
switch (vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
GL_CullFace(r_refdef.view.cullface_back);
break;
GL_ColorMask(0,0,0,0);
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
GL_CullFace(r_refdef.view.cullface_back);
break;
if (r_shadow_shadowmaptexturesize != shadowmaptexturesize ||
!(r_shadow_shadowmapping.integer || r_shadow_deferred.integer) ||
- r_shadow_shadowmapvsdct != (r_shadow_shadowmapping_vsdct.integer != 0 && vid.renderpath == RENDERPATH_GL20) ||
+ r_shadow_shadowmapvsdct != (r_shadow_shadowmapping_vsdct.integer != 0 && vid.renderpath == RENDERPATH_GL32) ||
r_shadow_shadowmapfilterquality != r_shadow_shadowmapping_filterquality.integer ||
r_shadow_shadowmapshadowsampler != r_shadow_shadowmapping_useshadowsampler.integer ||
r_shadow_shadowmapdepthbits != r_shadow_shadowmapping_depthbits.integer ||
switch (vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
#ifndef USE_GLES2
if (!r_shadow_deferred.integer || vid.maxdrawbuffers < 2)
{
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
#if defined(GL_SAMPLES_PASSED_ARB) && !defined(USE_GLES2)
CHECKGLERROR
{
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
#if defined(GL_SAMPLES_PASSED_ARB) && !defined(USE_GLES2)
// See if we can use the GPU-side method to prevent implicit sync
r_numqueries = 0;
switch (vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
usequery = vid.support.arb_occlusion_query && r_coronas_occlusionquery.integer;
#if defined(GL_SAMPLES_PASSED_ARB) && !defined(USE_GLES2)
typedef enum renderpath_e
{
- RENDERPATH_GL20,
+ RENDERPATH_GL32,
RENDERPATH_GLES2
}
renderpath_t;
{
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
case RENDERPATH_GLES2:
CHECKGLERROR
if (r_speeds.integer == 2 || gl_finish.integer)
// clear the extension flags
memset(&vid.support, 0, sizeof(vid.support));
- vid.renderpath = RENDERPATH_GL20;
+ vid.renderpath = RENDERPATH_GL32;
vid.sRGBcapable2D = false;
vid.sRGBcapable3D = false;
vid.maxtexturesize_2d = 0;
vid.texunits = bound(4, vid.texunits, MAX_TEXTUREUNITS);
vid.teximageunits = bound(16, vid.teximageunits, MAX_TEXTUREUNITS);
vid.texarrayunits = bound(8, vid.texarrayunits, MAX_TEXTUREUNITS);
- Con_DPrint("Using GL2+extensions rendering path\n");
- vid.renderpath = RENDERPATH_GL20;
+ Con_DPrint("Using GL3 rendering path\n");
+ vid.renderpath = RENDERPATH_GL32;
vid.sRGBcapable2D = false;
vid.sRGBcapable3D = true;
Con_DPrintf("vid.support.arb_multisample %i\n", vid.support.arb_multisample);
switch(vid.renderpath)
{
- case RENDERPATH_GL20:
+ case RENDERPATH_GL32:
#ifdef GL_STEREO
{
GLboolean stereo;