From aca99e6fc9dcbe8f09c5a706cedc9566f3ed3807 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Sat, 18 Jul 2020 20:21:10 +0200 Subject: [PATCH] r600/sfn: Add option to get a temp value for a specific channel Signed-off-by: Gert Wollny Part-of: --- src/gallium/drivers/r600/sfn/sfn_valuepool.cpp | 8 +++++++- src/gallium/drivers/r600/sfn/sfn_valuepool.h | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/r600/sfn/sfn_valuepool.cpp b/src/gallium/drivers/r600/sfn/sfn_valuepool.cpp index 579e39f0acd..750073a31ac 100644 --- a/src/gallium/drivers/r600/sfn/sfn_valuepool.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_valuepool.cpp @@ -151,8 +151,14 @@ PValue ValuePool::from_nir(const nir_alu_src &v, unsigned component) return from_nir(v.src, component, v.swizzle[component]); } -PValue ValuePool::get_temp_register() +PValue ValuePool::get_temp_register(int channel) { + /* Skip to next register to get the channel we want */ + if (next_temp_reg_comp <= channel) + next_temp_reg_comp = channel; + else + next_temp_reg_comp = 4; + if (next_temp_reg_comp > 3) { current_temp_reg_index = allocate_temp_register(); next_temp_reg_comp = 0; diff --git a/src/gallium/drivers/r600/sfn/sfn_valuepool.h b/src/gallium/drivers/r600/sfn/sfn_valuepool.h index acb04545974..dc44777c204 100644 --- a/src/gallium/drivers/r600/sfn/sfn_valuepool.h +++ b/src/gallium/drivers/r600/sfn/sfn_valuepool.h @@ -184,7 +184,7 @@ public: PValue literal(uint32_t value); - PValue get_temp_register(); + PValue get_temp_register(int channel = -1); GPRVector get_temp_vec4(); -- 2.30.2