We plan to report UINT32_MAX for UBOs.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16881>
* ``PIPE_CAP_QUERY_SPARSE_TEXTURE_RESIDENCY``: TRUE if shader sparse texture sample instruction could also return the residency information.
* ``PIPE_CAP_CLAMP_SPARSE_TEXTURE_LOD``: TRUE if shader sparse texture sample instruction support clamp the minimal lod to prevent read from un-committed pages.
* ``PIPE_CAP_ALLOW_DRAW_OUT_OF_ORDER``: TRUE if the driver allows the "draw out of order" optimization to be enabled. See _mesa_update_allow_draw_out_of_order for more details.
+* ``PIPE_CAP_MAX_CONSTANT_BUFFER_SIZE_UINT``: Maximum bound constant buffer size in bytes. This is unsigned integer with the maximum of 4GB - 1. This applies to all constant buffers used by UBOs, unlike `PIPE_SHADER_CAP_MAX_CONST_BUFFER0_SIZE`, which is specifically for GLSL uniforms.
.. _pipe_capf:
case PIPE_CAP_CLAMP_SPARSE_TEXTURE_LOD:
return 0;
+ case PIPE_CAP_MAX_CONSTANT_BUFFER_SIZE_UINT:
+ return pscreen->get_shader_param(pscreen, PIPE_SHADER_FRAGMENT,
+ PIPE_SHADER_CAP_MAX_CONST_BUFFER0_SIZE);
+
default:
unreachable("bad PIPE_CAP_*");
}
PIPE_CAP_QUERY_SPARSE_TEXTURE_RESIDENCY,
PIPE_CAP_CLAMP_SPARSE_TEXTURE_LOD,
PIPE_CAP_ALLOW_DRAW_OUT_OF_ORDER,
+ PIPE_CAP_MAX_CONSTANT_BUFFER_SIZE_UINT,
PIPE_CAP_LAST,
/* XXX do not add caps after PIPE_CAP_LAST! */
PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION);
c->MaxUniformBlockSize =
- screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT,
- PIPE_SHADER_CAP_MAX_CONST_BUFFER0_SIZE);
- /* GL45-CTS.enhanced_layouts.ssb_member_invalid_offset_alignment fails if
- * this is larger than INT_MAX - 100. Use a nicely aligned limit.
- */
- c->MaxUniformBlockSize = MIN2(c->MaxUniformBlockSize, INT_MAX - 127);
+ screen->get_param(screen, PIPE_CAP_MAX_CONSTANT_BUFFER_SIZE_UINT);
if (c->MaxUniformBlockSize < 16384) {
can_ubo = false;