gallium: add get_compute_state_info

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>
This commit is contained in:
Karol Herbst 2022-11-16 23:22:13 +01:00 committed by Marge Bot
parent 87147e2b09
commit 6305d1cb1c
2 changed files with 25 additions and 0 deletions

View file

@ -46,6 +46,7 @@ struct pipe_blend_state;
struct pipe_blit_info;
struct pipe_box;
struct pipe_clip_state;
struct pipe_compute_state_object_info;
struct pipe_constant_buffer;
struct pipe_depth_stencil_alpha_state;
struct pipe_device_reset_callback;
@ -933,6 +934,9 @@ struct pipe_context {
void (*bind_compute_state)(struct pipe_context *, void *);
void (*delete_compute_state)(struct pipe_context *, void *);
void (*get_compute_state_info)(struct pipe_context *, void *,
struct pipe_compute_state_object_info *);
/**
* Bind an array of shader resources that will be used by the
* compute program. Any resources that were previously bound to

View file

@ -1034,6 +1034,27 @@ struct pipe_compute_state
unsigned req_input_mem; /**< Required size of the INPUT resource. */
};
struct pipe_compute_state_object_info
{
/**
* Max number of threads per block supported for the given cso.
*/
unsigned max_threads;
/**
* Which multiple should the block size be of for best performance.
*
* E.g. for 8 a block with n * 8 threads would result in optimal utilization
* of the hardware.
*/
unsigned preferred_simd_size;
/**
* How much private memory does this CSO require per thread (a.k.a. NIR scratch memory).
*/
unsigned private_memory;
};
/**
* Structure that contains a callback for device reset messages from the driver
* back to the gallium frontend.