radv: cleanup using device/physical_device during pipeline creation

This removes a TON of pipeline->device occurences which were a mess.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16603>
This commit is contained in:
Samuel Pitoiset 2022-05-18 14:59:42 +02:00 committed by Marge Bot
parent 7fb4849314
commit fc3717df0c
4 changed files with 190 additions and 172 deletions

View File

@ -1058,7 +1058,7 @@ radv_update_binning_state(struct radv_cmd_buffer *cmd_buffer, struct radv_pipeli
{
const struct radv_pipeline *old_pipeline = cmd_buffer->state.emitted_pipeline;
if (pipeline->device->physical_device->rad_info.gfx_level < GFX9)
if (cmd_buffer->device->physical_device->rad_info.gfx_level < GFX9)
return;
if (old_pipeline &&

File diff suppressed because it is too large Load Diff

View File

@ -1098,7 +1098,7 @@ radv_lower_io_to_mem(struct radv_device *device, struct radv_pipeline_stage *sta
}
bool
radv_consider_culling(struct radv_device *device, struct nir_shader *nir, uint64_t ps_inputs_read,
radv_consider_culling(const struct radv_physical_device *pdevice, struct nir_shader *nir, uint64_t ps_inputs_read,
unsigned num_vertices_per_primitive, const struct radv_shader_info *info)
{
/* Culling doesn't make sense for meta shaders. */
@ -1113,15 +1113,15 @@ radv_consider_culling(struct radv_device *device, struct nir_shader *nir, uint64
if (info->vs.has_prolog)
return false;
if (!device->physical_device->use_ngg_culling)
if (!pdevice->use_ngg_culling)
return false;
/* Shader based culling efficiency can depend on PS throughput.
* Estimate an upper limit for PS input param count based on GPU info.
*/
unsigned max_ps_params;
unsigned max_render_backends = device->physical_device->rad_info.max_render_backends;
unsigned max_se = device->physical_device->rad_info.max_se;
unsigned max_render_backends = pdevice->rad_info.max_render_backends;
unsigned max_se = pdevice->rad_info.max_se;
if (max_render_backends / max_se == 4)
max_ps_params = 6; /* Navi21 and other GFX10.3 dGPUs. */

View File

@ -681,7 +681,7 @@ bool radv_lower_io_to_mem(struct radv_device *device, struct radv_pipeline_stage
void radv_lower_ngg(struct radv_device *device, struct radv_pipeline_stage *ngg_stage,
const struct radv_pipeline_key *pl_key);
bool radv_consider_culling(struct radv_device *device, struct nir_shader *nir,
bool radv_consider_culling(const struct radv_physical_device *pdevice, struct nir_shader *nir,
uint64_t ps_inputs_read, unsigned num_vertices_per_primitive,
const struct radv_shader_info *info);