#include "tnl_dd/t_dd_vertex.h"
#undef TAG
+/* Subpixel offsets for window coordinates (triangles): */
+#define SUBPIXEL_X (0.0F)
+#define SUBPIXEL_Y (0.125F)
+
struct nouveau_context;
typedef void (*nouveau_tri_func)( struct nouveau_context*,
uint32_t vblank_flags;
- GLfloat viewport[16];
+ GLmatrix viewport;
+ GLfloat depth_scale;
}nouveauContextRec, *nouveauContextPtr;
{
/* Calculate the Viewport Matrix */
-/* Taken from the intel driver
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
const GLfloat *v = ctx->Viewport._WindowMap.m;
- GLfloat *m = nmesa->ViewportMatrix.m;
+ GLfloat *m = nmesa->viewport.m;
GLint h = 0;
if (nmesa->driDrawable)
m[MAT_TY] = - v[MAT_TY] + h;
m[MAT_SZ] = v[MAT_SZ] * nmesa->depth_scale;
m[MAT_TZ] = v[MAT_TZ] * nmesa->depth_scale;
-*/
+
}
static nouveauViewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
* 44c 0x03000000 <-- (Height_from_glViewport << 16) | (win_height - height - y)
*
*/
+
+ nouveauCalcViewport(ctx);
+}
+void nouveauDepthRange(GLcontext *ctx)
+{
+ nouveauCalcViewport(ctx);
}
/* Initialize the context's hardware state. */
ctx->Driver.StencilMaskSeparate = NULL; //nouveauDDStencilMaskSeparate;
ctx->Driver.StencilOpSeparate = NULL; //nouveauDDStencilOpSeparate;
- ctx->Driver.DepthRange = NULL; //nouveauDepthRange;
+ ctx->Driver.DepthRange = nouveauDepthRange;
ctx->Driver.Viewport = nouveauViewport;
/* Pixel path fallbacks.