Almost all drivers ignore them.
(viewport->scale[0] == 1.0f &&
viewport->scale[1] == 1.0f &&
viewport->scale[2] == 1.0f &&
- viewport->scale[3] == 1.0f &&
viewport->translate[0] == 0.0f &&
viewport->translate[1] == 0.0f &&
- viewport->translate[2] == 0.0f &&
- viewport->translate[3] == 0.0f);
+ viewport->translate[2] == 0.0f);
}
viewport.scale[0] = 0.5f * hud->fb_width;
viewport.scale[1] = 0.5f * hud->fb_height;
viewport.scale[2] = 1.0f;
- viewport.scale[3] = 1.0f;
viewport.translate[0] = 0.5f * hud->fb_width;
viewport.translate[1] = 0.5f * hud->fb_height;
viewport.translate[2] = 0.0f;
- viewport.translate[3] = 0.0f;
cso_set_framebuffer(cso, &fb);
cso_set_sample_mask(cso, ~0);
p->viewport.scale[0] = p->viewport.translate[0] = (float) w / 2.0f;
p->viewport.scale[1] = p->viewport.translate[1] = (float) h / 2.0f;
- p->viewport.scale[3] = 1.0f;
- p->viewport.translate[3] = 0.0f;
ppq->fbos_init = true;
ctx->viewport.scale[0] = 0.5f * dst->width;
ctx->viewport.scale[1] = 0.5f * dst->height;
ctx->viewport.scale[2] = 0.5f;
- ctx->viewport.scale[3] = 1.0f;
ctx->viewport.translate[0] = 0.5f * dst->width;
ctx->viewport.translate[1] = 0.5f * dst->height;
ctx->viewport.translate[2] = 0.5f;
- ctx->viewport.translate[3] = 0.0f;
cso_set_viewport(ctx->cso, &ctx->viewport);
/* texture */
ctx->viewport.scale[0] = 0.5f * ctx->dst_width;
ctx->viewport.scale[1] = 0.5f * ctx->dst_height;
ctx->viewport.scale[2] = 1.0f;
- ctx->viewport.scale[3] = 1.0f;
ctx->viewport.translate[0] = 0.5f * ctx->dst_width;
ctx->viewport.translate[1] = 0.5f * ctx->dst_height;
ctx->viewport.translate[2] = 0.0f;
- ctx->viewport.translate[3] = 0.0f;
ctx->base.pipe->set_viewport_states(ctx->base.pipe, 0, 1, &ctx->viewport);
}
viewport.scale[0] = 0.5f * tex->width0;
viewport.scale[1] = 0.5f * tex->height0;
viewport.scale[2] = 1.0f;
- viewport.scale[3] = 1.0f;
viewport.translate[0] = 0.5f * tex->width0;
viewport.translate[1] = 0.5f * tex->height0;
viewport.translate[2] = 0.0f;
- viewport.translate[3] = 0.0f;
cso_set_viewport(cso, &viewport);
}
s->layers[i].blend = NULL;
s->layers[i].fs = NULL;
s->layers[i].viewport.scale[2] = 1;
- s->layers[i].viewport.scale[3] = 1;
s->layers[i].viewport.translate[2] = 0;
- s->layers[i].viewport.translate[3] = 0;
s->layers[i].rotate = VL_COMPOSITOR_ROTATE_0;
for ( j = 0; j < 3; j++)
/* prepare viewport */
memset(&viewport, 0, sizeof(viewport));
viewport.scale[2] = 1;
- viewport.scale[3] = 1;
/* prepare framebuffer */
memset(&fb_state, 0, sizeof(fb_state));
buffer->viewport_mismatch.scale[0] = tex->width0;
buffer->viewport_mismatch.scale[1] = tex->height0;
buffer->viewport_mismatch.scale[2] = 1;
- buffer->viewport_mismatch.scale[3] = 1;
return true;
}
buffer->viewport.scale[0] = tex->width0;
buffer->viewport.scale[1] = tex->height0;
buffer->viewport.scale[2] = 1;
- buffer->viewport.scale[3] = 1;
return true;
viewport.scale[0] = dst->width;
viewport.scale[1] = dst->height;
viewport.scale[2] = 1;
- viewport.scale[3] = 1;
memset(&fb_state, 0, sizeof(fb_state));
fb_state.width = dst->width;
assert(renderer && buffer);
buffer->viewport.scale[2] = 1;
- buffer->viewport.scale[3] = 1;
buffer->viewport.translate[0] = 0;
buffer->viewport.translate[1] = 0;
buffer->viewport.translate[2] = 0;
- buffer->viewport.translate[3] = 0;
buffer->fb_state.nr_cbufs = 1;
buffer->fb_state.zsbuf = NULL;
viewport.scale[0] = dst->width;
viewport.scale[1] = dst->height;
viewport.scale[2] = 1;
- viewport.scale[3] = 1;
memset(&fb_state, 0, sizeof(fb_state));
fb_state.width = dst->width;
buffer->viewport.scale[0] = dst->width;
buffer->viewport.scale[1] = dst->height;
buffer->viewport.scale[2] = 1;
- buffer->viewport.scale[3] = 1;
buffer->viewport.translate[0] = 0;
buffer->viewport.translate[1] = 0;
buffer->viewport.translate[2] = 0;
- buffer->viewport.translate[3] = 0;
buffer->fb_state.width = dst->width;
buffer->fb_state.height = dst->height;
vp.scale[0] = 1.0f;
vp.scale[1] = 1.0f;
vp.scale[2] = 1.0f;
- vp.scale[3] = 1.0f;
ilo_gpe_set_viewport_cso(blitter->ilo->dev, &vp, &blitter->viewport);
blitter->initialized = true;
PUSH_DATAf(push, vp->translate[0]);
PUSH_DATAf(push, vp->translate[1]);
PUSH_DATAf(push, vp->translate[2]);
- PUSH_DATAf(push, vp->translate[3]);
+ PUSH_DATAf(push, 0.0f);
PUSH_DATAf(push, vp->scale[0]);
PUSH_DATAf(push, vp->scale[1]);
PUSH_DATAf(push, vp->scale[2]);
- PUSH_DATAf(push, vp->scale[3]);
+ PUSH_DATAf(push, 1.0f);
BEGIN_NV04(push, NV30_3D(DEPTH_RANGE_NEAR), 2);
PUSH_DATAf(push, vp->translate[2] - fabsf(vp->scale[2]));
PUSH_DATAf(push, vp->translate[2] + fabsf(vp->scale[2]));
viewport.scale[0] = 1.0f;
viewport.scale[1] = 1.0f;
viewport.scale[2] = 1.0f;
- viewport.scale[3] = 1.0f;
viewport.translate[0] = 0.0f;
viewport.translate[1] = 0.0f;
viewport.translate[2] = 0.0f;
- viewport.translate[3] = 0.0f;
rctx->b.set_viewport_states(&rctx->b, 0, 1, &viewport);
/* Upload vertices. The hw rectangle has only 3 vertices,
struct pipe_viewport_state
{
- float scale[4];
- float translate[4];
+ float scale[3];
+ float translate[3];
};
viewport.scale[0] = fb->width / 2.f;
viewport.scale[1] = fb->height / y_scale;
viewport.scale[2] = 1.0;
- viewport.scale[3] = 1.0;
viewport.translate[0] = fb->width / 2.f;
viewport.translate[1] = fb->height / 2.f;
viewport.translate[2] = 0.0;
- viewport.translate[3] = 0.0;
cso_set_viewport(r->cso, &viewport);
}
viewport.scale[0] = width / 2.f;
viewport.scale[1] = height / 2.f;
viewport.scale[2] = 1.0;
- viewport.scale[3] = 1.0;
viewport.translate[0] = width / 2.f;
viewport.translate[1] = height / 2.f;
viewport.translate[2] = 0.0;
- viewport.translate[3] = 0.0;
/* Constant buffer set up to match viewport dimensions:
*/
vp.scale[0] = half_width;
vp.scale[1] = half_height;
vp.scale[2] = half_depth;
- vp.scale[3] = 1.0f;
vp.translate[0] = half_width + x;
vp.translate[1] = half_height + y;
vp.translate[2] = half_depth + z;
- vp.translate[3] = 0.0f;
ctx->set_viewport_states( ctx, 0, 1, &vp );
}
vp.scale[0] = half_width;
vp.scale[1] = half_height;
vp.scale[2] = half_depth;
- vp.scale[3] = 1.0f;
vp.translate[0] = half_width + x;
vp.translate[1] = half_height + y;
vp.translate[2] = half_depth + z;
- vp.translate[3] = 0.0f;
info->ctx->set_viewport_states(info->ctx, 0, 1, &vp);
}
vp.scale[0] = half_width;
vp.scale[1] = half_height;
vp.scale[2] = half_depth;
- vp.scale[3] = 1.0f;
vp.translate[0] = half_width + x;
vp.translate[1] = half_height + y;
vp.translate[2] = half_depth + z;
- vp.translate[3] = 0.0f;
ctx->set_viewport_states( ctx, 0, 1, &vp );
}
vp.scale[0] = half_width;
vp.scale[1] = half_height;
vp.scale[2] = half_depth;
- vp.scale[3] = 1.0f;
vp.translate[0] = half_width + x;
vp.translate[1] = half_height + y;
vp.translate[2] = half_depth + z;
- vp.translate[3] = 0.0f;
ctx->set_viewport_states( ctx, 0, 1, &vp );
}
vp.scale[0] = half_width;
vp.scale[1] = half_height;
vp.scale[2] = half_depth;
- vp.scale[3] = 1.0f;
vp.translate[0] = half_width + x;
vp.translate[1] = half_height + y;
vp.translate[2] = half_depth + z;
- vp.translate[3] = 0.0f;
ctx->set_viewport_states( ctx, 0, 1, &vp );
}
vp.scale[0] = half_width;
vp.scale[1] = half_height;
vp.scale[2] = half_depth;
- vp.scale[3] = 1.0f;
vp.translate[0] = half_width + x;
vp.translate[1] = half_height + y;
vp.translate[2] = half_depth + z;
- vp.translate[3] = 0.0f;
ctx->set_viewport_states( ctx, 0, 1, &vp );
}
vp.scale[0] = half_width;
vp.scale[1] = half_height;
vp.scale[2] = half_depth;
- vp.scale[3] = 1.0f;
vp.translate[0] = half_width + x;
vp.translate[1] = half_height + y;
vp.translate[2] = half_depth + z;
- vp.translate[3] = 0.0f;
ctx->set_viewport_states( ctx, 0, 1, &vp );
}
vp.scale[0] = half_width;
vp.scale[1] = half_height;
vp.scale[2] = half_depth;
- vp.scale[3] = 1.0f;
vp.translate[0] = half_width + x;
vp.translate[1] = half_height + y;
vp.translate[2] = half_depth + z;
- vp.translate[3] = 0.0f;
ctx->set_viewport_states( ctx, 0, 1, &vp );
}
p->viewport.scale[0] = half_width;
p->viewport.scale[1] = half_height * scale;
p->viewport.scale[2] = half_depth;
- p->viewport.scale[3] = 1.0f;
p->viewport.translate[0] = half_width + x;
p->viewport.translate[1] = (half_height + y) * scale + bias;
p->viewport.translate[2] = half_depth + z;
- p->viewport.translate[3] = 0.0f;
}
/* vertex elements state */
p->viewport.scale[0] = half_width;
p->viewport.scale[1] = half_height * scale;
p->viewport.scale[2] = half_depth;
- p->viewport.scale[3] = 1.0f;
p->viewport.translate[0] = half_width + x;
p->viewport.translate[1] = (half_height + y) * scale + bias;
p->viewport.translate[2] = half_depth + z;
- p->viewport.translate[3] = 0.0f;
}
/* vertex elements state */
st->state.viewport[i].scale[0] = scale[0];
st->state.viewport[i].scale[1] = scale[1] * yScale;
st->state.viewport[i].scale[2] = scale[2];
- st->state.viewport[i].scale[3] = 1.0;
st->state.viewport[i].translate[0] = translate[0];
st->state.viewport[i].translate[1] = translate[1] * yScale + yBias;
st->state.viewport[i].translate[2] = translate[2];
- st->state.viewport[i].translate[3] = 0.0;
}
cso_set_viewport(st->cso_context, &st->state.viewport[0]);
vp.scale[0] = 0.5f * width;
vp.scale[1] = height * (invert ? -0.5f : 0.5f);
vp.scale[2] = 0.5f;
- vp.scale[3] = 1.0f;
vp.translate[0] = 0.5f * width;
vp.translate[1] = 0.5f * height;
vp.translate[2] = 0.5f;
- vp.translate[3] = 0.0f;
cso_set_viewport(cso, &vp);
}
vp.scale[0] = 0.5f * fb_width;
vp.scale[1] = fb_height * (invert ? -0.5f : 0.5f);
vp.scale[2] = 0.5f;
- vp.scale[3] = 1.0f;
vp.translate[0] = 0.5f * fb_width;
vp.translate[1] = 0.5f * fb_height;
vp.translate[2] = 0.5f;
- vp.translate[3] = 0.0f;
cso_set_viewport(st->cso_context, &vp);
}
vp.scale[0] = 0.5f * w;
vp.scale[1] = -0.5f * h;
vp.scale[2] = 0.5f;
- vp.scale[3] = 1.0f;
vp.translate[0] = 0.5f * w;
vp.translate[1] = 0.5f * h;
vp.translate[2] = 0.5f;
- vp.translate[3] = 0.0f;
cso_set_viewport(cso, &vp);
}
vp.scale[0] = 0.5f * width;
vp.scale[1] = height * (invert ? -0.5f : 0.5f);
vp.scale[2] = 1.0f;
- vp.scale[3] = 1.0f;
vp.translate[0] = 0.5f * width;
vp.translate[1] = 0.5f * height;
vp.translate[2] = 0.0f;
- vp.translate[3] = 0.0f;
cso_set_viewport(cso, &vp);
}