mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 19:30:11 +01:00
gallium/u_blitter: change blitter_attrib from union to struct
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33837>
This commit is contained in:
parent
ca09c173f6
commit
e19f4c043d
9 changed files with 16 additions and 16 deletions
|
|
@ -855,7 +855,7 @@ static void get_texcoords(struct pipe_sampler_view *src,
|
|||
unsigned src_width0, unsigned src_height0,
|
||||
int x1, int y1, int x2, int y2,
|
||||
float layer, unsigned sample,
|
||||
bool uses_txf, union blitter_attrib *out)
|
||||
bool uses_txf, struct blitter_attrib *out)
|
||||
{
|
||||
unsigned level = src->u.tex.first_level;
|
||||
bool normalized = !uses_txf &&
|
||||
|
|
@ -918,7 +918,7 @@ static void blitter_set_dst_dimensions(struct blitter_context_priv *ctx,
|
|||
ctx->dst_height = height;
|
||||
}
|
||||
|
||||
static void set_texcoords_in_vertices(const union blitter_attrib *attrib,
|
||||
static void set_texcoords_in_vertices(const struct blitter_attrib *attrib,
|
||||
float *out, unsigned stride)
|
||||
{
|
||||
out[0] = attrib->texcoord.x1;
|
||||
|
|
@ -1396,7 +1396,7 @@ void util_blitter_draw_rectangle(struct blitter_context *blitter,
|
|||
int x1, int y1, int x2, int y2,
|
||||
float depth, unsigned num_instances,
|
||||
enum blitter_attrib_type type,
|
||||
const union blitter_attrib *attrib)
|
||||
const struct blitter_attrib *attrib)
|
||||
{
|
||||
struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter;
|
||||
unsigned i;
|
||||
|
|
@ -1772,7 +1772,7 @@ blitter_draw_tex(struct blitter_context_priv *ctx,
|
|||
float layer, unsigned sample,
|
||||
bool uses_txf, enum blitter_attrib_type type)
|
||||
{
|
||||
union blitter_attrib coord;
|
||||
struct blitter_attrib coord;
|
||||
blitter_get_vs_func get_vs = get_vs_passthrough_pos_generic;
|
||||
|
||||
get_texcoords(src, src_width0, src_height0,
|
||||
|
|
@ -2920,7 +2920,7 @@ util_blitter_stencil_fallback(struct blitter_context *blitter,
|
|||
|
||||
for (unsigned i = 0; i <= util_res_sample_count(dst) - 1; i++) {
|
||||
pipe->set_sample_mask(pipe, 1 << i);
|
||||
union blitter_attrib coord;
|
||||
struct blitter_attrib coord;
|
||||
get_texcoords(src_view, src->width0, src->height0,
|
||||
srcbox->x, srcbox->y,
|
||||
srcbox->x + srcbox->width, srcbox->y + srcbox->height,
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ enum blitter_attrib_type {
|
|||
UTIL_BLITTER_ATTRIB_TEXCOORD_XYZW,
|
||||
};
|
||||
|
||||
union blitter_attrib {
|
||||
struct blitter_attrib {
|
||||
struct {
|
||||
float x1, y1, x2, y2, z, w;
|
||||
} texcoord;
|
||||
|
|
@ -92,7 +92,7 @@ struct blitter_context
|
|||
int x1, int y1, int x2, int y2,
|
||||
float depth, unsigned num_instances,
|
||||
enum blitter_attrib_type type,
|
||||
const union blitter_attrib *attrib);
|
||||
const struct blitter_attrib *attrib);
|
||||
|
||||
/* Whether the blitter is running. */
|
||||
bool running;
|
||||
|
|
@ -181,7 +181,7 @@ void util_blitter_draw_rectangle(struct blitter_context *blitter,
|
|||
int x1, int y1, int x2, int y2,
|
||||
float depth, unsigned num_instances,
|
||||
enum blitter_attrib_type type,
|
||||
const union blitter_attrib *attrib);
|
||||
const struct blitter_attrib *attrib);
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -742,7 +742,7 @@ void r300_blitter_draw_rectangle(struct blitter_context *blitter,
|
|||
int x1, int y1, int x2, int y2,
|
||||
float depth, unsigned num_instances,
|
||||
enum blitter_attrib_type type,
|
||||
const union blitter_attrib *attrib);
|
||||
const struct blitter_attrib *attrib);
|
||||
|
||||
/* r300_state.c */
|
||||
enum r300_fb_state_change {
|
||||
|
|
|
|||
|
|
@ -1154,7 +1154,7 @@ void r300_blitter_draw_rectangle(struct blitter_context *blitter,
|
|||
int x1, int y1, int x2, int y2,
|
||||
float depth, unsigned num_instances,
|
||||
enum blitter_attrib_type type,
|
||||
const union blitter_attrib *attrib)
|
||||
const struct blitter_attrib *attrib)
|
||||
{
|
||||
struct r300_context *r300 = r300_context(util_blitter_get_pipe(blitter));
|
||||
unsigned last_sprite_coord_enable = r300->sprite_coord_enable;
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ void r600_draw_rectangle(struct blitter_context *blitter,
|
|||
int x1, int y1, int x2, int y2,
|
||||
float depth, unsigned num_instances,
|
||||
enum blitter_attrib_type type,
|
||||
const union blitter_attrib *attrib)
|
||||
const struct blitter_attrib *attrib)
|
||||
{
|
||||
struct r600_common_context *rctx =
|
||||
(struct r600_common_context*)util_blitter_get_pipe(blitter);
|
||||
|
|
|
|||
|
|
@ -657,7 +657,7 @@ void r600_draw_rectangle(struct blitter_context *blitter,
|
|||
int x1, int y1, int x2, int y2,
|
||||
float depth, unsigned num_instances,
|
||||
enum blitter_attrib_type type,
|
||||
const union blitter_attrib *attrib);
|
||||
const struct blitter_attrib *attrib);
|
||||
bool r600_common_screen_init(struct r600_common_screen *rscreen,
|
||||
struct radeon_winsys *ws);
|
||||
void r600_destroy_common_screen(struct r600_common_screen *rscreen);
|
||||
|
|
|
|||
|
|
@ -2477,7 +2477,7 @@ static void si_draw_vertex_state(struct pipe_context *ctx,
|
|||
static void si_draw_rectangle(struct blitter_context *blitter, void *vertex_elements_cso,
|
||||
blitter_get_vs_func get_vs, int x1, int y1, int x2, int y2,
|
||||
float depth, unsigned num_instances, enum blitter_attrib_type type,
|
||||
const union blitter_attrib *attrib)
|
||||
const struct blitter_attrib *attrib)
|
||||
{
|
||||
struct pipe_context *pipe = util_blitter_get_pipe(blitter);
|
||||
struct si_context *sctx = (struct si_context *)pipe;
|
||||
|
|
|
|||
|
|
@ -645,11 +645,11 @@ void
|
|||
zink_draw_rectangle(struct blitter_context *blitter, void *vertex_elements_cso,
|
||||
blitter_get_vs_func get_vs, int x1, int y1, int x2, int y2,
|
||||
float depth, unsigned num_instances, enum blitter_attrib_type type,
|
||||
const union blitter_attrib *attrib)
|
||||
const struct blitter_attrib *attrib)
|
||||
{
|
||||
struct zink_context *ctx = zink_context(blitter->pipe);
|
||||
|
||||
union blitter_attrib new_attrib = *attrib;
|
||||
struct blitter_attrib new_attrib = *attrib;
|
||||
|
||||
/* Avoid inconsistencies in rounding between both triangles which can show with
|
||||
* nearest filtering by expanding the rect so only one triangle is effectively drawn.
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ void
|
|||
zink_draw_rectangle(struct blitter_context *blitter, void *vertex_elements_cso,
|
||||
blitter_get_vs_func get_vs, int x1, int y1, int x2, int y2,
|
||||
float depth, unsigned num_instances, enum blitter_attrib_type type,
|
||||
const union blitter_attrib *attrib);
|
||||
const struct blitter_attrib *attrib);
|
||||
|
||||
static inline struct u_rect
|
||||
zink_rect_from_box(const struct pipe_box *box)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue