gen6_draw_session is not GEN dependent. Rename it to ilo_render_draw_session.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
}
static void
-gen6_draw_prepare(struct ilo_render *render,
- const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+draw_session_prepare(struct ilo_render *render,
+ const struct ilo_state_vector *vec,
+ struct ilo_render_draw_session *session)
{
memset(session, 0, sizeof(*session));
session->pipe_dirty = vec->dirty;
}
static void
-gen6_draw_end(struct ilo_render *render,
- const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+draw_session_end(struct ilo_render *render,
+ const struct ilo_state_vector *vec,
+ struct ilo_render_draw_session *session)
{
render->hw_ctx_changed = false;
ilo_render_emit_draw(struct ilo_render *render,
const struct ilo_state_vector *vec)
{
- struct gen6_draw_session session;
+ struct ilo_render_draw_session session;
ILO_DEV_ASSERT(render->dev, 6, 7.5);
- gen6_draw_prepare(render, vec, &session);
+ draw_session_prepare(render, vec, &session);
/* force all states to be uploaded if the state bo changed */
if (render->state_bo_changed)
ilo_render_emit_draw_commands(render, vec, &session);
- gen6_draw_end(render, vec, &session);
+ draw_session_end(render, vec, &session);
}
static void
gen6_emit_draw_dynamic_viewports(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
ILO_DEV_ASSERT(r->dev, 6, 6);
static void
gen7_emit_draw_dynamic_viewports(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
ILO_DEV_ASSERT(r->dev, 7, 7.5);
static void
gen6_emit_draw_dynamic_scissors(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
ILO_DEV_ASSERT(r->dev, 6, 7.5);
static void
gen6_emit_draw_dynamic_cc(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
ILO_DEV_ASSERT(r->dev, 6, 7.5);
gen6_emit_draw_dynamic_samplers(struct ilo_render *r,
const struct ilo_state_vector *vec,
int shader_type,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
const struct ilo_sampler_cso * const *samplers =
vec->sampler[shader_type].cso;
static void
gen6_emit_draw_dynamic_pcb(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
ILO_DEV_ASSERT(r->dev, 6, 7.5);
void
ilo_render_emit_draw_dynamic_states(struct ilo_render *render,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
const unsigned dynamic_used = ilo_builder_dynamic_used(render->builder);
} state;
};
-struct gen6_draw_session {
+struct ilo_render_draw_session {
uint32_t pipe_dirty;
/* commands */
void
ilo_render_emit_draw_commands_gen6(struct ilo_render *render,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session);
+ struct ilo_render_draw_session *session);
void
ilo_render_emit_draw_commands_gen7(struct ilo_render *render,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session);
+ struct ilo_render_draw_session *session);
static inline void
ilo_render_emit_draw_commands(struct ilo_render *render,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
const unsigned batch_used = ilo_builder_batch_used(render->builder);
void
ilo_render_emit_draw_dynamic_states(struct ilo_render *render,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session);
+ struct ilo_render_draw_session *session);
int
ilo_render_get_rectlist_dynamic_states_len(const struct ilo_render *render,
void
ilo_render_emit_draw_surface_states(struct ilo_render *render,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session);
+ struct ilo_render_draw_session *session);
void
gen6_wa_pre_pipe_control(struct ilo_render *r, uint32_t dw1);
void
gen6_draw_common_select(struct ilo_render *r,
const struct ilo_state_vector *ilo,
- struct gen6_draw_session *session);
+ struct ilo_render_draw_session *session);
void
gen6_draw_common_sip(struct ilo_render *r,
const struct ilo_state_vector *ilo,
- struct gen6_draw_session *session);
+ struct ilo_render_draw_session *session);
void
gen6_draw_common_base_address(struct ilo_render *r,
const struct ilo_state_vector *ilo,
- struct gen6_draw_session *session);
+ struct ilo_render_draw_session *session);
void
gen6_draw_vf(struct ilo_render *r,
const struct ilo_state_vector *ilo,
- struct gen6_draw_session *session);
+ struct ilo_render_draw_session *session);
void
gen6_draw_vf_statistics(struct ilo_render *r,
const struct ilo_state_vector *ilo,
- struct gen6_draw_session *session);
+ struct ilo_render_draw_session *session);
void
gen6_draw_vs(struct ilo_render *r,
const struct ilo_state_vector *ilo,
- struct gen6_draw_session *session);
+ struct ilo_render_draw_session *session);
void
gen6_draw_clip(struct ilo_render *r,
const struct ilo_state_vector *ilo,
- struct gen6_draw_session *session);
+ struct ilo_render_draw_session *session);
void
gen6_draw_sf_rect(struct ilo_render *r,
const struct ilo_state_vector *ilo,
- struct gen6_draw_session *session);
+ struct ilo_render_draw_session *session);
void
gen6_draw_wm_raster(struct ilo_render *r,
const struct ilo_state_vector *ilo,
- struct gen6_draw_session *session);
+ struct ilo_render_draw_session *session);
#endif /* ILO_RENDER_GEN_H */
void
gen6_draw_common_select(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* PIPELINE_SELECT */
if (r->hw_ctx_changed) {
void
gen6_draw_common_sip(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* STATE_SIP */
if (r->hw_ctx_changed) {
void
gen6_draw_common_base_address(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* STATE_BASE_ADDRESS */
if (r->state_bo_changed || r->instruction_bo_changed ||
static void
gen6_draw_common_urb(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* 3DSTATE_URB */
if (DIRTY(VE) || DIRTY(VS) || DIRTY(GS)) {
static void
gen6_draw_common_pointers_1(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* 3DSTATE_VIEWPORT_STATE_POINTERS */
if (session->viewport_changed) {
static void
gen6_draw_common_pointers_2(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* 3DSTATE_CC_STATE_POINTERS */
if (session->blend_changed ||
static void
gen6_draw_common_pointers_3(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* 3DSTATE_SCISSOR_STATE_POINTERS */
if (session->scissor_changed) {
void
gen6_draw_vf(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
if (ilo_dev_gen(r->dev) >= ILO_GEN(7.5)) {
/* 3DSTATE_INDEX_BUFFER */
void
gen6_draw_vf_statistics(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* 3DSTATE_VF_STATISTICS */
if (r->hw_ctx_changed)
static void
gen6_draw_vf_draw(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* 3DPRIMITIVE */
gen6_3DPRIMITIVE(r->builder, vec->draw, &vec->ib);
void
gen6_draw_vs(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
const bool emit_3dstate_vs = (DIRTY(VS) || DIRTY(SAMPLER_VS) ||
r->instruction_bo_changed);
static void
gen6_draw_gs(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* 3DSTATE_CONSTANT_GS */
if (session->pcb_gs_changed)
static bool
gen6_draw_update_max_svbi(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
if (DIRTY(VS) || DIRTY(GS) || DIRTY(SO)) {
const struct pipe_stream_output_info *so_info =
static void
gen6_draw_gs_svbi(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
const bool emit = gen6_draw_update_max_svbi(r, vec, session);
void
gen6_draw_clip(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* 3DSTATE_CLIP */
if (DIRTY(RASTERIZER) || DIRTY(FS) || DIRTY(VIEWPORT) || DIRTY(FB)) {
static void
gen6_draw_sf(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* 3DSTATE_SF */
if (DIRTY(RASTERIZER) || DIRTY(FS))
void
gen6_draw_sf_rect(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* 3DSTATE_DRAWING_RECTANGLE */
if (DIRTY(FB)) {
static void
gen6_draw_wm(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* 3DSTATE_CONSTANT_PS */
if (session->pcb_fs_changed) {
static void
gen6_draw_wm_multisample(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* 3DSTATE_MULTISAMPLE and 3DSTATE_SAMPLE_MASK */
if (DIRTY(SAMPLE_MASK) || DIRTY(FB)) {
static void
gen6_draw_wm_depth(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* 3DSTATE_DEPTH_BUFFER and 3DSTATE_CLEAR_PARAMS */
if (DIRTY(FB) || r->batch_bo_changed) {
void
gen6_draw_wm_raster(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* 3DSTATE_POLY_STIPPLE_PATTERN and 3DSTATE_POLY_STIPPLE_OFFSET */
if ((DIRTY(RASTERIZER) || DIRTY(POLY_STIPPLE)) &&
void
ilo_render_emit_draw_commands_gen6(struct ilo_render *render,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
ILO_DEV_ASSERT(render->dev, 6, 6);
static void
gen7_draw_common_urb(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* 3DSTATE_URB_{VS,GS,HS,DS} */
if (DIRTY(VE) || DIRTY(VS)) {
static void
gen7_draw_common_pcb_alloc(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* 3DSTATE_PUSH_CONSTANT_ALLOC_{VS,PS} */
if (r->hw_ctx_changed) {
static void
gen7_draw_common_pointers_1(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* 3DSTATE_VIEWPORT_STATE_POINTERS_{CC,SF_CLIP} */
if (session->viewport_changed) {
static void
gen7_draw_common_pointers_2(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* 3DSTATE_BLEND_STATE_POINTERS */
if (session->blend_changed) {
static void
gen7_draw_vs(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
const bool emit_3dstate_binding_table =
session->binding_table_vs_changed;
static void
gen7_draw_hs(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* 3DSTATE_CONSTANT_HS and 3DSTATE_HS */
if (r->hw_ctx_changed) {
static void
gen7_draw_te(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* 3DSTATE_TE */
if (r->hw_ctx_changed)
static void
gen7_draw_ds(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* 3DSTATE_CONSTANT_DS and 3DSTATE_DS */
if (r->hw_ctx_changed) {
static void
gen7_draw_gs(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* 3DSTATE_CONSTANT_GS and 3DSTATE_GS */
if (r->hw_ctx_changed) {
static void
gen7_draw_sol(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
const struct pipe_stream_output_info *so_info;
const struct ilo_shader_state *shader;
static void
gen7_draw_sf(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* 3DSTATE_SBE */
if (DIRTY(RASTERIZER) || DIRTY(FS))
static void
gen7_draw_wm(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* 3DSTATE_WM */
if (DIRTY(FS) || DIRTY(BLEND) || DIRTY(DSA) || DIRTY(RASTERIZER)) {
static void
gen7_draw_wm_multisample(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
/* 3DSTATE_MULTISAMPLE and 3DSTATE_SAMPLE_MASK */
if (DIRTY(SAMPLE_MASK) || DIRTY(FB)) {
static void
gen7_draw_vf_draw(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
if (r->state.deferred_pipe_control_dw1)
gen7_pipe_control(r, r->state.deferred_pipe_control_dw1);
void
ilo_render_emit_draw_commands_gen7(struct ilo_render *render,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
ILO_DEV_ASSERT(render->dev, 7, 7.5);
static void
gen6_emit_draw_surface_rt(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
ILO_DEV_ASSERT(r->dev, 6, 7.5);
static void
gen6_emit_draw_surface_so(struct ilo_render *r,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
const struct ilo_so_state *so = &vec->so;
gen6_emit_draw_surface_view(struct ilo_render *r,
const struct ilo_state_vector *vec,
int shader_type,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
const struct ilo_view_state *view = &vec->view[shader_type];
uint32_t *surface_state;
gen6_emit_draw_surface_const(struct ilo_render *r,
const struct ilo_state_vector *vec,
int shader_type,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
const struct ilo_cbuf_state *cbuf = &vec->cbuf[shader_type];
uint32_t *surface_state;
gen6_emit_draw_surface_binding_tables(struct ilo_render *r,
const struct ilo_state_vector *vec,
int shader_type,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
uint32_t *binding_table_state, *surface_state;
int *binding_table_state_size, size;
void
ilo_render_emit_draw_surface_states(struct ilo_render *render,
const struct ilo_state_vector *vec,
- struct gen6_draw_session *session)
+ struct ilo_render_draw_session *session)
{
const unsigned surface_used = ilo_builder_surface_used(render->builder);
int shader_type;