diff options
Diffstat (limited to 'mesalib/src/mesa/tnl')
-rw-r--r-- | mesalib/src/mesa/tnl/t_context.c | 12 | ||||
-rw-r--r-- | mesalib/src/mesa/tnl/t_context.h | 1 | ||||
-rw-r--r-- | mesalib/src/mesa/tnl/t_draw.c | 2 | ||||
-rw-r--r-- | mesalib/src/mesa/tnl/t_rasterpos.c | 14 | ||||
-rw-r--r-- | mesalib/src/mesa/tnl/t_vb_fog.c | 1 | ||||
-rw-r--r-- | mesalib/src/mesa/tnl/t_vb_light.c | 1 | ||||
-rw-r--r-- | mesalib/src/mesa/tnl/t_vb_lighttmp.h | 8 | ||||
-rw-r--r-- | mesalib/src/mesa/tnl/t_vb_normals.c | 1 | ||||
-rw-r--r-- | mesalib/src/mesa/tnl/t_vb_program.c | 1 | ||||
-rw-r--r-- | mesalib/src/mesa/tnl/t_vb_texgen.c | 1 | ||||
-rw-r--r-- | mesalib/src/mesa/tnl/t_vb_texmat.c | 1 | ||||
-rw-r--r-- | mesalib/src/mesa/tnl/t_vb_vertex.c | 1 | ||||
-rw-r--r-- | mesalib/src/mesa/tnl/t_vertex.c | 1 | ||||
-rw-r--r-- | mesalib/src/mesa/tnl/t_vertex_generic.c | 4 | ||||
-rw-r--r-- | mesalib/src/mesa/tnl/t_vertex_sse.c | 1 |
15 files changed, 26 insertions, 24 deletions
diff --git a/mesalib/src/mesa/tnl/t_context.c b/mesalib/src/mesa/tnl/t_context.c index bc705d7a3..5b9dd54d7 100644 --- a/mesalib/src/mesa/tnl/t_context.c +++ b/mesalib/src/mesa/tnl/t_context.c @@ -35,6 +35,7 @@ #include "math/m_translate.h" #include "math/m_xform.h" #include "main/state.h" +#include "main/viewport.h" #include "tnl.h" #include "t_context.h" @@ -69,6 +70,8 @@ _tnl_CreateContext( struct gl_context *ctx ) _tnl_install_pipeline( ctx, _tnl_default_pipeline ); } + _math_matrix_ctr(&tnl->_WindowMap); + tnl->NeedNdcCoords = GL_TRUE; tnl->AllowVertexFog = GL_TRUE; tnl->AllowPixelFog = GL_TRUE; @@ -108,6 +111,8 @@ _tnl_DestroyContext( struct gl_context *ctx ) struct tnl_shine_tab *s, *tmps; TNLcontext *tnl = TNL_CONTEXT(ctx); + _math_matrix_dtr(&tnl->_WindowMap); + /* Free lighting shininess exponentiation table */ foreach_s( s, tmps, tnl->_ShineTabList ) { free( s ); @@ -182,6 +187,13 @@ _tnl_InvalidateState( struct gl_context *ctx, GLuint new_state ) } } } + + if (new_state & (_NEW_VIEWPORT | _NEW_BUFFERS)) { + double scale[3], translate[3]; + _mesa_get_viewport_xform(ctx, 0, scale, translate); + _math_matrix_viewport(&tnl->_WindowMap, scale, translate, + ctx->DrawBuffer->_DepthMaxF); + } } diff --git a/mesalib/src/mesa/tnl/t_context.h b/mesalib/src/mesa/tnl/t_context.h index e89a7f836..e7adb5f53 100644 --- a/mesalib/src/mesa/tnl/t_context.h +++ b/mesalib/src/mesa/tnl/t_context.h @@ -514,6 +514,7 @@ typedef struct /* Clipspace/ndc/window vertex managment: */ struct tnl_clipspace clipspace; + GLmatrix _WindowMap; /* Probably need a better configuration mechanism: */ diff --git a/mesalib/src/mesa/tnl/t_draw.c b/mesalib/src/mesa/tnl/t_draw.c index 60265d60b..6adf1dce6 100644 --- a/mesalib/src/mesa/tnl/t_draw.c +++ b/mesalib/src/mesa/tnl/t_draw.c @@ -448,7 +448,7 @@ void _tnl_draw_prims(struct gl_context *ctx, if (0) { - printf("%s %d..%d\n", __FUNCTION__, min_index, max_index); + printf("%s %d..%d\n", __func__, min_index, max_index); for (i = 0; i < nr_prims; i++) printf("prim %d: %s start %d count %d\n", i, _mesa_lookup_enum_by_nr(prim[i].mode), diff --git a/mesalib/src/mesa/tnl/t_rasterpos.c b/mesalib/src/mesa/tnl/t_rasterpos.c index 9ecf947df..d4b45bac9 100644 --- a/mesalib/src/mesa/tnl/t_rasterpos.c +++ b/mesalib/src/mesa/tnl/t_rasterpos.c @@ -25,12 +25,12 @@ #include "c99_math.h" #include "main/glheader.h" -#include "main/colormac.h" #include "main/feedback.h" #include "main/light.h" #include "main/macros.h" #include "util/simple_list.h" #include "main/mtypes.h" +#include "main/viewport.h" #include "math/m_matrix.h" #include "tnl/tnl.h" @@ -378,6 +378,7 @@ _tnl_RasterPos(struct gl_context *ctx, const GLfloat vObj[4]) GLfloat eye[4], clip[4], ndc[3], d; GLfloat *norm, eyenorm[3]; GLfloat *objnorm = ctx->Current.Attrib[VERT_ATTRIB_NORMAL]; + double scale[3], translate[3]; /* apply modelview matrix: eye = MV * obj */ TRANSFORM_POINT( eye, ctx->ModelviewMatrixStack.Top->m, vObj ); @@ -410,13 +411,10 @@ _tnl_RasterPos(struct gl_context *ctx, const GLfloat vObj[4]) ndc[1] = clip[1] * d; ndc[2] = clip[2] * d; /* wincoord = viewport_mapping(ndc) */ - ctx->Current.RasterPos[0] = (ndc[0] * ctx->ViewportArray[0]._WindowMap.m[MAT_SX] - + ctx->ViewportArray[0]._WindowMap.m[MAT_TX]); - ctx->Current.RasterPos[1] = (ndc[1] * ctx->ViewportArray[0]._WindowMap.m[MAT_SY] - + ctx->ViewportArray[0]._WindowMap.m[MAT_TY]); - ctx->Current.RasterPos[2] = (ndc[2] * ctx->ViewportArray[0]._WindowMap.m[MAT_SZ] - + ctx->ViewportArray[0]._WindowMap.m[MAT_TZ]) - / ctx->DrawBuffer->_DepthMaxF; + _mesa_get_viewport_xform(ctx, 0, scale, translate); + ctx->Current.RasterPos[0] = ndc[0] * scale[0] + translate[0]; + ctx->Current.RasterPos[1] = ndc[1] * scale[1] + translate[1]; + ctx->Current.RasterPos[2] = ndc[2] * scale[2] + translate[2]; ctx->Current.RasterPos[3] = clip[3]; if (ctx->Transform.DepthClamp) { diff --git a/mesalib/src/mesa/tnl/t_vb_fog.c b/mesalib/src/mesa/tnl/t_vb_fog.c index 3626f1da3..1ca72f866 100644 --- a/mesalib/src/mesa/tnl/t_vb_fog.c +++ b/mesalib/src/mesa/tnl/t_vb_fog.c @@ -28,7 +28,6 @@ #include "c99_math.h" #include "main/glheader.h" -#include "main/colormac.h" #include "main/macros.h" #include "main/imports.h" #include "main/mtypes.h" diff --git a/mesalib/src/mesa/tnl/t_vb_light.c b/mesalib/src/mesa/tnl/t_vb_light.c index 7781b6a6c..dbd57fa6b 100644 --- a/mesalib/src/mesa/tnl/t_vb_light.c +++ b/mesalib/src/mesa/tnl/t_vb_light.c @@ -25,7 +25,6 @@ #include "c99_math.h" #include "main/glheader.h" -#include "main/colormac.h" #include "main/light.h" #include "main/macros.h" #include "main/imports.h" diff --git a/mesalib/src/mesa/tnl/t_vb_lighttmp.h b/mesalib/src/mesa/tnl/t_vb_lighttmp.h index 57f569bd7..f8786accb 100644 --- a/mesalib/src/mesa/tnl/t_vb_lighttmp.h +++ b/mesalib/src/mesa/tnl/t_vb_lighttmp.h @@ -68,7 +68,7 @@ static void TAG(light_rgba_spec)( struct gl_context *ctx, const GLuint nr = VB->Count; #ifdef TRACE - fprintf(stderr, "%s\n", __FUNCTION__ ); + fprintf(stderr, "%s\n", __func__ ); #endif VB->AttribPtr[_TNL_ATTRIB_COLOR0] = &store->LitColor[0]; @@ -249,7 +249,7 @@ static void TAG(light_rgba)( struct gl_context *ctx, const GLuint nr = VB->Count; #ifdef TRACE - fprintf(stderr, "%s\n", __FUNCTION__ ); + fprintf(stderr, "%s\n", __func__ ); #endif VB->AttribPtr[_TNL_ATTRIB_COLOR0] = &store->LitColor[0]; @@ -429,7 +429,7 @@ static void TAG(light_fast_rgba_single)( struct gl_context *ctx, #endif #ifdef TRACE - fprintf(stderr, "%s\n", __FUNCTION__ ); + fprintf(stderr, "%s\n", __func__ ); #endif (void) input; /* doesn't refer to Eye or Obj */ @@ -533,7 +533,7 @@ static void TAG(light_fast_rgba)( struct gl_context *ctx, const struct gl_light *light; #ifdef TRACE - fprintf(stderr, "%s %d\n", __FUNCTION__, nr ); + fprintf(stderr, "%s %d\n", __func__, nr ); #endif (void) input; diff --git a/mesalib/src/mesa/tnl/t_vb_normals.c b/mesalib/src/mesa/tnl/t_vb_normals.c index b67789e42..9aee1a2fb 100644 --- a/mesalib/src/mesa/tnl/t_vb_normals.c +++ b/mesalib/src/mesa/tnl/t_vb_normals.c @@ -27,7 +27,6 @@ #include "main/glheader.h" -#include "main/colormac.h" #include "main/macros.h" #include "main/imports.h" #include "main/mtypes.h" diff --git a/mesalib/src/mesa/tnl/t_vb_program.c b/mesalib/src/mesa/tnl/t_vb_program.c index 464a4cddd..149434971 100644 --- a/mesalib/src/mesa/tnl/t_vb_program.c +++ b/mesalib/src/mesa/tnl/t_vb_program.c @@ -32,7 +32,6 @@ #include "main/glheader.h" -#include "main/colormac.h" #include "main/macros.h" #include "main/imports.h" #include "main/samplerobj.h" diff --git a/mesalib/src/mesa/tnl/t_vb_texgen.c b/mesalib/src/mesa/tnl/t_vb_texgen.c index 9a61ef2fe..94066f4f6 100644 --- a/mesalib/src/mesa/tnl/t_vb_texgen.c +++ b/mesalib/src/mesa/tnl/t_vb_texgen.c @@ -35,7 +35,6 @@ */ #include "main/glheader.h" -#include "main/colormac.h" #include "main/macros.h" #include "main/imports.h" #include "main/mtypes.h" diff --git a/mesalib/src/mesa/tnl/t_vb_texmat.c b/mesalib/src/mesa/tnl/t_vb_texmat.c index 1cc2c8116..ef034d643 100644 --- a/mesalib/src/mesa/tnl/t_vb_texmat.c +++ b/mesalib/src/mesa/tnl/t_vb_texmat.c @@ -27,7 +27,6 @@ #include "main/glheader.h" -#include "main/colormac.h" #include "main/macros.h" #include "main/imports.h" #include "main/mtypes.h" diff --git a/mesalib/src/mesa/tnl/t_vb_vertex.c b/mesalib/src/mesa/tnl/t_vb_vertex.c index ea3a56cd1..b56d6803c 100644 --- a/mesalib/src/mesa/tnl/t_vb_vertex.c +++ b/mesalib/src/mesa/tnl/t_vb_vertex.c @@ -27,7 +27,6 @@ #include "main/glheader.h" -#include "main/colormac.h" #include "main/macros.h" #include "main/imports.h" #include "main/mtypes.h" diff --git a/mesalib/src/mesa/tnl/t_vertex.c b/mesalib/src/mesa/tnl/t_vertex.c index 369d6d945..c3294b007 100644 --- a/mesalib/src/mesa/tnl/t_vertex.c +++ b/mesalib/src/mesa/tnl/t_vertex.c @@ -28,7 +28,6 @@ #include <stdio.h> #include "main/glheader.h" #include "main/context.h" -#include "main/colormac.h" #include "swrast/s_chan.h" #include "t_context.h" #include "t_vertex.h" diff --git a/mesalib/src/mesa/tnl/t_vertex_generic.c b/mesalib/src/mesa/tnl/t_vertex_generic.c index 079d473fc..2a25a9692 100644 --- a/mesalib/src/mesa/tnl/t_vertex_generic.c +++ b/mesalib/src/mesa/tnl/t_vertex_generic.c @@ -28,7 +28,7 @@ #include "main/glheader.h" #include "main/context.h" -#include "main/colormac.h" +#include "main/macros.h" #include "util/simple_list.h" #include "swrast/s_chan.h" #include "t_context.h" @@ -36,7 +36,7 @@ #if 0 -#define DEBUG_INSERT printf("%s\n", __FUNCTION__) +#define DEBUG_INSERT printf("%s\n", __func__) #else #define DEBUG_INSERT #endif diff --git a/mesalib/src/mesa/tnl/t_vertex_sse.c b/mesalib/src/mesa/tnl/t_vertex_sse.c index 963432c48..30dc1a720 100644 --- a/mesalib/src/mesa/tnl/t_vertex_sse.c +++ b/mesalib/src/mesa/tnl/t_vertex_sse.c @@ -29,7 +29,6 @@ #include "main/glheader.h" #include "main/context.h" -#include "main/colormac.h" #include "util/simple_list.h" #include "main/enums.h" #include "swrast/s_chan.h" |