mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 15:40:11 +01:00
poly,asahi: Rename poly_tess_args to poly_tess_params
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com> Reviewed-by: Mary Guillemard <mary@mary.zone> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38404>
This commit is contained in:
parent
3182deaae1
commit
4716858a51
8 changed files with 43 additions and 43 deletions
|
|
@ -367,7 +367,7 @@ libagx_prefix_sum_geom(constant struct poly_geometry_params *p)
|
|||
}
|
||||
|
||||
KERNEL(1024)
|
||||
libagx_prefix_sum_tess(global struct poly_tess_args *p, global uint *c_prims,
|
||||
libagx_prefix_sum_tess(global struct poly_tess_params *p, global uint *c_prims,
|
||||
global uint *c_invs, uint increment_stats__2)
|
||||
{
|
||||
local uint scratch[32];
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
KERNEL(1)
|
||||
libagx_tess_setup_indirect(
|
||||
global struct poly_tess_args *p,
|
||||
global struct poly_tess_params *p,
|
||||
global uint32_t *grids /* output: VS then TCS then tess */,
|
||||
global struct poly_ia_state *ia /* output */, global uint32_t *indirect,
|
||||
global uint64_t *vertex_output_buffer_ptr, uint64_t in_index_buffer,
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
#include "poly/cl/tessellator.h"
|
||||
|
||||
KERNEL(64)
|
||||
libagx_tess_isoline(constant struct poly_tess_args *p,
|
||||
libagx_tess_isoline(constant struct poly_tess_params *p,
|
||||
enum poly_tess_mode mode__2)
|
||||
{
|
||||
uint patch = cl_global_id.x;
|
||||
|
|
@ -30,14 +30,14 @@ libagx_tess_isoline(constant struct poly_tess_args *p,
|
|||
}
|
||||
|
||||
KERNEL(64)
|
||||
libagx_tess_tri(constant struct poly_tess_args *p, enum poly_tess_mode mode__2)
|
||||
libagx_tess_tri(constant struct poly_tess_params *p, enum poly_tess_mode mode__2)
|
||||
{
|
||||
uint patch = cl_global_id.x;
|
||||
poly_tess_tri_process(p, patch, mode__2);
|
||||
}
|
||||
|
||||
KERNEL(64)
|
||||
libagx_tess_quad(constant struct poly_tess_args *p, enum poly_tess_mode mode__2)
|
||||
libagx_tess_quad(constant struct poly_tess_params *p, enum poly_tess_mode mode__2)
|
||||
{
|
||||
uint patch = cl_global_id.x;
|
||||
poly_tess_quad_process(p, patch, mode__2);
|
||||
|
|
|
|||
|
|
@ -1231,7 +1231,7 @@ hk_upload_geometry_params(struct hk_cmd_buffer *cmd, struct agx_draw draw)
|
|||
}
|
||||
|
||||
static void
|
||||
hk_upload_tess_params(struct hk_cmd_buffer *cmd, struct poly_tess_args *out,
|
||||
hk_upload_tess_params(struct hk_cmd_buffer *cmd, struct poly_tess_params *out,
|
||||
struct agx_draw draw)
|
||||
{
|
||||
struct hk_device *dev = hk_cmd_buffer_device(cmd);
|
||||
|
|
@ -1246,7 +1246,7 @@ hk_upload_tess_params(struct hk_cmd_buffer *cmd, struct poly_tess_args *out,
|
|||
? POLY_TESS_PARTITIONING_FRACTIONAL_ODD
|
||||
: POLY_TESS_PARTITIONING_FRACTIONAL_EVEN;
|
||||
|
||||
struct poly_tess_args args = {
|
||||
struct poly_tess_params args = {
|
||||
.heap = hk_heap(cmd),
|
||||
.tcs_stride_el = tcs->info.tess.tcs_output_stride / 4,
|
||||
.statistic = hk_pipeline_stat_addr(
|
||||
|
|
@ -1485,7 +1485,7 @@ hk_launch_gs_prerast(struct hk_cmd_buffer *cmd, struct hk_cs *cs,
|
|||
|
||||
if (cmd->state.gfx.shaders[MESA_SHADER_TESS_EVAL]) {
|
||||
gsi.vertex_buffer = desc->root.draw.tess_params +
|
||||
offsetof(struct poly_tess_args, tes_buffer);
|
||||
offsetof(struct poly_tess_params, tes_buffer);
|
||||
} else {
|
||||
gsi.vertex_buffer = desc->root.root_desc_addr +
|
||||
offsetof(struct hk_root_descriptor_table,
|
||||
|
|
@ -3095,7 +3095,7 @@ hk_flush_dynamic_state(struct hk_cmd_buffer *cmd, struct hk_cs *cs,
|
|||
|
||||
struct agx_ptr tess_args = {0};
|
||||
if (gfx->shaders[MESA_SHADER_TESS_EVAL]) {
|
||||
tess_args = hk_pool_alloc(cmd, sizeof(struct poly_tess_args), 4);
|
||||
tess_args = hk_pool_alloc(cmd, sizeof(struct poly_tess_params), 4);
|
||||
gfx->descriptors.root.draw.tess_params = tess_args.gpu;
|
||||
gfx->descriptors.root_dirty = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4575,7 +4575,7 @@ agx_draw_patches(struct agx_context *ctx, const struct pipe_draw_info *info,
|
|||
uint64_t heap = agx_batch_heap(batch);
|
||||
assert((tcs->tess.output_stride & 3) == 0 && "must be aligned");
|
||||
|
||||
struct poly_tess_args args = {
|
||||
struct poly_tess_params params = {
|
||||
.heap = heap,
|
||||
.tcs_stride_el = tcs->tess.output_stride / 4,
|
||||
.statistic = agx_get_query_address(
|
||||
|
|
@ -4591,12 +4591,12 @@ agx_draw_patches(struct agx_context *ctx, const struct pipe_draw_info *info,
|
|||
};
|
||||
|
||||
if (!point_mode && tes->tess.primitive != TESS_PRIMITIVE_ISOLINES) {
|
||||
args.ccw = !tes->tess.ccw;
|
||||
params.ccw = !tes->tess.ccw;
|
||||
}
|
||||
|
||||
memcpy(&args.tess_level_outer_default, ctx->default_outer_level,
|
||||
memcpy(¶ms.tess_level_outer_default, ctx->default_outer_level,
|
||||
sizeof(ctx->default_outer_level));
|
||||
memcpy(&args.tess_level_inner_default, ctx->default_inner_level,
|
||||
memcpy(¶ms.tess_level_inner_default, ctx->default_inner_level,
|
||||
sizeof(ctx->default_inner_level));
|
||||
|
||||
struct agx_grid vs_grid, tcs_grid, tess_grid;
|
||||
|
|
@ -4640,12 +4640,12 @@ agx_draw_patches(struct agx_context *ctx, const struct pipe_draw_info *info,
|
|||
struct agx_ptr blob =
|
||||
agx_pool_alloc_aligned_with_bo(&batch->pool, alloc, 4, &draw_bo);
|
||||
|
||||
args.tcs_buffer = blob.gpu + tcs_out_offs;
|
||||
args.patches_per_instance = in_patches;
|
||||
args.coord_allocs = blob.gpu + patch_coord_offs;
|
||||
args.nr_patches = unrolled_patches;
|
||||
args.out_draws = blob.gpu + draw_offs;
|
||||
args.counts = blob.gpu + count_offs;
|
||||
params.tcs_buffer = blob.gpu + tcs_out_offs;
|
||||
params.patches_per_instance = in_patches;
|
||||
params.coord_allocs = blob.gpu + patch_coord_offs;
|
||||
params.nr_patches = unrolled_patches;
|
||||
params.out_draws = blob.gpu + draw_offs;
|
||||
params.counts = blob.gpu + count_offs;
|
||||
|
||||
unsigned vb_size = poly_tcs_in_size(draws->count * info->instance_count,
|
||||
batch->uniforms.vertex_outputs);
|
||||
|
|
@ -4659,13 +4659,13 @@ agx_draw_patches(struct agx_context *ctx, const struct pipe_draw_info *info,
|
|||
|
||||
tess_grid = agx_1d(unrolled_patches);
|
||||
} else if (indirect) {
|
||||
args.out_draws =
|
||||
params.out_draws =
|
||||
agx_pool_alloc_aligned_with_bo(&batch->pool, draw_stride, 4, &draw_bo)
|
||||
.gpu;
|
||||
}
|
||||
|
||||
uint64_t state =
|
||||
agx_pool_upload_aligned(&batch->pool, &args, sizeof(args), 4);
|
||||
agx_pool_upload_aligned(&batch->pool, ¶ms, sizeof(params), 4);
|
||||
|
||||
if (indirect) {
|
||||
perf_debug(dev, "Indirect tessellation");
|
||||
|
|
@ -4746,7 +4746,7 @@ agx_draw_patches(struct agx_context *ctx, const struct pipe_draw_info *info,
|
|||
|
||||
struct pipe_draw_indirect_info copy_indirect = {
|
||||
.buffer = &indirect_rsrc.base,
|
||||
.offset = args.out_draws - draw_bo->va->addr,
|
||||
.offset = params.out_draws - draw_bo->va->addr,
|
||||
.stride = draw_stride,
|
||||
.draw_count = 1,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -7,25 +7,25 @@
|
|||
#include "poly/tessellator.h"
|
||||
|
||||
uint
|
||||
poly_tcs_patch_vertices_in(constant struct poly_tess_args *p)
|
||||
poly_tcs_patch_vertices_in(constant struct poly_tess_params *p)
|
||||
{
|
||||
return p->input_patch_size;
|
||||
}
|
||||
|
||||
uint
|
||||
poly_tes_patch_vertices_in(constant struct poly_tess_args *p)
|
||||
poly_tes_patch_vertices_in(constant struct poly_tess_params *p)
|
||||
{
|
||||
return p->output_patch_size;
|
||||
}
|
||||
|
||||
uint
|
||||
poly_tcs_unrolled_id(constant struct poly_tess_args *p, uint3 wg_id)
|
||||
poly_tcs_unrolled_id(constant struct poly_tess_params *p, uint3 wg_id)
|
||||
{
|
||||
return (wg_id.y * p->patches_per_instance) + wg_id.x;
|
||||
}
|
||||
|
||||
uint64_t
|
||||
poly_tes_buffer(constant struct poly_tess_args *p)
|
||||
poly_tes_buffer(constant struct poly_tess_params *p)
|
||||
{
|
||||
return p->tes_buffer;
|
||||
}
|
||||
|
|
@ -41,7 +41,7 @@ poly_tes_buffer(constant struct poly_tess_args *p)
|
|||
* Therefore we do a simple load. No bounds checking needed.
|
||||
*/
|
||||
uint32_t
|
||||
poly_load_tes_index(constant struct poly_tess_args *p, uint32_t index)
|
||||
poly_load_tes_index(constant struct poly_tess_params *p, uint32_t index)
|
||||
{
|
||||
/* Swap second and third vertices of each triangle to flip winding order
|
||||
* dynamically if needed.
|
||||
|
|
@ -59,7 +59,7 @@ poly_load_tes_index(constant struct poly_tess_args *p, uint32_t index)
|
|||
}
|
||||
|
||||
uintptr_t
|
||||
poly_tcs_out_address(constant struct poly_tess_args *p, uint patch_id,
|
||||
poly_tcs_out_address(constant struct poly_tess_params *p, uint patch_id,
|
||||
uint vtx_id, gl_varying_slot location, uint nr_patch_out,
|
||||
uint out_patch_size, uint64_t vtx_out_mask)
|
||||
{
|
||||
|
|
@ -82,7 +82,7 @@ tes_unrolled_patch_id(uint raw_id)
|
|||
}
|
||||
|
||||
uint
|
||||
poly_tes_patch_id(constant struct poly_tess_args *p, uint raw_id)
|
||||
poly_tes_patch_id(constant struct poly_tess_params *p, uint raw_id)
|
||||
{
|
||||
return tes_unrolled_patch_id(raw_id) % p->patches_per_instance;
|
||||
}
|
||||
|
|
@ -94,7 +94,7 @@ tes_vertex_id_in_patch(uint raw_id)
|
|||
}
|
||||
|
||||
float2
|
||||
poly_load_tess_coord(constant struct poly_tess_args *p, uint raw_id)
|
||||
poly_load_tess_coord(constant struct poly_tess_params *p, uint raw_id)
|
||||
{
|
||||
uint patch = tes_unrolled_patch_id(raw_id);
|
||||
uint vtx = tes_vertex_id_in_patch(raw_id);
|
||||
|
|
@ -110,7 +110,7 @@ poly_load_tess_coord(constant struct poly_tess_args *p, uint raw_id)
|
|||
}
|
||||
|
||||
uintptr_t
|
||||
poly_tes_in_address(constant struct poly_tess_args *p, uint raw_id, uint vtx_id,
|
||||
poly_tes_in_address(constant struct poly_tess_params *p, uint raw_id, uint vtx_id,
|
||||
gl_varying_slot location)
|
||||
{
|
||||
uint patch = tes_unrolled_patch_id(raw_id);
|
||||
|
|
@ -121,13 +121,13 @@ poly_tes_in_address(constant struct poly_tess_args *p, uint raw_id, uint vtx_id,
|
|||
}
|
||||
|
||||
float4
|
||||
poly_tess_level_outer_default(constant struct poly_tess_args *p)
|
||||
poly_tess_level_outer_default(constant struct poly_tess_params *p)
|
||||
{
|
||||
return vload4(0, p->tess_level_outer_default);
|
||||
}
|
||||
|
||||
float2
|
||||
poly_tess_level_inner_default(constant struct poly_tess_args *p)
|
||||
poly_tess_level_inner_default(constant struct poly_tess_params *p)
|
||||
{
|
||||
return vload2(0, p->tess_level_inner_default);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ struct CHWTessellator {
|
|||
#define FXP_ONE_HALF 0x00008000
|
||||
|
||||
static inline global float *
|
||||
tess_factors(constant struct poly_tess_args *p, uint patch)
|
||||
tess_factors(constant struct poly_tess_params *p, uint patch)
|
||||
{
|
||||
return p->tcs_buffer + (patch * p->tcs_stride_el);
|
||||
}
|
||||
|
|
@ -129,7 +129,7 @@ tess_factors(constant struct poly_tess_args *p, uint patch)
|
|||
* memory.
|
||||
*/
|
||||
static inline global void *
|
||||
poly_draw(constant struct poly_tess_args *p, enum poly_tess_mode mode,
|
||||
poly_draw(constant struct poly_tess_params *p, enum poly_tess_mode mode,
|
||||
bool lines, uint patch, uint count)
|
||||
{
|
||||
if (mode == POLY_TESS_MODE_COUNT) {
|
||||
|
|
@ -152,7 +152,7 @@ poly_draw(constant struct poly_tess_args *p, enum poly_tess_mode mode,
|
|||
|
||||
static inline void
|
||||
poly_draw_points(private struct CHWTessellator *ctx,
|
||||
constant struct poly_tess_args *p, uint patch, uint count)
|
||||
constant struct poly_tess_params *p, uint patch, uint count)
|
||||
{
|
||||
/* For points mode with a single draw, we need to generate a trivial index
|
||||
* buffer to stuff in the patch ID in the right place.
|
||||
|
|
@ -168,7 +168,7 @@ poly_draw_points(private struct CHWTessellator *ctx,
|
|||
}
|
||||
|
||||
static inline void
|
||||
poly_draw_empty(constant struct poly_tess_args *p, enum poly_tess_mode mode,
|
||||
poly_draw_empty(constant struct poly_tess_params *p, enum poly_tess_mode mode,
|
||||
uint patch)
|
||||
{
|
||||
if (mode == POLY_TESS_MODE_COUNT) {
|
||||
|
|
@ -181,7 +181,7 @@ poly_draw_empty(constant struct poly_tess_args *p, enum poly_tess_mode mode,
|
|||
* is recorded in the coord_allocs[] array, which is in elements.
|
||||
*/
|
||||
static inline global struct poly_tess_point *
|
||||
poly_heap_alloc_points(constant struct poly_tess_args *p, uint patch,
|
||||
poly_heap_alloc_points(constant struct poly_tess_params *p, uint patch,
|
||||
uint count)
|
||||
{
|
||||
/* If we're recording statistics, increment now. The statistic is for
|
||||
|
|
@ -720,7 +720,7 @@ StitchTransition(private struct CHWTessellator *ctx, int baseIndexOffset,
|
|||
}
|
||||
|
||||
static inline void
|
||||
poly_tess_isoline_process(constant struct poly_tess_args *p, uint32_t patch,
|
||||
poly_tess_isoline_process(constant struct poly_tess_params *p, uint32_t patch,
|
||||
enum poly_tess_mode mode)
|
||||
{
|
||||
enum poly_tess_partitioning partitioning = p->partitioning;
|
||||
|
|
@ -820,7 +820,7 @@ poly_tess_isoline_process(constant struct poly_tess_args *p, uint32_t patch,
|
|||
}
|
||||
|
||||
static inline void
|
||||
poly_tess_tri_process(constant struct poly_tess_args *p, uint32_t patch,
|
||||
poly_tess_tri_process(constant struct poly_tess_params *p, uint32_t patch,
|
||||
enum poly_tess_mode mode)
|
||||
{
|
||||
enum poly_tess_partitioning partitioning = p->partitioning;
|
||||
|
|
@ -1146,7 +1146,7 @@ poly_tess_tri_process(constant struct poly_tess_args *p, uint32_t patch,
|
|||
}
|
||||
|
||||
static inline void
|
||||
poly_tess_quad_process(constant struct poly_tess_args *p, uint32_t patch,
|
||||
poly_tess_quad_process(constant struct poly_tess_params *p, uint32_t patch,
|
||||
enum poly_tess_mode mode)
|
||||
{
|
||||
enum poly_tess_partitioning partitioning = p->partitioning;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ struct poly_tess_point {
|
|||
};
|
||||
static_assert(sizeof(struct poly_tess_point) == 8);
|
||||
|
||||
struct poly_tess_args {
|
||||
struct poly_tess_params {
|
||||
/* Heap to allocate tessellator outputs in */
|
||||
DEVICE(struct poly_heap) heap;
|
||||
|
||||
|
|
@ -105,4 +105,4 @@ struct poly_tess_args {
|
|||
*/
|
||||
uint32_t ccw;
|
||||
} PACKED;
|
||||
static_assert(sizeof(struct poly_tess_args) == 36 * 4);
|
||||
static_assert(sizeof(struct poly_tess_params) == 36 * 4);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue