summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2018-04-05 16:20:23 +1000
committerTimothy Arceri <[email protected]>2018-04-10 15:10:16 +1000
commitbc71e20993a456ab17e1775bf905fa000aae4c71 (patch)
tree484c2f7f4e6c708f58bea406651adf8c363c2857 /src
parent494a5c350126268c45f3055687e22593a3fd74f4 (diff)
st/mesa: exit st_translate_fragment_program() earlier for NIR path
This avoids a bunch of scanning that is only used by the TGSI path. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_program.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 5bf76e1b888..a740c874c9e 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -645,6 +645,12 @@ bool
st_translate_fragment_program(struct st_context *st,
struct st_fragment_program *stfp)
{
+ /* We have already compiled to NIR so just return */
+ if (stfp->shader_program) {
+ st_store_ir_in_disk_cache(st, &stfp->Base, true);
+ return true;
+ }
+
ubyte outputMapping[2 * FRAG_RESULT_MAX];
ubyte inputMapping[VARYING_SLOT_MAX];
ubyte inputSlotToAttr[VARYING_SLOT_MAX];
@@ -900,12 +906,6 @@ st_translate_fragment_program(struct st_context *st,
}
}
- /* We have already compiled to NIR so just return */
- if (stfp->shader_program) {
- st_store_ir_in_disk_cache(st, &stfp->Base, true);
- return true;
- }
-
ureg = ureg_create_with_screen(PIPE_SHADER_FRAGMENT, st->pipe->screen);
if (ureg == NULL)
return false;