[1/2] arb_viewport_array/viewport_indices: allow float precision instead of double

Submitted by Marek Olšák on Feb. 9, 2018, 12:59 a.m.

Details

Message ID 1518137959-10689-1-git-send-email-maraeo@gmail.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Marek Olšák Feb. 9, 2018, 12:59 a.m.
From: Marek Olšák <marek.olsak@amd.com>

Mesa will not use doubles for this state.
---
 tests/spec/arb_viewport_array/viewport_indices.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/tests/spec/arb_viewport_array/viewport_indices.c b/tests/spec/arb_viewport_array/viewport_indices.c
index 0088828..567f83d 100644
--- a/tests/spec/arb_viewport_array/viewport_indices.c
+++ b/tests/spec/arb_viewport_array/viewport_indices.c
@@ -194,21 +194,23 @@  test_preserve_invalid_index(GLint maxVP)
 		    || vpGet[3] != vp[3]) {
 			printf("Viewport index %d got erroneously changed\n",
 			       i);
 			pass = false;
 		}
 #ifdef PIGLIT_USE_OPENGL
 		glGetDoublei_v(GL_DEPTH_RANGE, i, drGet);
 #else
 		glGetFloati_vOES(GL_DEPTH_RANGE, i, drGet);
 #endif
-		if (drGet[0] != dr[0] || drGet[1] != dr[1]) {
+		/* Allow float precisions instead of double for desktop GL. */
+		if ((float)drGet[0] != (float)dr[0] ||
+		    (float)drGet[1] != (float)dr[1]) {
 			printf("DepthRange index %d got erroneously changed\n",
 			       i);
 			pass = false;
 		}
 		glGetIntegeri_v(GL_SCISSOR_BOX, i, scGet);
 		if (scGet[0] != sc[0] || scGet[1] != sc[1] || scGet[2] != sc[2]
 		    || scGet[3] != sc[3]) {
 			printf("Scissor Box for index %d got erroneously changed\n",
 			       i);
 			pass = false;

Comments

On 02/08/2018 05:59 PM, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak@amd.com>
> 
> Mesa will not use doubles for this state.
> ---
>   tests/spec/arb_viewport_array/viewport_indices.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/spec/arb_viewport_array/viewport_indices.c b/tests/spec/arb_viewport_array/viewport_indices.c
> index 0088828..567f83d 100644
> --- a/tests/spec/arb_viewport_array/viewport_indices.c
> +++ b/tests/spec/arb_viewport_array/viewport_indices.c
> @@ -194,21 +194,23 @@ test_preserve_invalid_index(GLint maxVP)
>   		    || vpGet[3] != vp[3]) {
>   			printf("Viewport index %d got erroneously changed\n",
>   			       i);
>   			pass = false;
>   		}
>   #ifdef PIGLIT_USE_OPENGL
>   		glGetDoublei_v(GL_DEPTH_RANGE, i, drGet);
>   #else
>   		glGetFloati_vOES(GL_DEPTH_RANGE, i, drGet);
>   #endif
> -		if (drGet[0] != dr[0] || drGet[1] != dr[1]) {
> +		/* Allow float precisions instead of double for desktop GL. */
> +		if ((float)drGet[0] != (float)dr[0] ||
> +		    (float)drGet[1] != (float)dr[1]) {
>   			printf("DepthRange index %d got erroneously changed\n",
>   			       i);
>   			pass = false;
>   		}
>   		glGetIntegeri_v(GL_SCISSOR_BOX, i, scGet);
>   		if (scGet[0] != sc[0] || scGet[1] != sc[1] || scGet[2] != sc[2]
>   		    || scGet[3] != sc[3]) {
>   			printf("Scissor Box for index %d got erroneously changed\n",
>   			       i);
>   			pass = false;
> 

Reviewed-by: Brian Paul <brianp@vmware.com>