panfrost: s/PAN_ALLOCATE_/PAN_BO_/
[mesa.git] / src / gallium / drivers / panfrost / pan_assemble.c
index dd877056d3b50216c5e7ef775ced7aa56c8791f1..cc4822a2361536a66161e78dde525c715488767e 100644 (file)
@@ -41,7 +41,8 @@ panfrost_shader_compile(
                 enum pipe_shader_ir ir_type,
                 const void *ir,
                 gl_shader_stage stage,
-                struct panfrost_shader_state *state)
+                struct panfrost_shader_state *state,
+                uint64_t *outputs_written)
 {
         struct panfrost_screen *screen = pan_screen(ctx->base.screen);
         uint8_t *dst;
@@ -81,7 +82,7 @@ panfrost_shader_compile(
          * I bet someone just thought that would be a cute pun. At least,
          * that's how I'd do it. */
 
-        state->bo = panfrost_drm_create_bo(screen, size, PAN_ALLOCATE_EXECUTE);
+        state->bo = panfrost_bo_create(screen, size, PAN_BO_EXECUTE);
         memcpy(state->bo->cpu, dst, size);
         meta->shader = state->bo->gpu | program.first_tag;
 
@@ -118,6 +119,9 @@ panfrost_shader_compile(
         state->reads_point_coord = false;
         state->helper_invocations = s->info.fs.needs_helper_invocations;
 
+        if (outputs_written)
+                *outputs_written = s->info.outputs_written;
+
         /* Separate as primary uniform count is truncated */
         state->uniform_count = program.uniform_count;
 
@@ -141,28 +145,25 @@ panfrost_shader_compile(
                 /* Check for special cases, otherwise assume general varying */
 
                 if (location == VARYING_SLOT_POS) {
-                        v.index = 1;
-                        v.format = MALI_VARYING_POS;
+                        if (stage == MESA_SHADER_FRAGMENT)
+                                state->reads_frag_coord = true;
+                        else
+                                v.format = MALI_VARYING_POS;
                 } else if (location == VARYING_SLOT_PSIZ) {
-                        v.index = 2;
                         v.format = MALI_R16F;
                         v.swizzle = default_vec1_swizzle;
 
                         state->writes_point_size = true;
                 } else if (location == VARYING_SLOT_PNTC) {
-                        v.index = 3;
                         v.format = MALI_RG16F;
                         v.swizzle = default_vec2_swizzle;
 
                         state->reads_point_coord = true;
                 } else if (location == VARYING_SLOT_FACE) {
-                        v.index = 4;
                         v.format = MALI_R32I;
                         v.swizzle = default_vec1_swizzle;
 
                         state->reads_face = true;
-                } else {
-                        v.index = 0;
                 }
 
                 state->varyings[i] = v;