diff options
author | Marcin Ślusarz <marcin.slusarz@intel.com> | 2021-05-14 18:44:56 +0200 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2021-05-17 09:46:45 +0000 |
commit | f2c48b04043ab84b91084a38a18b3d2cebf8e087 (patch) | |
tree | a40714bd4cddf7631a2851c2640d14db64529170 /src/mesa/drivers | |
parent | b1933d769f3148cc9e214fa87a88728a226e4b4a (diff) |
i965: simplify gfx version checks
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10810>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_surface_formats.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_surface_formats.c b/src/mesa/drivers/dri/i965/brw_surface_formats.c index 72fa53d5d71..235c15f2213 100644 --- a/src/mesa/drivers/dri/i965/brw_surface_formats.c +++ b/src/mesa/drivers/dri/i965/brw_surface_formats.c @@ -212,10 +212,6 @@ brw_screen_init_surface_formats(struct brw_screen *screen) memset(&screen->mesa_format_supports_texture, 0, sizeof(screen->mesa_format_supports_texture)); - int gen = devinfo->ver * 10; - if (devinfo->is_g4x || devinfo->is_haswell) - gen += 5; - for (format = MESA_FORMAT_NONE + 1; format < MESA_FORMAT_COUNT; format++) { if (!_mesa_get_format_name(format)) continue; @@ -227,7 +223,7 @@ brw_screen_init_surface_formats(struct brw_screen *screen) /* Only exposed with EXT_memory_object_* support which * is not for older gens. */ - if (gen < 70 && format == MESA_FORMAT_Z_UNORM16) + if (devinfo->ver < 7 && format == MESA_FORMAT_Z_UNORM16) continue; if (texture == ISL_FORMAT_UNSUPPORTED) @@ -322,7 +318,7 @@ brw_screen_init_surface_formats(struct brw_screen *screen) screen->mesa_format_supports_render[MESA_FORMAT_S_UINT8] = true; screen->mesa_format_supports_render[MESA_FORMAT_Z_FLOAT32] = true; screen->mesa_format_supports_render[MESA_FORMAT_Z32_FLOAT_S8X24_UINT] = true; - if (gen >= 80) + if (devinfo->ver >= 8) screen->mesa_format_supports_render[MESA_FORMAT_Z_UNORM16] = true; /* We remap depth formats to a supported texturing format in @@ -348,7 +344,7 @@ brw_screen_init_surface_formats(struct brw_screen *screen) * With the PMA stall workaround in place, Z16 is faster than Z24, as it * should be. */ - if (gen >= 80) + if (devinfo->ver >= 8) screen->mesa_format_supports_texture[MESA_FORMAT_Z_UNORM16] = true; /* The RGBX formats are not renderable. Normally these get mapped @@ -364,7 +360,7 @@ brw_screen_init_surface_formats(struct brw_screen *screen) * doesn't implement this swizzle override. We don't need to do this for * BGRX because that actually is supported natively on Gfx8+. */ - if (gen >= 90) { + if (devinfo->ver >= 9) { static const mesa_format rgbx_formats[] = { MESA_FORMAT_R8G8B8X8_UNORM, MESA_FORMAT_R8G8B8X8_SRGB, |