mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 19:40:10 +01:00
r300-gallium: Use fui instead of a roll-my-own.
Man, util/u_math just gets better by the day.
This commit is contained in:
parent
8520b15018
commit
f176c94e49
1 changed files with 3 additions and 13 deletions
|
|
@ -23,21 +23,11 @@
|
|||
#ifndef R300_CS_H
|
||||
#define R300_CS_H
|
||||
|
||||
#include "util/u_math.h"
|
||||
|
||||
#include "r300_reg.h"
|
||||
#include "r300_winsys.h"
|
||||
|
||||
/* Pack a 32-bit float into a dword. */
|
||||
static uint32_t pack_float_32(float f)
|
||||
{
|
||||
union {
|
||||
float f;
|
||||
uint32_t u;
|
||||
} u;
|
||||
|
||||
u.f = f;
|
||||
return u.u;
|
||||
}
|
||||
|
||||
/* Yes, I know macros are ugly. However, they are much prettier than the code
|
||||
* that they neatly hide away, and don't have the cost of function setup,so
|
||||
* we're going to use them. */
|
||||
|
|
@ -80,7 +70,7 @@ static uint32_t pack_float_32(float f)
|
|||
} while (0)
|
||||
|
||||
#define OUT_CS_32F(value) do { \
|
||||
cs_winsys->write_cs_dword(cs, pack_float_32(value)); \
|
||||
cs_winsys->write_cs_dword(cs, fui(value)); \
|
||||
cs_count--; \
|
||||
} while (0)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue