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

Author: Ian Romanick <[email protected]>
Date:   Fri Oct 16 15:15:00 2009 -0700

Convert gl_program::OutputsWritten to GLbitfield64

This only changes the uses of OutputsWritten in core Mesa to use
64-bits.  None of the drivers have been modified yet.

---

 src/mesa/main/mtypes.h                  |    2 +-
 src/mesa/main/texenvprogram.c           |    2 +-
 src/mesa/shader/prog_print.c            |    6 +++---
 src/mesa/shader/slang/slang_link.c      |    9 +++++----
 src/mesa/state_tracker/st_atom_shader.c |    2 +-
 src/mesa/state_tracker/st_program.c     |    2 +-
 src/mesa/swrast/s_fragprog.c            |    2 +-
 7 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 4b35266..2f8213b 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1764,7 +1764,7 @@ struct gl_program
    struct prog_instruction *Instructions;
 
    GLbitfield InputsRead;     /**< Bitmask of which input regs are read */
-   GLbitfield OutputsWritten; /**< Bitmask of which output regs are written to 
*/
+   GLbitfield64 OutputsWritten; /**< Bitmask of which output regs are written 
*/
    GLbitfield InputFlags[MAX_PROGRAM_INPUTS];   /**< PROG_PARAM_BIT_x flags */
    GLbitfield OutputFlags[MAX_PROGRAM_OUTPUTS]; /**< PROG_PARAM_BIT_x flags */
    GLbitfield TexturesUsed[MAX_TEXTURE_UNITS];  /**< TEXTURE_x_BIT bitmask */
diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c
index d7e77e7..f439d4a 100644
--- a/src/mesa/main/texenvprogram.c
+++ b/src/mesa/main/texenvprogram.c
@@ -367,7 +367,7 @@ static GLbitfield get_fp_input_mask( GLcontext *ctx )
    else {
       /* calculate from vp->outputs */
       struct gl_vertex_program *vprog;
-      GLbitfield vp_outputs;
+      GLbitfield64 vp_outputs;
 
       /* Choose GLSL vertex shader over ARB vertex program.  Need this
        * since vertex shader state validation comes after fragment state
diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c
index ba4d394..52c102c 100644
--- a/src/mesa/shader/prog_print.c
+++ b/src/mesa/shader/prog_print.c
@@ -826,11 +826,11 @@ _mesa_print_program(const struct gl_program *prog)
  * XXX move to imports.[ch] if useful elsewhere.
  */
 static const char *
-binary(GLbitfield val)
+binary(GLbitfield64 val)
 {
-   static char buf[50];
+   static char buf[80];
    GLint i, len = 0;
-   for (i = 31; i >= 0; --i) {
+   for (i = 63; i >= 0; --i) {
       if (val & (1 << i))
          buf[len++] = '1';
       else if (len > 0 || i == 0)
diff --git a/src/mesa/shader/slang/slang_link.c 
b/src/mesa/shader/slang/slang_link.c
index 71038d2..ddd916c 100644
--- a/src/mesa/shader/slang/slang_link.c
+++ b/src/mesa/shader/slang/slang_link.c
@@ -524,13 +524,13 @@ _slang_update_inputs_outputs(struct gl_program *prog)
             if (prog->Target == GL_VERTEX_PROGRAM_ARB) {
                if (inst->DstReg.Index == VERT_RESULT_TEX0) {
                   /* mark all texcoord outputs as written */
-                  const GLbitfield mask =
+                  const GLbitfield64 mask =
                      ((1 << MAX_TEXTURE_COORD_UNITS) - 1) << VERT_RESULT_TEX0;
                   prog->OutputsWritten |= mask;
                }
                else if (inst->DstReg.Index == VERT_RESULT_VAR0) {
                   /* mark all generic varying outputs as written */
-                  const GLbitfield mask =
+                  const GLbitfield64 mask =
                      ((1 << MAX_VARYING) - 1) << VERT_RESULT_VAR0;
                   prog->OutputsWritten |= mask;
                }
@@ -821,7 +821,7 @@ _slang_link(GLcontext *ctx,
    if (shProg->FragmentProgram) {
       const GLbitfield varyingRead
          = shProg->FragmentProgram->Base.InputsRead >> FRAG_ATTRIB_VAR0;
-      const GLbitfield varyingWritten = shProg->VertexProgram ?
+      const GLbitfield64 varyingWritten = shProg->VertexProgram ?
          shProg->VertexProgram->Base.OutputsWritten >> VERT_RESULT_VAR0 : 0x0;
       if ((varyingRead & varyingWritten) != varyingRead) {
          link_error(shProg,
@@ -832,7 +832,8 @@ _slang_link(GLcontext *ctx,
 
    /* check that gl_FragColor and gl_FragData are not both written to */
    if (shProg->FragmentProgram) {
-      GLbitfield outputsWritten = shProg->FragmentProgram->Base.OutputsWritten;
+      const GLbitfield64 outputsWritten =
+        shProg->FragmentProgram->Base.OutputsWritten;
       if ((outputsWritten & ((1 << FRAG_RESULT_COLOR))) &&
           (outputsWritten >= (1 << FRAG_RESULT_DATA0))) {
          link_error(shProg, "Fragment program cannot write both gl_FragColor"
diff --git a/src/mesa/state_tracker/st_atom_shader.c 
b/src/mesa/state_tracker/st_atom_shader.c
index ee649be..6e311e5 100644
--- a/src/mesa/state_tracker/st_atom_shader.c
+++ b/src/mesa/state_tracker/st_atom_shader.c
@@ -176,7 +176,7 @@ find_translated_vp(struct st_context *st,
    /* See if we need to translate vertex program to TGSI form */
    if (xvp->serialNo != stvp->serialNo) {
       GLuint outAttr;
-      const GLbitfield outputsWritten = stvp->Base.Base.OutputsWritten;
+      const GLbitfield64 outputsWritten = stvp->Base.Base.OutputsWritten;
       GLuint numVpOuts = 0;
       GLboolean emitPntSize = GL_FALSE, emitBFC0 = GL_FALSE, emitBFC1 = 
GL_FALSE;
       GLbitfield usedGenerics = 0x0;
diff --git a/src/mesa/state_tracker/st_program.c 
b/src/mesa/state_tracker/st_program.c
index a9be80c..2342726 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -469,7 +469,7 @@ st_translate_fragment_program(struct st_context *st,
     */
    {
       uint numColors = 0;
-      GLbitfield outputsWritten = stfp->Base.Base.OutputsWritten;
+      GLbitfield64 outputsWritten = stfp->Base.Base.OutputsWritten;
 
       /* if z is written, emit that first */
       if (outputsWritten & (1 << FRAG_RESULT_DEPTH)) {
diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c
index 77a77f0..61c97d8 100644
--- a/src/mesa/swrast/s_fragprog.c
+++ b/src/mesa/swrast/s_fragprog.c
@@ -190,7 +190,7 @@ run_program(GLcontext *ctx, SWspan *span, GLuint start, 
GLuint end)
 {
    SWcontext *swrast = SWRAST_CONTEXT(ctx);
    const struct gl_fragment_program *program = ctx->FragmentProgram._Current;
-   const GLbitfield outputsWritten = program->Base.OutputsWritten;
+   const GLbitfield64 outputsWritten = program->Base.OutputsWritten;
    struct gl_program_machine *machine = &swrast->FragProgMachine;
    GLuint i;
 

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to