From cbd39274451af7c0ad06676012a8f28a395df64d Mon Sep 17 00:00:00 2001 From: "Juan A. Suarez Romero" Date: Fri, 12 Jul 2024 17:44:15 +0200 Subject: [PATCH] v3d: expose ARB_depth_clamp in V3D 7.x Reviewed-by: Iago Toral Quiroga Signed-off-by: Juan A. Suarez Romero Part-of: --- docs/features.txt | 2 +- docs/relnotes/new_features.txt | 1 + src/gallium/drivers/v3d/v3d_screen.c | 3 +++ src/gallium/drivers/v3d/v3dx_emit.c | 11 ++--------- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/docs/features.txt b/docs/features.txt index fb2a707e42d..a9efa59145c 100644 --- a/docs/features.txt +++ b/docs/features.txt @@ -92,7 +92,7 @@ GL 3.2, GLSL 1.50 --- all DONE: freedreno, nv50, nvc0, r600, radeonsi, llvmpipe, GL_ARB_provoking_vertex (Provoking vertex) DONE (v3d, vc4, panfrost, lima, crocus) GL_ARB_seamless_cube_map (Seamless cubemaps) DONE (panfrost, crocus) GL_ARB_texture_multisample (Multisample textures) DONE (freedreno/a5xx+, v3d, vc4, panfrost) - GL_ARB_depth_clamp (Frag depth clamp) DONE (panfrost, crocus) + GL_ARB_depth_clamp (Frag depth clamp) DONE (panfrost, crocus, v3d) GL_ARB_sync (Fence objects) DONE (v3d, vc4, panfrost, lima, crocus) GLX_ARB_create_context_profile DONE diff --git a/docs/relnotes/new_features.txt b/docs/relnotes/new_features.txt index cac55d30235..aa7b72aa938 100644 --- a/docs/relnotes/new_features.txt +++ b/docs/relnotes/new_features.txt @@ -5,3 +5,4 @@ VK_EXT_shader_replicated_composites on ANV, dozen, hasvk, lavapipe, nvk, RADV, a VK_KHR_maintenance5 on v3dv VK_KHR_maintenance7 on RADV VK_EXT_depth_clamp_zero_one on v3dv +GL_ARB_depth_clamp on v3d diff --git a/src/gallium/drivers/v3d/v3d_screen.c b/src/gallium/drivers/v3d/v3d_screen.c index adeaaa3845a..91c5c2a1aa0 100644 --- a/src/gallium/drivers/v3d/v3d_screen.c +++ b/src/gallium/drivers/v3d/v3d_screen.c @@ -295,6 +295,9 @@ v3d_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) case PIPE_CAP_NATIVE_FENCE_FD: return true; + case PIPE_CAP_DEPTH_CLIP_DISABLE: + return screen->devinfo.ver >= 71; + default: return u_pipe_screen_get_param_defaults(pscreen, param); } diff --git a/src/gallium/drivers/v3d/v3dx_emit.c b/src/gallium/drivers/v3d/v3dx_emit.c index d709555ecf5..2055ec036c7 100644 --- a/src/gallium/drivers/v3d/v3dx_emit.c +++ b/src/gallium/drivers/v3d/v3dx_emit.c @@ -380,18 +380,11 @@ v3dX(emit_state)(struct pipe_context *pctx) } #if V3D_VERSION >= 71 - /* The following follows the logic implemented in v3dv - * plus the definition of depth_clip_near/far and - * depth_clamp. - * - * Note: some extensions are not supported by v3d - * (like ARB_depth_clamp) that would affect this, but - * the values on rasterizer are taking that into - * account. - */ config.z_clipping_mode = v3d->rasterizer->base.depth_clip_near || v3d->rasterizer->base.depth_clip_far ? V3D_Z_CLIP_MODE_MIN_ONE_TO_ONE : V3D_Z_CLIP_MODE_NONE; + + config.z_clamp_mode = v3d->rasterizer->base.depth_clamp; #endif } }