mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +02:00
crocus: Fix shader precompilation on Gen6 and higher
By default crocus precompiles shaders, to avoid stuttering at screens,
caused by compiling shaders at the drawing phase.
Unfortunately at intel Gen 6 and higher the precompiled version of the
fragment shaders is not used and every fragment shader is compiled twice.
These double fragment shaders also are added to the memory cache
and disk cache.
This is caused by setting wrong values to variables at the key during
precompiling at routine crocus_create_fs_state() at src/gallium/drivers/crocus/crocus_program.c,
which differ from values at crocus_populate_fs_key() at src/gallium/drivers/crocus/crocus_state.c.
This commit solves 3 problems:
it adjusts the predicted value 'input_slots_valid' at Gen 6
it adjusts the predicted value 'ignore_sample_mask_out' at Gen 6 and higher
it predicts the value 'multisample_fbo' , which helps if samplemask is used
Cc: mesa-stable
Signed-off-by: GKraats <vd.kraats@hccnet.nl>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 686266d2f1)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41269>
This commit is contained in:
parent
8a4dc04589
commit
286c245e98
2 changed files with 4 additions and 3 deletions
|
|
@ -2554,7 +2554,7 @@
|
|||
"description": "crocus: Fix shader precompilation on Gen6 and higher",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -2869,14 +2869,15 @@ crocus_create_fs_state(struct pipe_context *ctx,
|
|||
BITFIELD64_BIT(FRAG_RESULT_SAMPLE_MASK));
|
||||
|
||||
bool can_rearrange_varyings =
|
||||
screen->devinfo.ver > 6 && util_bitcount64(info->inputs_read & ELK_FS_VARYING_INPUT_MASK) <= 16;
|
||||
screen->devinfo.ver > 5 && util_bitcount64(info->inputs_read & ELK_FS_VARYING_INPUT_MASK) <= 16;
|
||||
|
||||
const struct intel_device_info *devinfo = &screen->devinfo;
|
||||
struct elk_wm_prog_key key = {
|
||||
KEY_INIT(),
|
||||
.nr_color_regions = util_bitcount(color_outputs),
|
||||
.coherent_fb_fetch = false,
|
||||
.ignore_sample_mask_out = screen->devinfo.ver < 6 ? 1 : 0,
|
||||
.multisample_fbo = (info->outputs_written & BITFIELD64_BIT(FRAG_RESULT_SAMPLE_MASK)) ? ELK_ALWAYS : ELK_NEVER,
|
||||
.ignore_sample_mask_out = !key.multisample_fbo,
|
||||
.input_slots_valid =
|
||||
can_rearrange_varyings ? 0 : info->inputs_read | VARYING_BIT_POS,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue