mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
anv: Query sampler offset in set_image_clear_color()
Enables set_image_clear_color() to be used in transition_depth_buffer() in a future commit. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35329>
This commit is contained in:
parent
1820db80d6
commit
d21e7e5a9f
1 changed files with 7 additions and 2 deletions
|
|
@ -966,12 +966,17 @@ set_image_clear_color(struct anv_cmd_buffer *cmd_buffer,
|
|||
uint32_t *dw = anv_batch_emitn(&cmd_buffer->batch, 3 + 6,
|
||||
GENX(MI_STORE_DATA_IMM),
|
||||
.StoreQword = true, .Address = addr);
|
||||
|
||||
bool is_depth = aspect & VK_IMAGE_ASPECT_DEPTH_BIT;
|
||||
uint64_t sampler_offset =
|
||||
isl_get_sampler_clear_field_offset(cmd_buffer->device->info,
|
||||
image->view_formats[i], is_depth);
|
||||
dw[3] = clear_color.u32[0];
|
||||
dw[4] = clear_color.u32[1];
|
||||
dw[5] = clear_color.u32[2];
|
||||
dw[6] = clear_color.u32[3];
|
||||
dw[7] = pixel[0];
|
||||
dw[8] = pixel[1];
|
||||
dw[3 + sampler_offset / 4] = pixel[0];
|
||||
dw[4 + sampler_offset / 4] = pixel[1];
|
||||
#else
|
||||
assert(cmd_buffer->device->isl_dev.ss.clear_color_state_size == 0);
|
||||
assert(cmd_buffer->device->isl_dev.ss.clear_value_size == 16);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue