radeonsi: remove si_atom::id
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
639b673fc3
commit
ccebcba893
|
@ -1339,11 +1339,16 @@ si_invalidate_draw_sh_constants(struct si_context *sctx)
|
||||||
sctx->last_base_vertex = SI_BASE_VERTEX_UNKNOWN;
|
sctx->last_base_vertex = SI_BASE_VERTEX_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline unsigned
|
||||||
si_set_atom_dirty(struct si_context *sctx,
|
si_get_atom_bit(struct si_context *sctx, struct si_atom *atom)
|
||||||
struct si_atom *atom, bool dirty)
|
|
||||||
{
|
{
|
||||||
unsigned bit = 1 << atom->id;
|
return 1 << (atom - sctx->atoms.array);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
si_set_atom_dirty(struct si_context *sctx, struct si_atom *atom, bool dirty)
|
||||||
|
{
|
||||||
|
unsigned bit = si_get_atom_bit(sctx, atom);
|
||||||
|
|
||||||
if (dirty)
|
if (dirty)
|
||||||
sctx->dirty_atoms |= bit;
|
sctx->dirty_atoms |= bit;
|
||||||
|
@ -1352,17 +1357,13 @@ si_set_atom_dirty(struct si_context *sctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool
|
static inline bool
|
||||||
si_is_atom_dirty(struct si_context *sctx,
|
si_is_atom_dirty(struct si_context *sctx, struct si_atom *atom)
|
||||||
struct si_atom *atom)
|
|
||||||
{
|
{
|
||||||
unsigned bit = 1 << atom->id;
|
return (sctx->dirty_atoms & si_get_atom_bit(sctx, atom)) != 0;
|
||||||
|
|
||||||
return sctx->dirty_atoms & bit;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
si_mark_atom_dirty(struct si_context *sctx,
|
si_mark_atom_dirty(struct si_context *sctx, struct si_atom *atom)
|
||||||
struct si_atom *atom)
|
|
||||||
{
|
{
|
||||||
si_set_atom_dirty(sctx, atom, true);
|
si_set_atom_dirty(sctx, atom, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,19 +33,11 @@
|
||||||
#include "util/u_resource.h"
|
#include "util/u_resource.h"
|
||||||
#include "util/u_upload_mgr.h"
|
#include "util/u_upload_mgr.h"
|
||||||
|
|
||||||
/* Initialize an external atom (owned by ../radeon). */
|
|
||||||
static void
|
|
||||||
si_init_external_atom(struct si_context *sctx, struct si_atom *atom)
|
|
||||||
{
|
|
||||||
atom->id = atom - sctx->atoms.array;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Initialize an atom owned by radeonsi. */
|
/* Initialize an atom owned by radeonsi. */
|
||||||
void si_init_atom(struct si_context *sctx, struct si_atom *atom,
|
void si_init_atom(struct si_context *sctx, struct si_atom *atom,
|
||||||
void (*emit_func)(struct si_context *ctx, struct si_atom *state))
|
void (*emit_func)(struct si_context *ctx, struct si_atom *state))
|
||||||
{
|
{
|
||||||
atom->emit = emit_func;
|
atom->emit = emit_func;
|
||||||
atom->id = atom - sctx->atoms.array;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned si_map_swizzle(unsigned swizzle)
|
static unsigned si_map_swizzle(unsigned swizzle)
|
||||||
|
@ -4526,12 +4518,6 @@ static void si_init_config(struct si_context *sctx);
|
||||||
|
|
||||||
void si_init_state_functions(struct si_context *sctx)
|
void si_init_state_functions(struct si_context *sctx)
|
||||||
{
|
{
|
||||||
si_init_external_atom(sctx, &sctx->atoms.s.render_cond);
|
|
||||||
si_init_external_atom(sctx, &sctx->atoms.s.streamout_begin);
|
|
||||||
si_init_external_atom(sctx, &sctx->atoms.s.streamout_enable);
|
|
||||||
si_init_external_atom(sctx, &sctx->atoms.s.scissors);
|
|
||||||
si_init_external_atom(sctx, &sctx->atoms.s.viewports);
|
|
||||||
|
|
||||||
si_init_atom(sctx, &sctx->atoms.s.framebuffer, si_emit_framebuffer_state);
|
si_init_atom(sctx, &sctx->atoms.s.framebuffer, si_emit_framebuffer_state);
|
||||||
si_init_atom(sctx, &sctx->atoms.s.msaa_sample_locs, si_emit_msaa_sample_locs);
|
si_init_atom(sctx, &sctx->atoms.s.msaa_sample_locs, si_emit_msaa_sample_locs);
|
||||||
si_init_atom(sctx, &sctx->atoms.s.db_render_state, si_emit_db_render_state);
|
si_init_atom(sctx, &sctx->atoms.s.db_render_state, si_emit_db_render_state);
|
||||||
|
|
|
@ -45,11 +45,11 @@ struct si_shader_selector;
|
||||||
struct r600_texture;
|
struct r600_texture;
|
||||||
struct si_qbo_state;
|
struct si_qbo_state;
|
||||||
|
|
||||||
/* This encapsulates a state or an operation which can emitted into the GPU
|
/* State atoms are callbacks which write a sequence of packets into a GPU
|
||||||
* command stream. */
|
* command buffer (AKA indirect buffer, AKA IB, AKA command stream, AKA CS).
|
||||||
|
*/
|
||||||
struct si_atom {
|
struct si_atom {
|
||||||
void (*emit)(struct si_context *ctx, struct si_atom *state);
|
void (*emit)(struct si_context *ctx, struct si_atom *state);
|
||||||
unsigned short id;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct si_state_blend {
|
struct si_state_blend {
|
||||||
|
|
|
@ -1436,7 +1436,7 @@ void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
|
||||||
unsigned masked_atoms = 0;
|
unsigned masked_atoms = 0;
|
||||||
|
|
||||||
if (unlikely(sctx->flags & SI_CONTEXT_FLUSH_FOR_RENDER_COND))
|
if (unlikely(sctx->flags & SI_CONTEXT_FLUSH_FOR_RENDER_COND))
|
||||||
masked_atoms |= 1u << sctx->atoms.s.render_cond.id;
|
masked_atoms |= si_get_atom_bit(sctx, &sctx->atoms.s.render_cond);
|
||||||
|
|
||||||
if (!si_upload_graphics_shader_descriptors(sctx))
|
if (!si_upload_graphics_shader_descriptors(sctx))
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue