[Mesa-dev] [PATCH 03/10] st/mesa: add PROGRAM_BUFFER, stop using gl_register_file

Ilia Mirkin imirkin at alum.mit.edu
Sun Jan 17 21:51:11 PST 2016


Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index d424e3b..055d187 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -53,6 +53,7 @@
 
 
 #define PROGRAM_IMMEDIATE PROGRAM_FILE_MAX
+#define PROGRAM_BUFFER    (PROGRAM_FILE_MAX + 1)
 #define PROGRAM_ANY_CONST ((1 << PROGRAM_STATE_VAR) |    \
                            (1 << PROGRAM_CONSTANT) |     \
                            (1 << PROGRAM_UNIFORM))
@@ -69,7 +70,7 @@ static int swizzle_for_size(int size);
  */
 class st_src_reg {
 public:
-   st_src_reg(gl_register_file file, int index, const glsl_type *type)
+   st_src_reg(int file, int index, const glsl_type *type)
    {
       this->file = file;
       this->index = index;
@@ -88,7 +89,7 @@ public:
       this->is_double_vertex_input = false;
    }
 
-   st_src_reg(gl_register_file file, int index, int type)
+   st_src_reg(int file, int index, int type)
    {
       this->type = type;
       this->file = file;
@@ -104,7 +105,7 @@ public:
       this->is_double_vertex_input = false;
    }
 
-   st_src_reg(gl_register_file file, int index, int type, int index2D)
+   st_src_reg(int file, int index, int type, int index2D)
    {
       this->type = type;
       this->file = file;
@@ -138,7 +139,7 @@ public:
 
    explicit st_src_reg(st_dst_reg reg);
 
-   gl_register_file file; /**< PROGRAM_* from Mesa */
+   int file; /**< PROGRAM_* from Mesa */
    int index; /**< temporary index, VERT_ATTRIB_*, VARYING_SLOT_*, etc. */
    int index2D;
    GLuint swizzle; /**< SWIZZLE_XYZWONEZERO swizzles from Mesa. */
@@ -203,7 +204,7 @@ public:
 
    explicit st_dst_reg(st_src_reg reg);
 
-   gl_register_file file; /**< PROGRAM_* from Mesa */
+   int file; /**< PROGRAM_* from Mesa */
    int index; /**< temporary index, VERT_ATTRIB_*, VARYING_SLOT_*, etc. */
    int index2D;
    int writemask; /**< Bitfield of WRITEMASK_[XYZW] */
@@ -273,14 +274,14 @@ public:
 
 class variable_storage : public exec_node {
 public:
-   variable_storage(ir_variable *var, gl_register_file file, int index,
+   variable_storage(ir_variable *var, int file, int index,
                     unsigned array_id = 0)
       : file(file), index(index), var(var), array_id(array_id)
    {
       /* empty */
    }
 
-   gl_register_file file;
+   int file;
    int index;
    ir_variable *var; /* variable that maps to this, if any */
    unsigned array_id;
@@ -401,7 +402,7 @@ public:
 
    variable_storage *find_variable_storage(ir_variable *var);
 
-   int add_constant(gl_register_file file, gl_constant_value values[8],
+   int add_constant(int file, gl_constant_value values[8],
                     int size, int datatype, GLuint *swizzle_out);
 
    function_entry *get_function_signature(ir_function_signature *sig);
@@ -990,7 +991,7 @@ glsl_to_tgsi_visitor::emit_arl(ir_instruction *ir,
 }
 
 int
-glsl_to_tgsi_visitor::add_constant(gl_register_file file,
+glsl_to_tgsi_visitor::add_constant(int file,
                                    gl_constant_value values[8], int size, int datatype,
                                    GLuint *swizzle_out)
 {
@@ -4550,7 +4551,7 @@ emit_immediate(struct st_translate *t,
  * Map a glsl_to_tgsi dst register to a TGSI ureg_dst register.
  */
 static struct ureg_dst
-dst_register(struct st_translate *t, gl_register_file file, unsigned index,
+dst_register(struct st_translate *t, int file, unsigned index,
              unsigned array_id)
 {
    unsigned array;
-- 
2.4.10



More information about the mesa-dev mailing list