anv/pipeline: Handle output lowering in anv_pipeline instead of spirv_to_nir
[mesa.git] / src / vulkan / gen7_state.c
index a7940ca9e2f58d1c40b6a208d36d53bd73f5ebf0..88598cea18e5943ccafc9e9176ab717fb558520b 100644 (file)
@@ -65,36 +65,6 @@ genX(fill_buffer_surface_state)(void *state, enum isl_format format,
    GENX(RENDER_SURFACE_STATE_pack)(NULL, state, &surface_state);
 }
 
-static const uint32_t vk_to_gen_tex_filter[] = {
-   [VK_FILTER_NEAREST]                          = MAPFILTER_NEAREST,
-   [VK_FILTER_LINEAR]                           = MAPFILTER_LINEAR
-};
-
-static const uint32_t vk_to_gen_mipmap_mode[] = {
-   [VK_SAMPLER_MIPMAP_MODE_BASE]                = MIPFILTER_NONE,
-   [VK_SAMPLER_MIPMAP_MODE_NEAREST]             = MIPFILTER_NEAREST,
-   [VK_SAMPLER_MIPMAP_MODE_LINEAR]              = MIPFILTER_LINEAR
-};
-
-static const uint32_t vk_to_gen_tex_address[] = {
-   [VK_SAMPLER_ADDRESS_MODE_REPEAT]             = TCM_WRAP,
-   [VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT]    = TCM_MIRROR,
-   [VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE]      = TCM_CLAMP,
-   [VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE] = TCM_MIRROR_ONCE,
-   [VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER]    = TCM_CLAMP_BORDER,
-};
-
-static const uint32_t vk_to_gen_compare_op[] = {
-   [VK_COMPARE_OP_NEVER]                        = PREFILTEROPNEVER,
-   [VK_COMPARE_OP_LESS]                         = PREFILTEROPLESS,
-   [VK_COMPARE_OP_EQUAL]                        = PREFILTEROPEQUAL,
-   [VK_COMPARE_OP_LESS_OR_EQUAL]                = PREFILTEROPLEQUAL,
-   [VK_COMPARE_OP_GREATER]                      = PREFILTEROPGREATER,
-   [VK_COMPARE_OP_NOT_EQUAL]                    = PREFILTEROPNOTEQUAL,
-   [VK_COMPARE_OP_GREATER_OR_EQUAL]             = PREFILTEROPGEQUAL,
-   [VK_COMPARE_OP_ALWAYS]                       = PREFILTEROPALWAYS,
-};
-
 static struct anv_state
 alloc_surface_state(struct anv_device *device,
                     struct anv_cmd_buffer *cmd_buffer)
@@ -281,6 +251,8 @@ genX(image_view_init)(struct anv_image_view *iview,
 
       if (!device->info.has_llc)
          anv_state_clflush(iview->nonrt_surface_state);
+   } else {
+      iview->nonrt_surface_state.alloc_size = 0;
    }
 
    if (image->needs_color_rt_surface_state) {
@@ -301,6 +273,8 @@ genX(image_view_init)(struct anv_image_view *iview,
                                       &surface_state);
       if (!device->info.has_llc)
          anv_state_clflush(iview->color_rt_surface_state);
+   } else {
+      iview->color_rt_surface_state.alloc_size = 0;
    }
 
    if (image->needs_storage_surface_state) {
@@ -317,5 +291,7 @@ genX(image_view_init)(struct anv_image_view *iview,
 
       GENX(RENDER_SURFACE_STATE_pack)(NULL, iview->storage_surface_state.map,
                                       &surface_state);
+   } else {
+      iview->storage_surface_state.alloc_size = 0;
    }
 }