lima: move pp_max_stack_size to lima_submit
[mesa.git] / src / gallium / drivers / lima / lima_program.c
index 3fd7b0711a6d950486c374c0bbb8de91c4d3ab9c..5a743130c51246fa0c963e4bdacc9d9551b67985 100644 (file)
@@ -34,6 +34,7 @@
 
 #include "lima_screen.h"
 #include "lima_context.h"
+#include "lima_submit.h"
 #include "lima_program.h"
 #include "lima_bo.h"
 #include "ir/lima_ir.h"
@@ -68,6 +69,7 @@ static const nir_shader_compiler_options fs_nir_options = {
    .lower_fsign = true,
    .lower_rotate = true,
    .lower_fdot = true,
+   .lower_fdph = true,
    .lower_bitops = true,
    .lower_vector_cmp = true,
 };
@@ -286,6 +288,8 @@ lima_create_fs_state(struct pipe_context *pctx,
       return NULL;
    }
 
+   so->uses_discard = nir->info.fs.uses_discard;
+
    return so;
 }
 
@@ -346,7 +350,8 @@ lima_update_fs_state(struct lima_context *ctx)
       fs->shader = NULL;
    }
 
-   ctx->pp_max_stack_size = MAX2(ctx->pp_max_stack_size, ctx->fs->stack_size);
+   struct lima_submit *submit = lima_submit_get(ctx);
+   submit->pp_max_stack_size = MAX2(submit->pp_max_stack_size, ctx->fs->stack_size);
 
    return true;
 }
@@ -380,6 +385,8 @@ lima_create_vs_state(struct pipe_context *pctx,
       return NULL;
    }
 
+   ralloc_free(nir);
+
    return so;
 }