Mesa (master): zink: correct inaccurate comment

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Feb 24 11:07:55 UTC 2021


Module: Mesa
Branch: master
Commit: dd055f6017ceb576e9b4cac23eb1d507adf49b99
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=dd055f6017ceb576e9b4cac23eb1d507adf49b99

Author: Erik Faye-Lund <kusmabite at gmail.com>
Date:   Tue Feb 23 14:23:37 2021 +0100

zink: correct inaccurate comment

PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE translate into
GL_MAX_*_UNIFORM_COMPONENTS, all of which are allowed to be as
low as 1024 by the GL 4.6 spec.

PIPE_CAP_MAX_SHADER_BUFFER_SIZE translate into
GL_MAX_SHADER_STORAGE_BLOCK_SIZE, which has different minimum values in
different versions of the GL spec. In the GL 4.6 spec for instance, it
is required to be 2^27, the same as what Vulkan requires.

But what these limits are in GL is irrelevant at this level of
abstraction. The OpenGL state-tracker cares, but the Gallium driver
shouldn't have to. So let's just delete those parts of the comments.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9216>

---

 src/gallium/drivers/zink/zink_screen.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c
index ea916e3685c..e7a47e10826 100644
--- a/src/gallium/drivers/zink/zink_screen.c
+++ b/src/gallium/drivers/zink/zink_screen.c
@@ -433,7 +433,7 @@ zink_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
       return 0;
 
    case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
-      /* 16777216 (1<<24) is required by GL spec, 1<<27 is required by VK spec */
+      /* 1<<27 is required by VK spec */
       assert(screen->info.props.limits.maxStorageBufferRange >= 1 << 27);
       /* but Gallium can't handle values that are too big, so clamp to VK spec minimum */
       return 1 << 27;
@@ -602,7 +602,7 @@ zink_get_shader_param(struct pipe_screen *pscreen,
    }
 
    case PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE:
-      /* 16384 required by GL spec, this is the minimum required by VK spec */
+      /* At least 16384 is guaranteed by VK spec */
       assert(screen->info.props.limits.maxUniformBufferRange >= 16384);
       /* but Gallium can't handle values that are too big */
       return MIN2(screen->info.props.limits.maxUniformBufferRange, 1 << 31);



More information about the mesa-commit mailing list