intel/fs/xe2+: Update TES payload setup for Xe2 reg size.
authorFrancisco Jerez <currojerez@riseup.net>
Wed, 7 Sep 2022 21:11:05 +0000 (14:11 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Thu, 21 Sep 2023 00:19:36 +0000 (17:19 -0700)
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>

src/intel/compiler/brw_fs.cpp
src/intel/compiler/brw_fs.h
src/intel/compiler/brw_fs_thread_payload.cpp

index b875bc6..8ccabc8 100644 (file)
@@ -7145,7 +7145,7 @@ fs_visitor::run_tes()
 {
    assert(stage == MESA_SHADER_TESS_EVAL);
 
-   payload_ = new tes_thread_payload();
+   payload_ = new tes_thread_payload(*this);
 
    emit_nir_code();
 
index 2c2bb6b..fc8f0ed 100644 (file)
@@ -112,7 +112,7 @@ struct tcs_thread_payload : public thread_payload {
 };
 
 struct tes_thread_payload : public thread_payload {
-   tes_thread_payload();
+   tes_thread_payload(const fs_visitor &v);
 
    fs_reg patch_urb_input;
    fs_reg primitive_id;
index 1b6ff46..89acc4a 100644 (file)
@@ -77,20 +77,26 @@ tcs_thread_payload::tcs_thread_payload(const fs_visitor &v)
    }
 }
 
-tes_thread_payload::tes_thread_payload()
+tes_thread_payload::tes_thread_payload(const fs_visitor &v)
 {
+   unsigned r = 0;
+
    /* R0: Thread Header. */
    patch_urb_input = retype(brw_vec1_grf(0, 0), BRW_REGISTER_TYPE_UD);
    primitive_id = brw_vec1_grf(0, 1);
+   r += reg_unit(v.devinfo);
 
    /* R1-3: gl_TessCoord.xyz. */
-   for (unsigned i = 0; i < 3; i++)
-      coords[i] = brw_vec8_grf(1 + i, 0);
+   for (unsigned i = 0; i < 3; i++) {
+      coords[i] = brw_vec8_grf(r, 0);
+      r += reg_unit(v.devinfo);
+   }
 
    /* R4: URB output handles. */
-   urb_output = brw_ud8_grf(4, 0);
+   urb_output = brw_ud8_grf(r, 0);
+   r += reg_unit(v.devinfo);
 
-   num_regs = 5;
+   num_regs = r;
 }
 
 gs_thread_payload::gs_thread_payload(const fs_visitor &v)