anv: Add a vk_to_isl_color helper
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
This commit is contained in:
@@ -802,9 +802,6 @@ void anv_CmdClearColorImage(
|
|||||||
struct blorp_batch batch;
|
struct blorp_batch batch;
|
||||||
blorp_batch_init(&cmd_buffer->device->blorp, &batch, cmd_buffer, 0);
|
blorp_batch_init(&cmd_buffer->device->blorp, &batch, cmd_buffer, 0);
|
||||||
|
|
||||||
union isl_color_value clear_color;
|
|
||||||
memcpy(clear_color.u32, pColor->uint32, sizeof(pColor->uint32));
|
|
||||||
|
|
||||||
struct blorp_surf surf;
|
struct blorp_surf surf;
|
||||||
get_blorp_surf_for_anv_image(image, VK_IMAGE_ASPECT_COLOR_BIT,
|
get_blorp_surf_for_anv_image(image, VK_IMAGE_ASPECT_COLOR_BIT,
|
||||||
image->aux_usage, &surf);
|
image->aux_usage, &surf);
|
||||||
@@ -836,7 +833,7 @@ void anv_CmdClearColorImage(
|
|||||||
src_format.isl_format, src_format.swizzle,
|
src_format.isl_format, src_format.swizzle,
|
||||||
level, base_layer, layer_count,
|
level, base_layer, layer_count,
|
||||||
0, 0, level_width, level_height,
|
0, 0, level_width, level_height,
|
||||||
clear_color, color_write_disable);
|
vk_to_isl_color(*pColor), color_write_disable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -963,9 +960,8 @@ clear_color_attachment(struct anv_cmd_buffer *cmd_buffer,
|
|||||||
uint32_t binding_table =
|
uint32_t binding_table =
|
||||||
binding_table_for_surface_state(cmd_buffer, att_state->color_rt_state);
|
binding_table_for_surface_state(cmd_buffer, att_state->color_rt_state);
|
||||||
|
|
||||||
union isl_color_value clear_color;
|
union isl_color_value clear_color =
|
||||||
memcpy(clear_color.u32, attachment->clearValue.color.uint32,
|
vk_to_isl_color(attachment->clearValue.color);
|
||||||
sizeof(clear_color.u32));
|
|
||||||
|
|
||||||
for (uint32_t r = 0; r < rectCount; ++r) {
|
for (uint32_t r = 0; r < rectCount; ++r) {
|
||||||
const VkOffset2D offset = pRects[r].rect.offset;
|
const VkOffset2D offset = pRects[r].rect.offset;
|
||||||
|
@@ -153,6 +153,19 @@ anv_clear_mask(uint32_t *inout_mask, uint32_t clear_mask)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline union isl_color_value
|
||||||
|
vk_to_isl_color(VkClearColorValue color)
|
||||||
|
{
|
||||||
|
return (union isl_color_value) {
|
||||||
|
.u32 = {
|
||||||
|
color.uint32[0],
|
||||||
|
color.uint32[1],
|
||||||
|
color.uint32[2],
|
||||||
|
color.uint32[3],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
#define for_each_bit(b, dword) \
|
#define for_each_bit(b, dword) \
|
||||||
for (uint32_t __dword = (dword); \
|
for (uint32_t __dword = (dword); \
|
||||||
(b) = __builtin_ffs(__dword) - 1, __dword; \
|
(b) = __builtin_ffs(__dword) - 1, __dword; \
|
||||||
|
Reference in New Issue
Block a user