wined3d: Remove the last vestiges of ARB_texture_rectangle support.

This commit is contained in:
Elizabeth Figura 2024-03-20 15:56:57 -05:00 committed by Alexandre Julliard
parent d257c47f07
commit 65cc641719
7 changed files with 6 additions and 76 deletions

View file

@ -146,7 +146,6 @@ static const struct wined3d_extension_map gl_extension_map[] =
{"GL_ARB_texture_multisample", ARB_TEXTURE_MULTISAMPLE },
{"GL_ARB_texture_non_power_of_two", ARB_TEXTURE_NON_POWER_OF_TWO },
{"GL_ARB_texture_query_levels", ARB_TEXTURE_QUERY_LEVELS },
{"GL_ARB_texture_rectangle", ARB_TEXTURE_RECTANGLE },
{"GL_ARB_texture_rg", ARB_TEXTURE_RG },
{"GL_ARB_texture_rgb10_a2ui", ARB_TEXTURE_RGB10_A2UI },
{"GL_ARB_texture_storage", ARB_TEXTURE_STORAGE },
@ -912,18 +911,9 @@ static void quirk_no_np2(struct wined3d_gl_info *gl_info)
* ARB_tex_npot from the list of supported extensions.
*
* Note that WINE_normalized_texrect can't be used in this case because
* internally it uses ARB_tex_npot, triggering the software fallback.
* There is not much we can do here apart from disabling the
* software-emulated extension and re-enable ARB_tex_rect (which was
* previously disabled in wined3d_adapter_init_gl_caps).
*
* This fixup removes performance problems on both the FX 5900 and
* FX 5700 (e.g. for framebuffer post-processing effects in the game
* "Max Payne 2"). The behaviour can be verified through a simple test
* app attached in bugreport #14724. */
* internally it uses ARB_tex_npot, triggering the software fallback. */
TRACE("GL_ARB_texture_non_power_of_two advertised through OpenGL 2.0 on NV FX card, removing.\n");
gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO] = FALSE;
gl_info->supported[ARB_TEXTURE_RECTANGLE] = TRUE;
}
static void quirk_clip_varying(struct wined3d_gl_info *gl_info)
@ -3533,13 +3523,6 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter_gl *adapter_gl,
gl_info->supported[ATI_FRAGMENT_SHADER] = FALSE;
}
}
if (gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO])
{
/* If we have full NP2 texture support, disable
* GL_ARB_texture_rectangle because we will never use it.
* This saves a few redundant glDisable calls. */
gl_info->supported[ARB_TEXTURE_RECTANGLE] = FALSE;
}
if (gl_info->supported[ATI_FRAGMENT_SHADER])
{
/* Disable NV_register_combiners and fragment shader if this is supported.
@ -5063,8 +5046,7 @@ static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *adapter_
d3d_info->viewport_array_index_any_shader = !!gl_info->supported[ARB_SHADER_VIEWPORT_LAYER_ARRAY];
d3d_info->stencil_export = !!gl_info->supported[ARB_SHADER_STENCIL_EXPORT];
d3d_info->texture_npot = !!gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO];
d3d_info->texture_npot_conditional = gl_info->supported[WINED3D_GL_NORMALIZED_TEXRECT]
|| gl_info->supported[ARB_TEXTURE_RECTANGLE];
d3d_info->texture_npot_conditional = gl_info->supported[WINED3D_GL_NORMALIZED_TEXRECT];
d3d_info->normalized_texrect = gl_info->supported[WINED3D_GL_NORMALIZED_TEXRECT];
d3d_info->draw_base_vertex_offset = !!gl_info->supported[ARB_DRAW_ELEMENTS_BASE_VERTEX];
d3d_info->vertex_bgra = !!gl_info->supported[ARB_VERTEX_ARRAY_BGRA];

View file

@ -295,7 +295,6 @@ static void context_dump_fbo_attachment(const struct wined3d_gl_info *gl_info, G
{GL_TEXTURE_1D, GL_TEXTURE_BINDING_1D, "1d", WINED3D_GL_EXT_NONE},
{GL_TEXTURE_1D_ARRAY, GL_TEXTURE_BINDING_1D_ARRAY, "1d-array", EXT_TEXTURE_ARRAY},
{GL_TEXTURE_2D, GL_TEXTURE_BINDING_2D, "2d", WINED3D_GL_EXT_NONE},
{GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_BINDING_RECTANGLE_ARB, "rectangle", ARB_TEXTURE_RECTANGLE},
{GL_TEXTURE_2D_ARRAY, GL_TEXTURE_BINDING_2D_ARRAY, "2d-array" , EXT_TEXTURE_ARRAY},
{GL_TEXTURE_CUBE_MAP, GL_TEXTURE_BINDING_CUBE_MAP, "cube", ARB_TEXTURE_CUBE_MAP},
{GL_TEXTURE_2D_MULTISAMPLE, GL_TEXTURE_BINDING_2D_MULTISAMPLE, "2d-ms", ARB_TEXTURE_MULTISAMPLE},
@ -1800,9 +1799,6 @@ void wined3d_context_gl_bind_dummy_textures(const struct wined3d_context_gl *con
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D, textures->tex_1d);
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, textures->tex_2d);
if (gl_info->supported[ARB_TEXTURE_RECTANGLE])
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_RECTANGLE_ARB, textures->tex_rect);
if (gl_info->supported[EXT_TEXTURE3D])
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_3D, textures->tex_3d);
@ -2521,9 +2517,6 @@ void wined3d_context_gl_bind_texture(struct wined3d_context_gl *context_gl, GLen
case GL_TEXTURE_2D_ARRAY:
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_ARRAY, textures->tex_2d_array);
break;
case GL_TEXTURE_RECTANGLE_ARB:
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_RECTANGLE_ARB, textures->tex_rect);
break;
case GL_TEXTURE_CUBE_MAP:
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP, textures->tex_cube);
break;
@ -3317,8 +3310,6 @@ void wined3d_context_gl_apply_ffp_blit_state(struct wined3d_context_gl *context_
if (gl_info->supported[ARB_TEXTURE_CUBE_MAP])
gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_CUBE_MAP_ARB);
gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_3D);
if (gl_info->supported[ARB_TEXTURE_RECTANGLE])
gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_RECTANGLE_ARB);
gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_2D);
gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
@ -3337,8 +3328,6 @@ void wined3d_context_gl_apply_ffp_blit_state(struct wined3d_context_gl *context_
if (gl_info->supported[ARB_TEXTURE_CUBE_MAP])
gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_CUBE_MAP_ARB);
gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_3D);
if (gl_info->supported[ARB_TEXTURE_RECTANGLE])
gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_RECTANGLE_ARB);
gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_2D);
gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);

View file

@ -620,15 +620,6 @@ static void wined3d_device_gl_create_dummy_textures(struct wined3d_device_gl *de
gl_info->gl_ops.gl.p_glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 1, 1, 0,
GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, &color);
if (gl_info->supported[ARB_TEXTURE_RECTANGLE])
{
gl_info->gl_ops.gl.p_glGenTextures(1, &textures->tex_rect);
TRACE("Dummy rectangle texture given name %u.\n", textures->tex_rect);
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_RECTANGLE_ARB, textures->tex_rect);
gl_info->gl_ops.gl.p_glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA8, 1, 1, 0,
GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, &color);
}
if (gl_info->supported[EXT_TEXTURE3D])
{
gl_info->gl_ops.gl.p_glGenTextures(1, &textures->tex_3d);
@ -765,9 +756,6 @@ static void wined3d_device_gl_destroy_dummy_textures(struct wined3d_device_gl *d
if (gl_info->supported[EXT_TEXTURE3D])
gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_3d);
if (gl_info->supported[ARB_TEXTURE_RECTANGLE])
gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_rect);
gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_2d);
gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_1d);

View file

@ -7802,10 +7802,6 @@ static GLuint shader_glsl_generate_fragment_shader(const struct wined3d_context_
shader_addline(buffer, "#extension GL_ARB_sample_shading : enable\n");
if (gl_info->supported[ARB_SHADER_TEXTURE_LOD])
shader_addline(buffer, "#extension GL_ARB_shader_texture_lod : enable\n");
/* The spec says that it doesn't have to be explicitly enabled, but the
* nvidia drivers write a warning if we don't do so. */
if (gl_info->supported[ARB_TEXTURE_RECTANGLE])
shader_addline(buffer, "#extension GL_ARB_texture_rectangle : enable\n");
/* Base Declarations */
shader_generate_glsl_declarations(context_gl, buffer, shader, reg_maps, &priv_ctx);
@ -9672,8 +9668,6 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv *
shader_addline(buffer, "#extension GL_ARB_explicit_attrib_location : enable\n");
if (gl_info->supported[ARB_SHADING_LANGUAGE_420PACK])
shader_addline(buffer, "#extension GL_ARB_shading_language_420pack : enable\n");
if (gl_info->supported[ARB_TEXTURE_RECTANGLE])
shader_addline(buffer, "#extension GL_ARB_texture_rectangle : enable\n");
if (!use_legacy_fragment_output(gl_info))
{
@ -12923,7 +12917,6 @@ static GLuint glsl_blitter_generate_program(struct wined3d_glsl_blitter *blitter
{
{GL_TEXTURE_2D, "2D", "xy"},
{GL_TEXTURE_CUBE_MAP, "Cube", "xyz"},
{GL_TEXTURE_RECTANGLE_ARB, "2DRect", "xy"},
};
static const char vshader_main[] =
"\n"

View file

@ -208,14 +208,6 @@ void texture2d_get_blt_info(const struct wined3d_texture_gl *texture_gl,
coords[3].z = 0.0f;
break;
case GL_TEXTURE_RECTANGLE_ARB:
info->bind_target = GL_TEXTURE_RECTANGLE_ARB;
coords[0].x = rect->left; coords[0].y = rect->top; coords[0].z = 0.0f;
coords[1].x = rect->right; coords[1].y = rect->top; coords[1].z = 0.0f;
coords[2].x = rect->left; coords[2].y = rect->bottom; coords[2].z = 0.0f;
coords[3].x = rect->right; coords[3].y = rect->bottom; coords[3].z = 0.0f;
break;
case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
info->bind_target = GL_TEXTURE_CUBE_MAP_ARB;
cube_coords_float(rect, w, h, &f);
@ -1353,17 +1345,10 @@ GLuint wined3d_texture_gl_prepare_gl_texture(struct wined3d_texture_gl *texture_
wined3d_context_gl_bind_texture(context_gl, target, gl_tex->name);
/* For a new texture we have to set the texture levels after binding the
* texture. Beware that texture rectangles do not support mipmapping, but
* set the maxmiplevel if we're relying on the partial
* GL_ARB_texture_non_power_of_two emulation with texture rectangles.
* (I.e., do not care about cond_np2 here, just look for
* GL_TEXTURE_RECTANGLE_ARB.) */
if (target != GL_TEXTURE_RECTANGLE_ARB)
{
TRACE("Setting GL_TEXTURE_MAX_LEVEL to %u.\n", texture_gl->t.level_count - 1);
gl_info->gl_ops.gl.p_glTexParameteri(target, GL_TEXTURE_MAX_LEVEL, texture_gl->t.level_count - 1);
checkGLcall("glTexParameteri(target, GL_TEXTURE_MAX_LEVEL, texture->level_count)");
}
* texture. */
TRACE("Setting GL_TEXTURE_MAX_LEVEL to %u.\n", texture_gl->t.level_count - 1);
gl_info->gl_ops.gl.p_glTexParameteri(target, GL_TEXTURE_MAX_LEVEL, texture_gl->t.level_count - 1);
checkGLcall("glTexParameteri(target, GL_TEXTURE_MAX_LEVEL, texture->level_count)");
if (target == GL_TEXTURE_CUBE_MAP_ARB)
{
@ -6221,11 +6206,6 @@ static DWORD ffp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit
gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_CUBE_MAP_ARB);
checkGLcall("glDisable(GL_TEXTURE_CUBE_MAP_ARB)");
}
if (gl_info->supported[ARB_TEXTURE_RECTANGLE])
{
gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_RECTANGLE_ARB);
checkGLcall("glDisable(GL_TEXTURE_RECTANGLE_ARB)");
}
if (dst_texture->swapchain && dst_texture->swapchain->front_buffer == dst_texture)
gl_info->gl_ops.gl.p_glFlush();

View file

@ -45,7 +45,6 @@ static GLenum get_texture_view_target(const struct wined3d_gl_info *gl_info,
view_types[] =
{
{GL_TEXTURE_CUBE_MAP, 0, GL_TEXTURE_CUBE_MAP},
{GL_TEXTURE_RECTANGLE, 0, GL_TEXTURE_RECTANGLE},
{GL_TEXTURE_3D, 0, GL_TEXTURE_3D},
{GL_TEXTURE_2D, 0, GL_TEXTURE_2D},

View file

@ -140,7 +140,6 @@ enum wined3d_gl_extension
ARB_TEXTURE_MULTISAMPLE,
ARB_TEXTURE_NON_POWER_OF_TWO,
ARB_TEXTURE_QUERY_LEVELS,
ARB_TEXTURE_RECTANGLE,
ARB_TEXTURE_RG,
ARB_TEXTURE_RGB10_A2UI,
ARB_TEXTURE_STORAGE,