freedreno: Misc cleanup

Some whitespace cleanup + comment addition.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8795>
This commit is contained in:
Rob Clark 2021-01-30 09:55:37 -08:00 committed by Marge Bot
parent d550c5780f
commit 6ed94905a6
13 changed files with 36 additions and 35 deletions

View File

@ -153,8 +153,8 @@ draw_impl(struct fd_context *ctx, const struct pipe_draw_info *info,
static bool
fd2_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *pinfo,
const struct pipe_draw_indirect_info *indirect,
const struct pipe_draw_start_count *pdraw,
const struct pipe_draw_indirect_info *indirect,
const struct pipe_draw_start_count *pdraw,
unsigned index_offset)
{
if (!ctx->prog.fs || !ctx->prog.vs)

View File

@ -124,8 +124,8 @@ fd3_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
.vtx = &ctx->vtx,
.prog = &ctx->prog,
.info = info,
.indirect = indirect,
.draw = draw,
.indirect = indirect,
.draw = draw,
.key = {
.color_two_side = ctx->rasterizer->light_twoside,
.vclamp_color = ctx->rasterizer->clamp_vertex_color,

View File

@ -46,8 +46,8 @@ struct fd3_emit {
const struct fd_vertex_state *vtx;
const struct fd_program_stateobj *prog;
const struct pipe_draw_info *info;
const struct pipe_draw_indirect_info *indirect;
const struct pipe_draw_start_count *draw;
const struct pipe_draw_indirect_info *indirect;
const struct pipe_draw_start_count *draw;
bool binning_pass;
struct ir3_shader_key key;
enum fd_dirty_3d_state dirty;

View File

@ -108,8 +108,8 @@ fd4_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
.vtx = &ctx->vtx,
.prog = &ctx->prog,
.info = info,
.indirect = indirect,
.draw = draw,
.indirect = indirect,
.draw = draw,
.key = {
.color_two_side = ctx->rasterizer->light_twoside,
.vclamp_color = ctx->rasterizer->clamp_vertex_color,

View File

@ -45,8 +45,8 @@ struct fd4_emit {
const struct fd_vertex_state *vtx;
const struct fd_program_stateobj *prog;
const struct pipe_draw_info *info;
const struct pipe_draw_indirect_info *indirect;
const struct pipe_draw_start_count *draw;
const struct pipe_draw_indirect_info *indirect;
const struct pipe_draw_start_count *draw;
bool binning_pass;
struct ir3_shader_key key;
enum fd_dirty_3d_state dirty;

View File

@ -103,8 +103,8 @@ fd5_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
.vtx = &ctx->vtx,
.prog = &ctx->prog,
.info = info,
.indirect = indirect,
.draw = draw,
.indirect = indirect,
.draw = draw,
.key = {
.color_two_side = ctx->rasterizer->light_twoside,
.vclamp_color = ctx->rasterizer->clamp_vertex_color,

View File

@ -45,8 +45,8 @@ struct fd5_emit {
const struct fd_vertex_state *vtx;
const struct fd_program_stateobj *prog;
const struct pipe_draw_info *info;
const struct pipe_draw_indirect_info *indirect;
const struct pipe_draw_start_count *draw;
const struct pipe_draw_indirect_info *indirect;
const struct pipe_draw_start_count *draw;
bool binning_pass;
struct ir3_shader_key key;
enum fd_dirty_3d_state dirty;

View File

@ -71,7 +71,7 @@ static void
draw_emit_indirect(struct fd_ringbuffer *ring,
struct CP_DRAW_INDX_OFFSET_0 *draw0,
const struct pipe_draw_info *info,
const struct pipe_draw_indirect_info *indirect,
const struct pipe_draw_indirect_info *indirect,
unsigned index_offset)
{
struct fd_resource *ind = fd_resource(indirect->buffer);
@ -101,7 +101,7 @@ static void
draw_emit(struct fd_ringbuffer *ring,
struct CP_DRAW_INDX_OFFSET_0 *draw0,
const struct pipe_draw_info *info,
const struct pipe_draw_start_count *draw,
const struct pipe_draw_start_count *draw,
unsigned index_offset)
{
if (info->index_size) {
@ -176,8 +176,8 @@ fd6_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
.ctx = ctx,
.vtx = &ctx->vtx,
.info = info,
.indirect = indirect,
.draw = draw,
.indirect = indirect,
.draw = draw,
.key = {
.vs = ctx->prog.vs,
.gs = ctx->prog.gs,

View File

@ -86,8 +86,8 @@ struct fd6_emit {
struct fd_context *ctx;
const struct fd_vertex_state *vtx;
const struct pipe_draw_info *info;
const struct pipe_draw_indirect_info *indirect;
const struct pipe_draw_start_count *draw;
const struct pipe_draw_indirect_info *indirect;
const struct pipe_draw_start_count *draw;
struct ir3_cache_key key;
enum fd_dirty_3d_state dirty;

View File

@ -238,13 +238,13 @@ fd_blitter_clear(struct pipe_context *pctx, unsigned buffers,
struct pipe_draw_info info = {
.mode = PIPE_PRIM_MAX, /* maps to DI_PT_RECTLIST */
.index_bounds_valid = true,
.index_bounds_valid = true,
.max_index = 1,
.instance_count = MAX2(1, pfb->layers),
};
struct pipe_draw_start_count draw = {
.count = 2,
};
struct pipe_draw_start_count draw = {
.count = 2,
};
pctx->draw_vbo(pctx, &info, NULL, &draw, 1);
/* We expect that this should not have triggered a change in pfb: */

View File

@ -235,18 +235,18 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info,
unsigned num_draws)
{
if (num_draws > 1) {
struct pipe_draw_info tmp_info = *info;
struct pipe_draw_info tmp_info = *info;
for (unsigned i = 0; i < num_draws; i++) {
fd_draw_vbo(pctx, &tmp_info, indirect, &draws[i], 1);
if (tmp_info.increment_draw_id)
tmp_info.drawid++;
}
return;
for (unsigned i = 0; i < num_draws; i++) {
fd_draw_vbo(pctx, &tmp_info, indirect, &draws[i], 1);
if (tmp_info.increment_draw_id)
tmp_info.drawid++;
}
return;
}
if (!indirect && (!draws[0].count || !info->instance_count))
return;
if (!indirect && (!draws[0].count || !info->instance_count))
return;
struct fd_context *ctx = fd_context(pctx);
@ -285,7 +285,7 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info,
if (info->index_size) {
if (info->has_user_indices) {
if (!util_upload_index_buffer(pctx, info, &draws[0],
&indexbuf, &index_offset, 4))
&indexbuf, &index_offset, 4))
return;
new_info = *info;
new_info.index.resource = indexbuf;

View File

@ -145,7 +145,7 @@ fd_draw_emit(struct fd_batch *batch, struct fd_ringbuffer *ring,
enum pc_di_primtype primtype,
enum pc_di_vis_cull_mode vismode,
const struct pipe_draw_info *info,
const struct pipe_draw_start_count *draw,
const struct pipe_draw_start_count *draw,
unsigned index_offset)
{
struct pipe_resource *idx_buffer = NULL;

View File

@ -225,6 +225,7 @@ ir3_shader_create(struct ir3_compiler *compiler,
ir3_shader_variant(shader, key, false, debug);
}
/* For vertex shaders, also compile initial binning pass shader: */
if (nir->info.stage == MESA_SHADER_VERTEX) {
key.safe_constlen = false;
v = ir3_shader_variant(shader, key, true, debug);