r600g: use gallium util for float->ui conversion
authorDave Airlie <airlied@redhat.com>
Wed, 28 Jul 2010 01:51:16 +0000 (11:51 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 28 Jul 2010 01:55:09 +0000 (11:55 +1000)
src/gallium/drivers/r600/r600_screen.h
src/gallium/drivers/r600/r600_state.c

index 0a0286d96bcc742ef6674aa67ed09b4a7447eac2..7a373cd0ef3f531b7a3caa5021d1dcb83ce553e4 100644 (file)
@@ -88,17 +88,4 @@ void r600_texture_transfer_unmap(struct pipe_context *ctx,
 int r600_conv_pipe_format(unsigned pformat, unsigned *format);
 int r600_conv_pipe_prim(unsigned pprim, unsigned *prim);
 
-union r600_float_to_u32_u {
-       u32     u;
-       float   f;
-};
-
-static inline u32 r600_float_to_u32(float f)
-{
-       union r600_float_to_u32_u c;
-
-       c.f = f;
-       return c.u;
-}
-
 #endif
index 6503c3740e8e72ea68488c2452746fec6d16be66..367a1f9991afaca573f8e6e000b5cc1b5ddafc1e 100644 (file)
@@ -579,12 +579,12 @@ static void r600_set_viewport_state(struct pipe_context *ctx,
                return;
        rstate->states[R600_VIEWPORT__PA_SC_VPORT_ZMIN_0] = 0x00000000;
        rstate->states[R600_VIEWPORT__PA_SC_VPORT_ZMAX_0] = 0x3F800000;
-       rstate->states[R600_VIEWPORT__PA_CL_VPORT_XSCALE_0] = r600_float_to_u32(state->scale[0]);
-       rstate->states[R600_VIEWPORT__PA_CL_VPORT_YSCALE_0] = r600_float_to_u32(state->scale[1]);
-       rstate->states[R600_VIEWPORT__PA_CL_VPORT_ZSCALE_0] = r600_float_to_u32(state->scale[2]);
-       rstate->states[R600_VIEWPORT__PA_CL_VPORT_XOFFSET_0] = r600_float_to_u32(state->translate[0]);
-       rstate->states[R600_VIEWPORT__PA_CL_VPORT_YOFFSET_0] = r600_float_to_u32(state->translate[1]);
-       rstate->states[R600_VIEWPORT__PA_CL_VPORT_ZOFFSET_0] = r600_float_to_u32(state->translate[2]);
+       rstate->states[R600_VIEWPORT__PA_CL_VPORT_XSCALE_0] = fui(state->scale[0]);
+       rstate->states[R600_VIEWPORT__PA_CL_VPORT_YSCALE_0] = fui(state->scale[1]);
+       rstate->states[R600_VIEWPORT__PA_CL_VPORT_ZSCALE_0] = fui(state->scale[2]);
+       rstate->states[R600_VIEWPORT__PA_CL_VPORT_XOFFSET_0] = fui(state->translate[0]);
+       rstate->states[R600_VIEWPORT__PA_CL_VPORT_YOFFSET_0] = fui(state->translate[1]);
+       rstate->states[R600_VIEWPORT__PA_CL_VPORT_ZOFFSET_0] = fui(state->translate[2]);
        rstate->states[R600_VIEWPORT__PA_CL_VTE_CNTL] = 0x0000043F;
        if (radeon_state_pm4(rstate)) {
                radeon_state_decref(rstate);