zink: add a driver workaround for broken L4A4 on nvidia

KHR-GLES2.core.internalformat.copy_tex_image.luminance4_alpha4_oes,Fail
KHR-GLES2.core.internalformat.texture2d.luminance_alpha_unsigned_byte_luminance4_alpha4_oes,Fail

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17687>
This commit is contained in:
Mike Blumenkrantz 2022-08-03 16:33:10 -04:00 committed by Marge Bot
parent d49586cfae
commit 206aad7c5c
2 changed files with 4 additions and 1 deletions

View file

@ -1517,7 +1517,8 @@ emulate_x8(enum pipe_format format)
VkFormat
zink_get_format(struct zink_screen *screen, enum pipe_format format)
{
format = zink_format_get_emulated_alpha(format);
if (!screen->driver_workarounds.broken_l4a4 || format != PIPE_FORMAT_L4A4_UNORM)
format = zink_format_get_emulated_alpha(format);
VkFormat ret = zink_pipe_format_to_vk_format(emulate_x8(format));
@ -2127,6 +2128,7 @@ init_driver_workarounds(struct zink_screen *screen)
screen->driver_workarounds.force_pipeline_library);
if (!screen->driver_workarounds.force_pipeline_library)
screen->info.have_EXT_graphics_pipeline_library = false;
screen->driver_workarounds.broken_l4a4 = screen->info.driver_props.driverID == VK_DRIVER_ID_NVIDIA_PROPRIETARY;
screen->driver_workarounds.color_write_missing =
!screen->info.have_EXT_color_write_enable ||
!screen->info.cwrite_feats.colorWriteEnable;

View file

@ -208,6 +208,7 @@ struct zink_screen {
VkExtent2D maxSampleLocationGridSize[5];
struct {
bool broken_l4a4;
bool color_write_missing;
bool depth_clip_control_missing;
bool implicit_sync;