aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-09-20 13:07:59 -0600
committerBrian Paul <[email protected]>2010-09-20 13:18:41 -0600
commit924c18da95bbc62492f8e54bd8273a4981a919dc (patch)
tree50a12ba2f7558a4845e70a0df4fe88ff6428ddcb /src/gallium
parentebba92875aca586b661f6547888a2ed95e70e0ff (diff)
llvmpipe: reformatting, remove trailing whitespace, etc
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_setup_point.c44
1 files changed, 23 insertions, 21 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_point.c b/src/gallium/drivers/llvmpipe/lp_setup_point.c
index 55389871518..5521cbbe876 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_point.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_point.c
@@ -52,26 +52,29 @@ struct point_info {
/**
* Compute a0 for a constant-valued coefficient (GL_FLAT shading).
*/
-static void constant_coef( struct lp_setup_context *setup,
- struct lp_rast_triangle *point,
- unsigned slot,
- const float value,
- unsigned i )
+static void
+constant_coef(struct lp_setup_context *setup,
+ struct lp_rast_triangle *point,
+ unsigned slot,
+ const float value,
+ unsigned i)
{
point->inputs.a0[slot][i] = value;
point->inputs.dadx[slot][i] = 0.0f;
point->inputs.dady[slot][i] = 0.0f;
}
-static void perspective_coef( struct lp_setup_context *setup,
- struct lp_rast_triangle *point,
- const struct point_info *info,
- unsigned slot,
- unsigned vert_attr,
- unsigned i)
+
+static void
+perspective_coef(struct lp_setup_context *setup,
+ struct lp_rast_triangle *point,
+ const struct point_info *info,
+ unsigned slot,
+ unsigned vert_attr,
+ unsigned i)
{
- if (i == 0) {
- float dadx = FIXED_ONE / (float)info->dx12;
+ if (i == 0) {
+ float dadx = FIXED_ONE / (float)info->dx12;
float dady = 0.0f;
point->inputs.dadx[slot][i] = dadx;
point->inputs.dady[slot][i] = dady;
@@ -79,30 +82,26 @@ static void perspective_coef( struct lp_setup_context *setup,
(dadx * ((float)info->v0[0][0] - setup->pixel_offset) +
dady * ((float)info->v0[0][1] - setup->pixel_offset)));
}
-
else if (i == 1) {
- float dadx = 0.0f;
+ float dadx = 0.0f;
float dady = FIXED_ONE / (float)info->dx12;
-
+
point->inputs.dadx[slot][i] = dadx;
point->inputs.dady[slot][i] = dady;
point->inputs.a0[slot][i] = (0.5 -
(dadx * ((float)info->v0[0][0] - setup->pixel_offset) +
dady * ((float)info->v0[0][1] - setup->pixel_offset)));
}
-
else if (i == 2) {
point->inputs.a0[slot][i] = 0.0f;
point->inputs.dadx[slot][i] = 0.0f;
point->inputs.dady[slot][i] = 0.0f;
}
-
else if (i == 3) {
point->inputs.a0[slot][i] = 1.0f;
point->inputs.dadx[slot][i] = 0.0f;
point->inputs.dady[slot][i] = 0.0f;
}
-
}
@@ -144,6 +143,7 @@ setup_point_fragcoord_coef(struct lp_setup_context *setup,
}
}
+
/**
* Compute the point->coef[] array dadx, dady, a0 values.
*/
@@ -203,6 +203,7 @@ setup_point_coefficients( struct lp_setup_context *setup,
fragcoord_usage_mask);
}
+
static INLINE int
subpixel_snap(float a)
{
@@ -322,8 +323,9 @@ try_setup_point( struct lp_setup_context *setup,
}
-static void lp_setup_point( struct lp_setup_context *setup,
- const float (*v0)[4] )
+static void
+lp_setup_point(struct lp_setup_context *setup,
+ const float (*v0)[4])
{
if (!try_setup_point( setup, v0 ))
{