diff --git a/docs/gallium/screen.rst b/docs/gallium/screen.rst index ebeef25d94e..dda1a5a14ee 100644 --- a/docs/gallium/screen.rst +++ b/docs/gallium/screen.rst @@ -611,6 +611,7 @@ The integer capabilities: * ``PIPE_CAP_DEVICE_PROTECTED_CONTENT``: Whether the device support protected / encrypted content. * ``PIPE_CAP_PREFER_REAL_BUFFER_IN_CONSTBUF0``: The state tracker is encouraged to upload constants into a real buffer and bind it into constant buffer 0 instead of binding a user pointer. This may enable a faster codepath in a gallium frontend for drivers that really prefer a real buffer. * ``PIPE_CAP_GL_CLAMP``: Driver natively supports GL_CLAMP. Required for non-NIR drivers with the GL frontend. NIR drivers with the cap unavailable will have GL_CLAMP lowered to txd/txl with a saturate on the coordinates. +* ``PIPE_CAP_TEXRECT``: Driver supports rectangle textures. Required for OpenGL on `!prefers_nir` drivers. If this cap is not present, st/mesa will lower the NIR to use normal 2D texture sampling by using either `txs` or `nir_intrinsic_load_texture_scaling` to normalize the texture coordinates. .. _pipe_capf: diff --git a/src/gallium/auxiliary/util/u_screen.c b/src/gallium/auxiliary/util/u_screen.c index 08d28f689e6..2bc560a1f07 100644 --- a/src/gallium/auxiliary/util/u_screen.c +++ b/src/gallium/auxiliary/util/u_screen.c @@ -453,6 +453,9 @@ u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen, case PIPE_CAP_PREFER_REAL_BUFFER_IN_CONSTBUF0: return 0; + case PIPE_CAP_TEXRECT: + return 1; + case PIPE_CAP_SHADER_ATOMIC_INT64: return 0; diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index 3d93fb08233..79f6bd5b152 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -978,6 +978,8 @@ enum pipe_cap PIPE_CAP_DEVICE_PROTECTED_CONTENT, PIPE_CAP_PREFER_REAL_BUFFER_IN_CONSTBUF0, PIPE_CAP_GL_CLAMP, + PIPE_CAP_TEXRECT, + PIPE_CAP_LAST, /* XXX do not add caps after PIPE_CAP_LAST! */ };