mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 20:28:04 +02:00
panfrost: Rename structs to panfrost_(un)compiled_shader
Consistency with other drivers, this makes the language less variant-centric. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19363>
This commit is contained in:
parent
ea45460f55
commit
52b4181eed
7 changed files with 62 additions and 63 deletions
|
|
@ -253,7 +253,7 @@ panfrost_create_sampler_state(
|
|||
|
||||
static bool
|
||||
panfrost_fs_required(
|
||||
struct panfrost_shader_state *fs,
|
||||
struct panfrost_compiled_shader *fs,
|
||||
struct panfrost_blend_state *blend,
|
||||
struct pipe_framebuffer_state *state,
|
||||
const struct panfrost_zsa_state *zsa)
|
||||
|
|
@ -401,7 +401,7 @@ panfrost_emit_blend(struct panfrost_batch *batch, void *rts, mali_ptr *blend_sha
|
|||
|
||||
#if PAN_ARCH >= 6
|
||||
const struct panfrost_device *dev = pan_device(ctx->base.screen);
|
||||
struct panfrost_shader_state *fs =
|
||||
struct panfrost_compiled_shader *fs =
|
||||
panfrost_get_shader_state(ctx, PIPE_SHADER_FRAGMENT);
|
||||
|
||||
/* Words 2 and 3: Internal blend */
|
||||
|
|
@ -462,7 +462,7 @@ panfrost_emit_blend(struct panfrost_batch *batch, void *rts, mali_ptr *blend_sha
|
|||
#endif
|
||||
|
||||
static inline bool
|
||||
pan_allow_forward_pixel_to_kill(struct panfrost_context *ctx, struct panfrost_shader_state *fs)
|
||||
pan_allow_forward_pixel_to_kill(struct panfrost_context *ctx, struct panfrost_compiled_shader *fs)
|
||||
{
|
||||
/* Track if any colour buffer is reused across draws, either
|
||||
* from reading it directly, or from failing to write it
|
||||
|
|
@ -481,7 +481,7 @@ pan_allow_forward_pixel_to_kill(struct panfrost_context *ctx, struct panfrost_sh
|
|||
static mali_ptr
|
||||
panfrost_emit_compute_shader_meta(struct panfrost_batch *batch, enum pipe_shader_type stage)
|
||||
{
|
||||
struct panfrost_shader_state *ss = panfrost_get_shader_state(batch->ctx, stage);
|
||||
struct panfrost_compiled_shader *ss = panfrost_get_shader_state(batch->ctx, stage);
|
||||
|
||||
panfrost_batch_add_bo(batch, ss->bin.bo, PIPE_SHADER_VERTEX);
|
||||
panfrost_batch_add_bo(batch, ss->state.bo, PIPE_SHADER_VERTEX);
|
||||
|
|
@ -526,7 +526,7 @@ panfrost_prepare_fs_state(struct panfrost_context *ctx,
|
|||
{
|
||||
struct pipe_rasterizer_state *rast = &ctx->rasterizer->base;
|
||||
const struct panfrost_zsa_state *zsa = ctx->depth_stencil;
|
||||
struct panfrost_shader_state *fs = panfrost_get_shader_state(ctx, PIPE_SHADER_FRAGMENT);
|
||||
struct panfrost_compiled_shader *fs = panfrost_get_shader_state(ctx, PIPE_SHADER_FRAGMENT);
|
||||
struct panfrost_blend_state *so = ctx->blend;
|
||||
bool alpha_to_coverage = ctx->blend->base.alpha_to_coverage;
|
||||
bool msaa = rast->multisample;
|
||||
|
|
@ -660,7 +660,7 @@ panfrost_emit_frag_shader(struct panfrost_context *ctx,
|
|||
{
|
||||
const struct panfrost_zsa_state *zsa = ctx->depth_stencil;
|
||||
const struct panfrost_rasterizer *rast = ctx->rasterizer;
|
||||
struct panfrost_shader_state *fs =
|
||||
struct panfrost_compiled_shader *fs =
|
||||
panfrost_get_shader_state(ctx, PIPE_SHADER_FRAGMENT);
|
||||
|
||||
/* We need to merge several several partial renderer state descriptors,
|
||||
|
|
@ -705,7 +705,7 @@ static mali_ptr
|
|||
panfrost_emit_frag_shader_meta(struct panfrost_batch *batch)
|
||||
{
|
||||
struct panfrost_context *ctx = batch->ctx;
|
||||
struct panfrost_shader_state *ss = panfrost_get_shader_state(ctx, PIPE_SHADER_FRAGMENT);
|
||||
struct panfrost_compiled_shader *ss = panfrost_get_shader_state(ctx, PIPE_SHADER_FRAGMENT);
|
||||
|
||||
panfrost_batch_add_bo(batch, ss->bin.bo, PIPE_SHADER_FRAGMENT);
|
||||
|
||||
|
|
@ -821,7 +821,7 @@ panfrost_emit_depth_stencil(struct panfrost_batch *batch)
|
|||
struct panfrost_context *ctx = batch->ctx;
|
||||
const struct panfrost_zsa_state *zsa = ctx->depth_stencil;
|
||||
struct panfrost_rasterizer *rast = ctx->rasterizer;
|
||||
struct panfrost_shader_state *fs = panfrost_get_shader_state(ctx, PIPE_SHADER_FRAGMENT);
|
||||
struct panfrost_compiled_shader *fs = panfrost_get_shader_state(ctx, PIPE_SHADER_FRAGMENT);
|
||||
bool back_enab = zsa->base.stencil[1].enabled;
|
||||
|
||||
struct panfrost_ptr T = pan_pool_alloc_desc(&batch->pool.base, DEPTH_STENCIL);
|
||||
|
|
@ -1292,7 +1292,7 @@ panfrost_xfb_offset(unsigned stride, struct pipe_stream_output_target *target)
|
|||
static void
|
||||
panfrost_upload_sysvals(struct panfrost_batch *batch,
|
||||
const struct panfrost_ptr *ptr,
|
||||
struct panfrost_shader_state *ss,
|
||||
struct panfrost_compiled_shader *ss,
|
||||
enum pipe_shader_type st)
|
||||
{
|
||||
struct sysval_uniform *uniforms = ptr->cpu;
|
||||
|
|
@ -1323,7 +1323,7 @@ panfrost_upload_sysvals(struct panfrost_batch *batch,
|
|||
case PAN_SYSVAL_XFB:
|
||||
{
|
||||
unsigned buf = PAN_SYSVAL_ID(sysval);
|
||||
struct panfrost_shader_state *vs =
|
||||
struct panfrost_compiled_shader *vs =
|
||||
panfrost_get_shader_state(batch->ctx, PIPE_SHADER_VERTEX);
|
||||
struct pipe_stream_output_info *so = &vs->stream_output;
|
||||
unsigned stride = so->stride[buf] * 4;
|
||||
|
|
@ -1472,13 +1472,13 @@ panfrost_emit_const_buf(struct panfrost_batch *batch,
|
|||
unsigned *pushed_words)
|
||||
{
|
||||
struct panfrost_context *ctx = batch->ctx;
|
||||
struct panfrost_shader_variants *all = ctx->shader[stage];
|
||||
struct panfrost_uncompiled_shader *all = ctx->shader[stage];
|
||||
|
||||
if (!all)
|
||||
return 0;
|
||||
|
||||
struct panfrost_constant_buffer *buf = &ctx->constant_buffer[stage];
|
||||
struct panfrost_shader_state *ss = &all->variants[all->active_variant];
|
||||
struct panfrost_compiled_shader *ss = &all->variants[all->active_variant];
|
||||
|
||||
/* Allocate room for the sysval and the uniforms */
|
||||
size_t sys_size = sizeof(float) * 4 * ss->info.sysvals.sysval_count;
|
||||
|
|
@ -1489,7 +1489,7 @@ panfrost_emit_const_buf(struct panfrost_batch *batch,
|
|||
panfrost_upload_sysvals(batch, &transfer, ss, stage);
|
||||
|
||||
/* Next up, attach UBOs. UBO count includes gaps but no sysval UBO */
|
||||
struct panfrost_shader_state *shader = panfrost_get_shader_state(ctx, stage);
|
||||
struct panfrost_compiled_shader *shader = panfrost_get_shader_state(ctx, stage);
|
||||
unsigned ubo_count = shader->info.ubo_count - (sys_size ? 1 : 0);
|
||||
unsigned sysval_ubo = sys_size ? ubo_count : ~0;
|
||||
struct panfrost_ptr ubos = { 0 };
|
||||
|
|
@ -1621,8 +1621,8 @@ panfrost_emit_shared_memory(struct panfrost_batch *batch,
|
|||
{
|
||||
struct panfrost_context *ctx = batch->ctx;
|
||||
struct panfrost_device *dev = pan_device(ctx->base.screen);
|
||||
struct panfrost_shader_variants *all = ctx->shader[PIPE_SHADER_COMPUTE];
|
||||
struct panfrost_shader_state *ss = &all->variants[all->active_variant];
|
||||
struct panfrost_uncompiled_shader *all = ctx->shader[PIPE_SHADER_COMPUTE];
|
||||
struct panfrost_compiled_shader *ss = &all->variants[all->active_variant];
|
||||
struct panfrost_ptr t =
|
||||
pan_pool_alloc_desc(&batch->pool.base, LOCAL_STORAGE);
|
||||
|
||||
|
|
@ -1970,7 +1970,7 @@ panfrost_emit_image_attribs(struct panfrost_batch *batch,
|
|||
enum pipe_shader_type type)
|
||||
{
|
||||
struct panfrost_context *ctx = batch->ctx;
|
||||
struct panfrost_shader_state *shader = panfrost_get_shader_state(ctx, type);
|
||||
struct panfrost_compiled_shader *shader = panfrost_get_shader_state(ctx, type);
|
||||
|
||||
if (!shader->info.attribute_count) {
|
||||
*buffers = 0;
|
||||
|
|
@ -2006,7 +2006,7 @@ panfrost_emit_vertex_data(struct panfrost_batch *batch,
|
|||
{
|
||||
struct panfrost_context *ctx = batch->ctx;
|
||||
struct panfrost_vertex_state *so = ctx->vertex;
|
||||
struct panfrost_shader_state *vs = panfrost_get_shader_state(ctx, PIPE_SHADER_VERTEX);
|
||||
struct panfrost_compiled_shader *vs = panfrost_get_shader_state(ctx, PIPE_SHADER_VERTEX);
|
||||
bool instanced = ctx->indirect_draw || ctx->instance_count > 1;
|
||||
uint32_t image_mask = ctx->image_mask[PIPE_SHADER_VERTEX];
|
||||
unsigned nr_images = util_last_bit(image_mask);
|
||||
|
|
@ -2461,8 +2461,8 @@ panfrost_emit_varying(const struct panfrost_device *dev,
|
|||
static void
|
||||
panfrost_emit_varying_descs(
|
||||
struct panfrost_pool *pool,
|
||||
struct panfrost_shader_state *producer,
|
||||
struct panfrost_shader_state *consumer,
|
||||
struct panfrost_compiled_shader *producer,
|
||||
struct panfrost_compiled_shader *consumer,
|
||||
uint16_t point_coord_mask,
|
||||
struct pan_linkage *out)
|
||||
{
|
||||
|
|
@ -2560,7 +2560,7 @@ panfrost_emit_varying_descriptor(struct panfrost_batch *batch,
|
|||
{
|
||||
/* Load the shaders */
|
||||
struct panfrost_context *ctx = batch->ctx;
|
||||
struct panfrost_shader_state *vs, *fs;
|
||||
struct panfrost_compiled_shader *vs, *fs;
|
||||
|
||||
vs = panfrost_get_shader_state(ctx, PIPE_SHADER_VERTEX);
|
||||
fs = panfrost_get_shader_state(ctx, PIPE_SHADER_FRAGMENT);
|
||||
|
|
@ -2957,7 +2957,7 @@ panfrost_update_shader_state(struct panfrost_batch *batch,
|
|||
enum pipe_shader_type st)
|
||||
{
|
||||
struct panfrost_context *ctx = batch->ctx;
|
||||
struct panfrost_shader_state *ss = panfrost_get_shader_state(ctx, st);
|
||||
struct panfrost_compiled_shader *ss = panfrost_get_shader_state(ctx, st);
|
||||
|
||||
bool frag = (st == PIPE_SHADER_FRAGMENT);
|
||||
unsigned dirty_3d = ctx->dirty;
|
||||
|
|
@ -3112,7 +3112,7 @@ panfrost_emit_primitive(struct panfrost_context *ctx,
|
|||
|
||||
cfg.job_task_split = 6;
|
||||
#else
|
||||
struct panfrost_shader_state *fs =
|
||||
struct panfrost_compiled_shader *fs =
|
||||
panfrost_get_shader_state(ctx, PIPE_SHADER_FRAGMENT);
|
||||
|
||||
cfg.allow_rotating_primitives = !(lines || fs->info.bifrost.uses_flat_shading);
|
||||
|
|
@ -3273,7 +3273,7 @@ panfrost_emit_draw(void *out,
|
|||
}
|
||||
|
||||
#if PAN_ARCH >= 9
|
||||
struct panfrost_shader_state *fs =
|
||||
struct panfrost_compiled_shader *fs =
|
||||
panfrost_get_shader_state(ctx, PIPE_SHADER_FRAGMENT);
|
||||
|
||||
cfg.multisample_enable = rast->multisample;
|
||||
|
|
@ -3407,10 +3407,10 @@ panfrost_emit_malloc_vertex(struct panfrost_batch *batch,
|
|||
{
|
||||
struct panfrost_context *ctx = batch->ctx;
|
||||
|
||||
struct panfrost_shader_state *vs =
|
||||
struct panfrost_compiled_shader *vs =
|
||||
panfrost_get_shader_state(ctx, PIPE_SHADER_VERTEX);
|
||||
|
||||
struct panfrost_shader_state *fs =
|
||||
struct panfrost_compiled_shader *fs =
|
||||
panfrost_get_shader_state(ctx, PIPE_SHADER_FRAGMENT);
|
||||
|
||||
bool fs_required = panfrost_fs_required(fs, ctx->blend,
|
||||
|
|
@ -3553,12 +3553,12 @@ panfrost_launch_xfb(struct panfrost_batch *batch,
|
|||
|
||||
perf_debug_ctx(batch->ctx, "Emulating transform feedback");
|
||||
|
||||
struct panfrost_shader_state *vs = panfrost_get_shader_state(ctx, PIPE_SHADER_VERTEX);
|
||||
struct panfrost_shader_variants v = { .variants = vs->xfb };
|
||||
struct panfrost_compiled_shader *vs = panfrost_get_shader_state(ctx, PIPE_SHADER_VERTEX);
|
||||
struct panfrost_uncompiled_shader v = { .variants = vs->xfb };
|
||||
|
||||
vs->xfb->stream_output = vs->stream_output;
|
||||
|
||||
struct panfrost_shader_variants *saved_vs = ctx->shader[PIPE_SHADER_VERTEX];
|
||||
struct panfrost_uncompiled_shader *saved_vs = ctx->shader[PIPE_SHADER_VERTEX];
|
||||
mali_ptr saved_rsd = batch->rsd[PIPE_SHADER_VERTEX];
|
||||
mali_ptr saved_ubo = batch->uniform_buffers[PIPE_SHADER_VERTEX];
|
||||
mali_ptr saved_push = batch->push_uniforms[PIPE_SHADER_VERTEX];
|
||||
|
|
@ -3650,7 +3650,7 @@ panfrost_direct_draw(struct panfrost_batch *batch,
|
|||
ctx->active_prim = info->mode;
|
||||
ctx->drawid = drawid_offset;
|
||||
|
||||
struct panfrost_shader_state *vs = panfrost_get_shader_state(ctx, PIPE_SHADER_VERTEX);
|
||||
struct panfrost_compiled_shader *vs = panfrost_get_shader_state(ctx, PIPE_SHADER_VERTEX);
|
||||
|
||||
bool idvs = vs->info.vs.idvs;
|
||||
bool secondary_shader = vs->info.vs.secondary_enable;
|
||||
|
|
@ -3816,7 +3816,7 @@ panfrost_indirect_draw(struct panfrost_batch *batch,
|
|||
ctx->drawid = drawid_offset;
|
||||
ctx->indirect_draw = true;
|
||||
|
||||
struct panfrost_shader_state *vs = panfrost_get_shader_state(ctx, PIPE_SHADER_VERTEX);
|
||||
struct panfrost_compiled_shader *vs = panfrost_get_shader_state(ctx, PIPE_SHADER_VERTEX);
|
||||
|
||||
bool idvs = vs->info.vs.idvs;
|
||||
bool secondary_shader = vs->info.vs.secondary_enable;
|
||||
|
|
@ -4149,7 +4149,7 @@ panfrost_launch_grid(struct pipe_context *pipe,
|
|||
cfg.samplers = batch->samplers[PIPE_SHADER_COMPUTE];
|
||||
}
|
||||
#else
|
||||
struct panfrost_shader_state *cs =
|
||||
struct panfrost_compiled_shader *cs =
|
||||
&ctx->shader[PIPE_SHADER_COMPUTE]->variants[0];
|
||||
|
||||
pan_section_pack(t.cpu, COMPUTE_JOB, PAYLOAD, cfg) {
|
||||
|
|
@ -4573,7 +4573,7 @@ panfrost_ftz_mode(struct pan_shader_info *info)
|
|||
#endif
|
||||
|
||||
static void
|
||||
prepare_shader(struct panfrost_shader_state *state,
|
||||
prepare_shader(struct panfrost_compiled_shader *state,
|
||||
struct panfrost_pool *pool, bool upload)
|
||||
{
|
||||
#if PAN_ARCH <= 7
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ bool
|
|||
panfrost_writes_point_size(struct panfrost_context *ctx)
|
||||
{
|
||||
assert(ctx->shader[PIPE_SHADER_VERTEX]);
|
||||
struct panfrost_shader_state *vs = panfrost_get_shader_state(ctx, PIPE_SHADER_VERTEX);
|
||||
struct panfrost_compiled_shader *vs = panfrost_get_shader_state(ctx, PIPE_SHADER_VERTEX);
|
||||
|
||||
return vs->info.vs.writes_point_size && ctx->active_prim == PIPE_PRIM_POINTS;
|
||||
}
|
||||
|
|
@ -208,7 +208,7 @@ panfrost_get_blend(struct panfrost_batch *batch, unsigned rti, struct panfrost_b
|
|||
PIPE_SHADER_FRAGMENT, "Blend shader");
|
||||
}
|
||||
|
||||
struct panfrost_shader_state *ss = panfrost_get_shader_state(ctx, PIPE_SHADER_FRAGMENT);
|
||||
struct panfrost_compiled_shader *ss = panfrost_get_shader_state(ctx, PIPE_SHADER_FRAGMENT);
|
||||
|
||||
/* Default for Midgard */
|
||||
nir_alu_type col0_type = nir_type_float32;
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ struct panfrost_context {
|
|||
|
||||
struct panfrost_constant_buffer constant_buffer[PIPE_SHADER_TYPES];
|
||||
struct panfrost_rasterizer *rasterizer;
|
||||
struct panfrost_shader_variants *shader[PIPE_SHADER_TYPES];
|
||||
struct panfrost_uncompiled_shader *shader[PIPE_SHADER_TYPES];
|
||||
struct panfrost_vertex_state *vertex;
|
||||
|
||||
struct pipe_vertex_buffer vertex_buffers[PIPE_MAX_ATTRIBS];
|
||||
|
|
@ -281,8 +281,7 @@ struct panfrost_shader_key {
|
|||
struct panfrost_fs_key fs;
|
||||
};
|
||||
|
||||
/* A shader state corresponds to the actual, current variant of the shader */
|
||||
struct panfrost_shader_state {
|
||||
struct panfrost_compiled_shader {
|
||||
/* Respectively, shader binary and Renderer State Descriptor */
|
||||
struct panfrost_pool_ref bin, state;
|
||||
|
||||
|
|
@ -294,7 +293,7 @@ struct panfrost_shader_state {
|
|||
struct pan_earlyzs_lut earlyzs;
|
||||
|
||||
/* Attached transform feedback program, if one exists */
|
||||
struct panfrost_shader_state *xfb;
|
||||
struct panfrost_compiled_shader *xfb;
|
||||
|
||||
/* Linked varyings, for non-separable programs */
|
||||
struct pan_linkage linkage;
|
||||
|
|
@ -308,8 +307,8 @@ struct panfrost_shader_state {
|
|||
unsigned dirty_3d, dirty_shader;
|
||||
};
|
||||
|
||||
/* A collection of varyings (the CSO) */
|
||||
struct panfrost_shader_variants {
|
||||
/* Shader CSO */
|
||||
struct panfrost_uncompiled_shader {
|
||||
nir_shader *nir;
|
||||
|
||||
/* Stream output information */
|
||||
|
|
@ -318,7 +317,7 @@ struct panfrost_shader_variants {
|
|||
/** Lock for the variants array */
|
||||
simple_mtx_t lock;
|
||||
|
||||
struct panfrost_shader_state *variants;
|
||||
struct panfrost_compiled_shader *variants;
|
||||
unsigned variant_space;
|
||||
|
||||
unsigned variant_count;
|
||||
|
|
@ -364,11 +363,11 @@ pan_so_target(struct pipe_stream_output_target *target)
|
|||
return (struct panfrost_streamout_target *)target;
|
||||
}
|
||||
|
||||
static inline struct panfrost_shader_state *
|
||||
static inline struct panfrost_compiled_shader *
|
||||
panfrost_get_shader_state(struct panfrost_context *ctx,
|
||||
enum pipe_shader_type st)
|
||||
{
|
||||
struct panfrost_shader_variants *all = ctx->shader[st];
|
||||
struct panfrost_uncompiled_shader *all = ctx->shader[st];
|
||||
|
||||
if (!all)
|
||||
return NULL;
|
||||
|
|
@ -399,7 +398,7 @@ panfrost_update_shader_variant(struct panfrost_context *ctx,
|
|||
enum pipe_shader_type type);
|
||||
|
||||
void
|
||||
panfrost_analyze_sysvals(struct panfrost_shader_state *ss);
|
||||
panfrost_analyze_sysvals(struct panfrost_compiled_shader *ss);
|
||||
|
||||
mali_ptr
|
||||
panfrost_get_index_buffer(struct panfrost_batch *batch,
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
#include "util/u_vbuf.h"
|
||||
|
||||
void
|
||||
panfrost_analyze_sysvals(struct panfrost_shader_state *ss)
|
||||
panfrost_analyze_sysvals(struct panfrost_compiled_shader *ss)
|
||||
{
|
||||
unsigned dirty = 0;
|
||||
unsigned dirty_shader = PAN_DIRTY_STAGE_SHADER | PAN_DIRTY_STAGE_CONST;
|
||||
|
|
|
|||
|
|
@ -873,7 +873,7 @@ panfrost_batch_adjust_stack_size(struct panfrost_batch *batch)
|
|||
struct panfrost_context *ctx = batch->ctx;
|
||||
|
||||
for (unsigned i = 0; i < PIPE_SHADER_TYPES; ++i) {
|
||||
struct panfrost_shader_state *ss;
|
||||
struct panfrost_compiled_shader *ss;
|
||||
|
||||
ss = panfrost_get_shader_state(ctx, i);
|
||||
if (!ss)
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
struct panfrost_batch;
|
||||
struct panfrost_context;
|
||||
struct panfrost_resource;
|
||||
struct panfrost_shader_state;
|
||||
struct panfrost_compiled_shader;
|
||||
struct pan_fb_info;
|
||||
struct pan_blend_state;
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ struct pan_blend_state;
|
|||
struct panfrost_vtable {
|
||||
/* Prepares the renderer state descriptor or shader program descriptor
|
||||
* for a given compiled shader, and if desired uploads it as well */
|
||||
void (*prepare_shader)(struct panfrost_shader_state *,
|
||||
void (*prepare_shader)(struct panfrost_compiled_shader *,
|
||||
struct panfrost_pool *, bool);
|
||||
|
||||
/* Emits a thread local storage descriptor */
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ panfrost_shader_compile(struct pipe_screen *pscreen,
|
|||
struct panfrost_pool *desc_pool,
|
||||
const nir_shader *ir,
|
||||
struct util_debug_callback *dbg,
|
||||
struct panfrost_shader_state *state,
|
||||
struct panfrost_compiled_shader *state,
|
||||
unsigned req_local_mem)
|
||||
{
|
||||
struct panfrost_screen *screen = pan_screen(pscreen);
|
||||
|
|
@ -56,7 +56,7 @@ panfrost_shader_compile(struct pipe_screen *pscreen,
|
|||
xfb->info.name = ralloc_asprintf(xfb, "%s@xfb", xfb->info.name);
|
||||
xfb->info.internal = true;
|
||||
|
||||
state->xfb = calloc(1, sizeof(struct panfrost_shader_state));
|
||||
state->xfb = calloc(1, sizeof(struct panfrost_compiled_shader));
|
||||
panfrost_shader_compile(pscreen, shader_pool, desc_pool, xfb, dbg, state->xfb, 0);
|
||||
|
||||
/* Main shader no longer uses XFB */
|
||||
|
|
@ -138,7 +138,7 @@ panfrost_build_key(struct panfrost_context *ctx,
|
|||
struct panfrost_device *dev = pan_device(ctx->base.screen);
|
||||
struct pipe_framebuffer_state *fb = &ctx->pipe_framebuffer;
|
||||
struct pipe_rasterizer_state *rast = (void *) ctx->rasterizer;
|
||||
struct panfrost_shader_variants *vs = ctx->shader[MESA_SHADER_VERTEX];
|
||||
struct panfrost_uncompiled_shader *vs = ctx->shader[MESA_SHADER_VERTEX];
|
||||
|
||||
key->fs.nr_cbufs = fb->nr_cbufs;
|
||||
|
||||
|
|
@ -215,7 +215,7 @@ update_so_info(struct pipe_stream_output_info *so_info,
|
|||
static unsigned
|
||||
panfrost_new_variant_locked(
|
||||
struct panfrost_context *ctx,
|
||||
struct panfrost_shader_variants *variants,
|
||||
struct panfrost_uncompiled_shader *variants,
|
||||
struct panfrost_shader_key *key)
|
||||
{
|
||||
unsigned variant = variants->variant_count++;
|
||||
|
|
@ -227,7 +227,7 @@ panfrost_new_variant_locked(
|
|||
if (variants->variant_space == 0)
|
||||
variants->variant_space = 1;
|
||||
|
||||
unsigned msize = sizeof(struct panfrost_shader_state);
|
||||
unsigned msize = sizeof(struct panfrost_compiled_shader);
|
||||
variants->variants = realloc(variants->variants,
|
||||
variants->variant_space * msize);
|
||||
|
||||
|
|
@ -237,7 +237,7 @@ panfrost_new_variant_locked(
|
|||
|
||||
variants->variants[variant].key = *key;
|
||||
|
||||
struct panfrost_shader_state *shader_state = &variants->variants[variant];
|
||||
struct panfrost_compiled_shader *shader_state = &variants->variants[variant];
|
||||
|
||||
/* We finally have a variant, so compile it */
|
||||
panfrost_shader_compile(ctx->base.screen,
|
||||
|
|
@ -289,7 +289,7 @@ panfrost_update_shader_variant(struct panfrost_context *ctx,
|
|||
|
||||
/* Match the appropriate variant */
|
||||
signed variant = -1;
|
||||
struct panfrost_shader_variants *variants = ctx->shader[type];
|
||||
struct panfrost_uncompiled_shader *variants = ctx->shader[type];
|
||||
|
||||
simple_mtx_lock(&variants->lock);
|
||||
|
||||
|
|
@ -338,7 +338,7 @@ panfrost_create_shader_state(
|
|||
struct pipe_context *pctx,
|
||||
const struct pipe_shader_state *cso)
|
||||
{
|
||||
struct panfrost_shader_variants *so = CALLOC_STRUCT(panfrost_shader_variants);
|
||||
struct panfrost_uncompiled_shader *so = CALLOC_STRUCT(panfrost_uncompiled_shader);
|
||||
struct panfrost_device *dev = pan_device(pctx->screen);
|
||||
|
||||
simple_mtx_init(&so->lock, mtx_plain);
|
||||
|
|
@ -361,7 +361,7 @@ panfrost_create_shader_state(
|
|||
if (unlikely(dev->debug & PAN_DBG_PRECOMPILE)) {
|
||||
struct panfrost_context *ctx = pan_context(pctx);
|
||||
|
||||
struct panfrost_shader_state state = { 0 };
|
||||
struct panfrost_compiled_shader state = { 0 };
|
||||
|
||||
panfrost_shader_compile(pctx->screen,
|
||||
&ctx->shaders, &ctx->descs,
|
||||
|
|
@ -376,12 +376,12 @@ panfrost_delete_shader_state(
|
|||
struct pipe_context *pctx,
|
||||
void *so)
|
||||
{
|
||||
struct panfrost_shader_variants *cso = (struct panfrost_shader_variants *) so;
|
||||
struct panfrost_uncompiled_shader *cso = (struct panfrost_uncompiled_shader *) so;
|
||||
|
||||
ralloc_free(cso->nir);
|
||||
|
||||
for (unsigned i = 0; i < cso->variant_count; ++i) {
|
||||
struct panfrost_shader_state *shader_state = &cso->variants[i];
|
||||
struct panfrost_compiled_shader *shader_state = &cso->variants[i];
|
||||
panfrost_bo_unreference(shader_state->bin.bo);
|
||||
panfrost_bo_unreference(shader_state->state.bo);
|
||||
panfrost_bo_unreference(shader_state->linkage.bo);
|
||||
|
|
@ -411,9 +411,9 @@ panfrost_create_compute_state(
|
|||
const struct pipe_compute_state *cso)
|
||||
{
|
||||
struct panfrost_context *ctx = pan_context(pctx);
|
||||
struct panfrost_shader_variants *so = CALLOC_STRUCT(panfrost_shader_variants);
|
||||
struct panfrost_uncompiled_shader *so = CALLOC_STRUCT(panfrost_uncompiled_shader);
|
||||
|
||||
struct panfrost_shader_state *v = calloc(1, sizeof(*v));
|
||||
struct panfrost_compiled_shader *v = calloc(1, sizeof(*v));
|
||||
so->variants = v;
|
||||
|
||||
so->variant_count = 1;
|
||||
|
|
@ -438,8 +438,8 @@ panfrost_bind_compute_state(struct pipe_context *pipe, void *cso)
|
|||
static void
|
||||
panfrost_delete_compute_state(struct pipe_context *pipe, void *cso)
|
||||
{
|
||||
struct panfrost_shader_variants *so =
|
||||
(struct panfrost_shader_variants *)cso;
|
||||
struct panfrost_uncompiled_shader *so =
|
||||
(struct panfrost_uncompiled_shader *)cso;
|
||||
|
||||
free(so->variants);
|
||||
free(cso);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue