[Piglit] [PATCH 2/7] gl-4.4: set KHR_no_error compatibility

Timothy Arceri tarceri at itsqueeze.com
Mon May 29 23:53:34 UTC 2017


On 19/05/17 19:08, Samuel Pitoiset wrote:
> On 05/18/2017 04:00 AM, Timothy Arceri wrote:
>> ---
>>   tests/spec/gl-4.4/gl_max_vertex_attrib_stride.c | 13 ++++++++-----
>>   1 file changed, 8 insertions(+), 5 deletions(-)
>>
>> diff --git a/tests/spec/gl-4.4/gl_max_vertex_attrib_stride.c 
>> b/tests/spec/gl-4.4/gl_max_vertex_attrib_stride.c
>> index 85113c8..71343d0 100644
>> --- a/tests/spec/gl-4.4/gl_max_vertex_attrib_stride.c
>> +++ b/tests/spec/gl-4.4/gl_max_vertex_attrib_stride.c
>> @@ -21,20 +21,21 @@
>>    * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
>>    * SOFTWARE.
>>    */
>>   #include "piglit-util-gl.h"
>>   #include "minmax-test.h"
>>   PIGLIT_GL_TEST_CONFIG_BEGIN
>>       config.supports_gl_core_version = 44;
>> +    config.khr_no_error_support = PIGLIT_NO_ERRORS;
>>   PIGLIT_GL_TEST_CONFIG_END
>>   static bool check_stride(char *function, bool check_valid)
>>   {
>>       bool pass = true;
>>       if (check_valid) {
>>           if (!piglit_check_gl_error(GL_NO_ERROR)) {
>>               fprintf(stderr, "error when testing valid "
>> @@ -138,24 +139,26 @@ void piglit_init(int argc, char **argv)
>>       pass = piglit_minmax_pass;
>>       /* Try passing the max stride value */
>>       pass = test_stride_bind_buffer(stride_max, true) && pass;
>>       pass = test_stride_bind_buffers(stride_max, true) && pass;
>>       pass = test_stride_vertex_attrib(stride_max, true) && pass;
>>       pass = test_stride_vertex_attribi(stride_max, true) && pass;
>>       pass = test_stride_vertex_attribl(stride_max, true) && pass;
>>       /* Try passing a stride value that is to large */
>> -    pass = test_stride_bind_buffer(stride_max_plus_one, false) && pass;
>> -    pass = test_stride_bind_buffers(stride_max_plus_one, false) && pass;
>> -    pass = test_stride_vertex_attrib(stride_max_plus_one, false) && 
>> pass;
>> -    pass = test_stride_vertex_attribi(stride_max_plus_one, false) && 
>> pass;
>> -    pass = test_stride_vertex_attribl(stride_max_plus_one, false) && 
>> pass;
>> +    if (!piglit_khr_no_error) {
>> +        pass = test_stride_bind_buffer(stride_max_plus_one, false) && 
>> pass;
>> +        pass = test_stride_bind_buffers(stride_max_plus_one, false) 
>> && pass;
>> +        pass = test_stride_vertex_attrib(stride_max_plus_one, false) 
>> && pass;
>> +        pass = test_stride_vertex_attribi(stride_max_plus_one, false) 
>> && pass;
>> +        pass = test_stride_vertex_attribl(stride_max_plus_one, false) 
>> && pass;
>> +    }
> 
> How about moving the piglit_khr_no_error check directly in 
> check_stride() ? With that changed, patch is:

Hey sorry, these fell off my radar. I've gone ahead and pushed this one 
unchanged without your review. The problem with the suggestion is that 
with KHR_no_error the idea is to never call the api in a way that can 
cause an error. Your suggesting would mean we call the api in an invalid 
way and just skip the error checks, this can mean we end up crashing, 
causing buffer overruns etc.

Thanks for the reviews I've pushed the other patches with you r-b.

> 
> Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> 
>>       piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
>>   }
>>   enum piglit_result
>>   piglit_display(void)
>>   {
>>       return PIGLIT_PASS;
>>   }
>>


More information about the Piglit mailing list