r600/sfn: Add option to get a temp value for a specific channel
authorGert Wollny <gert.wollny@collabora.com>
Sat, 18 Jul 2020 18:21:10 +0000 (20:21 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 20 Jul 2020 09:32:51 +0000 (09:32 +0000)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5963>

src/gallium/drivers/r600/sfn/sfn_valuepool.cpp
src/gallium/drivers/r600/sfn/sfn_valuepool.h

index 579e39f0acd0827f912b3ffd78f12d22c3987af7..750073a31ac01030f152dfa3818e94a20ca0ec7c 100644 (file)
@@ -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;
index acb0454597433a555fe9641a17992f8b081c0f84..dc44777c204fee9a2eb9dffedc588fb26dd7209a 100644 (file)
@@ -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();