[Mesa-dev] [PATCH 2/2] mesa: don't compile integer clear shaders for unsupported APIs

Oliver McFadden oliver.mcfadden at linux.intel.com
Wed May 30 04:49:11 PDT 2012


On Tue, May 29, 2012 at 08:33:33AM -0600, Brian Paul wrote:
> On Tue, May 29, 2012 at 1:40 AM, Oliver McFadden
> <oliver.mcfadden at linux.intel.com> wrote:
> > On Sat, May 26, 2012 at 10:22:17AM +0300, Oliver McFadden wrote:
> >> Discovered while running the Khronos conformance test suite and
> >> receiving "implementation error: meta program compile failed."
> >>
> >> This bug was recently introduced by the i965 clear patch set and would
> >> only be detected while using the ES2 API and only on gen6+ hardware.
> >>
> >> Signed-off-by: Oliver McFadden <oliver.mcfadden at linux.intel.com>
> >> ---
> >>  src/mesa/drivers/common/meta.c |    3 ++-
> >>  1 files changed, 2 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
> >> index 316d7b2..21bdeb1 100644
> >> --- a/src/mesa/drivers/common/meta.c
> >> +++ b/src/mesa/drivers/common/meta.c
> >> @@ -1793,7 +1793,8 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
> >>     clear->ColorLocation = _mesa_GetUniformLocationARB(clear->ShaderProg,
> >>                                                     "color");
> >>
> >> -   if (ctx->Const.GLSLVersion >= 130) {
> >> +   if (ctx->API != API_OPENGLES && ctx->API != API_OPENGLES2 &&
> >> +       ctx->Const.GLSLVersion >= 130) {
> 
> Wouldn't it be simpler to test ctx->API == API_OPENGL?

The logic here was that we might have some other API implemented in the
future, which would make use of meta clear code and use the integer
shaders. But AFAIK currently there are no such cases, so using
ctx->API == API_OPENGL should be fine.

I'll round-up the Reviewed-by's and push the patch.

> 
> Looks OK otherwise.
> 
> Reviewed-by: Brian Paul <brianp at vmware.com>

-- 
Oliver McFadden.


More information about the mesa-dev mailing list