mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +02:00
anv: rename push constant allocation helper
The name was confusing emission & allocation. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39584>
This commit is contained in:
parent
696163d0e2
commit
a21da01994
3 changed files with 20 additions and 21 deletions
|
|
@ -89,9 +89,9 @@ genX(push_constant_alloc_stages)(VkShaderStageFlags active_stages)
|
|||
return stages;
|
||||
}
|
||||
|
||||
void genX(batch_emit_push_constants)(struct anv_batch *batch,
|
||||
struct anv_device *device,
|
||||
VkShaderStageFlags stages);
|
||||
void genX(batch_emit_push_constants_alloc)(struct anv_batch *batch,
|
||||
struct anv_device *device,
|
||||
VkShaderStageFlags stages);
|
||||
|
||||
void
|
||||
genX(cmd_buffer_update_color_aux_op)(struct anv_cmd_buffer *cmd_buffer,
|
||||
|
|
|
|||
|
|
@ -36,16 +36,15 @@
|
|||
|
||||
#include "genX_mi_builder.h"
|
||||
|
||||
static VkShaderStageFlags
|
||||
batch_emit_push_constants(struct anv_batch *batch,
|
||||
struct anv_device *device,
|
||||
VkShaderStageFlags stages)
|
||||
static inline void
|
||||
batch_emit_push_constants_alloc(struct anv_batch *batch,
|
||||
struct anv_device *device,
|
||||
VkShaderStageFlags stages)
|
||||
{
|
||||
unsigned push_constant_kb;
|
||||
if (stages & VK_SHADER_STAGE_MESH_BIT_EXT)
|
||||
push_constant_kb = device->info->mesh_max_constant_urb_size_kb;
|
||||
else
|
||||
push_constant_kb = device->info->max_constant_urb_size_kb;
|
||||
const unsigned push_constant_kb =
|
||||
(stages & VK_SHADER_STAGE_MESH_BIT_EXT) ?
|
||||
device->info->mesh_max_constant_urb_size_kb :
|
||||
device->info->max_constant_urb_size_kb;
|
||||
|
||||
/* On Gfx12.5 there is no more push constant allocation required */
|
||||
if (GFX_VERx10 >= 125)
|
||||
|
|
@ -95,16 +94,14 @@ batch_emit_push_constants(struct anv_batch *batch,
|
|||
c.MOCS = anv_mocs(device, NULL, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
return stages;
|
||||
}
|
||||
|
||||
void
|
||||
genX(batch_emit_push_constants)(struct anv_batch *batch,
|
||||
struct anv_device *device,
|
||||
VkShaderStageFlags stages)
|
||||
genX(batch_emit_push_constants_alloc)(struct anv_batch *batch,
|
||||
struct anv_device *device,
|
||||
VkShaderStageFlags stages)
|
||||
{
|
||||
batch_emit_push_constants(batch, device, stages);
|
||||
batch_emit_push_constants_alloc(batch, device, stages);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -114,10 +111,12 @@ cmd_buffer_alloc_gfx_push_constants(struct anv_cmd_buffer *cmd_buffer)
|
|||
const VkShaderStageFlags stages =
|
||||
genX(push_constant_alloc_stages)(gfx->active_stages);
|
||||
|
||||
if (cmd_buffer->state.gfx.push_constant_stages == stages)
|
||||
if (stages == cmd_buffer->state.gfx.push_constant_stages)
|
||||
return;
|
||||
|
||||
batch_emit_push_constants(&cmd_buffer->batch, cmd_buffer->device, stages);
|
||||
batch_emit_push_constants_alloc(&cmd_buffer->batch,
|
||||
cmd_buffer->device,
|
||||
stages);
|
||||
|
||||
gfx->push_constant_stages = stages;
|
||||
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ genX(emit_simpler_shader_init_fragment)(struct anv_simple_shader *state)
|
|||
|
||||
VkShaderStageFlags push_stages =
|
||||
genX(push_constant_alloc_stages)(VK_SHADER_STAGE_FRAGMENT_BIT);
|
||||
genX(batch_emit_push_constants)(batch, device, push_stages);
|
||||
genX(batch_emit_push_constants_alloc)(batch, device, push_stages);
|
||||
state->cmd_buffer->state.gfx.push_constant_stages = push_stages;
|
||||
|
||||
#if GFX_VERx10 == 125
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue