summaryrefslogtreecommitdiff
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2018-07-30 11:41:15 -0700
committerEric Anholt <eric@anholt.net>2018-07-30 14:29:01 -0700
commit89ac6fa4036da815b5cf4985f438cec73df67480 (patch)
tree28f33d348e354b1e42c1b7fb77e9ee2e140cc5e8 /src/gallium/drivers
parente146e3a795ecd070679b8dfd1ad7f370e9ec5665 (diff)
v3d: Add pack header support for f187 values.
V3D only has one of these (the top 16 bits of a float32) left in its CLs, but VC4 had many more. This gets us proper pretty-printing of the values instead of a large uint.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/v3d/v3dx_emit.c2
-rw-r--r--src/gallium/drivers/v3d/v3dx_state.c18
2 files changed, 5 insertions, 15 deletions
diff --git a/src/gallium/drivers/v3d/v3dx_emit.c b/src/gallium/drivers/v3d/v3dx_emit.c
index ee4849a296f..c371a53a199 100644
--- a/src/gallium/drivers/v3d/v3dx_emit.c
+++ b/src/gallium/drivers/v3d/v3dx_emit.c
@@ -787,7 +787,7 @@ v3dX(emit_state)(struct pipe_context *pctx)
/* Note: SampleCoverage was handled at the
* state_tracker level by converting to sample_mask.
*/
- state.coverage = fui(1.0) >> 16;
+ state.coverage = 1.0;
state.mask = job->msaa ? v3d->sample_mask : 0xf;
}
}
diff --git a/src/gallium/drivers/v3d/v3dx_state.c b/src/gallium/drivers/v3d/v3dx_state.c
index 6ee4a2a835f..b7d60846d4a 100644
--- a/src/gallium/drivers/v3d/v3dx_state.c
+++ b/src/gallium/drivers/v3d/v3dx_state.c
@@ -81,12 +81,6 @@ v3d_set_sample_mask(struct pipe_context *pctx, unsigned sample_mask)
v3d->dirty |= VC5_DIRTY_SAMPLE_STATE;
}
-static uint16_t
-float_to_187_half(float f)
-{
- return fui(f) >> 16;
-}
-
static void *
v3d_create_rasterizer_state(struct pipe_context *pctx,
const struct pipe_rasterizer_state *cso)
@@ -107,20 +101,16 @@ v3d_create_rasterizer_state(struct pipe_context *pctx,
STATIC_ASSERT(sizeof(so->depth_offset) >=
cl_packet_length(DEPTH_OFFSET));
v3dx_pack(&so->depth_offset, DEPTH_OFFSET, depth) {
- depth.depth_offset_factor =
- float_to_187_half(cso->offset_scale);
- depth.depth_offset_units =
- float_to_187_half(cso->offset_units);
+ depth.depth_offset_factor = cso->offset_scale;
+ depth.depth_offset_units = cso->offset_units;
}
/* The HW treats polygon offset units based on a Z24 buffer, so we
* need to scale up offset_units if we're only Z16.
*/
v3dx_pack(&so->depth_offset_z16, DEPTH_OFFSET, depth) {
- depth.depth_offset_factor =
- float_to_187_half(cso->offset_scale);
- depth.depth_offset_units =
- float_to_187_half(cso->offset_units * 256.0);
+ depth.depth_offset_factor = cso->offset_scale;
+ depth.depth_offset_units = cso->offset_units * 256.0;
}
return so;