From 9b1f091bd924a4fba9e201ce8e0f98a91e9a8f1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 27 Sep 2020 22:57:10 -0400 Subject: [PATCH] gallium: add PIPE_CAP_PREFER_REAL_BUFFER_IN_CONSTBUF0 Acked-by: Pierre-Eric Pelloux-Prayer Part-of: --- docs/gallium/screen.rst | 1 + src/gallium/auxiliary/util/u_screen.c | 1 + src/gallium/drivers/radeonsi/si_get.c | 1 + src/gallium/include/pipe/p_defines.h | 1 + 4 files changed, 4 insertions(+) diff --git a/docs/gallium/screen.rst b/docs/gallium/screen.rst index 8f069c765c7..654df77dc0c 100644 --- a/docs/gallium/screen.rst +++ b/docs/gallium/screen.rst @@ -594,6 +594,7 @@ The integer capabilities: * ``PIPE_CAP_NO_CLIP_ON_COPY_TEX``: Driver doesn't want x/y/width/height clipped based on src size when doing a copy texture operation (eg: may want out-of-bounds reads that produce 0 instead of leaving the texture content undefined) * ``PIPE_CAP_MAX_TEXTURE_MB``: Maximum texture size in MB (default is 1024) * ``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_capf: diff --git a/src/gallium/auxiliary/util/u_screen.c b/src/gallium/auxiliary/util/u_screen.c index 2a97082e410..57dd0a1cb55 100644 --- a/src/gallium/auxiliary/util/u_screen.c +++ b/src/gallium/auxiliary/util/u_screen.c @@ -440,6 +440,7 @@ u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen, case PIPE_CAP_ALPHA_TO_COVERAGE_DITHER_CONTROL: case PIPE_CAP_NO_CLIP_ON_COPY_TEX: case PIPE_CAP_MAX_TEXTURE_MB: + case PIPE_CAP_PREFER_REAL_BUFFER_IN_CONSTBUF0: return 0; case PIPE_CAP_SHADER_ATOMIC_INT64: diff --git a/src/gallium/drivers/radeonsi/si_get.c b/src/gallium/drivers/radeonsi/si_get.c index 0b43e751ce8..0b3653c293a 100644 --- a/src/gallium/drivers/radeonsi/si_get.c +++ b/src/gallium/drivers/radeonsi/si_get.c @@ -165,6 +165,7 @@ static int si_get_param(struct pipe_screen *pscreen, enum pipe_cap param) case PIPE_CAP_FRONTEND_NOOP: case PIPE_CAP_DEMOTE_TO_HELPER_INVOCATION: case PIPE_CAP_MULTI_DRAW: + case PIPE_CAP_PREFER_REAL_BUFFER_IN_CONSTBUF0: return 1; case PIPE_CAP_GLSL_ZERO_INIT: diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index 1b93c1a2e53..f15aba76a42 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -977,6 +977,7 @@ enum pipe_cap PIPE_CAP_MAX_TEXTURE_MB, PIPE_CAP_SHADER_ATOMIC_INT64, PIPE_CAP_DEVICE_PROTECTED_CONTENT, + PIPE_CAP_PREFER_REAL_BUFFER_IN_CONSTBUF0, }; /**