aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/swrast_setup
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-03-18 16:33:08 +0100
committermarha <marha@users.sourceforge.net>2013-04-11 11:13:36 +0200
commitaccd8a3364ffd1e91a4ab52b06b5e3b9d250ae92 (patch)
treede6631463ba227bb7e08b9ff7ab0458925e75f15 /mesalib/src/mesa/swrast_setup
parenta2ce004b2966da2fe0249e72e2fb99255cef3092 (diff)
downloadvcxsrv-accd8a3364ffd1e91a4ab52b06b5e3b9d250ae92.tar.gz
vcxsrv-accd8a3364ffd1e91a4ab52b06b5e3b9d250ae92.tar.bz2
vcxsrv-accd8a3364ffd1e91a4ab52b06b5e3b9d250ae92.zip
libX11 mesa git update 18 Mar 2013
libX11 commit f49bb2dd6d4ea45c55bd21acc0efe2b764441020 mesa commit 2da8ee16a8b126d15f34552916c77b203be326db
Diffstat (limited to 'mesalib/src/mesa/swrast_setup')
-rw-r--r--mesalib/src/mesa/swrast_setup/ss_context.c30
-rw-r--r--mesalib/src/mesa/swrast_setup/ss_triangle.c12
-rw-r--r--mesalib/src/mesa/swrast_setup/ss_tritmp.h92
3 files changed, 67 insertions, 67 deletions
diff --git a/mesalib/src/mesa/swrast_setup/ss_context.c b/mesalib/src/mesa/swrast_setup/ss_context.c
index 9444611f1..5847a7682 100644
--- a/mesalib/src/mesa/swrast_setup/ss_context.c
+++ b/mesalib/src/mesa/swrast_setup/ss_context.c
@@ -125,22 +125,22 @@ setup_vertex_format(struct gl_context *ctx)
swsetup->intColors = intColors;
- EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, attrib[FRAG_ATTRIB_WPOS] );
+ EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, attrib[VARYING_SLOT_POS] );
if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_COLOR0)) {
if (swsetup->intColors)
EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4CHAN_4F_RGBA, color );
else
- EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F, attrib[FRAG_ATTRIB_COL0]);
+ EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F, attrib[VARYING_SLOT_COL0]);
}
if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_COLOR1)) {
- EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_4F, attrib[FRAG_ATTRIB_COL1]);
+ EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_4F, attrib[VARYING_SLOT_COL1]);
}
if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_FOG)) {
const GLint emit = ctx->FragmentProgram._Current ? EMIT_4F : EMIT_1F;
- EMIT_ATTR( _TNL_ATTRIB_FOG, emit, attrib[FRAG_ATTRIB_FOGC]);
+ EMIT_ATTR( _TNL_ATTRIB_FOG, emit, attrib[VARYING_SLOT_FOGC]);
}
if (index_bitset & BITFIELD64_RANGE(_TNL_ATTRIB_TEX0, _TNL_NUM_TEX))
@@ -148,7 +148,7 @@ setup_vertex_format(struct gl_context *ctx)
for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) {
if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_TEX(i))) {
EMIT_ATTR( _TNL_ATTRIB_TEX(i), EMIT_4F,
- attrib[FRAG_ATTRIB_TEX0 + i] );
+ attrib[VARYING_SLOT_TEX0 + i] );
}
}
}
@@ -158,7 +158,7 @@ setup_vertex_format(struct gl_context *ctx)
for (i = 0; i < ctx->Const.MaxVarying; i++) {
if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_GENERIC(i))) {
EMIT_ATTR( _TNL_ATTRIB_GENERIC(i), VARYING_EMIT_STYLE,
- attrib[FRAG_ATTRIB_VAR0 + i] );
+ attrib[VARYING_SLOT_VAR0 + i] );
}
}
}
@@ -271,29 +271,29 @@ _swsetup_Translate( struct gl_context *ctx, const void *vertex, SWvertex *dest )
_tnl_get_attr( ctx, vertex, _TNL_ATTRIB_POS, tmp );
- dest->attrib[FRAG_ATTRIB_WPOS][0] = m[0] * tmp[0] + m[12];
- dest->attrib[FRAG_ATTRIB_WPOS][1] = m[5] * tmp[1] + m[13];
- dest->attrib[FRAG_ATTRIB_WPOS][2] = m[10] * tmp[2] + m[14];
- dest->attrib[FRAG_ATTRIB_WPOS][3] = tmp[3];
+ dest->attrib[VARYING_SLOT_POS][0] = m[0] * tmp[0] + m[12];
+ dest->attrib[VARYING_SLOT_POS][1] = m[5] * tmp[1] + m[13];
+ dest->attrib[VARYING_SLOT_POS][2] = m[10] * tmp[2] + m[14];
+ dest->attrib[VARYING_SLOT_POS][3] = tmp[3];
/** XXX try to limit these loops someday */
for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++)
_tnl_get_attr( ctx, vertex, _TNL_ATTRIB_TEX0 + i,
- dest->attrib[FRAG_ATTRIB_TEX0 + i] );
+ dest->attrib[VARYING_SLOT_TEX0 + i] );
for (i = 0 ; i < ctx->Const.MaxVarying ; i++)
_tnl_get_attr( ctx, vertex, _TNL_ATTRIB_GENERIC0 + i,
- dest->attrib[FRAG_ATTRIB_VAR0 + i] );
+ dest->attrib[VARYING_SLOT_VAR0 + i] );
_tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR0,
- dest->attrib[FRAG_ATTRIB_COL0] );
+ dest->attrib[VARYING_SLOT_COL0] );
UNCLAMPED_FLOAT_TO_RGBA_CHAN( dest->color, tmp );
_tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR1,
- dest->attrib[FRAG_ATTRIB_COL1]);
+ dest->attrib[VARYING_SLOT_COL1]);
_tnl_get_attr( ctx, vertex, _TNL_ATTRIB_FOG, tmp );
- dest->attrib[FRAG_ATTRIB_FOGC][0] = tmp[0];
+ dest->attrib[VARYING_SLOT_FOGC][0] = tmp[0];
/* XXX See _tnl_get_attr about pointsize ... */
_tnl_get_attr( ctx, vertex, _TNL_ATTRIB_POINTSIZE, tmp );
diff --git a/mesalib/src/mesa/swrast_setup/ss_triangle.c b/mesalib/src/mesa/swrast_setup/ss_triangle.c
index 5d1c70e94..5f4a997ee 100644
--- a/mesalib/src/mesa/swrast_setup/ss_triangle.c
+++ b/mesalib/src/mesa/swrast_setup/ss_triangle.c
@@ -137,21 +137,21 @@ static void _swsetup_render_tri(struct gl_context *ctx,
/* save colors/indexes for v0, v1 vertices */
COPY_CHAN4(c[0], v0->color);
COPY_CHAN4(c[1], v1->color);
- COPY_4V(s[0], v0->attrib[FRAG_ATTRIB_COL1]);
- COPY_4V(s[1], v1->attrib[FRAG_ATTRIB_COL1]);
+ COPY_4V(s[0], v0->attrib[VARYING_SLOT_COL1]);
+ COPY_4V(s[1], v1->attrib[VARYING_SLOT_COL1]);
/* copy v2 color/indexes to v0, v1 indexes */
COPY_CHAN4(v0->color, v2->color);
COPY_CHAN4(v1->color, v2->color);
- COPY_4V(v0->attrib[FRAG_ATTRIB_COL1], v2->attrib[FRAG_ATTRIB_COL1]);
- COPY_4V(v1->attrib[FRAG_ATTRIB_COL1], v2->attrib[FRAG_ATTRIB_COL1]);
+ COPY_4V(v0->attrib[VARYING_SLOT_COL1], v2->attrib[VARYING_SLOT_COL1]);
+ COPY_4V(v1->attrib[VARYING_SLOT_COL1], v2->attrib[VARYING_SLOT_COL1]);
render(ctx, ef, e0, e1, e2, v0, v1, v2);
COPY_CHAN4(v0->color, c[0]);
COPY_CHAN4(v1->color, c[1]);
- COPY_4V(v0->attrib[FRAG_ATTRIB_COL1], s[0]);
- COPY_4V(v1->attrib[FRAG_ATTRIB_COL1], s[1]);
+ COPY_4V(v0->attrib[VARYING_SLOT_COL1], s[0]);
+ COPY_4V(v1->attrib[VARYING_SLOT_COL1], s[1]);
}
else {
render(ctx, ef, e0, e1, e2, v0, v1, v2);
diff --git a/mesalib/src/mesa/swrast_setup/ss_tritmp.h b/mesalib/src/mesa/swrast_setup/ss_tritmp.h
index 5844ad594..11742067f 100644
--- a/mesalib/src/mesa/swrast_setup/ss_tritmp.h
+++ b/mesalib/src/mesa/swrast_setup/ss_tritmp.h
@@ -50,10 +50,10 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e
if (IND & (SS_TWOSIDE_BIT | SS_OFFSET_BIT | SS_UNFILLED_BIT))
{
- GLfloat ex = v[0]->attrib[FRAG_ATTRIB_WPOS][0] - v[2]->attrib[FRAG_ATTRIB_WPOS][0];
- GLfloat ey = v[0]->attrib[FRAG_ATTRIB_WPOS][1] - v[2]->attrib[FRAG_ATTRIB_WPOS][1];
- GLfloat fx = v[1]->attrib[FRAG_ATTRIB_WPOS][0] - v[2]->attrib[FRAG_ATTRIB_WPOS][0];
- GLfloat fy = v[1]->attrib[FRAG_ATTRIB_WPOS][1] - v[2]->attrib[FRAG_ATTRIB_WPOS][1];
+ GLfloat ex = v[0]->attrib[VARYING_SLOT_POS][0] - v[2]->attrib[VARYING_SLOT_POS][0];
+ GLfloat ey = v[0]->attrib[VARYING_SLOT_POS][1] - v[2]->attrib[VARYING_SLOT_POS][1];
+ GLfloat fx = v[1]->attrib[VARYING_SLOT_POS][0] - v[2]->attrib[VARYING_SLOT_POS][0];
+ GLfloat fy = v[1]->attrib[VARYING_SLOT_POS][1] - v[2]->attrib[VARYING_SLOT_POS][1];
GLfloat cc = ex*fy - ey*fx;
if (IND & (SS_TWOSIDE_BIT | SS_UNFILLED_BIT))
@@ -74,9 +74,9 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e
COPY_CHAN4(saved_color[2], v[2]->color);
}
else {
- COPY_4V(saved_col0[0], v[0]->attrib[FRAG_ATTRIB_COL0]);
- COPY_4V(saved_col0[1], v[1]->attrib[FRAG_ATTRIB_COL0]);
- COPY_4V(saved_col0[2], v[2]->attrib[FRAG_ATTRIB_COL0]);
+ COPY_4V(saved_col0[0], v[0]->attrib[VARYING_SLOT_COL0]);
+ COPY_4V(saved_col0[1], v[1]->attrib[VARYING_SLOT_COL0]);
+ COPY_4V(saved_col0[2], v[2]->attrib[VARYING_SLOT_COL0]);
}
if (VB->BackfaceColorPtr->stride) {
@@ -86,9 +86,9 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e
SS_COLOR(v[2]->color, vbcolor[e2]);
}
else {
- COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL0], vbcolor[e0]);
- COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL0], vbcolor[e1]);
- COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL0], vbcolor[e2]);
+ COPY_4V(v[0]->attrib[VARYING_SLOT_COL0], vbcolor[e0]);
+ COPY_4V(v[1]->attrib[VARYING_SLOT_COL0], vbcolor[e1]);
+ COPY_4V(v[2]->attrib[VARYING_SLOT_COL0], vbcolor[e2]);
}
}
else {
@@ -99,9 +99,9 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e
SS_COLOR(v[2]->color, vbcolor[0]);
}
else {
- COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL0], vbcolor[0]);
- COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL0], vbcolor[0]);
- COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL0], vbcolor[0]);
+ COPY_4V(v[0]->attrib[VARYING_SLOT_COL0], vbcolor[0]);
+ COPY_4V(v[1]->attrib[VARYING_SLOT_COL0], vbcolor[0]);
+ COPY_4V(v[2]->attrib[VARYING_SLOT_COL0], vbcolor[0]);
}
}
}
@@ -109,19 +109,19 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e
if (VB->BackfaceSecondaryColorPtr) {
GLfloat (*vbspec)[4] = VB->BackfaceSecondaryColorPtr->data;
- COPY_4V(saved_spec[0], v[0]->attrib[FRAG_ATTRIB_COL1]);
- COPY_4V(saved_spec[1], v[1]->attrib[FRAG_ATTRIB_COL1]);
- COPY_4V(saved_spec[2], v[2]->attrib[FRAG_ATTRIB_COL1]);
+ COPY_4V(saved_spec[0], v[0]->attrib[VARYING_SLOT_COL1]);
+ COPY_4V(saved_spec[1], v[1]->attrib[VARYING_SLOT_COL1]);
+ COPY_4V(saved_spec[2], v[2]->attrib[VARYING_SLOT_COL1]);
if (VB->BackfaceSecondaryColorPtr->stride) {
- SS_SPEC(v[0]->attrib[FRAG_ATTRIB_COL1], vbspec[e0]);
- SS_SPEC(v[1]->attrib[FRAG_ATTRIB_COL1], vbspec[e1]);
- SS_SPEC(v[2]->attrib[FRAG_ATTRIB_COL1], vbspec[e2]);
+ SS_SPEC(v[0]->attrib[VARYING_SLOT_COL1], vbspec[e0]);
+ SS_SPEC(v[1]->attrib[VARYING_SLOT_COL1], vbspec[e1]);
+ SS_SPEC(v[2]->attrib[VARYING_SLOT_COL1], vbspec[e2]);
}
else {
- SS_SPEC(v[0]->attrib[FRAG_ATTRIB_COL1], vbspec[0]);
- SS_SPEC(v[1]->attrib[FRAG_ATTRIB_COL1], vbspec[0]);
- SS_SPEC(v[2]->attrib[FRAG_ATTRIB_COL1], vbspec[0]);
+ SS_SPEC(v[0]->attrib[VARYING_SLOT_COL1], vbspec[0]);
+ SS_SPEC(v[1]->attrib[VARYING_SLOT_COL1], vbspec[0]);
+ SS_SPEC(v[2]->attrib[VARYING_SLOT_COL1], vbspec[0]);
}
}
}
@@ -131,9 +131,9 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e
if (IND & SS_OFFSET_BIT) {
const GLfloat max = ctx->DrawBuffer->_DepthMaxF;
/* save original Z values (restored later) */
- z[0] = v[0]->attrib[FRAG_ATTRIB_WPOS][2];
- z[1] = v[1]->attrib[FRAG_ATTRIB_WPOS][2];
- z[2] = v[2]->attrib[FRAG_ATTRIB_WPOS][2];
+ z[0] = v[0]->attrib[VARYING_SLOT_POS][2];
+ z[1] = v[1]->attrib[VARYING_SLOT_POS][2];
+ z[2] = v[2]->attrib[VARYING_SLOT_POS][2];
/* Note that Z values are already scaled to [0,65535] (for example)
* so no MRD value is used here.
*/
@@ -147,31 +147,31 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e
offset += MAX2(dzdx, dzdy) * ctx->Polygon.OffsetFactor;
}
/* new Z values */
- oz0 = CLAMP(v[0]->attrib[FRAG_ATTRIB_WPOS][2] + offset, 0.0F, max);
- oz1 = CLAMP(v[1]->attrib[FRAG_ATTRIB_WPOS][2] + offset, 0.0F, max);
- oz2 = CLAMP(v[2]->attrib[FRAG_ATTRIB_WPOS][2] + offset, 0.0F, max);
+ oz0 = CLAMP(v[0]->attrib[VARYING_SLOT_POS][2] + offset, 0.0F, max);
+ oz1 = CLAMP(v[1]->attrib[VARYING_SLOT_POS][2] + offset, 0.0F, max);
+ oz2 = CLAMP(v[2]->attrib[VARYING_SLOT_POS][2] + offset, 0.0F, max);
}
}
if (mode == GL_POINT) {
if ((IND & SS_OFFSET_BIT) && ctx->Polygon.OffsetPoint) {
- v[0]->attrib[FRAG_ATTRIB_WPOS][2] = oz0;
- v[1]->attrib[FRAG_ATTRIB_WPOS][2] = oz1;
- v[2]->attrib[FRAG_ATTRIB_WPOS][2] = oz2;
+ v[0]->attrib[VARYING_SLOT_POS][2] = oz0;
+ v[1]->attrib[VARYING_SLOT_POS][2] = oz1;
+ v[2]->attrib[VARYING_SLOT_POS][2] = oz2;
}
_swsetup_render_tri(ctx, e0, e1, e2, facing, _swsetup_edge_render_point_tri);
} else if (mode == GL_LINE) {
if ((IND & SS_OFFSET_BIT) && ctx->Polygon.OffsetLine) {
- v[0]->attrib[FRAG_ATTRIB_WPOS][2] = oz0;
- v[1]->attrib[FRAG_ATTRIB_WPOS][2] = oz1;
- v[2]->attrib[FRAG_ATTRIB_WPOS][2] = oz2;
+ v[0]->attrib[VARYING_SLOT_POS][2] = oz0;
+ v[1]->attrib[VARYING_SLOT_POS][2] = oz1;
+ v[2]->attrib[VARYING_SLOT_POS][2] = oz2;
}
_swsetup_render_tri(ctx, e0, e1, e2, facing, _swsetup_edge_render_line_tri);
} else {
if ((IND & SS_OFFSET_BIT) && ctx->Polygon.OffsetFill) {
- v[0]->attrib[FRAG_ATTRIB_WPOS][2] = oz0;
- v[1]->attrib[FRAG_ATTRIB_WPOS][2] = oz1;
- v[2]->attrib[FRAG_ATTRIB_WPOS][2] = oz2;
+ v[0]->attrib[VARYING_SLOT_POS][2] = oz0;
+ v[1]->attrib[VARYING_SLOT_POS][2] = oz1;
+ v[2]->attrib[VARYING_SLOT_POS][2] = oz2;
}
_swrast_Triangle( ctx, v[0], v[1], v[2] );
}
@@ -180,9 +180,9 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e
* Restore original vertex colors, etc.
*/
if (IND & SS_OFFSET_BIT) {
- v[0]->attrib[FRAG_ATTRIB_WPOS][2] = z[0];
- v[1]->attrib[FRAG_ATTRIB_WPOS][2] = z[1];
- v[2]->attrib[FRAG_ATTRIB_WPOS][2] = z[2];
+ v[0]->attrib[VARYING_SLOT_POS][2] = z[0];
+ v[1]->attrib[VARYING_SLOT_POS][2] = z[1];
+ v[2]->attrib[VARYING_SLOT_POS][2] = z[2];
}
if (IND & SS_TWOSIDE_BIT) {
@@ -194,16 +194,16 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e
COPY_CHAN4(v[2]->color, saved_color[2]);
}
else {
- COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL0], saved_col0[0]);
- COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL0], saved_col0[1]);
- COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL0], saved_col0[2]);
+ COPY_4V(v[0]->attrib[VARYING_SLOT_COL0], saved_col0[0]);
+ COPY_4V(v[1]->attrib[VARYING_SLOT_COL0], saved_col0[1]);
+ COPY_4V(v[2]->attrib[VARYING_SLOT_COL0], saved_col0[2]);
}
}
if (VB->BackfaceSecondaryColorPtr) {
- COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL1], saved_spec[0]);
- COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL1], saved_spec[1]);
- COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL1], saved_spec[2]);
+ COPY_4V(v[0]->attrib[VARYING_SLOT_COL1], saved_spec[0]);
+ COPY_4V(v[1]->attrib[VARYING_SLOT_COL1], saved_spec[1]);
+ COPY_4V(v[2]->attrib[VARYING_SLOT_COL1], saved_spec[2]);
}
}
}