Mesa (main): i965: simplify gfx version checks

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon May 17 09:58:40 UTC 2021


Module: Mesa
Branch: main
Commit: f2c48b04043ab84b91084a38a18b3d2cebf8e087
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f2c48b04043ab84b91084a38a18b3d2cebf8e087

Author: Marcin Ślusarz <marcin.slusarz at intel.com>
Date:   Fri May 14 18:44:56 2021 +0200

i965: simplify gfx version checks

Signed-off-by: Marcin Ślusarz <marcin.slusarz at intel.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10810>

---

 src/mesa/drivers/dri/i965/brw_surface_formats.c | 12 ++++--------
 1 file 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,



More information about the mesa-commit mailing list