lima: rename *_shader_state to *_compiled_shader
Tested-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> Reviewed-by: Erico Nunes <nunes.erico@gmail.com> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9672>
This commit is contained in:

committed by
Marge Bot

parent
5c7dd85e4f
commit
1261c06c68
@@ -384,7 +384,7 @@ typedef struct {
|
||||
gpir_node *cond;
|
||||
} gpir_branch_node;
|
||||
|
||||
struct lima_vs_shader_state;
|
||||
struct lima_vs_compiled_shader;
|
||||
|
||||
#define GPIR_VECTOR_SSA_VIEWPORT_SCALE 0
|
||||
#define GPIR_VECTOR_SSA_VIEWPORT_OFFSET 1
|
||||
@@ -419,7 +419,7 @@ typedef struct gpir_compiler {
|
||||
gpir_node *nodes[4];
|
||||
} vector_ssa[GPIR_VECTOR_SSA_NUM];
|
||||
|
||||
struct lima_vs_shader_state *prog;
|
||||
struct lima_vs_compiled_shader *prog;
|
||||
int constant_base;
|
||||
|
||||
/* shaderdb */
|
||||
|
@@ -447,7 +447,7 @@ static void gpir_print_shader_db(struct nir_shader *nir, gpir_compiler *comp,
|
||||
free(shaderdb);
|
||||
}
|
||||
|
||||
bool gpir_compile_nir(struct lima_vs_shader_state *prog, struct nir_shader *nir,
|
||||
bool gpir_compile_nir(struct lima_vs_compiled_shader *prog, struct nir_shader *nir,
|
||||
struct pipe_debug_callback *debug)
|
||||
{
|
||||
nir_function_impl *func = nir_shader_get_entrypoint(nir);
|
||||
|
@@ -49,16 +49,16 @@
|
||||
|
||||
|
||||
struct ra_regs;
|
||||
struct lima_vs_shader_state;
|
||||
struct lima_fs_shader_state;
|
||||
struct lima_vs_compiled_shader;
|
||||
struct lima_fs_compiled_shader;
|
||||
|
||||
/* gpir interface */
|
||||
bool gpir_compile_nir(struct lima_vs_shader_state *prog, struct nir_shader *nir,
|
||||
bool gpir_compile_nir(struct lima_vs_compiled_shader *prog, struct nir_shader *nir,
|
||||
struct pipe_debug_callback *debug);
|
||||
|
||||
|
||||
/* ppir interface */
|
||||
bool ppir_compile_nir(struct lima_fs_shader_state *prog, struct nir_shader *nir,
|
||||
bool ppir_compile_nir(struct lima_fs_compiled_shader *prog, struct nir_shader *nir,
|
||||
struct ra_regs *ra,
|
||||
struct pipe_debug_callback *debug);
|
||||
struct ra_regs *ppir_regalloc_init(void *mem_ctx);
|
||||
|
@@ -874,7 +874,7 @@ static void ppir_add_write_after_read_deps(ppir_compiler *comp)
|
||||
}
|
||||
}
|
||||
|
||||
bool ppir_compile_nir(struct lima_fs_shader_state *prog, struct nir_shader *nir,
|
||||
bool ppir_compile_nir(struct lima_fs_compiled_shader *prog, struct nir_shader *nir,
|
||||
struct ra_regs *ra,
|
||||
struct pipe_debug_callback *debug)
|
||||
{
|
||||
|
@@ -369,7 +369,7 @@ typedef struct {
|
||||
} ppir_branch_node;
|
||||
|
||||
struct ra_regs;
|
||||
struct lima_fs_shader_state;
|
||||
struct lima_fs_compiled_shader;
|
||||
|
||||
typedef struct ppir_compiler {
|
||||
struct list_head block_list;
|
||||
@@ -385,7 +385,7 @@ typedef struct ppir_compiler {
|
||||
unsigned reg_base;
|
||||
|
||||
struct ra_regs *ra;
|
||||
struct lima_fs_shader_state *prog;
|
||||
struct lima_fs_compiled_shader *prog;
|
||||
bool uses_discard;
|
||||
|
||||
/* for scheduler */
|
||||
|
@@ -43,7 +43,7 @@ struct lima_depth_stencil_alpha_state {
|
||||
struct pipe_depth_stencil_alpha_state base;
|
||||
};
|
||||
|
||||
struct lima_fs_shader_state {
|
||||
struct lima_fs_compiled_shader {
|
||||
void *shader;
|
||||
int shader_size;
|
||||
int stack_size;
|
||||
@@ -70,7 +70,7 @@ struct lima_varying_info {
|
||||
int offset;
|
||||
};
|
||||
|
||||
struct lima_vs_shader_state {
|
||||
struct lima_vs_compiled_shader {
|
||||
void *shader;
|
||||
int shader_size;
|
||||
int prefetch;
|
||||
@@ -208,8 +208,8 @@ struct lima_context {
|
||||
struct lima_context_viewport_state viewport;
|
||||
struct pipe_scissor_state scissor;
|
||||
struct pipe_scissor_state clipped_scissor;
|
||||
struct lima_vs_shader_state *vs;
|
||||
struct lima_fs_shader_state *fs;
|
||||
struct lima_vs_compiled_shader *vs;
|
||||
struct lima_fs_compiled_shader *fs;
|
||||
struct lima_vs_bind_state *bind_vs;
|
||||
struct lima_fs_bind_state *bind_fs;
|
||||
struct lima_vertex_element_state *vertex_elements;
|
||||
|
@@ -270,7 +270,7 @@ lima_pack_vs_cmd(struct lima_context *ctx, const struct pipe_draw_info *info,
|
||||
{
|
||||
struct lima_context_constant_buffer *ccb =
|
||||
ctx->const_buffer + PIPE_SHADER_VERTEX;
|
||||
struct lima_vs_shader_state *vs = ctx->vs;
|
||||
struct lima_vs_compiled_shader *vs = ctx->vs;
|
||||
struct lima_job *job = lima_job_get(ctx);
|
||||
|
||||
VS_CMD_BEGIN(&job->vs_cmd_array, 24);
|
||||
@@ -317,7 +317,7 @@ static void
|
||||
lima_pack_plbu_cmd(struct lima_context *ctx, const struct pipe_draw_info *info,
|
||||
const struct pipe_draw_start_count *draw)
|
||||
{
|
||||
struct lima_vs_shader_state *vs = ctx->vs;
|
||||
struct lima_vs_compiled_shader *vs = ctx->vs;
|
||||
struct pipe_scissor_state *cscissor = &ctx->clipped_scissor;
|
||||
struct lima_job *job = lima_job_get(ctx);
|
||||
PLBU_CMD_BEGIN(&job->plbu_cmd_array, 32);
|
||||
@@ -602,7 +602,7 @@ lima_calculate_depth_test(struct pipe_depth_stencil_alpha_state *depth,
|
||||
static void
|
||||
lima_pack_render_state(struct lima_context *ctx, const struct pipe_draw_info *info)
|
||||
{
|
||||
struct lima_fs_shader_state *fs = ctx->fs;
|
||||
struct lima_fs_compiled_shader *fs = ctx->fs;
|
||||
struct lima_render_state *render =
|
||||
lima_ctx_buff_alloc(ctx, lima_ctx_buff_pp_plb_rsw,
|
||||
sizeof(*render));
|
||||
@@ -842,7 +842,7 @@ lima_update_gp_uniform(struct lima_context *ctx)
|
||||
{
|
||||
struct lima_context_constant_buffer *ccb =
|
||||
ctx->const_buffer + PIPE_SHADER_VERTEX;
|
||||
struct lima_vs_shader_state *vs = ctx->vs;
|
||||
struct lima_vs_compiled_shader *vs = ctx->vs;
|
||||
int uniform_size = MIN2(vs->uniform_size, ccb->size);
|
||||
|
||||
int size = uniform_size + vs->constant_size + 32;
|
||||
@@ -922,7 +922,7 @@ lima_update_varying(struct lima_context *ctx, const struct pipe_draw_info *info,
|
||||
{
|
||||
struct lima_job *job = lima_job_get(ctx);
|
||||
struct lima_screen *screen = lima_screen(ctx->base.screen);
|
||||
struct lima_vs_shader_state *vs = ctx->vs;
|
||||
struct lima_vs_compiled_shader *vs = ctx->vs;
|
||||
uint32_t gp_output_size;
|
||||
unsigned num = info->index_size ? (ctx->max_index - ctx->min_index + 1) : draw->count;
|
||||
|
||||
|
@@ -273,7 +273,7 @@ lima_program_optimize_fs_nir(struct nir_shader *s,
|
||||
static bool
|
||||
lima_fs_compile_shader(struct lima_context *ctx,
|
||||
struct lima_fs_key *key,
|
||||
struct lima_fs_shader_state *fs)
|
||||
struct lima_fs_compiled_shader *fs)
|
||||
{
|
||||
struct lima_screen *screen = lima_screen(ctx->base.screen);
|
||||
nir_shader *nir = nir_shader_clone(fs, key->shader_state->base.ir.nir);
|
||||
@@ -314,7 +314,7 @@ lima_fs_compile_shader(struct lima_context *ctx,
|
||||
return true;
|
||||
}
|
||||
|
||||
static struct lima_fs_shader_state *
|
||||
static struct lima_fs_compiled_shader *
|
||||
lima_get_compiled_fs(struct lima_context *ctx,
|
||||
struct lima_fs_key *key)
|
||||
{
|
||||
@@ -329,7 +329,7 @@ lima_get_compiled_fs(struct lima_context *ctx,
|
||||
return entry->data;
|
||||
|
||||
/* not on cache, compile and insert into the cache */
|
||||
struct lima_fs_shader_state *fs = rzalloc(NULL, struct lima_fs_shader_state);
|
||||
struct lima_fs_compiled_shader *fs = rzalloc(NULL, struct lima_fs_compiled_shader);
|
||||
if (!fs)
|
||||
return NULL;
|
||||
|
||||
@@ -401,7 +401,7 @@ lima_delete_fs_state(struct pipe_context *pctx, void *hwcso)
|
||||
hash_table_foreach(ctx->fs_cache, entry) {
|
||||
const struct lima_fs_key *key = entry->key;
|
||||
if (key->shader_state == so) {
|
||||
struct lima_fs_shader_state *fs = entry->data;
|
||||
struct lima_fs_compiled_shader *fs = entry->data;
|
||||
_mesa_hash_table_remove(ctx->fs_cache, entry);
|
||||
if (fs->bo)
|
||||
lima_bo_unreference(fs->bo);
|
||||
@@ -420,7 +420,7 @@ lima_delete_fs_state(struct pipe_context *pctx, void *hwcso)
|
||||
static bool
|
||||
lima_vs_compile_shader(struct lima_context *ctx,
|
||||
struct lima_vs_key *key,
|
||||
struct lima_vs_shader_state *vs)
|
||||
struct lima_vs_compiled_shader *vs)
|
||||
{
|
||||
nir_shader *nir = nir_shader_clone(vs, key->shader_state->base.ir.nir);
|
||||
|
||||
@@ -450,7 +450,7 @@ lima_vs_compile_shader(struct lima_context *ctx,
|
||||
return true;
|
||||
}
|
||||
|
||||
static struct lima_vs_shader_state *
|
||||
static struct lima_vs_compiled_shader *
|
||||
lima_get_compiled_vs(struct lima_context *ctx,
|
||||
struct lima_vs_key *key)
|
||||
{
|
||||
@@ -465,7 +465,7 @@ lima_get_compiled_vs(struct lima_context *ctx,
|
||||
return entry->data;
|
||||
|
||||
/* not on cache, compile and insert into the cache */
|
||||
struct lima_vs_shader_state *vs = rzalloc(NULL, struct lima_vs_shader_state);
|
||||
struct lima_vs_compiled_shader *vs = rzalloc(NULL, struct lima_vs_compiled_shader);
|
||||
if (!vs)
|
||||
return NULL;
|
||||
|
||||
@@ -492,9 +492,9 @@ lima_update_vs_state(struct lima_context *ctx)
|
||||
memset(key, 0, sizeof(*key));
|
||||
key->shader_state = ctx->bind_vs;
|
||||
|
||||
struct lima_vs_shader_state *old_vs = ctx->vs;
|
||||
struct lima_vs_compiled_shader *old_vs = ctx->vs;
|
||||
|
||||
struct lima_vs_shader_state *vs = lima_get_compiled_vs(ctx, key);
|
||||
struct lima_vs_compiled_shader *vs = lima_get_compiled_vs(ctx, key);
|
||||
if (!vs)
|
||||
return false;
|
||||
|
||||
@@ -532,9 +532,9 @@ lima_update_fs_state(struct lima_context *ctx)
|
||||
for (int i = lima_tex->num_textures; i < ARRAY_SIZE(key->tex); i++)
|
||||
memcpy(key->tex[i].swizzle, identity, 4);
|
||||
|
||||
struct lima_fs_shader_state *old_fs = ctx->fs;
|
||||
struct lima_fs_compiled_shader *old_fs = ctx->fs;
|
||||
|
||||
struct lima_fs_shader_state *fs = lima_get_compiled_fs(ctx, key);
|
||||
struct lima_fs_compiled_shader *fs = lima_get_compiled_fs(ctx, key);
|
||||
if (!fs)
|
||||
return false;
|
||||
|
||||
@@ -599,7 +599,7 @@ lima_delete_vs_state(struct pipe_context *pctx, void *hwcso)
|
||||
hash_table_foreach(ctx->vs_cache, entry) {
|
||||
const struct lima_vs_key *key = entry->key;
|
||||
if (key->shader_state == so) {
|
||||
struct lima_vs_shader_state *vs = entry->data;
|
||||
struct lima_vs_compiled_shader *vs = entry->data;
|
||||
_mesa_hash_table_remove(ctx->vs_cache, entry);
|
||||
if (vs->bo)
|
||||
lima_bo_unreference(vs->bo);
|
||||
@@ -660,7 +660,7 @@ void
|
||||
lima_program_fini(struct lima_context *ctx)
|
||||
{
|
||||
hash_table_foreach(ctx->vs_cache, entry) {
|
||||
struct lima_vs_shader_state *vs = entry->data;
|
||||
struct lima_vs_compiled_shader *vs = entry->data;
|
||||
if (vs->bo)
|
||||
lima_bo_unreference(vs->bo);
|
||||
ralloc_free(vs);
|
||||
@@ -668,7 +668,7 @@ lima_program_fini(struct lima_context *ctx)
|
||||
}
|
||||
|
||||
hash_table_foreach(ctx->fs_cache, entry) {
|
||||
struct lima_fs_shader_state *fs = entry->data;
|
||||
struct lima_fs_compiled_shader *fs = entry->data;
|
||||
if (fs->bo)
|
||||
lima_bo_unreference(fs->bo);
|
||||
ralloc_free(fs);
|
||||
|
@@ -224,7 +224,7 @@ main(int argc, char **argv)
|
||||
|
||||
nir_print_shader(nir, stdout);
|
||||
|
||||
struct lima_vs_shader_state *vs = ralloc(nir, struct lima_vs_shader_state);
|
||||
struct lima_vs_compiled_shader *vs = ralloc(nir, struct lima_vs_compiled_shader);
|
||||
gpir_compile_nir(vs, nir, NULL);
|
||||
break;
|
||||
case MESA_SHADER_FRAGMENT:
|
||||
@@ -232,7 +232,7 @@ main(int argc, char **argv)
|
||||
|
||||
nir_print_shader(nir, stdout);
|
||||
|
||||
struct lima_fs_shader_state *so = rzalloc(NULL, struct lima_fs_shader_state);
|
||||
struct lima_fs_compiled_shader *so = rzalloc(NULL, struct lima_fs_compiled_shader);
|
||||
struct ra_regs *ra = ppir_regalloc_init(NULL);
|
||||
ppir_compile_nir(so, nir, ra, NULL);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user