Commit c6899653 authored by Kenneth Graunke's avatar Kenneth Graunke
Browse files

HACK: Add IRIS_INDIRECT=1 for hacky performance tests of indirect draws

parent 82029aed
Pipeline #723264 waiting for manual action with stages
......@@ -309,6 +309,29 @@ iris_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info,
iris_handle_always_flush_cache(batch);
struct pipe_draw_indirect_info indirect_hack = {};
if (screen->indirect_hack && !indirect) {
unsigned dwords = info->index_size ? 5 : 4;
void *v_map;
u_upload_alloc(ctx->stream_uploader, 0, dwords * sizeof(uint32_t), 4,
&indirect_hack.offset, &indirect_hack.buffer, &v_map);
indirect_hack.draw_count = 1;
uint32_t *map = v_map;
map[0] = draws[0].count;
map[1] = info->instance_count;
map[2] = draws[0].start;
if (info->index_size) {
map[3] = draws[0].index_bias;
map[4] = info->start_instance;
} else {
map[3] = info->start_instance;
}
indirect = &indirect_hack;
}
if (indirect && indirect->buffer)
iris_indirect_draw_vbo(ice, info, drawid_offset, indirect, &draws[0]);
else
......@@ -320,6 +343,8 @@ iris_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info,
ice->state.dirty &= ~IRIS_ALL_DIRTY_FOR_RENDER;
ice->state.stage_dirty &= ~IRIS_ALL_STAGE_DIRTY_FOR_RENDER;
pipe_resource_reference(&indirect_hack.buffer, NULL);
}
static void
......
......@@ -931,5 +931,7 @@ iris_screen_create(int fd, const struct pipe_screen_config *config)
return NULL;
}
screen->indirect_hack = env_var_as_boolean("IRIS_INDIRECT", false);
return pscreen;
}
......@@ -229,6 +229,8 @@ struct iris_screen {
/** Every screen on a bufmgr has an unique ID assigned by the bufmgr. */
int id;
bool indirect_hack;
};
struct pipe_screen *
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment