From 0e466efe417d8d8a32e360231e587ecc11c2dc35 Mon Sep 17 00:00:00 2001 From: "Juan A. Suarez Romero" Date: Thu, 27 Apr 2023 14:15:18 +0200 Subject: [PATCH] v3d: apply proper clamping when setting up RT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ensure the render target values are in the proper range. This fixes `spec@!opengl 3.0@render-integer`. Reviewed-by: Alejandro PiƱeiro Signed-off-by: Juan A. Suarez Romero Part-of: --- src/broadcom/ci/broadcom-rpi4-fails.txt | 9 --------- src/gallium/drivers/v3d/v3dx_rcl.c | 9 ++++++++- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/broadcom/ci/broadcom-rpi4-fails.txt b/src/broadcom/ci/broadcom-rpi4-fails.txt index 02919a1a8bd..e88df79ea14 100644 --- a/src/broadcom/ci/broadcom-rpi4-fails.txt +++ b/src/broadcom/ci/broadcom-rpi4-fails.txt @@ -103,15 +103,6 @@ spec@!opengl 3.0@bindfragdata-nonexistent-variable,Fail spec@!opengl 3.0@clearbuffer-mixed-format,Fail spec@!opengl 3.0@getfragdatalocation,Fail spec@!opengl 3.0@minmax,Fail -spec@!opengl 3.0@render-integer,Fail -spec@!opengl 3.0@render-integer@GL_R8I,Fail -spec@!opengl 3.0@render-integer@GL_R8UI,Fail -spec@!opengl 3.0@render-integer@GL_RG8I,Fail -spec@!opengl 3.0@render-integer@GL_RG8UI,Fail -spec@!opengl 3.0@render-integer@GL_RGB8I,Fail -spec@!opengl 3.0@render-integer@GL_RGB8UI,Fail -spec@!opengl 3.0@render-integer@GL_RGBA8I,Fail -spec@!opengl 3.0@render-integer@GL_RGBA8UI,Fail spec@!opengl 3.0@required-texture-attachment-formats,Fail spec@!opengl 3.1@minmax,Fail spec@!opengl 3.1@primitive-restart-xfb flush,Fail diff --git a/src/gallium/drivers/v3d/v3dx_rcl.c b/src/gallium/drivers/v3d/v3dx_rcl.c index 538912f641c..82547437c25 100644 --- a/src/gallium/drivers/v3d/v3dx_rcl.c +++ b/src/gallium/drivers/v3d/v3dx_rcl.c @@ -498,7 +498,14 @@ v3d_setup_render_target(struct v3d_job *job, int cbuf, *rt_bpp = MAX2(*rt_bpp, bsurf->internal_bpp); } *rt_type = surf->internal_type; - *rt_clamp = V3D_RENDER_TARGET_CLAMP_NONE; + if (util_format_is_srgb(surf->base.format)) + *rt_clamp = V3D_RENDER_TARGET_CLAMP_NORM; +#if V3D_VERSION >= 42 + else if (util_format_is_pure_integer(surf->base.format)) + *rt_clamp = V3D_RENDER_TARGET_CLAMP_INT; +#endif + else + *rt_clamp = V3D_RENDER_TARGET_CLAMP_NONE; } #else /* V3D_VERSION < 40 */