summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_fragprog.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2007-05-18 14:14:12 -0700
committerEric Anholt <[email protected]>2007-05-18 14:14:12 -0700
commit1bdee1853627e08894bd267b8f0ec176a1b5978f (patch)
tree78c3b8bb81e866de4544d2621abb633b008095ab /src/mesa/swrast/s_fragprog.c
parentc085e350df593ab2af60f53b86265db4c3eab38a (diff)
parent4fca6bfa5d211a093c54b0bbeadaa38081e8c141 (diff)
Merge branch 'master' into i915-unification
Conflicts: src/mesa/drivers/dri/common/dri_bufmgr.c src/mesa/drivers/dri/common/dri_drmpool.c src/mesa/drivers/dri/i915tex/intel_batchpool.c src/mesa/drivers/dri/i915tex/intel_buffer_objects.c src/mesa/drivers/dri/i915tex/intel_regions.c src/mesa/drivers/dri/i915tex/intel_screen.c src/mesa/drivers/dri/i915tex/intel_screen.h
Diffstat (limited to 'src/mesa/swrast/s_fragprog.c')
-rw-r--r--src/mesa/swrast/s_fragprog.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c
index 7f7c0d6db52..e47dbbdaf35 100644
--- a/src/mesa/swrast/s_fragprog.c
+++ b/src/mesa/swrast/s_fragprog.c
@@ -25,7 +25,6 @@
#include "glheader.h"
#include "colormac.h"
#include "context.h"
-#include "prog_execute.h"
#include "prog_instruction.h"
#include "s_fragprog.h"
@@ -100,11 +99,6 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine,
const struct gl_fragment_program *program,
const SWspan *span, GLuint col)
{
- GLuint inputsRead = program->Base.InputsRead;
-
- if (ctx->FragmentProgram.CallbackEnabled)
- inputsRead = ~0;
-
if (program->Base.Target == GL_FRAGMENT_PROGRAM_NV) {
/* Clear temporary registers (undefined for ARB_f_p) */
_mesa_bzero(machine->Temporaries,
@@ -114,8 +108,14 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine,
/* Setup pointer to input attributes */
machine->Attribs = span->array->attribs;
- /* Store front/back facing value in register FOGC.Y */
- machine->Attribs[FRAG_ATTRIB_FOGC][col][1] = (GLfloat) ctx->_Facing;
+ machine->DerivX = (GLfloat (*)[4]) span->attrStepX;
+ machine->DerivY = (GLfloat (*)[4]) span->attrStepY;
+ machine->NumDeriv = FRAG_ATTRIB_MAX;
+
+ if (ctx->Shader.CurrentProgram) {
+ /* Store front/back facing value in register FOGC.Y */
+ machine->Attribs[FRAG_ATTRIB_FOGC][col][1] = (GLfloat) ctx->_Facing;
+ }
machine->CurElement = col;
@@ -142,19 +142,19 @@ 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;
- struct gl_program_machine machine;
+ struct gl_program_machine *machine = &swrast->FragProgMachine;
GLuint i;
for (i = start; i < end; i++) {
if (span->array->mask[i]) {
- init_machine(ctx, &machine, program, span, i);
+ init_machine(ctx, machine, program, span, i);
- if (_mesa_execute_program(ctx, &program->Base, &machine)) {
+ if (_mesa_execute_program(ctx, &program->Base, machine)) {
/* Store result color */
if (outputsWritten & (1 << FRAG_RESULT_COLR)) {
COPY_4V(span->array->attribs[FRAG_ATTRIB_COL0][i],
- machine.Outputs[FRAG_RESULT_COLR]);
+ machine->Outputs[FRAG_RESULT_COLR]);
}
else {
/* Multiple drawbuffers / render targets
@@ -165,14 +165,14 @@ run_program(GLcontext *ctx, SWspan *span, GLuint start, GLuint end)
for (output = 0; output < swrast->_NumColorOutputs; output++) {
if (outputsWritten & (1 << (FRAG_RESULT_DATA0 + output))) {
COPY_4V(span->array->attribs[FRAG_ATTRIB_COL0+output][i],
- machine.Outputs[FRAG_RESULT_DATA0 + output]);
+ machine->Outputs[FRAG_RESULT_DATA0 + output]);
}
}
}
/* Store result depth/z */
if (outputsWritten & (1 << FRAG_RESULT_DEPR)) {
- const GLfloat depth = machine.Outputs[FRAG_RESULT_DEPR][2];
+ const GLfloat depth = machine->Outputs[FRAG_RESULT_DEPR][2];
if (depth <= 0.0)
span->array->z[i] = 0;
else if (depth >= 1.0)