compiler: add SYSTEM_VALUE_TESS_LEVEL_OUTER/INNER_DEFAULT
authorMarek Olšák <marek.olsak@amd.com>
Thu, 1 Aug 2019 18:38:40 +0000 (14:38 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 12 Aug 2019 18:52:17 +0000 (14:52 -0400)
TCS system values for internal passthru TCS, needed by radeonsi NIR support

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/compiler/nir/nir.c
src/compiler/nir/nir_intrinsics.py
src/compiler/shader_enums.h
src/gallium/auxiliary/nir/tgsi_to_nir.c

index 1e6f15517f5342af5ab0d6bf0534ee456245fc4b..6547a29585208e26fba04434758ac9f97cb855a8 100644 (file)
@@ -1986,6 +1986,10 @@ nir_intrinsic_from_system_value(gl_system_value val)
       return nir_intrinsic_load_tess_level_outer;
    case SYSTEM_VALUE_TESS_LEVEL_INNER:
       return nir_intrinsic_load_tess_level_inner;
+   case SYSTEM_VALUE_TESS_LEVEL_OUTER_DEFAULT:
+      return nir_intrinsic_load_tess_level_outer_default;
+   case SYSTEM_VALUE_TESS_LEVEL_INNER_DEFAULT:
+      return nir_intrinsic_load_tess_level_inner_default;
    case SYSTEM_VALUE_VERTICES_IN:
       return nir_intrinsic_load_patch_vertices_in;
    case SYSTEM_VALUE_HELPER_INVOCATION:
@@ -2079,6 +2083,10 @@ nir_system_value_from_intrinsic(nir_intrinsic_op intrin)
       return SYSTEM_VALUE_TESS_LEVEL_OUTER;
    case nir_intrinsic_load_tess_level_inner:
       return SYSTEM_VALUE_TESS_LEVEL_INNER;
+   case nir_intrinsic_load_tess_level_outer_default:
+      return SYSTEM_VALUE_TESS_LEVEL_OUTER_DEFAULT;
+   case nir_intrinsic_load_tess_level_inner_default:
+      return SYSTEM_VALUE_TESS_LEVEL_INNER_DEFAULT;
    case nir_intrinsic_load_patch_vertices_in:
       return SYSTEM_VALUE_VERTICES_IN;
    case nir_intrinsic_load_helper_invocation:
index f4ca623bb3d1dc1434c6363e4275f7e7e7269822..e1b336c2f60fa052262ab74ed551ef0f96483d4e 100644 (file)
@@ -559,6 +559,8 @@ system_value("invocation_id", 1)
 system_value("tess_coord", 3)
 system_value("tess_level_outer", 4)
 system_value("tess_level_inner", 2)
+system_value("tess_level_outer_default", 4)
+system_value("tess_level_inner_default", 2)
 system_value("patch_vertices_in", 1)
 system_value("local_invocation_id", 3)
 system_value("local_invocation_index", 1)
index 20e62da5b11d220aee369a1ddc32c44a2657b1be..1a0ec5fb12aaa16efaa5eae6549f936f4eb4fcfb 100644 (file)
@@ -594,6 +594,8 @@ typedef enum
    SYSTEM_VALUE_PRIMITIVE_ID,
    SYSTEM_VALUE_TESS_LEVEL_OUTER, /**< TES input */
    SYSTEM_VALUE_TESS_LEVEL_INNER, /**< TES input */
+   SYSTEM_VALUE_TESS_LEVEL_OUTER_DEFAULT, /**< TCS input for passthru TCS */
+   SYSTEM_VALUE_TESS_LEVEL_INNER_DEFAULT, /**< TCS input for passthru TCS */
    /*@}*/
 
    /**
index 09d7f18881e0b0ad0c902ae7e3882fd22013abc4..8c49acce60adac5d7f1f129381939bc6fc8d4d00 100644 (file)
@@ -643,6 +643,14 @@ ttn_src_for_file_and_index(struct ttn_compile *c, unsigned file, unsigned index,
          op = nir_intrinsic_load_user_data_amd;
          load = nir_load_user_data_amd(b);
          break;
+      case TGSI_SEMANTIC_TESS_DEFAULT_INNER_LEVEL:
+         op = nir_intrinsic_load_tess_level_inner_default;
+         load = nir_load_tess_level_inner_default(b);
+         break;
+      case TGSI_SEMANTIC_TESS_DEFAULT_OUTER_LEVEL:
+         op = nir_intrinsic_load_tess_level_outer_default;
+         load = nir_load_tess_level_outer_default(b);
+         break;
       default:
          unreachable("bad system value");
       }