Permalink
Browse files

Remove some cvars for disabling extensions that make no sense to disa…

…ble.

Those extensions should be universally available and/or we couldn't
load our assets if they are turned off anyway.
  • Loading branch information...
1 parent 4e3efb6 commit 895d1f69fc26783f67a486e143c7b0cb886b9aaa @gimhael gimhael committed Mar 9, 2016
@@ -472,16 +472,6 @@ std::string GLShaderManager::BuildGPUShaderText( Str::StringRef mainShaderNa
AddDefine( env, "r_FBufScale", fbufWidthScale, fbufHeightScale );
- float npotWidthScale = 1;
- float npotHeightScale = 1;
-
- if ( !glConfig2.textureNPOTAvailable )
- {
- npotWidthScale = ( float ) glConfig.vidWidth / ( float ) NearestPowerOfTwo( glConfig.vidWidth );
- npotHeightScale = ( float ) glConfig.vidHeight / ( float ) NearestPowerOfTwo( glConfig.vidHeight );
- }
-
- AddDefine( env, "r_NPOTScale", npotWidthScale, npotHeightScale );
AddDefine( env, "r_tileStep", glState.tileStep[ 0 ], glState.tileStep[ 1 ] );
if ( glConfig.driverType == glDriverType_t::GLDRV_MESA )
Oops, something went wrong.
@@ -410,16 +410,8 @@ void R_InitFBOs()
// make sure the render thread is stopped
R_SyncRenderThread();
- if ( glConfig2.textureNPOTAvailable )
- {
- width = glConfig.vidWidth;
- height = glConfig.vidHeight;
- }
- else
- {
- width = NearestPowerOfTwo( glConfig.vidWidth );
- height = NearestPowerOfTwo( glConfig.vidHeight );
- }
+ width = glConfig.vidWidth;
+ height = glConfig.vidHeight;
xTiles = (width + 15) >> 4;
yTiles = (height + 15) >> 4;
@@ -523,16 +515,8 @@ void R_InitFBOs()
}
{
- if ( glConfig2.textureNPOTAvailable )
- {
- width = glConfig.vidWidth;
- height = glConfig.vidHeight;
- }
- else
- {
- width = NearestPowerOfTwo( glConfig.vidWidth );
- height = NearestPowerOfTwo( glConfig.vidHeight );
- }
+ width = glConfig.vidWidth;
+ height = glConfig.vidHeight;
// portalRender FBO for portals, mirrors, water, cameras et cetera
tr.portalRenderFBO = R_CreateFBO( "_portalRender", width, height );
@@ -544,16 +528,8 @@ void R_InitFBOs()
}
{
- if ( glConfig2.textureNPOTAvailable )
- {
- width = glConfig.vidWidth * 0.25f;
- height = glConfig.vidHeight * 0.25f;
- }
- else
- {
- width = NearestPowerOfTwo( glConfig.vidWidth * 0.25f );
- height = NearestPowerOfTwo( glConfig.vidHeight * 0.25f );
- }
+ width = glConfig.vidWidth * 0.25f;
+ height = glConfig.vidHeight * 0.25f;
tr.downScaleFBO_quarter = R_CreateFBO( "_downScale_quarter", width, height );
R_BindFBO( tr.downScaleFBO_quarter );
@@ -567,16 +543,8 @@ void R_InitFBOs()
R_AttachFBOTexture2D( GL_TEXTURE_2D, tr.downScaleFBOImage_64x64->texnum, 0 );
R_CheckFBO( tr.downScaleFBO_64x64 );
- if ( glConfig2.textureNPOTAvailable )
- {
- width = glConfig.vidWidth * 0.25f;
- height = glConfig.vidHeight * 0.25f;
- }
- else
- {
- width = NearestPowerOfTwo( glConfig.vidWidth * 0.25f );
- height = NearestPowerOfTwo( glConfig.vidHeight * 0.25f );
- }
+ width = glConfig.vidWidth * 0.25f;
+ height = glConfig.vidHeight * 0.25f;
tr.contrastRenderFBO = R_CreateFBO( "_contrastRender", width, height );
R_BindFBO( tr.contrastRenderFBO );
@@ -1043,34 +1043,8 @@ void R_UploadImage( const byte **dataArray, int numLayers, int numMips,
GL_Bind( image );
- if ( glConfig2.textureNPOTAvailable )
- {
- scaledWidth = image->width;
- scaledHeight = image->height;
- }
- else
- {
- // convert to exact power of 2 sizes
- for ( scaledWidth = 1; scaledWidth < image->width; scaledWidth <<= 1 )
- {
- ;
- }
-
- for ( scaledHeight = 1; scaledHeight < image->height; scaledHeight <<= 1 )
- {
- ;
- }
- }
-
- if ( r_roundImagesDown->integer && scaledWidth > image->width )
- {
- scaledWidth >>= 1;
- }
-
- if ( r_roundImagesDown->integer && scaledHeight > image->height )
- {
- scaledHeight >>= 1;
- }
+ scaledWidth = image->width;
+ scaledHeight = image->height;
// perform optional picmip operation
if ( !( image->bits & IF_NOPICMIP ) )
@@ -2617,16 +2591,8 @@ static void R_CreateContrastRenderFBOImage()
{
int width, height;
- if ( glConfig2.textureNPOTAvailable )
- {
- width = glConfig.vidWidth * 0.25f;
- height = glConfig.vidHeight * 0.25f;
- }
- else
- {
- width = NearestPowerOfTwo( glConfig.vidWidth ) * 0.25f;
- height = NearestPowerOfTwo( glConfig.vidHeight ) * 0.25f;
- }
+ width = glConfig.vidWidth * 0.25f;
+ height = glConfig.vidHeight * 0.25f;
tr.contrastRenderFBOImage = R_CreateImage( "_contrastRenderFBO", nullptr, width, height, 1, IF_NOPICMIP | IF_NOCOMPRESSION, filterType_t::FT_LINEAR, wrapTypeEnum_t::WT_CLAMP );
}
@@ -2636,16 +2602,8 @@ static void R_CreateBloomRenderFBOImage()
int i;
int width, height;
- if ( glConfig2.textureNPOTAvailable )
- {
- width = glConfig.vidWidth * 0.25f;
- height = glConfig.vidHeight * 0.25f;
- }
- else
- {
- width = NearestPowerOfTwo( glConfig.vidWidth ) * 0.25f;
- height = NearestPowerOfTwo( glConfig.vidHeight ) * 0.25f;
- }
+ width = glConfig.vidWidth * 0.25f;
+ height = glConfig.vidHeight * 0.25f;
for ( i = 0; i < 2; i++ )
{
@@ -2657,16 +2615,8 @@ static void R_CreateCurrentRenderImage()
{
int width, height;
- if ( glConfig2.textureNPOTAvailable )
- {
- width = glConfig.vidWidth;
- height = glConfig.vidHeight;
- }
- else
- {
- width = NearestPowerOfTwo( glConfig.vidWidth );
- height = NearestPowerOfTwo( glConfig.vidHeight );
- }
+ width = glConfig.vidWidth;
+ height = glConfig.vidHeight;
tr.currentRenderImage[0] = R_CreateImage( "_currentRender[0]", nullptr, width, height, 1, IF_NOPICMIP | IF_NOCOMPRESSION, filterType_t::FT_NEAREST, wrapTypeEnum_t::WT_CLAMP );
tr.currentRenderImage[1] = R_CreateImage( "_currentRender[1]", nullptr, width, height, 1, IF_NOPICMIP | IF_NOCOMPRESSION, filterType_t::FT_NEAREST, wrapTypeEnum_t::WT_CLAMP );
@@ -2677,16 +2627,8 @@ static void R_CreateDepthRenderImage()
{
int width, height, w, h;
- if ( glConfig2.textureNPOTAvailable )
- {
- width = glConfig.vidWidth;
- height = glConfig.vidHeight;
- }
- else
- {
- width = NearestPowerOfTwo( glConfig.vidWidth );
- height = NearestPowerOfTwo( glConfig.vidHeight );
- }
+ width = glConfig.vidWidth;
+ height = glConfig.vidHeight;
w = (width + TILE_SIZE_STEP1 - 1) >> TILE_SHIFT_STEP1;
h = (height + TILE_SIZE_STEP1 - 1) >> TILE_SHIFT_STEP1;
@@ -2707,16 +2649,8 @@ static void R_CreatePortalRenderImage()
{
int width, height;
- if ( glConfig2.textureNPOTAvailable )
- {
- width = glConfig.vidWidth;
- height = glConfig.vidHeight;
- }
- else
- {
- width = NearestPowerOfTwo( glConfig.vidWidth );
- height = NearestPowerOfTwo( glConfig.vidHeight );
- }
+ width = glConfig.vidWidth;
+ height = glConfig.vidHeight;
tr.portalRenderImage = R_CreateImage( "_portalRender", nullptr, width, height, 1, IF_NOPICMIP | IF_NOCOMPRESSION, filterType_t::FT_NEAREST, wrapTypeEnum_t::WT_CLAMP );
}
@@ -2725,16 +2659,8 @@ static void R_CreateOcclusionRenderFBOImage()
{
int width, height;
- if ( glConfig2.textureNPOTAvailable )
- {
- width = glConfig.vidWidth;
- height = glConfig.vidHeight;
- }
- else
- {
- width = NearestPowerOfTwo( glConfig.vidWidth );
- height = NearestPowerOfTwo( glConfig.vidHeight );
- }
+ width = glConfig.vidWidth;
+ height = glConfig.vidHeight;
{
tr.occlusionRenderFBOImage = R_CreateImage( "_occlusionFBORender", nullptr, width, height, 1, IF_NOPICMIP | IF_NOCOMPRESSION, filterType_t::FT_NEAREST, wrapTypeEnum_t::WT_CLAMP );
@@ -2745,16 +2671,8 @@ static void R_CreateDepthToColorFBOImages()
{
int width, height;
- if ( glConfig2.textureNPOTAvailable )
- {
- width = glConfig.vidWidth;
- height = glConfig.vidHeight;
- }
- else
- {
- width = NearestPowerOfTwo( glConfig.vidWidth );
- height = NearestPowerOfTwo( glConfig.vidHeight );
- }
+ width = glConfig.vidWidth;
+ height = glConfig.vidHeight;
{
tr.depthToColorBackFacesFBOImage = R_CreateImage( "_depthToColorBackFacesFBORender", nullptr, width, height, 1, IF_NOPICMIP | IF_NOCOMPRESSION, filterType_t::FT_NEAREST, wrapTypeEnum_t::WT_CLAMP );
@@ -2767,16 +2685,8 @@ static void R_CreateDownScaleFBOImages()
{
int width, height;
- if ( glConfig2.textureNPOTAvailable )
- {
- width = glConfig.vidWidth * 0.25f;
- height = glConfig.vidHeight * 0.25f;
- }
- else
- {
- width = NearestPowerOfTwo( glConfig.vidWidth * 0.25f );
- height = NearestPowerOfTwo( glConfig.vidHeight * 0.25f );
- }
+ width = glConfig.vidWidth * 0.25f;
+ height = glConfig.vidHeight * 0.25f;
tr.downScaleFBOImage_quarter = R_CreateImage( "_downScaleFBOImage_quarter", nullptr, width, height, 1, IF_NOPICMIP | IF_NOCOMPRESSION, filterType_t::FT_NEAREST, wrapTypeEnum_t::WT_CLAMP );
@@ -91,9 +91,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
cvar_t *r_recompileShaders;
cvar_t *r_lazyShaders;
- cvar_t *r_ext_compressed_textures;
cvar_t *r_ext_occlusion_query;
- cvar_t *r_ext_texture_non_power_of_two;
cvar_t *r_ext_draw_buffers;
cvar_t *r_ext_vertex_array_object;
cvar_t *r_ext_half_float_pixel;
@@ -102,7 +100,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
cvar_t *r_ext_texture_rg;
cvar_t *r_ext_texture_filter_anisotropic;
cvar_t *r_ext_packed_depth_stencil;
- cvar_t *r_ext_generate_mipmap;
cvar_t *r_arb_buffer_storage;
cvar_t *r_arb_map_buffer_range;
cvar_t *r_arb_sync;
@@ -157,7 +154,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
cvar_t *r_collapseStages;
cvar_t *r_nobind;
cvar_t *r_singleShader;
- cvar_t *r_roundImagesDown;
cvar_t *r_colorMipLevels;
cvar_t *r_picmip;
cvar_t *r_finish;
@@ -1074,9 +1070,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
r_glAllowSoftware = ri.Cvar_Get( "r_glAllowSoftware", "0", CVAR_LATCH );
// latched and archived variables
- r_ext_compressed_textures = ri.Cvar_Get( "r_ext_compressed_textures", "0", CVAR_LATCH | CVAR_ARCHIVE );
r_ext_occlusion_query = ri.Cvar_Get( "r_ext_occlusion_query", "1", CVAR_CHEAT | CVAR_LATCH );
- r_ext_texture_non_power_of_two = ri.Cvar_Get( "r_ext_texture_non_power_of_two", "1", CVAR_CHEAT | CVAR_LATCH );
r_ext_draw_buffers = ri.Cvar_Get( "r_ext_draw_buffers", "1", CVAR_CHEAT | CVAR_LATCH );
r_ext_vertex_array_object = ri.Cvar_Get( "r_ext_vertex_array_object", "1", CVAR_CHEAT | CVAR_LATCH );
r_ext_half_float_pixel = ri.Cvar_Get( "r_ext_half_float_pixel", "1", CVAR_CHEAT | CVAR_LATCH );
@@ -1085,15 +1079,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
r_ext_texture_rg = ri.Cvar_Get( "r_ext_texture_rg", "1", CVAR_CHEAT | CVAR_LATCH );
r_ext_texture_filter_anisotropic = ri.Cvar_Get( "r_ext_texture_filter_anisotropic", "4", CVAR_LATCH | CVAR_ARCHIVE );
r_ext_packed_depth_stencil = ri.Cvar_Get( "r_ext_packed_depth_stencil", "1", CVAR_CHEAT | CVAR_LATCH );
- r_ext_generate_mipmap = ri.Cvar_Get( "r_ext_generate_mipmap", "1", CVAR_CHEAT | CVAR_LATCH );
r_arb_buffer_storage = ri.Cvar_Get( "r_arb_buffer_storage", "1", CVAR_CHEAT | CVAR_LATCH );
r_arb_map_buffer_range = ri.Cvar_Get( "r_arb_map_buffer_range", "1", CVAR_CHEAT | CVAR_LATCH );
r_arb_sync = ri.Cvar_Get( "r_arb_sync", "1", CVAR_CHEAT | CVAR_LATCH );
r_collapseStages = ri.Cvar_Get( "r_collapseStages", "1", CVAR_LATCH | CVAR_CHEAT );
r_picmip = ri.Cvar_Get( "r_picmip", "0", CVAR_LATCH | CVAR_ARCHIVE );
AssertCvarRange( r_picmip, 0, 3, true );
- r_roundImagesDown = ri.Cvar_Get( "r_roundImagesDown", "1", CVAR_LATCH );
r_colorMipLevels = ri.Cvar_Get( "r_colorMipLevels", "0", CVAR_LATCH );
r_colorbits = ri.Cvar_Get( "r_colorbits", "0", CVAR_LATCH );
r_alphabits = ri.Cvar_Get( "r_alphabits", "0", CVAR_LATCH );
@@ -1447,13 +1439,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
R_InitFBOs();
- if ( glConfig.driverType == glDriverType_t::GLDRV_OPENGL3 )
- {
- tr.vao = 0;
- glGenVertexArrays( 1, &tr.vao );
- glBindVertexArray( tr.vao );
- }
-
R_InitVBOs();
R_InitShaders();
@@ -1522,12 +1507,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
R_ShutdownFBOs();
R_ShutdownVisTests();
- if ( glConfig.driverType == glDriverType_t::GLDRV_OPENGL3 )
- {
- glDeleteVertexArrays( 1, &tr.vao );
- tr.vao = 0;
- }
-
#if !defined( GLSL_COMPILE_STARTUP_ONLY )
GLSL_ShutdownGPUShaders();
#endif
@@ -2740,7 +2740,6 @@ static inline void halfToFloat( const f16vec4_t in, vec4_t out )
int numFBOs;
FBO_t *fbos[ MAX_FBOS ];
- GLuint vao;
GLuint dlightUBO;
growList_t vbos;
@@ -2870,9 +2869,7 @@ static inline void halfToFloat( const f16vec4_t in, vec4_t out )
extern cvar_t *r_fullscreen;
extern cvar_t *r_gamma;
- extern cvar_t *r_ext_compressed_textures; // these control use of specific extensions
- extern cvar_t *r_ext_occlusion_query;
- extern cvar_t *r_ext_texture_non_power_of_two;
+ extern cvar_t *r_ext_occlusion_query; // these control use of specific extensions
extern cvar_t *r_ext_draw_buffers;
extern cvar_t *r_ext_vertex_array_object;
extern cvar_t *r_ext_half_float_pixel;
@@ -2881,15 +2878,13 @@ static inline void halfToFloat( const f16vec4_t in, vec4_t out )
extern cvar_t *r_ext_texture_rg;
extern cvar_t *r_ext_texture_filter_anisotropic;
extern cvar_t *r_ext_packed_depth_stencil;
- extern cvar_t *r_ext_generate_mipmap;
extern cvar_t *r_arb_buffer_storage;
extern cvar_t *r_arb_map_buffer_range;
extern cvar_t *r_arb_sync;
extern cvar_t *r_nobind; // turns off binding to appropriate textures
extern cvar_t *r_collapseStages;
extern cvar_t *r_singleShader; // make most world faces use default shader
- extern cvar_t *r_roundImagesDown;
extern cvar_t *r_colorMipLevels; // development aid to see texture mip usage
extern cvar_t *r_picmip; // controls picmip values
extern cvar_t *r_finish;
Oops, something went wrong.

0 comments on commit 895d1f6

Please sign in to comment.