From: Rob Clark Date: Fri, 5 Jun 2020 19:07:02 +0000 (-0700) Subject: freedreno/ir3: shuffle some variant fields X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fdbe1ffaf74c4b1e913947cff5f3f40ab7b5feca;p=mesa.git freedreno/ir3: shuffle some variant fields Just to group together the parts that will get serialized when we have shader disk-cache. Signed-off-by: Rob Clark Part-of: --- diff --git a/src/freedreno/ir3/ir3_shader.h b/src/freedreno/ir3/ir3_shader.h index 8e154428c53..cbbdce767ee 100644 --- a/src/freedreno/ir3/ir3_shader.h +++ b/src/freedreno/ir3/ir3_shader.h @@ -451,6 +451,10 @@ struct ir3_ibo_mapping { /* Represents half register in regid */ #define HALF_REG_ID 0x100 +/** + * Shader variant which contains the actual hw shader instructions, + * and necessary info for shader state setup. + */ struct ir3_shader_variant { struct fd_bo *bo; @@ -468,12 +472,22 @@ struct ir3_shader_variant { struct ir3_shader_variant *nonbinning; // }; - struct ir3_info info; - struct ir3 *ir; + struct ir3 *ir; /* freed after assembling machine instructions */ + + /* shader variants form a linked list: */ + struct ir3_shader_variant *next; + + /* replicated here to avoid passing extra ptrs everywhere: */ + gl_shader_stage type; + struct ir3_shader *shader; /* The actual binary shader instructions, size given by info.sizedwords: */ uint32_t *bin; + struct ir3_const_state *const_state; + + struct ir3_info info; + /* Levels of nesting of flow control: */ unsigned branchstack; @@ -492,8 +506,6 @@ struct ir3_shader_variant { */ unsigned constlen; - struct ir3_const_state *const_state; - /* About Linkage: * + Let the frag shader determine the position/compmask for the * varyings, since it is the place where we know if the varying @@ -610,13 +622,6 @@ struct ir3_shader_variant { unsigned orig_idx[16]; } astc_srgb; - /* shader variants form a linked list: */ - struct ir3_shader_variant *next; - - /* replicated here to avoid passing extra ptrs everywhere: */ - gl_shader_stage type; - struct ir3_shader *shader; - /* texture sampler pre-dispatches */ uint32_t num_sampler_prefetch; struct ir3_sampler_prefetch sampler_prefetch[IR3_MAX_SAMPLER_PREFETCH]; @@ -639,6 +644,10 @@ ir3_shader_stage(struct ir3_shader_variant *v) } +/** + * Represents a shader at the API level, before state-specific variants are + * generated. + */ struct ir3_shader { gl_shader_stage type;