Lines Matching defs:shader

29  * that is, for every API shader, there is exactly one shader binary in
35 * - each shader has multiple variants for each combination of emulated states,
36 * and the variants are compiled on demand, possibly relying on a shader
42 * split the shader into 3 parts:
43 * - prolog part (shader code dependent on states)
44 * - main part (the API shader)
45 * - epilog part (shader code dependent on states)
47 * Each part is compiled as a separate shader and the final binaries are
48 * concatenated. This type of shader is called non-monolithic, because it
49 * consists of multiple independent binaries. Creating a new shader variant
50 * is therefore only a concatenation of shader parts (binaries) and doesn't
51 * involve any compilation. The main shader parts are the only parts that are
52 * compiled when applications create shader objects. The prolog and epilog
60 * have many other important responsibilities in various shader stages.
66 * shader, but the final code can be better, because LLVM can optimize across
67 * all shader parts. Monolithic shaders aren't usually used except for these
70 * 1) Some rarely-used states require modification of the main shader part
71 * itself, and in such cases, only the monolithic shader variant is
74 * 2) When we do cross-stage optimizations for separate shader objects and
75 * e.g. eliminate unused shader varyings, the resulting optimized shader
79 * the non-monolithic unoptimized shader variant is always available for use
80 * when the asynchronous compilation of the optimized shader is not done
83 * Starting with GFX9 chips, some shader stages are merged, and the number of
84 * shader parts per shader increased. The complete new list of shader parts is:
85 * - 1st shader: prolog part
86 * - 1st shader: main part
87 * - 2nd shader: prolog part
88 * - 2nd shader: main part
89 * - 2nd shader: epilog part
92 /* How linking shader inputs and outputs between vertex, tessellation, and
111 * For example, a shader only writing GENERIC0 has the output stride of 5.
126 * where per-vertex and per-patch data start, is passed to the shader via
178 /* API VS, TES without GS, GS copy shader */
255 * accessible in the shader via vs_state_bits in VS, TES, and GS.
263 * in the shader via vs_state_bits in LS/HS.
272 * in the shader via vs_state_bits in legacy GS, the GS copy shader, and any NGG shader.
298 /* This is called during shader compilation and returns LLVMValueRef. */
304 /* These represent the number of SGPRs the shader uses. */
326 * For VS shader keys, describe any fixups required for vertex fetch.
347 /* State of the context creating the shader object. */
427 bool reads_samplemask; /**< does fragment shader read sample mask? */
429 bool writes_z; /**< does fragment shader write Z value? */
430 bool writes_stencil; /**< does fragment shader write stencil value? */
431 bool writes_samplemask; /**< does fragment shader write sample mask? */
432 bool writes_edgeflag; /**< vertex shader outputs edgeflag */
474 * fragment shader invocations if flat shading.
486 /* A shader selector is a gallium CSO and contains shader variants and
502 /* The compiled NIR shader without a prolog and/or epilog (not
536 /* Valid shader configurations:
558 * shader key memory footprint.
562 /* Common VS bits between the shader key and the prolog key. */
575 /* Common TCS bits between the shader key and the epilog key. */
582 /* Common PS bits between the shader key and the prolog key. */
596 /* Common PS bits between the shader key and the epilog key. */
656 /* The shader key for geometry stages (VS, TCS, TES, GS) */
667 } tcs; /* tessellation control shader */
677 unsigned as_es : 1; /* whether it's a shader before GS */
771 /* GCN-specific shader info. */
967 void si_update_shader_binary_info(struct si_shader *shader, nir_shader *nir);
969 struct si_shader *shader, struct util_debug_callback *debug);
971 struct si_shader *shader, struct util_debug_callback *debug);
972 void si_shader_destroy(struct si_shader *shader);
975 bool si_shader_binary_upload(struct si_screen *sscreen, struct si_shader *shader,
977 void si_shader_dump(struct si_screen *sscreen, struct si_shader *shader,
979 void si_shader_dump_stats_for_shader_db(struct si_screen *screen, struct si_shader *shader,
982 const char *si_get_shader_name(const struct si_shader *shader);
1004 unsigned si_determine_wave_size(struct si_screen *sscreen, struct si_shader *shader);
1007 bool gfx10_is_ngg_passthrough(struct si_shader *shader);
1011 /* Return the pointer to the main shader part's pointer. */
1038 static inline bool gfx10_edgeflags_have_effect(struct si_shader *shader)
1040 if (shader->selector->stage == MESA_SHADER_VERTEX &&
1041 !shader->selector->info.base.vs.blit_sgprs_amd &&
1042 !(shader->key.ge.opt.ngg_culling & SI_NGG_CULL_LINES))
1048 static inline bool gfx10_ngg_writes_user_edgeflags(struct si_shader *shader)
1050 return gfx10_edgeflags_have_effect(shader) &&
1051 shader->selector->info.writes_edgeflag;
1054 static inline bool si_shader_uses_streamout(struct si_shader *shader)
1056 return shader->selector->stage <= MESA_SHADER_GEOMETRY &&
1057 shader->selector->info.enabled_streamout_buffer_mask &&
1058 !shader->key.ge.opt.remove_streamout;
1061 static inline bool si_shader_uses_discard(struct si_shader *shader)
1064 return shader->selector->info.base.fs.uses_discard ||
1065 shader->key.ps.part.prolog.poly_stipple ||
1066 shader->key.ps.mono.point_smoothing ||
1067 shader->key.ps.part.epilog.alpha_func != PIPE_FUNC_ALWAYS;