svga: Increase max_combined_shader_output_resources and SSBO limit to 16

The gl43 capability indicates we have a DX11.1+ device which supports
64 UAVs shared across all stages. This limit is roughly equivalent to
GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES which is controlled by
caps.max_combined_shader_output_resources which we currently set to
SVGA_MAX_SHADER_BUFFERS (8) which is probably too low since this limit
is also supposed to include render targets which we also set to 8.

The shader linker will validate that the pipeline does not exceed this
combined limit so we don't have to worry about the sum of the max for all
stages (16*5=80) now exceeding it.

Increasing the combined limt and the number of SSBOs from 8 to 16 allows
Blender to run as it requires 12 SSBOs. In theory we could increase the
combined limit to 56 but these limits are poorly documented and
implemented.

Signed-off-by: Ian Forbes <ian.forbes@broadcom.com>
This commit is contained in:
Ian Forbes 2025-12-12 10:01:58 -06:00
parent f8feed17e1
commit f219b9e14a
3 changed files with 8 additions and 7 deletions

View file

@ -85,9 +85,10 @@ enum svga_hud {
#define CONST0_UPLOAD_ALIGNMENT 256
#define SVGA_MAX_UAVIEWS SVGA3D_DX11_1_MAX_UAVIEWS
#define SVGA_MAX_IMAGES SVGA3D_DX11_MAX_UAVIEWS
#define SVGA_MAX_SHADER_BUFFERS SVGA3D_DX11_MAX_UAVIEWS
#define SVGA_MAX_SHADER_BUFFERS 16
#define SVGA_MAX_ATOMIC_BUFFERS SVGA3D_DX11_MAX_UAVIEWS
enum svga_surface_state
{
SVGA_SURFACE_STATE_CREATED,
@ -365,7 +366,7 @@ struct svga_state
/* HW atomic buffers */
unsigned num_atomic_buffers;
struct svga_shader_buffer atomic_buffers[SVGA_MAX_SHADER_BUFFERS];
struct svga_shader_buffer atomic_buffers[SVGA_MAX_ATOMIC_BUFFERS];
struct {
/* Determine the layout of the grid (in block units) to be used. */

View file

@ -131,10 +131,10 @@ struct svga_compile_key
unsigned sampler_index:5;
} tex[PIPE_MAX_SAMPLERS];
unsigned uav_splice_index:4; /* starting uav index */
unsigned srv_raw_constbuf_index:8; /* start index for srv raw buffers */
unsigned srv_raw_shaderbuf_index:8; /* start index for srv raw shader bufs */
unsigned image_size_used:1;
uint8_t uav_splice_index; /* starting uav index */
uint8_t srv_raw_constbuf_index; /* start index for srv raw buffers */
uint8_t srv_raw_shaderbuf_index; /* start index for srv raw shader bufs */
bool image_size_used;
uint16_t raw_constbufs; /* bitmask of raw constant buffers */
uint64_t raw_shaderbufs; /* bitmask of raw shader buffers */

View file

@ -11,8 +11,8 @@
struct svga_shader_buffer {
struct pipe_shader_buffer desc;
struct pipe_resource *resource;
unsigned uav_index;
struct svga_winsys_surface *handle;
unsigned uav_index;
bool writeAccess;
};