if (state & MESA_META_VIEWPORT) {
/* save viewport state */
- save->ViewportX = ctx->Viewport.X;
- save->ViewportY = ctx->Viewport.Y;
- save->ViewportW = ctx->Viewport.Width;
- save->ViewportH = ctx->Viewport.Height;
+ save->ViewportX = ctx->ViewportArray[0].X;
+ save->ViewportY = ctx->ViewportArray[0].Y;
+ save->ViewportW = ctx->ViewportArray[0].Width;
+ save->ViewportH = ctx->ViewportArray[0].Height;
/* set viewport to match window size */
- if (ctx->Viewport.X != 0 ||
- ctx->Viewport.Y != 0 ||
- ctx->Viewport.Width != (float) ctx->DrawBuffer->Width ||
- ctx->Viewport.Height != (float) ctx->DrawBuffer->Height) {
+ if (ctx->ViewportArray[0].X != 0 ||
+ ctx->ViewportArray[0].Y != 0 ||
+ ctx->ViewportArray[0].Width != (float) ctx->DrawBuffer->Width ||
+ ctx->ViewportArray[0].Height != (float) ctx->DrawBuffer->Height) {
_mesa_set_viewport(ctx, 0, 0,
ctx->DrawBuffer->Width, ctx->DrawBuffer->Height);
}
/* save depth range state */
- save->DepthNear = ctx->Viewport.Near;
- save->DepthFar = ctx->Viewport.Far;
+ save->DepthNear = ctx->ViewportArray[0].Near;
+ save->DepthFar = ctx->ViewportArray[0].Far;
/* set depth range to default */
_mesa_DepthRange(0.0, 1.0);
}
}
if (state & MESA_META_VIEWPORT) {
- if (save->ViewportX != ctx->Viewport.X ||
- save->ViewportY != ctx->Viewport.Y ||
- save->ViewportW != ctx->Viewport.Width ||
- save->ViewportH != ctx->Viewport.Height) {
+ if (save->ViewportX != ctx->ViewportArray[0].X ||
+ save->ViewportY != ctx->ViewportArray[0].Y ||
+ save->ViewportW != ctx->ViewportArray[0].Width ||
+ save->ViewportH != ctx->ViewportArray[0].Height) {
_mesa_set_viewport(ctx, save->ViewportX, save->ViewportY,
save->ViewportW, save->ViewportH);
}
if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) {
_math_matrix_viewport(&intel->ViewportMatrix,
- ctx->Viewport.X,
- ctx->DrawBuffer->Height - ctx->Viewport.Y,
- ctx->Viewport.Width,
- -ctx->Viewport.Height,
- ctx->Viewport.Near,
- ctx->Viewport.Far,
+ ctx->ViewportArray[0].X,
+ ctx->DrawBuffer->Height - ctx->ViewportArray[0].Y,
+ ctx->ViewportArray[0].Width,
+ -ctx->ViewportArray[0].Height,
+ ctx->ViewportArray[0].Near,
+ ctx->ViewportArray[0].Far,
1.0);
} else {
_math_matrix_viewport(&intel->ViewportMatrix,
- ctx->Viewport.X,
- ctx->Viewport.Y,
- ctx->Viewport.Width,
- ctx->Viewport.Height,
- ctx->Viewport.Near,
- ctx->Viewport.Far,
+ ctx->ViewportArray[0].X,
+ ctx->ViewportArray[0].Y,
+ ctx->ViewportArray[0].Width,
+ ctx->ViewportArray[0].Height,
+ ctx->ViewportArray[0].Near,
+ ctx->ViewportArray[0].Far,
1.0);
}
}
/* _NEW_TRANSFORM */
if (ctx->Transform.DepthClamp) {
/* _NEW_VIEWPORT */
- ccv->min_depth = MIN2(ctx->Viewport.Near, ctx->Viewport.Far);
- ccv->max_depth = MAX2(ctx->Viewport.Near, ctx->Viewport.Far);
+ ccv->min_depth = MIN2(ctx->ViewportArray[0].Near, ctx->ViewportArray[0].Far);
+ ccv->max_depth = MAX2(ctx->ViewportArray[0].Near, ctx->ViewportArray[0].Far);
} else {
ccv->min_depth = 0.0;
ccv->max_depth = 1.0;
sizeof(*vp), 32, &brw->clip.vp_offset);
const float maximum_post_clamp_delta = 4096;
- float gbx = maximum_post_clamp_delta / ctx->Viewport.Width;
- float gby = maximum_post_clamp_delta / ctx->Viewport.Height;
+ float gbx = maximum_post_clamp_delta / ctx->ViewportArray[0].Width;
+ float gby = maximum_post_clamp_delta / ctx->ViewportArray[0].Height;
vp->xmin = -gbx;
vp->xmax = gbx;
clip->clip5.userclip_must_clip = 1;
/* enable guardband clipping if we can */
- if (ctx->Viewport.X == 0 &&
- ctx->Viewport.Y == 0 &&
- ctx->Viewport.Width == (float) fb->Width &&
- ctx->Viewport.Height == (float) fb->Height)
+ if (ctx->ViewportArray[0].X == 0 &&
+ ctx->ViewportArray[0].Y == 0 &&
+ ctx->ViewportArray[0].Width == (float) fb->Width &&
+ ctx->ViewportArray[0].Height == (float) fb->Height)
{
clip->clip5.guard_band_enable = 1;
clip->clip6.clipper_viewport_state_ptr =
struct brw_sf_viewport *sfv;
GLfloat y_scale, y_bias;
const bool render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
- const GLfloat *v = ctx->Viewport._WindowMap.m;
+ const GLfloat *v = ctx->ViewportArray[0]._WindowMap.m;
sfv = brw_state_batch(brw, AUB_TRACE_SF_VP_STATE,
sizeof(*sfv), 32, &brw->sf.vp_offset);
dw2 |= (ctx->Transform.ClipPlanesEnabled <<
GEN6_USER_CLIP_CLIP_DISTANCES_SHIFT);
- if (ctx->Viewport.X == 0 &&
- ctx->Viewport.Y == 0 &&
- ctx->Viewport.Width == (float) fb->Width &&
- ctx->Viewport.Height == (float) fb->Height) {
+ if (ctx->ViewportArray[0].X == 0 &&
+ ctx->ViewportArray[0].Y == 0 &&
+ ctx->ViewportArray[0].Width == (float) fb->Width &&
+ ctx->ViewportArray[0].Height == (float) fb->Height) {
dw2 |= GEN6_CLIP_GB_TEST;
}
* drawable.
*/
const float maximum_post_clamp_delta = 8192;
- float gbx = maximum_post_clamp_delta / ctx->Viewport.Width;
- float gby = maximum_post_clamp_delta / ctx->Viewport.Height;
+ float gbx = maximum_post_clamp_delta / ctx->ViewportArray[0].Width;
+ float gby = maximum_post_clamp_delta / ctx->ViewportArray[0].Height;
vp->xmin = -gbx;
vp->xmax = gbx;
struct brw_sf_viewport *sfv;
GLfloat y_scale, y_bias;
const bool render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
- const GLfloat *v = ctx->Viewport._WindowMap.m;
+ const GLfloat *v = ctx->ViewportArray[0]._WindowMap.m;
sfv = brw_state_batch(brw, AUB_TRACE_SF_VP_STATE,
sizeof(*sfv), 32, &brw->sf.vp_offset);
const GLfloat depth_scale = 1.0F / ctx->DrawBuffer->_DepthMaxF;
GLfloat y_scale, y_bias;
const bool render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
- const GLfloat *v = ctx->Viewport._WindowMap.m;
+ const GLfloat *v = ctx->ViewportArray[0]._WindowMap.m;
struct gen7_sf_clip_viewport *vp;
vp = brw_state_batch(brw, AUB_TRACE_SF_VP_STATE,
* drawable.
*/
const float maximum_guardband_extent = 8192;
- float gbx = maximum_guardband_extent / ctx->Viewport.Width;
- float gby = maximum_guardband_extent / ctx->Viewport.Height;
+ float gbx = maximum_guardband_extent / ctx->ViewportArray[0].Width;
+ float gby = maximum_guardband_extent / ctx->ViewportArray[0].Height;
vp->guardband.xmin = -gbx;
vp->guardband.xmax = gbx;
static inline void
get_viewport_scale(struct gl_context *ctx, float a[16])
{
- struct gl_viewport_attrib *vp = &ctx->Viewport;
+ struct gl_viewport_attrib *vp = &ctx->ViewportArray[0];
struct gl_framebuffer *fb = ctx->DrawBuffer;
a[MAT_SX] = (float)vp->Width / 2;
static inline void
get_viewport_translate(struct gl_context *ctx, float a[4])
{
- struct gl_viewport_attrib *vp = &ctx->Viewport;
+ struct gl_viewport_attrib *vp = &ctx->ViewportArray[0];
struct gl_framebuffer *fb = ctx->DrawBuffer;
a[0] = (float)vp->Width / 2 + vp->X;
nv10_emit_viewport(struct gl_context *ctx, int emit)
{
struct nouveau_pushbuf *push = context_push(ctx);
- struct gl_viewport_attrib *vp = &ctx->Viewport;
+ struct gl_viewport_attrib *vp = &ctx->ViewportArray[0];
struct gl_framebuffer *fb = ctx->DrawBuffer;
float a[4] = {};
__DRIdrawable *dPriv = radeon_get_drawable(&rmesa->radeon);
GLfloat xoffset = 0;
GLfloat yoffset = dPriv ? (GLfloat) dPriv->h : 0;
- const GLfloat *v = ctx->Viewport._WindowMap.m;
+ const GLfloat *v = ctx->ViewportArray[0]._WindowMap.m;
const GLboolean render_to_fbo = (ctx->DrawBuffer ? _mesa_is_user_fbo(ctx->DrawBuffer) : 0);
const GLfloat depthScale = 1.0F / ctx->DrawBuffer->_DepthMaxF;
GLfloat y_scale, y_bias;
__DRIdrawable *dPriv = radeon_get_drawable(&rmesa->radeon);
GLfloat xoffset = (GLfloat)0;
GLfloat yoffset = (GLfloat)dPriv->h;
- const GLfloat *v = ctx->Viewport._WindowMap.m;
+ const GLfloat *v = ctx->ViewportArray[0]._WindowMap.m;
float_ui32_type tx;
float_ui32_type ty;
__DRIdrawable *dPriv = radeon_get_drawable(&rmesa->radeon);
GLfloat xoffset = 0.0;
GLfloat yoffset = dPriv ? (GLfloat) dPriv->h : 0;
- const GLfloat *v = ctx->Viewport._WindowMap.m;
+ const GLfloat *v = ctx->ViewportArray[0]._WindowMap.m;
const GLboolean render_to_fbo = (ctx->DrawBuffer ? _mesa_is_user_fbo(ctx->DrawBuffer) : 0);
const GLfloat depthScale = 1.0F / ctx->DrawBuffer->_DepthMaxF;
GLfloat y_scale, y_bias;
__DRIdrawable *dPriv = radeon_get_drawable(&rmesa->radeon);
GLfloat xoffset = 0.0;
GLfloat yoffset = (GLfloat)dPriv->h;
- const GLfloat *v = ctx->Viewport._WindowMap.m;
+ const GLfloat *v = ctx->ViewportArray[0]._WindowMap.m;
float_ui32_type tx;
float_ui32_type ty;
if (mask & GL_VIEWPORT_BIT) {
if (!push_attrib(ctx, &head, GL_VIEWPORT_BIT,
- sizeof(struct gl_viewport_attrib),
- (void*)&ctx->Viewport))
+ sizeof(struct gl_viewport_attrib)
+ * ctx->Const.MaxViewports,
+ (void*)&ctx->ViewportArray))
goto end;
}
ctx->Const.ViewportBounds.Min = 0;
ctx->Const.ViewportBounds.Max = 0;
+ /* Driver must override if it supports ARB_viewport_array */
+ ctx->Const.MaxViewports = 1;
+
/** GL_ARB_uniform_buffer_object */
ctx->Const.MaxCombinedUniformBlocks = 36;
ctx->Const.MaxUniformBufferBindings = 36;
}
if (mask & GL_VIEWPORT_BIT) {
/* Cannot use memcpy, because of pointers in GLmatrix _WindowMap */
- dst->Viewport.X = src->Viewport.X;
- dst->Viewport.Y = src->Viewport.Y;
- dst->Viewport.Width = src->Viewport.Width;
- dst->Viewport.Height = src->Viewport.Height;
- dst->Viewport.Near = src->Viewport.Near;
- dst->Viewport.Far = src->Viewport.Far;
- _math_matrix_copy(&dst->Viewport._WindowMap, &src->Viewport._WindowMap);
+ dst->ViewportArray[0].X = src->ViewportArray[0].X;
+ dst->ViewportArray[0].Y = src->ViewportArray[0].Y;
+ dst->ViewportArray[0].Width = src->ViewportArray[0].Width;
+ dst->ViewportArray[0].Height = src->ViewportArray[0].Height;
+ dst->ViewportArray[0].Near = src->ViewportArray[0].Near;
+ dst->ViewportArray[0].Far = src->ViewportArray[0].Far;
+ _math_matrix_copy(&dst->ViewportArray[0]._WindowMap,
+ &src->ViewportArray[0]._WindowMap);
}
/* XXX FIXME: Call callbacks?
break;
case GL_VIEWPORT:
- v->value_float_4[0] = ctx->Viewport.X;
- v->value_float_4[1] = ctx->Viewport.Y;
- v->value_float_4[2] = ctx->Viewport.Width;
- v->value_float_4[3] = ctx->Viewport.Height;
+ v->value_float_4[0] = ctx->ViewportArray[0].X;
+ v->value_float_4[1] = ctx->ViewportArray[0].Y;
+ v->value_float_4[2] = ctx->ViewportArray[0].Width;
+ v->value_float_4[3] = ctx->ViewportArray[0].Height;
break;
case GL_DEPTH_RANGE:
- v->value_double_2[0] = ctx->Viewport.Near;
- v->value_double_2[1] = ctx->Viewport.Far;
+ v->value_double_2[0] = ctx->ViewportArray[0].Near;
+ v->value_double_2[1] = ctx->ViewportArray[0].Far;
break;
case GL_ACTIVE_STENCIL_FACE_EXT:
struct gl_stencil_attrib Stencil; /**< Stencil buffer attributes */
struct gl_texture_attrib Texture; /**< Texture attributes */
struct gl_transform_attrib Transform; /**< Transformation attributes */
- struct gl_viewport_attrib Viewport; /**< Viewport attributes */
+ struct gl_viewport_attrib ViewportArray[MAX_VIEWPORTS]; /**< Viewport attributes */
/*@}*/
/** \name Client attribute stack */
FLUSH_VERTICES(ctx, 0);
FLUSH_CURRENT(ctx, 0);
- z2 = CLAMP(z, 0.0F, 1.0F) * (ctx->Viewport.Far - ctx->Viewport.Near)
- + ctx->Viewport.Near;
+ z2 = CLAMP(z, 0.0F, 1.0F)
+ * (ctx->ViewportArray[0].Far - ctx->ViewportArray[0].Near)
+ + ctx->ViewportArray[0].Near;
/* set raster position */
ctx->Current.RasterPos[0] = x;
* and should be maintained elsewhere if at all.
* NOTE: RasterPos uses this.
*/
- _math_matrix_viewport(&ctx->Viewport._WindowMap,
- ctx->Viewport.X, ctx->Viewport.Y,
- ctx->Viewport.Width, ctx->Viewport.Height,
- ctx->Viewport.Near, ctx->Viewport.Far,
+ _math_matrix_viewport(&ctx->ViewportArray[0]._WindowMap,
+ ctx->ViewportArray[0].X, ctx->ViewportArray[0].Y,
+ ctx->ViewportArray[0].Width, ctx->ViewportArray[0].Height,
+ ctx->ViewportArray[0].Near, ctx->ViewportArray[0].Far,
depthMax);
}
width = MIN2(width, (GLsizei) ctx->Const.MaxViewportWidth);
height = MIN2(height, (GLsizei) ctx->Const.MaxViewportHeight);
- ctx->Viewport.X = x;
- ctx->Viewport.Width = width;
- ctx->Viewport.Y = y;
- ctx->Viewport.Height = height;
+ ctx->ViewportArray[0].X = x;
+ ctx->ViewportArray[0].Width = width;
+ ctx->ViewportArray[0].Y = y;
+ ctx->ViewportArray[0].Height = height;
ctx->NewState |= _NEW_VIEWPORT;
#if 1
* the WindowMap matrix being up to date in the driver's Viewport
* and DepthRange functions.
*/
- _math_matrix_viewport(&ctx->Viewport._WindowMap,
- ctx->Viewport.X, ctx->Viewport.Y,
- ctx->Viewport.Width, ctx->Viewport.Height,
- ctx->Viewport.Near, ctx->Viewport.Far,
+ _math_matrix_viewport(&ctx->ViewportArray[0]._WindowMap,
+ ctx->ViewportArray[0].X, ctx->ViewportArray[0].Y,
+ ctx->ViewportArray[0].Width, ctx->ViewportArray[0].Height,
+ ctx->ViewportArray[0].Near, ctx->ViewportArray[0].Far,
ctx->DrawBuffer->_DepthMaxF);
#endif
if (MESA_VERBOSE&VERBOSE_API)
_mesa_debug(ctx, "glDepthRange %f %f\n", nearval, farval);
- if (ctx->Viewport.Near == nearval &&
- ctx->Viewport.Far == farval)
+ if (ctx->ViewportArray[0].Near == nearval &&
+ ctx->ViewportArray[0].Far == farval)
return;
- ctx->Viewport.Near = CLAMP(nearval, 0.0, 1.0);
- ctx->Viewport.Far = CLAMP(farval, 0.0, 1.0);
+ ctx->ViewportArray[0].Near = CLAMP(nearval, 0.0, 1.0);
+ ctx->ViewportArray[0].Far = CLAMP(farval, 0.0, 1.0);
ctx->NewState |= _NEW_VIEWPORT;
#if 1
* the WindowMap matrix being up to date in the driver's Viewport
* and DepthRange functions.
*/
- _math_matrix_viewport(&ctx->Viewport._WindowMap,
- ctx->Viewport.X, ctx->Viewport.Y,
- ctx->Viewport.Width, ctx->Viewport.Height,
- ctx->Viewport.Near, ctx->Viewport.Far,
+ _math_matrix_viewport(&ctx->ViewportArray[0]._WindowMap,
+ ctx->ViewportArray[0].X, ctx->ViewportArray[0].Y,
+ ctx->ViewportArray[0].Width, ctx->ViewportArray[0].Height,
+ ctx->ViewportArray[0].Near, ctx->ViewportArray[0].Far,
ctx->DrawBuffer->_DepthMaxF);
#endif
GLfloat depthMax = 65535.0F; /* sorf of arbitrary */
/* Viewport group */
- ctx->Viewport.X = 0;
- ctx->Viewport.Y = 0;
- ctx->Viewport.Width = 0;
- ctx->Viewport.Height = 0;
- ctx->Viewport.Near = 0.0;
- ctx->Viewport.Far = 1.0;
- _math_matrix_ctr(&ctx->Viewport._WindowMap);
-
- _math_matrix_viewport(&ctx->Viewport._WindowMap, 0, 0, 0, 0,
+ ctx->ViewportArray[0].X = 0;
+ ctx->ViewportArray[0].Y = 0;
+ ctx->ViewportArray[0].Width = 0;
+ ctx->ViewportArray[0].Height = 0;
+ ctx->ViewportArray[0].Near = 0.0;
+ ctx->ViewportArray[0].Far = 1.0;
+ _math_matrix_ctr(&ctx->ViewportArray[0]._WindowMap);
+
+ _math_matrix_viewport(&ctx->ViewportArray[0]._WindowMap, 0, 0, 0, 0,
0.0F, 1.0F, depthMax);
}
*/
void _mesa_free_viewport_data(struct gl_context *ctx)
{
- _math_matrix_dtr(&ctx->Viewport._WindowMap);
+ _math_matrix_dtr(&ctx->ViewportArray[0]._WindowMap);
}
((int *)value)[0] = ctx->DrawBuffer->Visual.samples;
return;
case STATE_DEPTH_RANGE:
- value[0] = ctx->Viewport.Near; /* near */
- value[1] = ctx->Viewport.Far; /* far */
- value[2] = ctx->Viewport.Far - ctx->Viewport.Near; /* far - near */
+ value[0] = ctx->ViewportArray[0].Near; /* near */
+ value[1] = ctx->ViewportArray[0].Far; /* far */
+ value[2] = ctx->ViewportArray[0].Far - ctx->ViewportArray[0].Near; /* far - near */
value[3] = 1.0;
return;
case STATE_FRAGMENT_PROGRAM:
/* _NEW_VIEWPORT
*/
{
- GLfloat x = ctx->Viewport.X;
- GLfloat y = ctx->Viewport.Y;
- GLfloat z = ctx->Viewport.Near;
- GLfloat half_width = ctx->Viewport.Width * 0.5f;
- GLfloat half_height = ctx->Viewport.Height * 0.5f;
- GLfloat half_depth = (GLfloat)(ctx->Viewport.Far - ctx->Viewport.Near) * 0.5f;
+ GLfloat x = ctx->ViewportArray[0].X;
+ GLfloat y = ctx->ViewportArray[0].Y;
+ GLfloat z = ctx->ViewportArray[0].Near;
+ GLfloat half_width = ctx->ViewportArray[0].Width * 0.5f;
+ GLfloat half_height = ctx->ViewportArray[0].Height * 0.5f;
+ GLfloat half_depth = (GLfloat)(ctx->ViewportArray[0].Far - ctx->ViewportArray[0].Near) * 0.5f;
st->state.viewport.scale[0] = half_width;
st->state.viewport.scale[1] = half_height * yScale;
}
if (ctx->Color.ColorLogicOpEnabled) rasterMask |= LOGIC_OP_BIT;
if (ctx->Texture._EnabledUnits) rasterMask |= TEXTURE_BIT;
- if ( ctx->Viewport.X < 0
- || ctx->Viewport.X + ctx->Viewport.Width > (GLfloat) ctx->DrawBuffer->Width
- || ctx->Viewport.Y < 0
- || ctx->Viewport.Y + ctx->Viewport.Height > (GLfloat) ctx->DrawBuffer->Height) {
+ if ( ctx->ViewportArray[0].X < 0
+ || ctx->ViewportArray[0].X + ctx->ViewportArray[0].Width > (GLfloat) ctx->DrawBuffer->Width
+ || ctx->ViewportArray[0].Y < 0
+ || ctx->ViewportArray[0].Y + ctx->ViewportArray[0].Height > (GLfloat) ctx->DrawBuffer->Height) {
rasterMask |= CLIP_BIT;
}
GLfloat min_f, max_f;
GLuint i;
- if (ctx->Viewport.Near < ctx->Viewport.Far) {
- min_f = ctx->Viewport.Near;
- max_f = ctx->Viewport.Far;
+ if (ctx->ViewportArray[0].Near < ctx->ViewportArray[0].Far) {
+ min_f = ctx->ViewportArray[0].Near;
+ max_f = ctx->ViewportArray[0].Far;
} else {
- min_f = ctx->Viewport.Far;
- max_f = ctx->Viewport.Near;
+ min_f = ctx->ViewportArray[0].Far;
+ max_f = ctx->ViewportArray[0].Near;
}
/* Convert floating point values in [0,1] to device Z coordinates in
EMIT_ATTR( _TNL_ATTRIB_POINTSIZE, EMIT_1F, pointSize );
_tnl_install_attrs( ctx, map, e,
- ctx->Viewport._WindowMap.m,
+ ctx->ViewportArray[0]._WindowMap.m,
sizeof(SWvertex) );
swsetup->last_index_bitset = index_bitset;
void
_swsetup_Translate( struct gl_context *ctx, const void *vertex, SWvertex *dest )
{
- const GLfloat *m = ctx->Viewport._WindowMap.m;
+ const GLfloat *m = ctx->ViewportArray[0]._WindowMap.m;
GLfloat tmp[4];
GLuint i;
ndc[1] = clip[1] * d;
ndc[2] = clip[2] * d;
/* wincoord = viewport_mapping(ndc) */
- ctx->Current.RasterPos[0] = (ndc[0] * ctx->Viewport._WindowMap.m[MAT_SX]
- + ctx->Viewport._WindowMap.m[MAT_TX]);
- ctx->Current.RasterPos[1] = (ndc[1] * ctx->Viewport._WindowMap.m[MAT_SY]
- + ctx->Viewport._WindowMap.m[MAT_TY]);
- ctx->Current.RasterPos[2] = (ndc[2] * ctx->Viewport._WindowMap.m[MAT_SZ]
- + ctx->Viewport._WindowMap.m[MAT_TZ])
+ 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;
ctx->Current.RasterPos[3] = clip[3];
if (ctx->Transform.DepthClamp) {
ctx->Current.RasterPos[3] = CLAMP(ctx->Current.RasterPos[3],
- ctx->Viewport.Near,
- ctx->Viewport.Far);
+ ctx->ViewportArray[0].Near,
+ ctx->ViewportArray[0].Far);
}
/* compute raster distance */