Module: Mesa
Branch: master
Commit: f383fec903220ecd18cb0d237b7d9a4de2ae8f2a
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f383fec903220ecd18cb0d237b7d9a4de2ae8f2a

Author: Timothy Arceri <tarc...@itsqueeze.com>
Date:   Tue Feb 13 13:06:51 2018 +1100

radeonsi: set some context vars for nir path

Reviewed-by: Marek Olšák <marek.ol...@amd.com>

---

 src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c 
b/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c
index 8707be504e..4a027d8659 100644
--- a/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c
+++ b/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c
@@ -1253,7 +1253,16 @@ void si_llvm_context_set_tgsi(struct si_shader_context 
*ctx,
        ctx->temps = NULL;
        ctx->temps_count = 0;
 
-       if (!info || !tokens)
+       if (!info)
+               return;
+
+       ctx->num_const_buffers = util_last_bit(info->const_buffers_declared);
+       ctx->num_shader_buffers = util_last_bit(info->shader_buffers_declared);
+
+       ctx->num_samplers = util_last_bit(info->samplers_declared);
+       ctx->num_images = util_last_bit(info->images_declared);
+
+       if (!tokens)
                return;
 
        if (info->array_max[TGSI_FILE_TEMPORARY] > 0) {
@@ -1281,11 +1290,6 @@ void si_llvm_context_set_tgsi(struct si_shader_context 
*ctx,
        ctx->bld_base.emit_fetch_funcs[TGSI_FILE_TEMPORARY] = 
si_llvm_emit_fetch;
        ctx->bld_base.emit_fetch_funcs[TGSI_FILE_OUTPUT] = si_llvm_emit_fetch;
        ctx->bld_base.emit_fetch_funcs[TGSI_FILE_SYSTEM_VALUE] = 
fetch_system_value;
-
-       ctx->num_const_buffers = util_last_bit(info->const_buffers_declared);
-       ctx->num_shader_buffers = util_last_bit(info->shader_buffers_declared);
-       ctx->num_samplers = util_last_bit(info->samplers_declared);
-       ctx->num_images = util_last_bit(info->images_declared);
 }
 
 void si_llvm_create_func(struct si_shader_context *ctx,

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to