summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2013-04-23 19:40:05 +0100
committerJosé Fonseca <[email protected]>2013-04-23 19:42:47 +0100
commit2737abb44efebfa10ac84b183c20fc5818d1514e (patch)
tree32447cf1ab7291a489bca9dd770c3e424785dbd9 /src/gallium/auxiliary/draw
parentb69207642079fe8ba33c594750415e8d9c66a06f (diff)
gallium: Replace gl_rasterization_rules with lower_left_origin and half_pixel_center.
Squashed commit of the following: commit 04c5fa2cbb8e89d6f2fa5a75af1cca03b1f6b852 Author: José Fonseca <[email protected]> Date: Tue Apr 23 17:37:18 2013 +0100 gallium: s/lower_left_origin/bottom_edge_rule/ commit 4dff4f64fa83b9737def136fffd161d55e4f1722 Author: José Fonseca <[email protected]> Date: Tue Apr 23 17:35:04 2013 +0100 gallium: Move diagram to docs. commit 442a63012c8c3c3797f45e03f2ca20ad5f399832 Author: James Benton <[email protected]> Date: Fri May 11 17:50:55 2012 +0100 gallium: Replace gl_rasterization_rules with lower_left_origin and half_pixel_center. This change is necessary to achieve correct results when using OpenGL FBOs. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw')
-rw-r--r--src/gallium/auxiliary/draw/draw_context.c3
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_wide_line.c10
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_wide_point.c2
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c6
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c6
5 files changed, 14 insertions, 13 deletions
diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c
index 25f79ae19e6..6caa62ab31b 100644
--- a/src/gallium/auxiliary/draw/draw_context.c
+++ b/src/gallium/auxiliary/draw/draw_context.c
@@ -724,7 +724,8 @@ draw_get_rasterizer_no_cull( struct draw_context *draw,
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] =
diff --git a/src/gallium/auxiliary/draw/draw_pipe_wide_line.c b/src/gallium/auxiliary/draw/draw_pipe_wide_line.c
index 98da9cfb999..8daefa49ebb 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_wide_line.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_wide_line.c
@@ -77,11 +77,11 @@ static void wideline_line( struct draw_stage *stage,
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
@@ -95,7 +95,7 @@ static void wideline_line( struct draw_stage *stage,
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;
@@ -118,7 +118,7 @@ static void wideline_line( struct draw_stage *stage,
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;
diff --git a/src/gallium/auxiliary/draw/draw_pipe_wide_point.c b/src/gallium/auxiliary/draw/draw_pipe_wide_point.c
index 0d3fee4bb0d..321106cdb15 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_wide_point.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_wide_point.c
@@ -207,7 +207,7 @@ widepoint_first_point(struct draw_stage *stage,
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;
}
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c
index 664c5949e8c..7b871c2952d 100644
--- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c
+++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c
@@ -108,9 +108,9 @@ static void fetch_pipeline_prepare( struct draw_pt_middle_end *middle,
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,
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c
index afa5d4748db..0873e342a2d 100644
--- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c
@@ -159,9 +159,9 @@ llvm_middle_end_prepare( struct draw_pt_middle_end *middle,
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,