panfrost: Let precompile imply shaderdb
[mesa.git] / src / gallium / drivers / panfrost / pan_assemble.c
index cc4822a2361536a66161e78dde525c715488767e..87127ba945b29cc0c319e1684cff044aa380cd1f 100644 (file)
@@ -25,7 +25,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include "pan_bo.h"
 #include "pan_context.h"
+#include "pan_util.h"
 
 #include "compiler/nir/nir.h"
 #include "nir/tgsi_to_nir.h"
@@ -58,21 +60,14 @@ panfrost_shader_compile(
 
         s->info.stage = stage;
 
-        if (stage == MESA_SHADER_FRAGMENT) {
-                /* Inject the alpha test now if we need to */
-
-                if (state->alpha_state.enabled) {
-                        NIR_PASS_V(s, nir_lower_alpha_test, state->alpha_state.func, false);
-                }
-        }
-
         /* Call out to Midgard compiler given the above NIR */
 
         midgard_program program = {
                 .alpha_ref = state->alpha_state.ref_value
         };
 
-        midgard_compile_shader_nir(&ctx->compiler, s, &program, false);
+        midgard_compile_shader_nir(s, &program, false, 0, screen->gpu_id,
+                        pan_debug & PAN_DBG_PRECOMPILE);
 
         /* Prepare the compiled binary for upload */
         int size = program.compiled.size;
@@ -118,6 +113,7 @@ panfrost_shader_compile(
         state->writes_point_size = program.writes_point_size;
         state->reads_point_coord = false;
         state->helper_invocations = s->info.fs.needs_helper_invocations;
+        state->stack_size = program.tls_size;
 
         if (outputs_written)
                 *outputs_written = s->info.outputs_written;