aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2012-07-27 17:48:30 -0700
committerIan Romanick <[email protected]>2012-08-29 15:09:35 -0700
commit33e01d93ca1a1d3183243c308a2c87f4b969b3bd (patch)
tree9654da4b59bceec0a1c41294c4e68d6209ba81b7
parent8a263b6efd2c520a4ed9c98b9c8142c6c2c6f389 (diff)
mesa/es: Validate glGetTexEnv parameters in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <[email protected]>
-rw-r--r--src/mesa/main/APIspec.xml82
-rw-r--r--src/mesa/main/texenv.c10
2 files changed, 5 insertions, 87 deletions
diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml
index c72dcb5018f..947ece20cc2 100644
--- a/src/mesa/main/APIspec.xml
+++ b/src/mesa/main/APIspec.xml
@@ -432,88 +432,6 @@
<param name="pname" type="GLenum"/>
<vector name="params" type="GLtype *" size="dynamic"/>
</proto>
-
- <desc name="target" category="OES_point_sprite">
- <value name="GL_POINT_SPRITE_OES"/>
- <desc name="pname">
- <value name="GL_COORD_REPLACE_OES"/>
- </desc>
- </desc>
-
- <desc name="pname" category="OES_point_sprite">
- <value name="GL_COORD_REPLACE_OES"/>
- <desc name="params" vector_size="1" convert="false"/>
- </desc>
-
- <desc name="target" category="EXT_texture_lod_bias">
- <value name="GL_TEXTURE_FILTER_CONTROL_EXT"/>
-
- <desc name="pname">
- <value name="GL_TEXTURE_LOD_BIAS_EXT"/>
- </desc>
- </desc>
-
- <desc name="pname" category="EXT_texture_lod_bias">
- <value name="GL_TEXTURE_LOD_BIAS_EXT"/>
- <desc name="params" vector_size="1"/>
- </desc>
-
- <desc name="target">
- <value name="GL_TEXTURE_ENV"/>
-
- <desc name="pname">
- <value name="GL_TEXTURE_ENV_COLOR"/>
- <value name="GL_RGB_SCALE"/>
- <value name="GL_ALPHA_SCALE"/>
- <value name="GL_TEXTURE_ENV_MODE"/>
- <value name="GL_COMBINE_RGB"/>
- <value name="GL_COMBINE_ALPHA"/>
- <value name="GL_SRC0_RGB"/>
- <value name="GL_SRC1_RGB"/>
- <value name="GL_SRC2_RGB"/>
- <value name="GL_SRC0_ALPHA"/>
- <value name="GL_SRC1_ALPHA"/>
- <value name="GL_SRC2_ALPHA"/>
- <value name="GL_OPERAND0_RGB"/>
- <value name="GL_OPERAND1_RGB"/>
- <value name="GL_OPERAND2_RGB"/>
- <value name="GL_OPERAND0_ALPHA"/>
- <value name="GL_OPERAND1_ALPHA"/>
- <value name="GL_OPERAND2_ALPHA"/>
- </desc>
- </desc>
-
- <desc name="pname">
- <value name="GL_TEXTURE_ENV_COLOR"/>
- <desc name="params" vector_size="4"/>
- </desc>
-
- <desc name="pname">
- <value name="GL_RGB_SCALE"/>
- <value name="GL_ALPHA_SCALE"/>
-
- <desc name="params" vector_size="1"/>
- </desc>
-
- <desc name="pname">
- <value name="GL_TEXTURE_ENV_MODE"/>
- <value name="GL_COMBINE_RGB"/>
- <value name="GL_COMBINE_ALPHA"/>
- <value name="GL_SRC0_RGB"/>
- <value name="GL_SRC1_RGB"/>
- <value name="GL_SRC2_RGB"/>
- <value name="GL_SRC0_ALPHA"/>
- <value name="GL_SRC1_ALPHA"/>
- <value name="GL_SRC2_ALPHA"/>
- <value name="GL_OPERAND0_RGB"/>
- <value name="GL_OPERAND1_RGB"/>
- <value name="GL_OPERAND2_RGB"/>
- <value name="GL_OPERAND0_ALPHA"/>
- <value name="GL_OPERAND1_ALPHA"/>
- <value name="GL_OPERAND2_ALPHA"/>
-
- <desc name="params" vector_size="1" convert="false"/>
- </desc>
</template>
<template name="GetTexGen" direction="get">
diff --git a/src/mesa/main/texenv.c b/src/mesa/main/texenv.c
index c2044a8c2c0..f1064c5e36c 100644
--- a/src/mesa/main/texenv.c
+++ b/src/mesa/main/texenv.c
@@ -588,7 +588,7 @@ get_texenvi(struct gl_context *ctx, const struct gl_texture_unit *texUnit,
return texUnit->Combine.SourceRGB[rgb_idx];
}
case GL_SOURCE3_RGB_NV:
- if (ctx->Extensions.NV_texture_env_combine4) {
+ if (ctx->API == API_OPENGL && ctx->Extensions.NV_texture_env_combine4) {
return texUnit->Combine.SourceRGB[3];
}
else {
@@ -602,7 +602,7 @@ get_texenvi(struct gl_context *ctx, const struct gl_texture_unit *texUnit,
return texUnit->Combine.SourceA[alpha_idx];
}
case GL_SOURCE3_ALPHA_NV:
- if (ctx->Extensions.NV_texture_env_combine4) {
+ if (ctx->API == API_OPENGL && ctx->Extensions.NV_texture_env_combine4) {
return texUnit->Combine.SourceA[3];
}
else {
@@ -616,7 +616,7 @@ get_texenvi(struct gl_context *ctx, const struct gl_texture_unit *texUnit,
return texUnit->Combine.OperandRGB[op_rgb];
}
case GL_OPERAND3_RGB_NV:
- if (ctx->Extensions.NV_texture_env_combine4) {
+ if (ctx->API == API_OPENGL && ctx->Extensions.NV_texture_env_combine4) {
return texUnit->Combine.OperandRGB[3];
}
else {
@@ -630,7 +630,7 @@ get_texenvi(struct gl_context *ctx, const struct gl_texture_unit *texUnit,
return texUnit->Combine.OperandA[op_alpha];
}
case GL_OPERAND3_ALPHA_NV:
- if (ctx->Extensions.NV_texture_env_combine4) {
+ if (ctx->API == API_OPENGL && ctx->Extensions.NV_texture_env_combine4) {
return texUnit->Combine.OperandA[3];
}
else {
@@ -643,7 +643,7 @@ get_texenvi(struct gl_context *ctx, const struct gl_texture_unit *texUnit,
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) {
+ if (ctx->API == API_OPENGL && ctx->Extensions.ATI_envmap_bumpmap) {
return texUnit->BumpTarget;
}
else {