mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 06:58:05 +02:00
anv: Move the gfx9 sRGB sampling clear color code
Simplify set_image_clear_color() by restricting the gfx9-specific code to the gfx9 #ifdef. 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
d21e7e5a9f
commit
e0bce5650c
2 changed files with 6 additions and 15 deletions
|
|
@ -5802,7 +5802,8 @@ anv_image_get_clear_color_addr(UNUSED const struct anv_device *device,
|
|||
if (view_format == ISL_FORMAT_UNSUPPORTED)
|
||||
view_format = image->planes[plane].primary_surface.isl.format;
|
||||
|
||||
uint64_t access_offset = device->info->ver == 9 && for_sampler ? 16 : 0;
|
||||
uint64_t access_offset = device->info->ver == 9 && for_sampler &&
|
||||
isl_format_is_srgb(view_format) ? 16 : 0;
|
||||
const unsigned clear_state_size = device->info->ver >= 11 ? 64 : 32;
|
||||
for (int i = 0; i < image->num_view_formats; i++) {
|
||||
if (view_format == image->view_formats[i]) {
|
||||
|
|
|
|||
|
|
@ -945,16 +945,6 @@ set_image_clear_color(struct anv_cmd_buffer *cmd_buffer,
|
|||
isl_color_value_unpack(&clear_color, image->view_formats[i], pixel);
|
||||
}
|
||||
|
||||
UNUSED union isl_color_value sample_color = clear_color;
|
||||
if (isl_format_is_srgb(image->view_formats[i])) {
|
||||
sample_color.f32[0] =
|
||||
util_format_linear_to_srgb_float(clear_color.f32[0]);
|
||||
sample_color.f32[1] =
|
||||
util_format_linear_to_srgb_float(clear_color.f32[1]);
|
||||
sample_color.f32[2] =
|
||||
util_format_linear_to_srgb_float(clear_color.f32[2]);
|
||||
}
|
||||
|
||||
const struct anv_address addr =
|
||||
anv_image_get_clear_color_addr(cmd_buffer->device, image,
|
||||
image->view_formats[i], aspect,
|
||||
|
|
@ -987,10 +977,10 @@ set_image_clear_color(struct anv_cmd_buffer *cmd_buffer,
|
|||
dw[4] = clear_color.u32[1];
|
||||
dw[5] = clear_color.u32[2];
|
||||
dw[6] = clear_color.u32[3];
|
||||
dw[7] = sample_color.u32[0];
|
||||
dw[8] = sample_color.u32[1];
|
||||
dw[9] = sample_color.u32[2];
|
||||
dw[10] = sample_color.u32[3];
|
||||
dw[7] = fui(util_format_linear_to_srgb_float(clear_color.f32[0]));
|
||||
dw[8] = fui(util_format_linear_to_srgb_float(clear_color.f32[1]));
|
||||
dw[9] = fui(util_format_linear_to_srgb_float(clear_color.f32[2]));
|
||||
dw[10] = clear_color.u32[3];
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue