mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-21 18:00:13 +01:00
asahi: Don't use lower_wpos_pntc
Instead we can flip point coords with the object type. That means fewer instructions without shader variants. Thanks, PowerVR ^_^ Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18421>
This commit is contained in:
parent
f7ef5eefdd
commit
baadc1ec13
3 changed files with 13 additions and 6 deletions
|
|
@ -301,7 +301,6 @@ static const nir_shader_compiler_options agx_nir_options = {
|
||||||
.lower_insert_word = true,
|
.lower_insert_word = true,
|
||||||
.lower_cs_local_index_to_id = true,
|
.lower_cs_local_index_to_id = true,
|
||||||
.has_cs_global_id = true,
|
.has_cs_global_id = true,
|
||||||
.lower_wpos_pntc = true,
|
|
||||||
.vectorize_io = true,
|
.vectorize_io = true,
|
||||||
.use_interpolated_input_intrinsics = true,
|
.use_interpolated_input_intrinsics = true,
|
||||||
.lower_rotate = true,
|
.lower_rotate = true,
|
||||||
|
|
|
||||||
|
|
@ -819,7 +819,6 @@ agx_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
|
||||||
case PIPE_CAP_SEAMLESS_CUBE_MAP:
|
case PIPE_CAP_SEAMLESS_CUBE_MAP:
|
||||||
case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
|
case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
|
||||||
return true;
|
return true;
|
||||||
case PIPE_CAP_POINT_COORD_ORIGIN_UPPER_LEFT:
|
|
||||||
case PIPE_CAP_FS_POINT_IS_SYSVAL:
|
case PIPE_CAP_FS_POINT_IS_SYSVAL:
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1525,9 +1525,18 @@ demo_rasterizer(struct agx_context *ctx, struct agx_pool *pool, bool is_points)
|
||||||
return agx_pool_upload_aligned(pool, &out, sizeof(out), 64);
|
return agx_pool_upload_aligned(pool, &out, sizeof(out), 64);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static enum agx_object_type
|
||||||
|
agx_point_object_type(struct agx_rasterizer *rast)
|
||||||
|
{
|
||||||
|
return (rast->base.sprite_coord_mode == PIPE_SPRITE_COORD_UPPER_LEFT) ?
|
||||||
|
AGX_OBJECT_TYPE_POINT_SPRITE_UV01 :
|
||||||
|
AGX_OBJECT_TYPE_POINT_SPRITE_UV10;
|
||||||
|
}
|
||||||
|
|
||||||
static uint64_t
|
static uint64_t
|
||||||
demo_unk11(struct agx_pool *pool, bool prim_lines, bool prim_points, bool
|
demo_unk11(struct agx_pool *pool, struct agx_rasterizer *rast,
|
||||||
reads_tib, bool sample_mask_from_shader, bool no_colour_output)
|
bool prim_lines, bool prim_points, bool reads_tib,
|
||||||
|
bool sample_mask_from_shader, bool no_colour_output)
|
||||||
{
|
{
|
||||||
struct agx_ptr T = agx_pool_alloc_aligned(pool, AGX_UNKNOWN_4A_LENGTH, 64);
|
struct agx_ptr T = agx_pool_alloc_aligned(pool, AGX_UNKNOWN_4A_LENGTH, 64);
|
||||||
|
|
||||||
|
|
@ -1538,7 +1547,7 @@ demo_unk11(struct agx_pool *pool, bool prim_lines, bool prim_points, bool
|
||||||
cfg.sample_mask_from_shader = sample_mask_from_shader;
|
cfg.sample_mask_from_shader = sample_mask_from_shader;
|
||||||
|
|
||||||
cfg.front.object_type = cfg.back.object_type =
|
cfg.front.object_type = cfg.back.object_type =
|
||||||
prim_points ? AGX_OBJECT_TYPE_POINT_SPRITE_UV01 :
|
prim_points ? agx_point_object_type(rast) :
|
||||||
prim_lines ? AGX_OBJECT_TYPE_LINE :
|
prim_lines ? AGX_OBJECT_TYPE_LINE :
|
||||||
AGX_OBJECT_TYPE_TRIANGLE;
|
AGX_OBJECT_TYPE_TRIANGLE;
|
||||||
};
|
};
|
||||||
|
|
@ -1614,7 +1623,7 @@ agx_encode_state(struct agx_context *ctx, uint8_t *out,
|
||||||
varyings, ctx->fs->info.varyings.fs.nr_bindings));
|
varyings, ctx->fs->info.varyings.fs.nr_bindings));
|
||||||
agx_push_record(&out, 4, demo_linkage(ctx->vs, ctx->fs, pool));
|
agx_push_record(&out, 4, demo_linkage(ctx->vs, ctx->fs, pool));
|
||||||
agx_push_record(&out, 7, demo_rasterizer(ctx, pool, is_points));
|
agx_push_record(&out, 7, demo_rasterizer(ctx, pool, is_points));
|
||||||
agx_push_record(&out, 5, demo_unk11(pool, is_lines, is_points, reads_tib,
|
agx_push_record(&out, 5, demo_unk11(pool, ctx->rast, is_lines, is_points, reads_tib,
|
||||||
sample_mask_from_shader, no_colour_output));
|
sample_mask_from_shader, no_colour_output));
|
||||||
|
|
||||||
unsigned zbias = 0;
|
unsigned zbias = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue