summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texenv.c
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2011-08-30 17:24:13 -0700
committerIan Romanick <[email protected]>2011-09-29 10:40:51 -0700
commitbde8bd99b64876b47f9d335320eb1ad5b3be8d9d (patch)
tree33fc4bc0ea6903583e834b5f9c062f5de3eb82fe /src/mesa/main/texenv.c
parent5c4f914f9a883be67a93a78c853de103bb6a2d2a (diff)
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 <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/texenv.c')
-rw-r--r--src/mesa/main/texenv.c121
1 files changed, 21 insertions, 100 deletions
diff --git a/src/mesa/main/texenv.c b/src/mesa/main/texenv.c
index 9d47c7bba45..9848dd4c9be 100644
--- a/src/mesa/main/texenv.c
+++ b/src/mesa/main/texenv.c
@@ -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) {