mesa/es: Validate glGetTexEnv parameters in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
Ian Romanick 2012-07-27 17:48:30 -07:00
parent 8a263b6efd
commit 33e01d93ca
2 changed files with 5 additions and 87 deletions

View file

@ -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">

View file

@ -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 {