mesa: Remove EXT_texture_env_combine extension enable flag
All drivers remaining in Mesa support this extension. This extension is either required or optional features in desktop OpenGL, OpenGL ES 1.x, and OpenGL ES 2.x. The existing support is already partially broken in Mesa (e.g., querying GL_TEXTURE_ENV_MODE in OpenGL ES 2.x). This patch does not change the situation in any way. It looks like the only hardware supported by Mesa that cannot do ARB_texture_env_combine is pre-NV10 NVIDA chips. It appears that these chips cannot do the GL_SUBTRACT mode. Based on looking at older copies of nvOpenGLspecs.pdf found on the net, NVIDIA never supported ARB_texture_env_combine on those chips either. This extension was previously not supported on mach64, mga (G200), r128, savage, sis, and tdfx (Voodoo Banshee and Voodoo3). Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
5c4f914f9a
commit
bde8bd99b6
|
@ -77,7 +77,6 @@ intelInitExtensions(struct gl_context *ctx)
|
|||
ctx->Extensions.EXT_secondary_color = true;
|
||||
ctx->Extensions.EXT_separate_shader_objects = true;
|
||||
ctx->Extensions.EXT_stencil_wrap = true;
|
||||
ctx->Extensions.EXT_texture_env_combine = true;
|
||||
ctx->Extensions.EXT_texture_env_dot3 = true;
|
||||
ctx->Extensions.EXT_texture_filter_anisotropic = true;
|
||||
ctx->Extensions.EXT_texture_lod_bias = true;
|
||||
|
|
|
@ -127,7 +127,6 @@ nouveau_context_init(struct gl_context *ctx, struct nouveau_screen *screen,
|
|||
ctx->Extensions.EXT_packed_depth_stencil = true;
|
||||
ctx->Extensions.EXT_secondary_color = true;
|
||||
ctx->Extensions.EXT_stencil_wrap = true;
|
||||
ctx->Extensions.EXT_texture_env_combine = true;
|
||||
ctx->Extensions.EXT_texture_filter_anisotropic = true;
|
||||
ctx->Extensions.EXT_texture_lod_bias = true;
|
||||
ctx->Extensions.NV_blend_square = true;
|
||||
|
|
|
@ -370,7 +370,6 @@ GLboolean r200CreateContext( gl_api api,
|
|||
ctx->Extensions.EXT_packed_depth_stencil = true;
|
||||
ctx->Extensions.EXT_secondary_color = true;
|
||||
ctx->Extensions.EXT_stencil_wrap = true;
|
||||
ctx->Extensions.EXT_texture_env_combine = true;
|
||||
ctx->Extensions.EXT_texture_env_dot3 = true;
|
||||
ctx->Extensions.EXT_texture_filter_anisotropic = true;
|
||||
ctx->Extensions.EXT_texture_lod_bias = true;
|
||||
|
|
|
@ -386,7 +386,6 @@ static void r300InitGLExtensions(struct gl_context *ctx)
|
|||
ctx->Extensions.EXT_secondary_color = true;
|
||||
ctx->Extensions.EXT_shadow_funcs = true;
|
||||
ctx->Extensions.EXT_stencil_wrap = true;
|
||||
ctx->Extensions.EXT_texture_env_combine = true;
|
||||
ctx->Extensions.EXT_texture_env_dot3 = true;
|
||||
ctx->Extensions.EXT_texture_filter_anisotropic = true;
|
||||
ctx->Extensions.EXT_texture_lod_bias = true;
|
||||
|
|
|
@ -287,7 +287,6 @@ static void r600InitGLExtensions(struct gl_context *ctx)
|
|||
ctx->Extensions.EXT_shadow_funcs = true;
|
||||
ctx->Extensions.EXT_stencil_two_side = true;
|
||||
ctx->Extensions.EXT_stencil_wrap = true;
|
||||
ctx->Extensions.EXT_texture_env_combine = true;
|
||||
ctx->Extensions.EXT_texture_env_dot3 = true;
|
||||
ctx->Extensions.EXT_texture_filter_anisotropic = true;
|
||||
ctx->Extensions.EXT_texture_lod_bias = true;
|
||||
|
|
|
@ -323,7 +323,6 @@ r100CreateContext( gl_api api,
|
|||
ctx->Extensions.EXT_packed_depth_stencil = true;
|
||||
ctx->Extensions.EXT_secondary_color = true;
|
||||
ctx->Extensions.EXT_stencil_wrap = true;
|
||||
ctx->Extensions.EXT_texture_env_combine = true;
|
||||
ctx->Extensions.EXT_texture_env_dot3 = true;
|
||||
ctx->Extensions.EXT_texture_filter_anisotropic = true;
|
||||
ctx->Extensions.EXT_texture_lod_bias = true;
|
||||
|
|
|
@ -731,41 +731,38 @@ pop_texture_group(struct gl_context *ctx, struct texture_state *texstate)
|
|||
_mesa_TexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT,
|
||||
GL_TEXTURE_LOD_BIAS_EXT, unit->LodBias);
|
||||
}
|
||||
if (ctx->Extensions.EXT_texture_env_combine ||
|
||||
ctx->Extensions.ARB_texture_env_combine) {
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB,
|
||||
unit->Combine.ModeRGB);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA,
|
||||
unit->Combine.ModeA);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB,
|
||||
unit->Combine.SourceRGB[0]);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB,
|
||||
unit->Combine.SourceRGB[1]);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB,
|
||||
unit->Combine.SourceRGB[2]);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA,
|
||||
unit->Combine.SourceA[0]);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA,
|
||||
unit->Combine.SourceA[1]);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA,
|
||||
unit->Combine.SourceA[2]);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB,
|
||||
unit->Combine.OperandRGB[0]);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB,
|
||||
unit->Combine.OperandRGB[1]);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB,
|
||||
unit->Combine.OperandRGB[2]);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA,
|
||||
unit->Combine.OperandA[0]);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA,
|
||||
unit->Combine.OperandA[1]);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA,
|
||||
unit->Combine.OperandA[2]);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE,
|
||||
1 << unit->Combine.ScaleShiftRGB);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_ALPHA_SCALE,
|
||||
1 << unit->Combine.ScaleShiftA);
|
||||
}
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB,
|
||||
unit->Combine.ModeRGB);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA,
|
||||
unit->Combine.ModeA);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB,
|
||||
unit->Combine.SourceRGB[0]);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB,
|
||||
unit->Combine.SourceRGB[1]);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB,
|
||||
unit->Combine.SourceRGB[2]);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA,
|
||||
unit->Combine.SourceA[0]);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA,
|
||||
unit->Combine.SourceA[1]);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA,
|
||||
unit->Combine.SourceA[2]);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB,
|
||||
unit->Combine.OperandRGB[0]);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB,
|
||||
unit->Combine.OperandRGB[1]);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB,
|
||||
unit->Combine.OperandRGB[2]);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA,
|
||||
unit->Combine.OperandA[0]);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA,
|
||||
unit->Combine.OperandA[1]);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA,
|
||||
unit->Combine.OperandA[2]);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE,
|
||||
1 << unit->Combine.ScaleShiftRGB);
|
||||
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_ALPHA_SCALE,
|
||||
1 << unit->Combine.ScaleShiftA);
|
||||
|
||||
/* Restore texture object state for each target */
|
||||
for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) {
|
||||
|
|
|
@ -192,7 +192,7 @@ static const struct extension extension_table[] = {
|
|||
{ "GL_EXT_texture_cube_map", o(ARB_texture_cube_map), GL, 2001 },
|
||||
{ "GL_EXT_texture_edge_clamp", o(dummy_true), GL, 1997 },
|
||||
{ "GL_EXT_texture_env_add", o(dummy_true), GL, 1999 },
|
||||
{ "GL_EXT_texture_env_combine", o(EXT_texture_env_combine), GL, 2000 },
|
||||
{ "GL_EXT_texture_env_combine", o(dummy_true), GL, 2000 },
|
||||
{ "GL_EXT_texture_env_dot3", o(EXT_texture_env_dot3), GL, 2000 },
|
||||
{ "GL_EXT_texture_filter_anisotropic", o(EXT_texture_filter_anisotropic), GL | ES1 | ES2, 1999 },
|
||||
{ "GL_EXT_texture_format_BGRA8888", o(dummy_true), ES1 | ES2, 2005 },
|
||||
|
@ -473,7 +473,6 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
|
|||
ctx->Extensions.EXT_stencil_two_side = GL_TRUE;
|
||||
ctx->Extensions.EXT_texture_array = GL_TRUE;
|
||||
ctx->Extensions.EXT_texture_compression_latc = GL_TRUE;
|
||||
ctx->Extensions.EXT_texture_env_combine = GL_TRUE;
|
||||
ctx->Extensions.EXT_texture_env_dot3 = GL_TRUE;
|
||||
ctx->Extensions.EXT_texture_filter_anisotropic = GL_TRUE;
|
||||
ctx->Extensions.EXT_texture_mirror_clamp = GL_TRUE;
|
||||
|
|
|
@ -2834,7 +2834,6 @@ struct gl_extensions
|
|||
GLboolean EXT_texture_array;
|
||||
GLboolean EXT_texture_compression_latc;
|
||||
GLboolean EXT_texture_compression_s3tc;
|
||||
GLboolean EXT_texture_env_combine;
|
||||
GLboolean EXT_texture_env_dot3;
|
||||
GLboolean EXT_texture_filter_anisotropic;
|
||||
GLboolean EXT_texture_integer;
|
||||
|
|
|
@ -61,16 +61,13 @@ set_env_mode(struct gl_context *ctx,
|
|||
case GL_DECAL:
|
||||
case GL_REPLACE:
|
||||
case GL_ADD:
|
||||
case GL_COMBINE:
|
||||
legal = GL_TRUE;
|
||||
break;
|
||||
case GL_REPLACE_EXT:
|
||||
mode = GL_REPLACE; /* GL_REPLACE_EXT != GL_REPLACE */
|
||||
legal = GL_TRUE;
|
||||
break;
|
||||
case GL_COMBINE:
|
||||
legal = (ctx->Extensions.EXT_texture_env_combine ||
|
||||
ctx->Extensions.ARB_texture_env_combine);
|
||||
break;
|
||||
case GL_COMBINE4_NV:
|
||||
legal = ctx->Extensions.NV_texture_env_combine4;
|
||||
break;
|
||||
|
@ -112,12 +109,6 @@ set_combiner_mode(struct gl_context *ctx,
|
|||
{
|
||||
GLboolean legal;
|
||||
|
||||
if (!ctx->Extensions.EXT_texture_env_combine &&
|
||||
!ctx->Extensions.ARB_texture_env_combine) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(pname)");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (mode) {
|
||||
case GL_REPLACE:
|
||||
case GL_MODULATE:
|
||||
|
@ -187,12 +178,6 @@ set_combiner_source(struct gl_context *ctx,
|
|||
GLuint term;
|
||||
GLboolean alpha, legal;
|
||||
|
||||
if (!ctx->Extensions.EXT_texture_env_combine &&
|
||||
!ctx->Extensions.ARB_texture_env_combine) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(pname)");
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Translate pname to (term, alpha).
|
||||
*
|
||||
|
@ -280,12 +265,6 @@ set_combiner_operand(struct gl_context *ctx,
|
|||
GLuint term;
|
||||
GLboolean alpha, legal;
|
||||
|
||||
if (!ctx->Extensions.EXT_texture_env_combine &&
|
||||
!ctx->Extensions.ARB_texture_env_combine) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(pname)");
|
||||
return;
|
||||
}
|
||||
|
||||
/* The enums were given sequential values for a reason.
|
||||
*/
|
||||
switch (pname) {
|
||||
|
@ -365,12 +344,6 @@ set_combiner_scale(struct gl_context *ctx,
|
|||
{
|
||||
GLuint shift;
|
||||
|
||||
if (!ctx->Extensions.EXT_texture_env_combine &&
|
||||
!ctx->Extensions.ARB_texture_env_combine) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(pname)");
|
||||
return;
|
||||
}
|
||||
|
||||
if (scale == 1.0F) {
|
||||
shift = 0;
|
||||
}
|
||||
|
@ -603,35 +576,15 @@ get_texenvi(struct gl_context *ctx, const struct gl_texture_unit *texUnit,
|
|||
return texUnit->EnvMode;
|
||||
break;
|
||||
case GL_COMBINE_RGB:
|
||||
if (ctx->Extensions.EXT_texture_env_combine ||
|
||||
ctx->Extensions.ARB_texture_env_combine) {
|
||||
return texUnit->Combine.ModeRGB;
|
||||
}
|
||||
else {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
|
||||
}
|
||||
break;
|
||||
return texUnit->Combine.ModeRGB;
|
||||
case GL_COMBINE_ALPHA:
|
||||
if (ctx->Extensions.EXT_texture_env_combine ||
|
||||
ctx->Extensions.ARB_texture_env_combine) {
|
||||
return texUnit->Combine.ModeA;
|
||||
}
|
||||
else {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
|
||||
}
|
||||
break;
|
||||
return texUnit->Combine.ModeA;
|
||||
case GL_SOURCE0_RGB:
|
||||
case GL_SOURCE1_RGB:
|
||||
case GL_SOURCE2_RGB:
|
||||
if (ctx->Extensions.EXT_texture_env_combine ||
|
||||
ctx->Extensions.ARB_texture_env_combine) {
|
||||
const unsigned rgb_idx = pname - GL_SOURCE0_RGB;
|
||||
return texUnit->Combine.SourceRGB[rgb_idx];
|
||||
}
|
||||
else {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
|
||||
}
|
||||
break;
|
||||
case GL_SOURCE2_RGB: {
|
||||
const unsigned rgb_idx = pname - GL_SOURCE0_RGB;
|
||||
return texUnit->Combine.SourceRGB[rgb_idx];
|
||||
}
|
||||
case GL_SOURCE3_RGB_NV:
|
||||
if (ctx->Extensions.NV_texture_env_combine4) {
|
||||
return texUnit->Combine.SourceRGB[3];
|
||||
|
@ -642,16 +595,10 @@ get_texenvi(struct gl_context *ctx, const struct gl_texture_unit *texUnit,
|
|||
break;
|
||||
case GL_SOURCE0_ALPHA:
|
||||
case GL_SOURCE1_ALPHA:
|
||||
case GL_SOURCE2_ALPHA:
|
||||
if (ctx->Extensions.EXT_texture_env_combine ||
|
||||
ctx->Extensions.ARB_texture_env_combine) {
|
||||
const unsigned alpha_idx = pname - GL_SOURCE0_ALPHA;
|
||||
return texUnit->Combine.SourceA[alpha_idx];
|
||||
}
|
||||
else {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
|
||||
}
|
||||
break;
|
||||
case GL_SOURCE2_ALPHA: {
|
||||
const unsigned alpha_idx = pname - GL_SOURCE0_ALPHA;
|
||||
return texUnit->Combine.SourceA[alpha_idx];
|
||||
}
|
||||
case GL_SOURCE3_ALPHA_NV:
|
||||
if (ctx->Extensions.NV_texture_env_combine4) {
|
||||
return texUnit->Combine.SourceA[3];
|
||||
|
@ -662,16 +609,10 @@ get_texenvi(struct gl_context *ctx, const struct gl_texture_unit *texUnit,
|
|||
break;
|
||||
case GL_OPERAND0_RGB:
|
||||
case GL_OPERAND1_RGB:
|
||||
case GL_OPERAND2_RGB:
|
||||
if (ctx->Extensions.EXT_texture_env_combine ||
|
||||
ctx->Extensions.ARB_texture_env_combine) {
|
||||
const unsigned op_rgb = pname - GL_OPERAND0_RGB;
|
||||
return texUnit->Combine.OperandRGB[op_rgb];
|
||||
}
|
||||
else {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
|
||||
}
|
||||
break;
|
||||
case GL_OPERAND2_RGB: {
|
||||
const unsigned op_rgb = pname - GL_OPERAND0_RGB;
|
||||
return texUnit->Combine.OperandRGB[op_rgb];
|
||||
}
|
||||
case GL_OPERAND3_RGB_NV:
|
||||
if (ctx->Extensions.NV_texture_env_combine4) {
|
||||
return texUnit->Combine.OperandRGB[3];
|
||||
|
@ -682,16 +623,10 @@ get_texenvi(struct gl_context *ctx, const struct gl_texture_unit *texUnit,
|
|||
break;
|
||||
case GL_OPERAND0_ALPHA:
|
||||
case GL_OPERAND1_ALPHA:
|
||||
case GL_OPERAND2_ALPHA:
|
||||
if (ctx->Extensions.EXT_texture_env_combine ||
|
||||
ctx->Extensions.ARB_texture_env_combine) {
|
||||
const unsigned op_alpha = pname - GL_OPERAND0_ALPHA;
|
||||
return texUnit->Combine.OperandA[op_alpha];
|
||||
}
|
||||
else {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
|
||||
}
|
||||
break;
|
||||
case GL_OPERAND2_ALPHA: {
|
||||
const unsigned op_alpha = pname - GL_OPERAND0_ALPHA;
|
||||
return texUnit->Combine.OperandA[op_alpha];
|
||||
}
|
||||
case GL_OPERAND3_ALPHA_NV:
|
||||
if (ctx->Extensions.NV_texture_env_combine4) {
|
||||
return texUnit->Combine.OperandA[3];
|
||||
|
@ -701,23 +636,9 @@ get_texenvi(struct gl_context *ctx, const struct gl_texture_unit *texUnit,
|
|||
}
|
||||
break;
|
||||
case GL_RGB_SCALE:
|
||||
if (ctx->Extensions.EXT_texture_env_combine ||
|
||||
ctx->Extensions.ARB_texture_env_combine) {
|
||||
return 1 << texUnit->Combine.ScaleShiftRGB;
|
||||
}
|
||||
else {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
|
||||
}
|
||||
break;
|
||||
return 1 << texUnit->Combine.ScaleShiftRGB;
|
||||
case GL_ALPHA_SCALE:
|
||||
if (ctx->Extensions.EXT_texture_env_combine ||
|
||||
ctx->Extensions.ARB_texture_env_combine) {
|
||||
return 1 << texUnit->Combine.ScaleShiftA;
|
||||
}
|
||||
else {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
|
||||
}
|
||||
break;
|
||||
return 1 << texUnit->Combine.ScaleShiftA;
|
||||
case GL_BUMP_TARGET_ATI:
|
||||
/* spec doesn't say so, but I think this should be queryable */
|
||||
if (ctx->Extensions.ATI_envmap_bumpmap) {
|
||||
|
|
|
@ -278,7 +278,6 @@ void st_init_extensions(struct st_context *st)
|
|||
ctx->Extensions.EXT_provoking_vertex = GL_TRUE;
|
||||
ctx->Extensions.EXT_secondary_color = GL_TRUE;
|
||||
ctx->Extensions.EXT_stencil_wrap = GL_TRUE;
|
||||
ctx->Extensions.EXT_texture_env_combine = GL_TRUE;
|
||||
ctx->Extensions.EXT_texture_env_dot3 = GL_TRUE;
|
||||
ctx->Extensions.EXT_texture_lod_bias = GL_TRUE;
|
||||
ctx->Extensions.EXT_vertex_array_bgra = GL_TRUE;
|
||||
|
|
Loading…
Reference in New Issue