rast.scissor = scissor;
rast.flatshade = flatshade;
rast.front_ccw = 1;
- rast.gl_rasterization_rules = draw->rasterizer->gl_rasterization_rules;
+ rast.half_pixel_center = draw->rasterizer->half_pixel_center;
+ rast.bottom_edge_rule = draw->rasterizer->bottom_edge_rule;
rast.clip_halfz = draw->rasterizer->clip_halfz;
draw->rasterizer_no_cull[scissor][flatshade] =
const float dx = fabsf(pos0[0] - pos2[0]);
const float dy = fabsf(pos0[1] - pos2[1]);
- const boolean gl_rasterization_rules =
- stage->draw->rasterizer->gl_rasterization_rules;
+ const boolean half_pixel_center =
+ stage->draw->rasterizer->half_pixel_center;
/* small tweak to meet GL specification */
- const float bias = gl_rasterization_rules ? 0.125f : 0.0f;
+ const float bias = half_pixel_center ? 0.125f : 0.0f;
/*
* Draw wide line as a quad (two tris) by "stretching" the line along
pos1[1] = pos1[1] + half_width - bias;
pos2[1] = pos2[1] - half_width - bias;
pos3[1] = pos3[1] + half_width - bias;
- if (gl_rasterization_rules) {
+ if (half_pixel_center) {
if (pos0[0] < pos2[0]) {
/* left to right line */
pos0[0] -= 0.5f;
pos1[0] = pos1[0] + half_width + bias;
pos2[0] = pos2[0] - half_width + bias;
pos3[0] = pos3[0] + half_width + bias;
- if (gl_rasterization_rules) {
+ if (half_pixel_center) {
if (pos0[1] < pos2[1]) {
/* top to bottom line */
pos0[1] -= 0.5f;
wide->xbias = 0.0;
wide->ybias = 0.0;
- if (rast->gl_rasterization_rules) {
+ if (rast->half_pixel_center) {
wide->xbias = 0.125;
wide->ybias = -0.125;
}
fpme->vertex_size,
instance_id_index );
draw_pt_post_vs_prepare( fpme->post_vs,
- draw->clip_xy,
- draw->clip_z,
- draw->clip_user,
+ draw->clip_xy,
+ draw->clip_z,
+ draw->clip_user,
draw->guard_band_xy,
draw->identity_viewport,
draw->rasterizer->clip_halfz,
draw_pt_post_vs_prepare( fpme->post_vs,
- draw->clip_xy,
- draw->clip_z,
- draw->clip_user,
+ draw->clip_xy,
+ draw->clip_z,
+ draw->clip_user,
draw->guard_band_xy,
draw->identity_viewport,
draw->rasterizer->clip_halfz,
}
/* rasterizer */
- hud->rasterizer.gl_rasterization_rules = 1;
+ hud->rasterizer.half_pixel_center = 1;
+ hud->rasterizer.bottom_edge_rule = 1;
hud->rasterizer.depth_clip = 1;
hud->rasterizer.line_width = 1;
hud->rasterizer.line_last_pixel = 1;
PIPE_BLENDFACTOR_INV_SRC_ALPHA;
p->rasterizer.cull_face = PIPE_FACE_NONE;
- p->rasterizer.gl_rasterization_rules = 1;
+ p->rasterizer.half_pixel_center = 1;
+ p->rasterizer.bottom_edge_rule = 1;
p->rasterizer.depth_clip = 1;
p->sampler.wrap_s = p->sampler.wrap_t = p->sampler.wrap_r =
/* rasterizer */
ctx->rasterizer.cull_face = PIPE_FACE_NONE;
- ctx->rasterizer.gl_rasterization_rules = 1;
+ ctx->rasterizer.half_pixel_center = 1;
+ ctx->rasterizer.bottom_edge_rule = 1;
ctx->rasterizer.depth_clip = 1;
/* samplers */
/* rasterizer state */
memset(&rs_state, 0, sizeof(rs_state));
rs_state.cull_face = PIPE_FACE_NONE;
- rs_state.gl_rasterization_rules = 1;
+ rs_state.half_pixel_center = 1;
+ rs_state.bottom_edge_rule = 1;
rs_state.flatshade = 1;
rs_state.depth_clip = 1;
ctx->rs_state = pipe->create_rasterizer_state(pipe, &rs_state);
util_dump_member(stream, uint, state, line_stipple_pattern);
util_dump_member(stream, bool, state, line_last_pixel);
util_dump_member(stream, bool, state, flatshade_first);
- util_dump_member(stream, bool, state, gl_rasterization_rules);
+ util_dump_member(stream, bool, state, half_pixel_center);
+ util_dump_member(stream, bool, state, bottom_edge_rule);
util_dump_member(stream, bool, state, rasterizer_discard);
util_dump_member(stream, bool, state, depth_clip);
util_dump_member(stream, uint, state, clip_plane_enable);
/* rasterizer */
memset(&ctx->rasterizer, 0, sizeof(ctx->rasterizer));
ctx->rasterizer.cull_face = PIPE_FACE_NONE;
- ctx->rasterizer.gl_rasterization_rules = 1;
+ ctx->rasterizer.half_pixel_center = 1;
+ ctx->rasterizer.bottom_edge_rule = 1;
ctx->rasterizer.depth_clip = 1;
/* sampler state */
{
/* The point size should be clamped to this value at the rasterizer stage.
*/
- return state->gl_rasterization_rules &&
- !state->point_quad_rasterization &&
+ return !state->point_quad_rasterization &&
!state->point_smooth &&
!state->multisample ? 1.0f : 0.0f;
}
rast.point_size_per_vertex = 1;
rast.offset_units = 1;
rast.offset_scale = 1;
- rast.gl_rasterization_rules = 1;
+ rast.half_pixel_center = 1;
+ rast.bottom_edge_rule = 1;
rast.depth_clip = 1;
c->rast = c->pipe->create_rasterizer_state(c->pipe, &rast);
memset(&rs_state, 0, sizeof(rs_state));
rs_state.point_size = 1;
- rs_state.gl_rasterization_rules = true;
+ rs_state.half_pixel_center = true;
+ rs_state.bottom_edge_rule = true;
rs_state.depth_clip = 1;
idct->rs_state = idct->pipe->create_rasterizer_state(idct->pipe, &rs_state);
if (!idct->rs_state)
filter->pipe = pipe;
memset(&rs_state, 0, sizeof(rs_state));
- rs_state.gl_rasterization_rules = true;
+ rs_state.half_pixel_center = true;
+ rs_state.bottom_edge_rule = true;
rs_state.depth_clip = 1;
filter->rs_state = pipe->create_rasterizer_state(pipe, &rs_state);
if (!filter->rs_state)
rs_state.sprite_coord_mode = PIPE_SPRITE_COORD_UPPER_LEFT;
rs_state.point_quad_rasterization = true;
rs_state.point_size = VL_BLOCK_WIDTH;
- rs_state.gl_rasterization_rules = true;
+ rs_state.half_pixel_center = true;
+ rs_state.bottom_edge_rule = true;
rs_state.depth_clip = 1;
r->rs_state = r->pipe->create_rasterizer_state(r->pipe, &rs_state);
if (!r->rs_state)
filter->pipe = pipe;
memset(&rs_state, 0, sizeof(rs_state));
- rs_state.gl_rasterization_rules = true;
+ rs_state.half_pixel_center = true;
+ rs_state.bottom_edge_rule = true;
rs_state.depth_clip = 1;
filter->rs_state = pipe->create_rasterizer_state(pipe, &rs_state);
if (!filter->rs_state)
assert(zscan);
memset(&rs_state, 0, sizeof(rs_state));
- rs_state.gl_rasterization_rules = true;
+ rs_state.half_pixel_center = true;
+ rs_state.bottom_edge_rule = true;
rs_state.depth_clip = 1;
zscan->rs_state = zscan->pipe->create_rasterizer_state(zscan->pipe, &rs_state);
if (!zscan->rs_state)
multisample
Whether :term:`MSAA` is enabled.
-gl_rasterization_rules
- Whether the rasterizer should use (0.5, 0.5) pixel centers. When not set,
- the rasterizer will use (0, 0) for pixel centers.
+half_pixel_center
+ When true, the rasterizer should use (0.5, 0.5) pixel centers for
+ determining pixel ownership (e.g, OpenGL, D3D10 and higher)::
+
+ 0 0.5 1
+ 0 +-----+
+ | |
+ 0.5 | X |
+ | |
+ 1 +-----+
+
+ When false, the rasterizer should use (0, 0) pixel centers for determining
+ pixel ownership (e.g., D3D9 or ealier)::
+
+ -0.5 0 0.5
+ -0.5 +-----+
+ | |
+ 0 | X |
+ | |
+ 0.5 +-----+
+
+bottom_edge_rule
+ Determines what happens when a pixel sample lies precisely on a triangle
+ edge.
+
+ When true, a pixel sample is considered to lie inside of a triangle if it
+ lies on the *bottom edge* or *left edge* (e.g., OpenGL drawables)::
+
+ 0 x
+ 0 +--------------------->
+ |
+ | +-------------+
+ | | |
+ | | |
+ | | |
+ | +=============+
+ |
+ y V
+
+ When false, a pixel sample is considered to lie inside of a triangle if it
+ lies on the *top edge* or *left edge* (e.g., OpenGL FBOs, D3D)::
+
+ 0 x
+ 0 +--------------------->
+ |
+ | +=============+
+ | | |
+ | | |
+ | | |
+ | +-------------+
+ |
+ y V
+
+ Where:
+ - a *top edge* is an edge that is horizontal and is above the other edges;
+ - a *bottom edge* is an edge that is horizontal and is below the other
+ edges;
+ - a *left edge* is an edge that is not horizontal and is on the left side of
+ the triangle.
+
+ .. note::
+
+ Actually all graphics APIs use a top-left rasterization rule for pixel
+ ownership, but their notion of top varies with the axis origin (which
+ can be either at y = 0 or at y = height). Gallium instead always
+ assumes that top is always at y=0.
+
+ See also:
+ - http://msdn.microsoft.com/en-us/library/windows/desktop/cc627092.aspx
+ - http://msdn.microsoft.com/en-us/library/windows/desktop/bb147314.aspx
clip_halfz
When true clip space in the z axis goes from [0..1] (D3D). When false
If INTEGER, the fractionary part of the position will be 0.0
Note that this does not affect the set of fragments generated by
-rasterization, which is instead controlled by gl_rasterization_rules in the
+rasterization, which is instead controlled by half_pixel_center in the
rasterizer.
OpenGL defaults to HALF_INTEGER, and is configurable with the
so->pa_cl_clip_cntl = 0; // TODO
so->pa_su_vtx_cntl =
- A2XX_PA_SU_VTX_CNTL_PIX_CENTER(cso->gl_rasterization_rules ? PIXCENTER_OGL : PIXCENTER_D3D) |
+ A2XX_PA_SU_VTX_CNTL_PIX_CENTER(cso->half_pixel_center ? PIXCENTER_OGL : PIXCENTER_D3D) |
A2XX_PA_SU_VTX_CNTL_QUANT_MODE(ONE_SIXTEENTH);
so->pa_su_point_size =
unsigned cull_mode,
boolean ccw_is_frontface,
boolean scissor,
- boolean gl_rasterization_rules)
+ boolean half_pixel_center,
+ boolean bottom_edge_rule)
{
LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__);
setup->ccw_is_frontface = ccw_is_frontface;
setup->cullmode = cull_mode;
setup->triangle = first_triangle;
- setup->pixel_offset = gl_rasterization_rules ? 0.5f : 0.0f;
+ setup->pixel_offset = half_pixel_center ? 0.5f : 0.0f;
+ setup->bottom_edge_rule = bottom_edge_rule;
if (setup->scissor_test != scissor) {
setup->dirty |= LP_SETUP_NEW_SCISSOR;
unsigned cullmode,
boolean front_is_ccw,
boolean scissor,
- boolean gl_rasterization_rules );
+ boolean half_pixel_center,
+ boolean bottom_edge_rule);
void
lp_setup_set_line_state( struct lp_setup_context *setup,
boolean point_size_per_vertex;
boolean rasterizer_discard;
unsigned cullmode;
+ unsigned bottom_edge_rule;
float pixel_offset;
float line_width;
float point_size;
/* correct for top-left vs. bottom-left fill convention.
- *
- * note that we're overloading gl_rasterization_rules to mean
- * both (0.5,0.5) pixel centers *and* bottom-left filling
- * convention.
- *
- * GL actually has a top-left filling convention, but GL's
- * notion of "top" differs from gallium's...
- *
- * Also, sometimes (in FBO cases) GL will render upside down
- * to its usual method, in which case it will probably want
- * to use the opposite, top-left convention.
*/
if (plane[i].dcdx < 0) {
/* both fill conventions want this - adjust for left edges */
dcdx_zero_mask = _mm_cmpeq_epi32(dcdx, zero);
dcdy_neg_mask = _mm_srai_epi32(dcdy, 31);
- top_left_flag = _mm_set1_epi32((setup->pixel_offset == 0) ? ~0 : 0);
+ top_left_flag = _mm_set1_epi32((setup->bottom_edge_rule == 0) ? ~0 : 0);
c_inc_mask = _mm_or_si128(dcdx_neg_mask,
_mm_and_si128(dcdx_zero_mask,
*/
plane[i].c = plane[i].dcdx * position->x[i] - plane[i].dcdy * position->y[i];
- /* correct for top-left vs. bottom-left fill convention.
- *
- * note that we're overloading gl_rasterization_rules to mean
- * both (0.5,0.5) pixel centers *and* bottom-left filling
- * convention.
- *
- * GL actually has a top-left filling convention, but GL's
- * notion of "top" differs from gallium's...
- *
- * Also, sometimes (in FBO cases) GL will render upside down
- * to its usual method, in which case it will probably want
- * to use the opposite, top-left convention.
+ /* correct for top-left vs. bottom-left fill convention.
*/
if (plane[i].dcdx < 0) {
/* both fill conventions want this - adjust for left edges */
plane[i].c++;
}
else if (plane[i].dcdx == 0) {
- if (setup->pixel_offset == 0) {
+ if (setup->bottom_edge_rule == 0){
/* correct for top-left fill convention:
*/
if (plane[i].dcdy > 0) plane[i].c++;
/* XXX: just pass lp_state directly to setup.
*/
lp_setup_set_triangle_state( llvmpipe->setup,
- state->lp_state.cull_face,
- state->lp_state.front_ccw,
- state->lp_state.scissor,
- state->lp_state.gl_rasterization_rules);
+ state->lp_state.cull_face,
+ state->lp_state.front_ccw,
+ state->lp_state.scissor,
+ state->lp_state.half_pixel_center,
+ state->lp_state.bottom_edge_rule);
lp_setup_set_flatshade_first( llvmpipe->setup,
state->lp_state.flatshade_first);
lp_setup_set_rasterizer_discard( llvmpipe->setup,
state->lp_state.rasterizer_discard);
lp_setup_set_line_state( llvmpipe->setup,
- state->lp_state.line_width);
+ state->lp_state.line_width);
lp_setup_set_point_state( llvmpipe->setup,
- state->lp_state.point_size,
- state->lp_state.point_size_per_vertex,
- state->lp_state.sprite_coord_enable,
- state->lp_state.sprite_coord_mode);
+ state->lp_state.point_size,
+ state->lp_state.point_size_per_vertex,
+ state->lp_state.sprite_coord_enable,
+ state->lp_state.sprite_coord_mode);
}
else {
llvmpipe->rasterizer = NULL;
key->num_inputs = fs->info.base.num_inputs;
key->flatshade_first = lp->rasterizer->flatshade_first;
- key->pixel_center_half = lp->rasterizer->gl_rasterization_rules;
+ key->pixel_center_half = lp->rasterizer->half_pixel_center;
key->twoside = lp->rasterizer->light_twoside;
key->size = Offset(struct lp_setup_variant_key,
inputs[key->num_inputs]);
* ! pipe_rasterizer_state.flatshade_first also applies to QUADS
* (There's a GL query for that, forcing an exception is just ridiculous.)
*
- * ! pipe_rasterizer_state.gl_rasterization_rules is ignored - pixel centers
+ * ! pipe_rasterizer_state.half_pixel_center is ignored - pixel centers
* are always at half integer coordinates and the top-left rule applies
* (There does not seem to be a hardware switch for this.)
*
nvc0->blit->nvc0 = nvc0;
- nvc0->blit->rast.pipe.gl_rasterization_rules = 1;
+ nvc0->blit->rast.pipe.half_pixel_center = 1;
return TRUE;
}
if (rctx->chip_class == CAYMAN) {
r600_store_context_reg(&rs->buffer, CM_R_028BE4_PA_SU_VTX_CNTL,
- S_028C08_PIX_CENTER_HALF(state->gl_rasterization_rules) |
+ S_028C08_PIX_CENTER_HALF(state->half_pixel_center) |
S_028C08_QUANT_MODE(V_028C08_X_1_256TH));
} else {
r600_store_context_reg(&rs->buffer, R_028C08_PA_SU_VTX_CNTL,
- S_028C08_PIX_CENTER_HALF(state->gl_rasterization_rules) |
+ S_028C08_PIX_CENTER_HALF(state->half_pixel_center) |
S_028C08_QUANT_MODE(V_028C08_X_1_256TH));
}
r600_store_context_reg(&rs->buffer, R_0286D4_SPI_INTERP_CONTROL_0, spi_interp);
r600_store_context_reg(&rs->buffer, R_028A4C_PA_SC_MODE_CNTL, sc_mode_cntl);
r600_store_context_reg(&rs->buffer, R_028C08_PA_SU_VTX_CNTL,
- S_028C08_PIX_CENTER_HALF(state->gl_rasterization_rules) |
+ S_028C08_PIX_CENTER_HALF(state->half_pixel_center) |
S_028C08_QUANT_MODE(V_028C08_X_1_256TH));
r600_store_context_reg(&rs->buffer, R_028DFC_PA_SU_POLY_OFFSET_CLAMP, fui(state->offset_clamp));
r600_store_context_reg(&rs->buffer, R_028814_PA_SU_SC_MODE_CNTL,
si_pm4_set_reg(pm4, R_028BDC_PA_SC_LINE_CNTL, 0x00000400);
si_pm4_set_reg(pm4, R_028BE4_PA_SU_VTX_CNTL,
- S_028BE4_PIX_CENTER(state->gl_rasterization_rules));
+ S_028BE4_PIX_CENTER(state->half_pixel_center));
si_pm4_set_reg(pm4, R_028BE8_PA_CL_GB_VERT_CLIP_ADJ, 0x3F800000);
si_pm4_set_reg(pm4, R_028BEC_PA_CL_GB_VERT_DISC_ADJ, 0x3F800000);
si_pm4_set_reg(pm4, R_028BF0_PA_CL_GB_HORZ_CLIP_ADJ, 0x3F800000);
* - pixel center (0.5, 0.5) for GL, or
* - assume (0.0, 0.0) for other APIs.
*/
- if (setup->softpipe->rasterizer->gl_rasterization_rules) {
+ if (setup->softpipe->rasterizer->half_pixel_center) {
setup->pixel_offset = 0.5f;
} else {
setup->pixel_offset = 0.0f;
/* point_size_per_vertex - ? */
/* sprite_coord_mode - ??? */
/* flatshade_first - handled by index translation */
- /* gl_rasterization_rules - XXX - viewport code */
+ /* half_pixel_center - XXX - viewport code */
/* line_width - draw module */
/* fill_cw, fill_ccw - draw module or index translation */
* screen-space coordinates slightly relative to D3D which is
* what hardware implements natively.
*/
- if (svga->curr.rast->templ.gl_rasterization_rules) {
+ if (svga->curr.rast->templ.half_pixel_center) {
float adjust_x = 0.0;
float adjust_y = 0.0;
trace_dump_member(uint, state, line_stipple_pattern);
trace_dump_member(bool, state, line_last_pixel);
trace_dump_member(bool, state, flatshade_first);
- trace_dump_member(bool, state, gl_rasterization_rules);
+ trace_dump_member(bool, state, half_pixel_center);
+ trace_dump_member(bool, state, bottom_edge_rule);
trace_dump_member(bool, state, rasterizer_discard);
trace_dump_member(bool, state, depth_clip);
trace_dump_member(uint, state, clip_plane_enable);
*/
unsigned flatshade_first:1;
- /**
- * When true, triangle rasterization uses (0.5, 0.5) pixel centers
- * for determining pixel ownership.
- *
- * When false, triangle rasterization uses (0,0) pixel centers for
- * determining pixel ownership.
- *
- * Triangle rasterization always uses a 'top,left' rule for pixel
- * ownership, this just alters which point we consider the pixel
- * center for that test.
- */
- unsigned gl_rasterization_rules:1;
+ unsigned half_pixel_center:1;
+ unsigned bottom_edge_rule:1;
/**
* When true, rasterization is disabled and no pixels are written.
/* GL rasterization rules */
raster = &renderer->g3d.rasterizer;
memset(raster, 0, sizeof(*raster));
- raster->gl_rasterization_rules = 1;
+ raster->half_pixel_center = 1;
+ raster->bottom_edge_rule = 1;
raster->depth_clip = 1;
cso_set_rasterizer(renderer->cso, raster);
/* XXX: move to renderer_init_state? */
memset(&raster, 0, sizeof(struct pipe_rasterizer_state));
- raster.gl_rasterization_rules = 1;
+ raster.half_pixel_center = 1;
+ raster.bottom_edge_rule = 1;
raster.depth_clip = 1;
cso_set_rasterizer(r->cso, &raster);
/* XXX: move to renderer_init_state? */
memset(&raster, 0, sizeof(struct pipe_rasterizer_state));
- raster.gl_rasterization_rules = 1;
+ raster.half_pixel_center = 1;
+ raster.bottom_edge_rule = 1;
raster.depth_clip = 1;
cso_set_rasterizer(r->cso, &raster);
void *handle;
memset(&rasterizer, 0, sizeof rasterizer);
rasterizer.cull_face = PIPE_FACE_NONE;
- rasterizer.gl_rasterization_rules = 1;
+ rasterizer.half_pixel_center = 1;
+ rasterizer.bottom_edge_rule = 1;
rasterizer.depth_clip = 1;
handle = ctx->create_rasterizer_state(ctx, &rasterizer);
ctx->bind_rasterizer_state(ctx, handle);
void *handle;
memset(&rasterizer, 0, sizeof rasterizer);
rasterizer.cull_face = PIPE_FACE_NONE;
- rasterizer.gl_rasterization_rules = 1;
+ rasterizer.half_pixel_center = 1;
+ rasterizer.bottom_edge_rule = 1;
handle = info->ctx->create_rasterizer_state(info->ctx, &rasterizer);
info->ctx->bind_rasterizer_state(info->ctx, handle);
}
void *handle;
memset(&rasterizer, 0, sizeof rasterizer);
rasterizer.cull_face = PIPE_FACE_NONE;
- rasterizer.gl_rasterization_rules = 1;
+ rasterizer.half_pixel_center = 1;
+ rasterizer.bottom_edge_rule = 1;
rasterizer.depth_clip = 1;
handle = ctx->create_rasterizer_state(ctx, &rasterizer);
ctx->bind_rasterizer_state(ctx, handle);
void *handle;
memset(&rasterizer, 0, sizeof rasterizer);
rasterizer.cull_face = PIPE_FACE_NONE;
- rasterizer.gl_rasterization_rules = 1;
+ rasterizer.half_pixel_center = 1;
+ rasterizer.bottom_edge_rule = 1;
rasterizer.depth_clip = 1;
handle = ctx->create_rasterizer_state(ctx, &rasterizer);
ctx->bind_rasterizer_state(ctx, handle);
void *handle;
memset(&rasterizer, 0, sizeof rasterizer);
rasterizer.cull_face = PIPE_FACE_NONE;
- rasterizer.gl_rasterization_rules = 1;
+ rasterizer.half_pixel_center = 1;
+ rasterizer.bottom_edge_rule = 1;
rasterizer.depth_clip = 1;
handle = info.ctx->create_rasterizer_state(info.ctx, &rasterizer);
info.ctx->bind_rasterizer_state(info.ctx, handle);
void *handle;
memset(&rasterizer, 0, sizeof rasterizer);
rasterizer.cull_face = PIPE_FACE_NONE;
- rasterizer.gl_rasterization_rules = 1;
+ rasterizer.half_pixel_center = 1;
+ rasterizer.bottom_edge_rule = 1;
rasterizer.depth_clip = 1;
handle = ctx->create_rasterizer_state(ctx, &rasterizer);
ctx->bind_rasterizer_state(ctx, handle);
void *handle;
memset(&rasterizer, 0, sizeof rasterizer);
rasterizer.cull_face = PIPE_FACE_NONE;
- rasterizer.gl_rasterization_rules = 1;
+ rasterizer.half_pixel_center = 1;
+ rasterizer.bottom_edge_rule = 1;
rasterizer.depth_clip = 1;
handle = ctx->create_rasterizer_state(ctx, &rasterizer);
ctx->bind_rasterizer_state(ctx, handle);
void *handle;
memset(&rasterizer, 0, sizeof rasterizer);
rasterizer.cull_face = PIPE_FACE_NONE;
- rasterizer.gl_rasterization_rules = 1;
+ rasterizer.half_pixel_center = 1;
+ rasterizer.bottom_edge_rule = 1;
rasterizer.depth_clip = 1;
handle = ctx->create_rasterizer_state(ctx, &rasterizer);
ctx->bind_rasterizer_state(ctx, handle);
void *handle;
memset(&rasterizer, 0, sizeof rasterizer);
rasterizer.cull_face = PIPE_FACE_NONE;
- rasterizer.gl_rasterization_rules = 1;
+ rasterizer.half_pixel_center = 1;
+ rasterizer.bottom_edge_rule = 1;
rasterizer.flatshade = FlatShade;
rasterizer.depth_clip = 1;
handle = info.ctx->create_rasterizer_state(info.ctx, &rasterizer);
memset(&rasterizer, 0, sizeof rasterizer);
rasterizer.cull_face = PIPE_FACE_NONE;
rasterizer.point_size = 8.0;
- rasterizer.gl_rasterization_rules = 1;
+ rasterizer.half_pixel_center = 1;
+ rasterizer.bottom_edge_rule = 1;
rasterizer.depth_clip = 1;
handle = ctx->create_rasterizer_state(ctx, &rasterizer);
ctx->bind_rasterizer_state(ctx, handle);
/* rasterizer */
memset(&p->rasterizer, 0, sizeof(p->rasterizer));
p->rasterizer.cull_face = PIPE_FACE_NONE;
- p->rasterizer.gl_rasterization_rules = 1;
+ p->rasterizer.half_pixel_center = 1;
+ p->rasterizer.bottom_edge_rule = 1;
p->rasterizer.depth_clip = 1;
/* sampler */
/* rasterizer */
memset(&p->rasterizer, 0, sizeof(p->rasterizer));
p->rasterizer.cull_face = PIPE_FACE_NONE;
- p->rasterizer.gl_rasterization_rules = 1;
+ p->rasterizer.half_pixel_center = 1;
+ p->rasterizer.bottom_edge_rule = 1;
p->rasterizer.depth_clip = 1;
surf_tmpl.format = PIPE_FORMAT_B8G8R8A8_UNORM;
/* _NEW_FRAG_CLAMP */
raster->clamp_fragment_color = !st->clamp_frag_color_in_shader &&
ctx->Color._ClampFragmentColor;
- raster->gl_rasterization_rules = 1;
+
+ raster->half_pixel_center = 1;
+ if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP)
+ raster->bottom_edge_rule = 1;
/* _NEW_RASTERIZER_DISCARD */
raster->rasterizer_discard = ctx->RasterDiscard;
/* init baseline rasterizer state once */
memset(&st->bitmap.rasterizer, 0, sizeof(st->bitmap.rasterizer));
- st->bitmap.rasterizer.gl_rasterization_rules = 1;
+ st->bitmap.rasterizer.half_pixel_center = 1;
+ st->bitmap.rasterizer.bottom_edge_rule = 1;
st->bitmap.rasterizer.depth_clip = 1;
/* find a usable texture format */
{
memset(&st->clear, 0, sizeof(st->clear));
- st->clear.raster.gl_rasterization_rules = 1;
+ st->clear.raster.half_pixel_center = 1;
+ st->clear.raster.bottom_edge_rule = 1;
st->clear.raster.depth_clip = 1;
}
memset(&rasterizer, 0, sizeof(rasterizer));
rasterizer.clamp_fragment_color = !st->clamp_frag_color_in_shader &&
ctx->Color._ClampFragmentColor;
- rasterizer.gl_rasterization_rules = 1;
+ rasterizer.half_pixel_center = 1;
+ rasterizer.bottom_edge_rule = 1;
rasterizer.depth_clip = !ctx->Transform.DepthClamp;
rasterizer.scissor = ctx->Scissor.Enabled;
cso_set_rasterizer(cso, &rasterizer);