mesa: need to check resource and set length even if bufSize is 0
authorIlia Mirkin <imirkin@alum.mit.edu>
Fri, 12 Feb 2016 17:17:18 +0000 (12:17 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Mon, 15 Feb 2016 17:20:25 +0000 (12:20 -0500)
This fixes a number of dEQP tests, such as:

dEQP-GLES31.functional.program_interface_query.buffer_limited_query.resource_query

It was expecting the length to be set even in the bufSize == 0 case.
Also _mesa_get_program_resourceiv does some error checking on the
resource which should probably happen even in the bufSize == 0 case as
well although there's no dEQP test for that.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/mesa/main/program_resource.c

index 50659b0cd218bf2c7eb7e174cc95a2b3df9b3f00..0d9f8aecf082162328136316649edc7e60a7a6b5 100644 (file)
@@ -357,10 +357,6 @@ _mesa_GetProgramResourceiv(GLuint program, GLenum programInterface,
       return;
    }
 
-   /* No need to write any properties, user requested none. */
-   if (bufSize == 0)
-      return;
-
    _mesa_get_program_resourceiv(shProg, programInterface, index,
                                 propCount, props, bufSize, length, params);
 }