Browse Source

swrast: stop using PutRowRGB() in triangle code

Reviewed-by: Eric Anholt <eric@anholt.net>
tags/mesa-8.0-rc1
Brian Paul 13 years ago
parent
commit
6e7bc79578
1 changed files with 12 additions and 10 deletions
  1. 12
    10
      src/mesa/swrast/s_triangle.c

+ 12
- 10
src/mesa/swrast/s_triangle.c View File



#define RENDER_SPAN( span ) \ #define RENDER_SPAN( span ) \
GLuint i; \ GLuint i; \
GLubyte rgb[MAX_WIDTH][3]; \
GLubyte rgba[MAX_WIDTH][4]; \
span.intTex[0] -= FIXED_HALF; /* off-by-one error? */ \ span.intTex[0] -= FIXED_HALF; /* off-by-one error? */ \
span.intTex[1] -= FIXED_HALF; \ span.intTex[1] -= FIXED_HALF; \
for (i = 0; i < span.end; i++) { \ for (i = 0; i < span.end; i++) { \
GLint t = FixedToInt(span.intTex[1]) & tmask; \ GLint t = FixedToInt(span.intTex[1]) & tmask; \
GLint pos = (t << twidth_log2) + s; \ GLint pos = (t << twidth_log2) + s; \
pos = pos + pos + pos; /* multiply by 3 */ \ pos = pos + pos + pos; /* multiply by 3 */ \
rgb[i][RCOMP] = texture[pos+2]; \
rgb[i][GCOMP] = texture[pos+1]; \
rgb[i][BCOMP] = texture[pos+0]; \
rgba[i][RCOMP] = texture[pos+2]; \
rgba[i][GCOMP] = texture[pos+1]; \
rgba[i][BCOMP] = texture[pos+0]; \
rgba[i][ACOMP] = 0xff; \
span.intTex[0] += span.intTexStep[0]; \ span.intTex[0] += span.intTexStep[0]; \
span.intTex[1] += span.intTexStep[1]; \ span.intTex[1] += span.intTexStep[1]; \
} \ } \
rb->PutRowRGB(ctx, rb, span.end, span.x, span.y, rgb, NULL);
rb->PutRow(ctx, rb, span.end, span.x, span.y, rgba, NULL);


#include "s_tritemp.h" #include "s_tritemp.h"




#define RENDER_SPAN( span ) \ #define RENDER_SPAN( span ) \
GLuint i; \ GLuint i; \
GLubyte rgb[MAX_WIDTH][3]; \
GLubyte rgba[MAX_WIDTH][4]; \
span.intTex[0] -= FIXED_HALF; /* off-by-one error? */ \ span.intTex[0] -= FIXED_HALF; /* off-by-one error? */ \
span.intTex[1] -= FIXED_HALF; \ span.intTex[1] -= FIXED_HALF; \
for (i = 0; i < span.end; i++) { \ for (i = 0; i < span.end; i++) { \
GLint t = FixedToInt(span.intTex[1]) & tmask; \ GLint t = FixedToInt(span.intTex[1]) & tmask; \
GLint pos = (t << twidth_log2) + s; \ GLint pos = (t << twidth_log2) + s; \
pos = pos + pos + pos; /* multiply by 3 */ \ pos = pos + pos + pos; /* multiply by 3 */ \
rgb[i][RCOMP] = texture[pos+2]; \
rgb[i][GCOMP] = texture[pos+1]; \
rgb[i][BCOMP] = texture[pos+0]; \
rgba[i][RCOMP] = texture[pos+2]; \
rgba[i][GCOMP] = texture[pos+1]; \
rgba[i][BCOMP] = texture[pos+0]; \
rgba[i][ACOMP] = 0xff; \
zRow[i] = z; \ zRow[i] = z; \
span.array->mask[i] = 1; \ span.array->mask[i] = 1; \
} \ } \
span.intTex[1] += span.intTexStep[1]; \ span.intTex[1] += span.intTexStep[1]; \
span.z += span.zStep; \ span.z += span.zStep; \
} \ } \
rb->PutRowRGB(ctx, rb, span.end, span.x, span.y, rgb, span.array->mask);
rb->PutRow(ctx, rb, span.end, span.x, span.y, rgba, span.array->mask);


#include "s_tritemp.h" #include "s_tritemp.h"



Loading…
Cancel
Save