intel/compiler: Create and use struct for VS thread payload

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18176>
This commit is contained in:
Caio Oliveira
2022-08-21 21:22:12 -07:00
committed by Marge Bot
parent 19c6e1b447
commit 0ca65b3c4c
4 changed files with 30 additions and 13 deletions

View File

@@ -93,6 +93,12 @@ struct thread_payload {
virtual ~thread_payload() = default;
};
struct vs_thread_payload : public thread_payload {
vs_thread_payload();
fs_reg urb_handles;
};
struct tcs_thread_payload : public thread_payload {
tcs_thread_payload(const fs_visitor &v);
@@ -173,7 +179,6 @@ public:
bool run_mesh(bool allow_spilling);
void optimize();
void allocate_registers(bool allow_spilling);
void setup_vs_payload();
void setup_gs_payload();
void setup_cs_payload();
bool fixup_sends_duplicate_payload();
@@ -438,6 +443,11 @@ public:
return *this->payload_;
}
vs_thread_payload &vs_payload() {
assert(stage == MESA_SHADER_VERTEX);
return *static_cast<vs_thread_payload *>(this->payload_);
}
tcs_thread_payload &tcs_payload() {
assert(stage == MESA_SHADER_TESS_CTRL);
return *static_cast<tcs_thread_payload *>(this->payload_);