summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_fragprog.c
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2009-11-17 16:10:24 -0800
committerIan Romanick <ian.d.romanick@intel.com>2009-11-17 16:25:38 -0800
commit5606dfb572bf4b89b4882265924705bacc8c182b (patch)
treef168c4f81f99fbe5741e6b10b958e0939f444397 /src/mesa/swrast/s_fragprog.c
parentb43887cf7e64cc44cf1409f910d1324549b265d2 (diff)
Merge branch 'outputswritten64'
Add a GLbitfield64 type and several macros to operate on 64-bit fields. The OutputsWritten field of gl_program is changed to use that type. This results in a fair amount of fallout in drivers that use programs. No changes are strictly necessary at this point as all bits used are below the 32-bit boundary. Fairly soon several bits will be added for clip distances written by a vertex shader. This will cause several bits used for varyings to be pushed above the 32-bit boundary. This will affect any drivers that support GLSL. At this point, only the i965 driver has been modified to support this eventuality. I did this as a "squash" merge. There were several places through the outputswritten64 branch where things were broken. I foresee this causing difficulties later for bisecting. The history is still available in the branch. Conflicts: src/mesa/drivers/dri/i965/brw_wm.h
Diffstat (limited to 'src/mesa/swrast/s_fragprog.c')
-rw-r--r--src/mesa/swrast/s_fragprog.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c
index 77a77f0bcb..a22d34415d 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;
@@ -201,7 +201,7 @@ run_program(GLcontext *ctx, SWspan *span, GLuint start, GLuint end)
if (_mesa_execute_program(ctx, &program->Base, machine)) {
/* Store result color */
- if (outputsWritten & (1 << FRAG_RESULT_COLOR)) {
+ if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_COLOR)) {
COPY_4V(span->array->attribs[FRAG_ATTRIB_COL0][i],
machine->Outputs[FRAG_RESULT_COLOR]);
}
@@ -212,7 +212,7 @@ run_program(GLcontext *ctx, SWspan *span, GLuint start, GLuint end)
*/
GLuint buf;
for (buf = 0; buf < ctx->DrawBuffer->_NumColorDrawBuffers; buf++) {
- if (outputsWritten & (1 << (FRAG_RESULT_DATA0 + buf))) {
+ if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_DATA0 + buf)) {
COPY_4V(span->array->attribs[FRAG_ATTRIB_COL0 + buf][i],
machine->Outputs[FRAG_RESULT_DATA0 + buf]);
}
@@ -220,7 +220,7 @@ run_program(GLcontext *ctx, SWspan *span, GLuint start, GLuint end)
}
/* Store result depth/z */
- if (outputsWritten & (1 << FRAG_RESULT_DEPTH)) {
+ if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) {
const GLfloat depth = machine->Outputs[FRAG_RESULT_DEPTH][2];
if (depth <= 0.0)
span->array->z[i] = 0;
@@ -256,12 +256,12 @@ _swrast_exec_fragment_program( GLcontext *ctx, SWspan *span )
run_program(ctx, span, 0, span->end);
- if (program->Base.OutputsWritten & (1 << FRAG_RESULT_COLOR)) {
+ if (program->Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_COLOR)) {
span->interpMask &= ~SPAN_RGBA;
span->arrayMask |= SPAN_RGBA;
}
- if (program->Base.OutputsWritten & (1 << FRAG_RESULT_DEPTH)) {
+ if (program->Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) {
span->interpMask &= ~SPAN_Z;
span->arrayMask |= SPAN_Z;
}