mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 20:18:12 +02:00
anv: Plumb the shader into push constant helpers
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10571>
(cherry picked from commit 24b3e71fa9)
This commit is contained in:
parent
88bd86baa0
commit
49f846f596
2 changed files with 10 additions and 10 deletions
|
|
@ -202,7 +202,7 @@
|
|||
"description": "anv: Plumb the shader into push constant helpers",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2973,7 +2973,7 @@ cmd_buffer_emit_descriptor_pointers(struct anv_cmd_buffer *cmd_buffer,
|
|||
|
||||
static struct anv_address
|
||||
get_push_range_address(struct anv_cmd_buffer *cmd_buffer,
|
||||
gl_shader_stage stage,
|
||||
const struct anv_shader_bin *shader,
|
||||
const struct anv_push_range *range)
|
||||
{
|
||||
struct anv_cmd_graphics_state *gfx_state = &cmd_buffer->state.gfx;
|
||||
|
|
@ -3044,10 +3044,10 @@ get_push_range_address(struct anv_cmd_buffer *cmd_buffer,
|
|||
*/
|
||||
static uint32_t
|
||||
get_push_range_bound_size(struct anv_cmd_buffer *cmd_buffer,
|
||||
gl_shader_stage stage,
|
||||
const struct anv_shader_bin *shader,
|
||||
const struct anv_push_range *range)
|
||||
{
|
||||
assert(stage != MESA_SHADER_COMPUTE);
|
||||
assert(shader->stage != MESA_SHADER_COMPUTE);
|
||||
const struct anv_cmd_graphics_state *gfx_state = &cmd_buffer->state.gfx;
|
||||
switch (range->set) {
|
||||
case ANV_DESCRIPTOR_SET_DESCRIPTORS: {
|
||||
|
|
@ -3273,8 +3273,8 @@ cmd_buffer_flush_push_constants(struct anv_cmd_buffer *cmd_buffer,
|
|||
if (!anv_pipeline_has_stage(pipeline, stage))
|
||||
continue;
|
||||
|
||||
const struct anv_pipeline_bind_map *bind_map =
|
||||
&pipeline->shaders[stage]->bind_map;
|
||||
const struct anv_shader_bin *shader = pipeline->shaders[stage];
|
||||
const struct anv_pipeline_bind_map *bind_map = &shader->bind_map;
|
||||
struct anv_push_constants *push = &gfx_state->base.push_constants;
|
||||
|
||||
push->push_reg_mask[stage] = 0;
|
||||
|
|
@ -3288,7 +3288,7 @@ cmd_buffer_flush_push_constants(struct anv_cmd_buffer *cmd_buffer,
|
|||
continue;
|
||||
|
||||
unsigned bound_size =
|
||||
get_push_range_bound_size(cmd_buffer, stage, range);
|
||||
get_push_range_bound_size(cmd_buffer, shader, range);
|
||||
if (bound_size >= range->start * 32) {
|
||||
unsigned bound_regs =
|
||||
MIN2(DIV_ROUND_UP(bound_size, 32) - range->start,
|
||||
|
|
@ -3318,8 +3318,8 @@ cmd_buffer_flush_push_constants(struct anv_cmd_buffer *cmd_buffer,
|
|||
|
||||
struct anv_address buffers[4] = {};
|
||||
if (anv_pipeline_has_stage(pipeline, stage)) {
|
||||
const struct anv_pipeline_bind_map *bind_map =
|
||||
&pipeline->shaders[stage]->bind_map;
|
||||
const struct anv_shader_bin *shader = pipeline->shaders[stage];
|
||||
const struct anv_pipeline_bind_map *bind_map = &shader->bind_map;
|
||||
|
||||
/* We have to gather buffer addresses as a second step because the
|
||||
* loop above puts data into the push constant area and the call to
|
||||
|
|
@ -3333,7 +3333,7 @@ cmd_buffer_flush_push_constants(struct anv_cmd_buffer *cmd_buffer,
|
|||
if (range->length == 0)
|
||||
break;
|
||||
|
||||
buffers[i] = get_push_range_address(cmd_buffer, stage, range);
|
||||
buffers[i] = get_push_range_address(cmd_buffer, shader, range);
|
||||
max_push_range = MAX2(max_push_range, range->length);
|
||||
buffer_count++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue