arb_dsa: avoid non-determinism in create-programpipelines subtests

Submitted by Ilia Mirkin on June 18, 2015, 2:37 a.m.

Details

Message ID 1434595051-531-1-git-send-email-imirkin@alum.mit.edu
State New
Headers show

Not browsing as part of any series.

Commit Message

Ilia Mirkin June 18, 2015, 2:37 a.m.
Right now the default label size test fails due to mesa not implementing
the call, and length is uninitialized, which causes the subtest name to
keep changing. A well-behaved impl won't modify the param on error, so
initialize it to a known-bad value.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
---
 tests/spec/arb_direct_state_access/create-programpipelines.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Patch hide | download patch | download mbox

diff --git a/tests/spec/arb_direct_state_access/create-programpipelines.c b/tests/spec/arb_direct_state_access/create-programpipelines.c
index 981c206..c9992e2 100644
--- a/tests/spec/arb_direct_state_access/create-programpipelines.c
+++ b/tests/spec/arb_direct_state_access/create-programpipelines.c
@@ -87,27 +87,32 @@  piglit_display(void)
 	SUBTESTCONDITION(glIsProgramPipeline(ids[2]), pass,
 			 "IsProgramPipeline()");
 
+	param = -1;
 	glGetProgramPipelineiv(ids[2], GL_ACTIVE_PROGRAM, &param);
 	piglit_check_gl_error(GL_NO_ERROR);
 	SUBTESTCONDITION(param == 0, pass,
 			 "default active program(%d) == 0", param);
 
+	param = -1;
 	glGetProgramPipelineiv(ids[2], GL_VERTEX_SHADER, &param);
 	piglit_check_gl_error(GL_NO_ERROR);
 	SUBTESTCONDITION(param == 0, pass,
 			 "default vertex shader program(%d) == 0", param);
 
+	param = -1;
 	glGetProgramPipelineiv(ids[2], GL_GEOMETRY_SHADER, &param);
 	piglit_check_gl_error(GL_NO_ERROR);
 	SUBTESTCONDITION(param == 0, pass,
 			 "default geometry shader program(%d) == 0", param);
 
+	param = -1;
 	glGetProgramPipelineiv(ids[2], GL_FRAGMENT_SHADER, &param);
 	piglit_check_gl_error(GL_NO_ERROR);
 	SUBTESTCONDITION(param == 0, pass,
 			 "default fragment shader program(%d) == 0", param);
 
 	if (piglit_is_extension_supported("GL_ARB_compute_shader")) {
+		param = -1;
 		glGetProgramPipelineiv(ids[2], GL_COMPUTE_SHADER, &param);
 		piglit_check_gl_error(GL_NO_ERROR);
 		SUBTESTCONDITION(param == 0, pass,
@@ -119,11 +124,13 @@  piglit_display(void)
 	}
 
 	if (piglit_is_extension_supported("GL_ARB_tessellation_shader")) {
+		param = -1;
 		glGetProgramPipelineiv(ids[2], GL_TESS_CONTROL_SHADER, &param);
 		piglit_check_gl_error(GL_NO_ERROR);
 		SUBTESTCONDITION(param == 0, pass,
 				 "default TCS(%d) == 0", param);
 
+		param = -1;
 		glGetProgramPipelineiv(ids[2], GL_TESS_EVALUATION_SHADER,
 				       &param);
 		piglit_check_gl_error(GL_NO_ERROR);
@@ -137,16 +144,19 @@  piglit_display(void)
 					 "default TES == 0");
 	}
 
+	param = -1;
 	glGetProgramPipelineiv(ids[2], GL_VALIDATE_STATUS, &param);
 	piglit_check_gl_error(GL_NO_ERROR);
 	SUBTESTCONDITION(param == GL_FALSE, pass,
 			 "default validate status(%d) == FALSE", param);
 
+	param = -1;
 	glGetProgramPipelineiv(ids[2], GL_INFO_LOG_LENGTH, &param);
 	piglit_check_gl_error(GL_NO_ERROR);
 	SUBTESTCONDITION(param == 0, pass,
 			 "startup log length(%d) == 0", param);
 
+	length = -1;
 	glGetObjectLabel(GL_PROGRAM_PIPELINE, ids[2], 11, &length, label);
 	piglit_check_gl_error(GL_NO_ERROR);
 	SUBTESTCONDITION(length == 0, pass,

Comments

On 18/06/15 03:37, Ilia Mirkin wrote:
> Right now the default label size test fails due to mesa not implementing
> the call, and length is uninitialized, which causes the subtest name to
> keep changing. A well-behaved impl won't modify the param on error, so
> initialize it to a known-bad value.
>
> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
> ---
>   tests/spec/arb_direct_state_access/create-programpipelines.c | 10 ++++++++++
>   1 file changed, 10 insertions(+)
>
> diff --git a/tests/spec/arb_direct_state_access/create-programpipelines.c b/tests/spec/arb_direct_state_access/create-programpipelines.c
> index 981c206..c9992e2 100644
> --- a/tests/spec/arb_direct_state_access/create-programpipelines.c
> +++ b/tests/spec/arb_direct_state_access/create-programpipelines.c
> @@ -87,27 +87,32 @@ piglit_display(void)
>   	SUBTESTCONDITION(glIsProgramPipeline(ids[2]), pass,
>   			 "IsProgramPipeline()");
>
> +	param = -1;
>   	glGetProgramPipelineiv(ids[2], GL_ACTIVE_PROGRAM, &param);
>   	piglit_check_gl_error(GL_NO_ERROR);
>   	SUBTESTCONDITION(param == 0, pass,
>   			 "default active program(%d) == 0", param);
>
> +	param = -1;
>   	glGetProgramPipelineiv(ids[2], GL_VERTEX_SHADER, &param);
>   	piglit_check_gl_error(GL_NO_ERROR);
>   	SUBTESTCONDITION(param == 0, pass,
>   			 "default vertex shader program(%d) == 0", param);
>
> +	param = -1;
>   	glGetProgramPipelineiv(ids[2], GL_GEOMETRY_SHADER, &param);
>   	piglit_check_gl_error(GL_NO_ERROR);
>   	SUBTESTCONDITION(param == 0, pass,
>   			 "default geometry shader program(%d) == 0", param);
>
> +	param = -1;
>   	glGetProgramPipelineiv(ids[2], GL_FRAGMENT_SHADER, &param);
>   	piglit_check_gl_error(GL_NO_ERROR);
>   	SUBTESTCONDITION(param == 0, pass,
>   			 "default fragment shader program(%d) == 0", param);
>
>   	if (piglit_is_extension_supported("GL_ARB_compute_shader")) {
> +		param = -1;
>   		glGetProgramPipelineiv(ids[2], GL_COMPUTE_SHADER, &param);
>   		piglit_check_gl_error(GL_NO_ERROR);
>   		SUBTESTCONDITION(param == 0, pass,
> @@ -119,11 +124,13 @@ piglit_display(void)
>   	}
>
>   	if (piglit_is_extension_supported("GL_ARB_tessellation_shader")) {
> +		param = -1;
>   		glGetProgramPipelineiv(ids[2], GL_TESS_CONTROL_SHADER, &param);
>   		piglit_check_gl_error(GL_NO_ERROR);
>   		SUBTESTCONDITION(param == 0, pass,
>   				 "default TCS(%d) == 0", param);
>
> +		param = -1;
>   		glGetProgramPipelineiv(ids[2], GL_TESS_EVALUATION_SHADER,
>   				       &param);
>   		piglit_check_gl_error(GL_NO_ERROR);
> @@ -137,16 +144,19 @@ piglit_display(void)
>   					 "default TES == 0");
>   	}
>
> +	param = -1;
>   	glGetProgramPipelineiv(ids[2], GL_VALIDATE_STATUS, &param);
>   	piglit_check_gl_error(GL_NO_ERROR);
>   	SUBTESTCONDITION(param == GL_FALSE, pass,
>   			 "default validate status(%d) == FALSE", param);
>
> +	param = -1;
>   	glGetProgramPipelineiv(ids[2], GL_INFO_LOG_LENGTH, &param);
>   	piglit_check_gl_error(GL_NO_ERROR);
>   	SUBTESTCONDITION(param == 0, pass,
>   			 "startup log length(%d) == 0", param);
>
> +	length = -1;
>   	glGetObjectLabel(GL_PROGRAM_PIPELINE, ids[2], 11, &length, label);
>   	piglit_check_gl_error(GL_NO_ERROR);
>   	SUBTESTCONDITION(length == 0, pass,
>

Thanks. I recently stumbled onto this one too, but didn't had 
opportunity to do anything about it.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
On 18/06/15 15:53, Jose Fonseca wrote:
> On 18/06/15 03:37, Ilia Mirkin wrote:
>> Right now the default label size test fails due to mesa not implementing
>> the call, and length is uninitialized, which causes the subtest name to
>> keep changing. A well-behaved impl won't modify the param on error, so
>> initialize it to a known-bad value.
>>
>> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
>> ---
>>   tests/spec/arb_direct_state_access/create-programpipelines.c | 10 
>> ++++++++++
>>   1 file changed, 10 insertions(+)
>>
>> diff --git 
>> a/tests/spec/arb_direct_state_access/create-programpipelines.c 
>> b/tests/spec/arb_direct_state_access/create-programpipelines.c
>> index 981c206..c9992e2 100644
>> --- a/tests/spec/arb_direct_state_access/create-programpipelines.c
>> +++ b/tests/spec/arb_direct_state_access/create-programpipelines.c
>> @@ -87,27 +87,32 @@ piglit_display(void)
>>       SUBTESTCONDITION(glIsProgramPipeline(ids[2]), pass,
>>                "IsProgramPipeline()");
>>
>> +    param = -1;
>>       glGetProgramPipelineiv(ids[2], GL_ACTIVE_PROGRAM, &param);
>>       piglit_check_gl_error(GL_NO_ERROR);
>>       SUBTESTCONDITION(param == 0, pass,
>>                "default active program(%d) == 0", param);
>>
>> +    param = -1;
>>       glGetProgramPipelineiv(ids[2], GL_VERTEX_SHADER, &param);
>>       piglit_check_gl_error(GL_NO_ERROR);
>>       SUBTESTCONDITION(param == 0, pass,
>>                "default vertex shader program(%d) == 0", param);
>>
>> +    param = -1;
>>       glGetProgramPipelineiv(ids[2], GL_GEOMETRY_SHADER, &param);
>>       piglit_check_gl_error(GL_NO_ERROR);
>>       SUBTESTCONDITION(param == 0, pass,
>>                "default geometry shader program(%d) == 0", param);
>>
>> +    param = -1;
>>       glGetProgramPipelineiv(ids[2], GL_FRAGMENT_SHADER, &param);
>>       piglit_check_gl_error(GL_NO_ERROR);
>>       SUBTESTCONDITION(param == 0, pass,
>>                "default fragment shader program(%d) == 0", param);
>>
>>       if (piglit_is_extension_supported("GL_ARB_compute_shader")) {
>> +        param = -1;
>>           glGetProgramPipelineiv(ids[2], GL_COMPUTE_SHADER, &param);
>>           piglit_check_gl_error(GL_NO_ERROR);
>>           SUBTESTCONDITION(param == 0, pass,
>> @@ -119,11 +124,13 @@ piglit_display(void)
>>       }
>>
>>       if (piglit_is_extension_supported("GL_ARB_tessellation_shader")) {
>> +        param = -1;
>>           glGetProgramPipelineiv(ids[2], GL_TESS_CONTROL_SHADER, 
>> &param);
>>           piglit_check_gl_error(GL_NO_ERROR);
>>           SUBTESTCONDITION(param == 0, pass,
>>                    "default TCS(%d) == 0", param);
>>
>> +        param = -1;
>>           glGetProgramPipelineiv(ids[2], GL_TESS_EVALUATION_SHADER,
>>                          &param);
>>           piglit_check_gl_error(GL_NO_ERROR);
>> @@ -137,16 +144,19 @@ piglit_display(void)
>>                        "default TES == 0");
>>       }
>>
>> +    param = -1;
>>       glGetProgramPipelineiv(ids[2], GL_VALIDATE_STATUS, &param);
>>       piglit_check_gl_error(GL_NO_ERROR);
>>       SUBTESTCONDITION(param == GL_FALSE, pass,
>>                "default validate status(%d) == FALSE", param);
>>
>> +    param = -1;
>>       glGetProgramPipelineiv(ids[2], GL_INFO_LOG_LENGTH, &param);
>>       piglit_check_gl_error(GL_NO_ERROR);
>>       SUBTESTCONDITION(param == 0, pass,
>>                "startup log length(%d) == 0", param);
>>
>> +    length = -1;
>>       glGetObjectLabel(GL_PROGRAM_PIPELINE, ids[2], 11, &length, label);
>>       piglit_check_gl_error(GL_NO_ERROR);
>>       SUBTESTCONDITION(length == 0, pass,
>>
>
> Thanks. I recently stumbled onto this one too, but didn't had 
> opportunity to do anything about it.
>
> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>

Sorry about this:
Reviewed-by: Martin Peres <martin.peres@linux.intel.com>