Mesa (master): i915: Derive the gl_fragment_program from i915_fragment_program.

Henri Verbeet hverbeet at kemper.freedesktop.org
Mon Mar 7 20:48:59 UTC 2011


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

Author: Henri Verbeet <hverbeet at gmail.com>
Date:   Mon Mar  7 21:15:03 2011 +0100

i915: Derive the gl_fragment_program from i915_fragment_program.

Instead of using the current gl_fragment_program. These aren't necessarily
the same, for example when translate_program() is called by
i915ValidateFragmentProgram().

---

 src/mesa/drivers/dri/i915/i915_fragprog.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c
index 25f4fc3..2bfe665 100644
--- a/src/mesa/drivers/dri/i915/i915_fragprog.c
+++ b/src/mesa/drivers/dri/i915/i915_fragprog.c
@@ -269,7 +269,7 @@ translate_tex_src_target(struct i915_fragment_program *p, GLubyte bit)
 #define EMIT_TEX( OP )						\
 do {								\
    GLuint dim = translate_tex_src_target( p, inst->TexSrcTarget );	\
-   const struct gl_fragment_program *program = p->ctx->FragmentProgram._Current; \
+   const struct gl_fragment_program *program = &p->FragProg;	\
    GLuint unit = program->Base.SamplerUnits[inst->TexSrcUnit];	\
    GLuint sampler = i915_emit_decl(p, REG_TYPE_S,		\
 				   unit, dim);			\
@@ -304,7 +304,7 @@ do {									\
  */
 static void calc_live_regs( struct i915_fragment_program *p )
 {
-    const struct gl_fragment_program *program = p->ctx->FragmentProgram._Current;
+    const struct gl_fragment_program *program = &p->FragProg;
     GLuint regsUsed = 0xffff0000;
     uint8_t live_components[16] = { 0, };
     GLint i;
@@ -344,7 +344,7 @@ static void calc_live_regs( struct i915_fragment_program *p )
 static GLuint get_live_regs( struct i915_fragment_program *p, 
                              const struct prog_instruction *inst )
 {
-    const struct gl_fragment_program *program = p->ctx->FragmentProgram._Current;
+    const struct gl_fragment_program *program = &p->FragProg;
     GLuint nr = inst - program->Base.Instructions;
 
     return p->usedRegs[nr];
@@ -365,8 +365,7 @@ static GLuint get_live_regs( struct i915_fragment_program *p,
 static void
 upload_program(struct i915_fragment_program *p)
 {
-   const struct gl_fragment_program *program =
-      p->ctx->FragmentProgram._Current;
+   const struct gl_fragment_program *program = &p->FragProg;
    const struct prog_instruction *inst = program->Base.Instructions;
 
    if (INTEL_DEBUG & DEBUG_WM)
@@ -1166,7 +1165,7 @@ translate_program(struct i915_fragment_program *p)
 
    if (INTEL_DEBUG & DEBUG_WM) {
       printf("fp:\n");
-      _mesa_print_program(&p->ctx->FragmentProgram._Current->Base);
+      _mesa_print_program(&p->FragProg.Base);
       printf("\n");
    }
 




More information about the mesa-commit mailing list