[Mesa-dev] [PATCH 09/16] mesa/st: get immediate size from param list

Timothy Arceri tarceri at itsqueeze.com
Tue Jun 20 01:50:38 UTC 2017


---
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 2 +-
 src/mesa/state_tracker/st_mesa_to_tgsi.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 885fd7d..1bd55e4 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -6651,21 +6651,21 @@ st_translate_program(
           * indirect addressing is only valid within the referenced
           * array.
           */
          case PROGRAM_CONSTANT:
             if (program->indirect_addr_consts)
                t->constants[i] = ureg_DECL_constant(ureg, i);
             else
                t->constants[i] = emit_immediate(t,
                                                 proginfo->Parameters->ParameterValues + pvo,
                                                 proginfo->Parameters->Parameters[i].DataType,
-                                                4);
+                                                proginfo->Parameters->Parameters[i].Size);
             break;
          default:
             break;
          }
       }
    }
 
    for (i = 0; i < proginfo->info.num_ubos; i++) {
       unsigned size = proginfo->sh.UniformBlocks[i]->UniformBufferSize;
       unsigned num_const_vecs = (size + 15) / 16;
diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c
index 640e175..30dc5cb 100644
--- a/src/mesa/state_tracker/st_mesa_to_tgsi.c
+++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c
@@ -1012,21 +1012,21 @@ st_translate_mesa_program(
              * indirect addressing is only valid within the referenced
              * array.
              */
          case PROGRAM_CONSTANT:
             if (program->arb.IndirectRegisterFiles & PROGRAM_ANY_CONST)
                t->constants[i] = ureg_DECL_constant( ureg, i );
             else
                t->constants[i] = 
                   ureg_DECL_immediate(ureg,
                                       (const float*) program->Parameters->ParameterValues + pvo,
-                                      4);
+                                      program->Parameters->Parameters[i].Size);
             break;
          default:
             break;
          }
       }
    }
 
    /* texture samplers */
    for (i = 0; i < ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits; i++) {
       if (program->SamplersUsed & (1u << i)) {
-- 
2.9.4



More information about the mesa-dev mailing list