From 52f03f63e77990dbeeb2027ac68077b2f8601989 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Wed, 30 Nov 2022 17:17:48 +0100 Subject: [PATCH] nv50: implement get_compute_state_info Signed-off-by: Karol Herbst Reviewed-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/nouveau/nv50/nv50_state.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/gallium/drivers/nouveau/nv50/nv50_state.c b/src/gallium/drivers/nouveau/nv50/nv50_state.c index 3161549..d2a870d 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_state.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_state.c @@ -877,6 +877,21 @@ nv50_cp_state_bind(struct pipe_context *pipe, void *hwcso) } static void +nv50_get_compute_state_info(struct pipe_context *pipe, void *hwcso, + struct pipe_compute_state_object_info *info) +{ + struct nv50_context *nv50 = nv50_context(pipe); + struct nv50_program *prog = (struct nv50_program *)hwcso; + uint16_t obj_class = nv50->screen->compute->oclass; + uint32_t smregs = obj_class >= NVA3_COMPUTE_CLASS ? 16384 : 8192; + uint32_t threads = smregs / align(prog->max_gpr, 4); + + info->max_threads = MIN2(ROUND_DOWN_TO(threads, 32), 512); + info->private_memory = prog->tls_space; + info->preferred_simd_size = 32; +} + +static void nv50_set_constant_buffer(struct pipe_context *pipe, enum pipe_shader_type shader, uint index, bool take_ownership, @@ -1496,6 +1511,8 @@ nv50_init_state_functions(struct nv50_context *nv50) pipe->delete_gs_state = nv50_sp_state_delete; pipe->delete_compute_state = nv50_sp_state_delete; + pipe->get_compute_state_info = nv50_get_compute_state_info; + pipe->set_blend_color = nv50_set_blend_color; pipe->set_stencil_ref = nv50_set_stencil_ref; pipe->set_clip_state = nv50_set_clip_state; -- 2.7.4