mesa: implement glGetShaderPrecisionFormat()
Drivers should override the default range/precision info as needed. No drivers do this yet.
This commit is contained in:
@@ -1628,12 +1628,51 @@ void GLAPIENTRY
|
||||
_mesa_GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype,
|
||||
GLint* range, GLint* precision)
|
||||
{
|
||||
const struct gl_program_constants *limits;
|
||||
const struct gl_precision *p;
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
(void) shadertype;
|
||||
(void) precisiontype;
|
||||
(void) range;
|
||||
(void) precision;
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, __FUNCTION__);
|
||||
|
||||
switch (shadertype) {
|
||||
case GL_VERTEX_SHADER:
|
||||
limits = &ctx->Const.VertexProgram;
|
||||
break;
|
||||
case GL_FRAGMENT_SHADER:
|
||||
limits = &ctx->Const.FragmentProgram;
|
||||
break;
|
||||
default:
|
||||
_mesa_error(ctx, GL_INVALID_ENUM,
|
||||
"glGetShaderPrecisionFormat(shadertype)");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (precisiontype) {
|
||||
case GL_LOW_FLOAT:
|
||||
p = &limits->LowFloat;
|
||||
break;
|
||||
case GL_MEDIUM_FLOAT:
|
||||
p = &limits->MediumFloat;
|
||||
break;
|
||||
case GL_HIGH_FLOAT:
|
||||
p = &limits->HighFloat;
|
||||
break;
|
||||
case GL_LOW_INT:
|
||||
p = &limits->LowInt;
|
||||
break;
|
||||
case GL_MEDIUM_INT:
|
||||
p = &limits->MediumInt;
|
||||
break;
|
||||
case GL_HIGH_INT:
|
||||
p = &limits->HighInt;
|
||||
break;
|
||||
default:
|
||||
_mesa_error(ctx, GL_INVALID_ENUM,
|
||||
"glGetShaderPrecisionFormat(precisiontype)");
|
||||
return;
|
||||
}
|
||||
|
||||
range[0] = p->RangeMin;
|
||||
range[1] = p->RangeMax;
|
||||
precision[0] = p->Precision;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user