anv: Rename cpp variable to "bs"
[mesa.git] / src / vulkan / anv_private.h
index 8e921afb5fbbf605db57cfcc364db2ef9c637c59..03d033ff0c5d8cb405c88d5b89e316efd4cebf80 100644 (file)
@@ -430,6 +430,9 @@ struct anv_physical_device {
     struct brw_compiler *                       compiler;
 };
 
+bool anv_is_scalar_shader_stage(const struct brw_compiler *compiler,
+                                VkShaderStage stage);
+
 struct anv_instance {
     VK_LOADER_DATA                              _loader_data;
 
@@ -448,7 +451,10 @@ void anv_finish_wsi(struct anv_instance *instance);
 
 struct anv_meta_state {
    struct {
-      VkPipeline                                pipeline;
+      struct anv_pipeline *color_pipeline;
+      struct anv_pipeline *depth_only_pipeline;
+      struct anv_pipeline *stencil_only_pipeline;
+      struct anv_pipeline *depthstencil_pipeline;
    } clear;
 
    struct {
@@ -672,10 +678,23 @@ struct anv_device_memory {
    void *                                       map;
 };
 
+/**
+ * Header for Vertex URB Entry (VUE)
+ */
+struct anv_vue_header {
+   uint32_t Reserved;
+   uint32_t RTAIndex; /* RenderTargetArrayIndex */
+   uint32_t ViewportIndex;
+   float PointWidth;
+};
+
 struct anv_descriptor_set_binding_layout {
    /* Number of array elements in this binding */
    uint16_t array_size;
 
+   /* Index into the flattend descriptor set */
+   uint16_t descriptor_index;
+
    /* Index into the dynamic state array for a dynamic buffer */
    int16_t dynamic_offset_index;
 
@@ -708,22 +727,12 @@ struct anv_descriptor_set_layout {
    struct anv_descriptor_set_binding_layout binding[0];
 };
 
-enum anv_descriptor_type {
-   ANV_DESCRIPTOR_TYPE_EMPTY = 0,
-   ANV_DESCRIPTOR_TYPE_BUFFER_VIEW,
-   ANV_DESCRIPTOR_TYPE_BUFFER_AND_OFFSET,
-   ANV_DESCRIPTOR_TYPE_IMAGE_VIEW,
-   ANV_DESCRIPTOR_TYPE_SAMPLER,
-   ANV_DESCRIPTOR_TYPE_IMAGE_VIEW_AND_SAMPLER,
-};
-
 struct anv_descriptor {
-   enum anv_descriptor_type type;
+   VkDescriptorType type;
 
    union {
       struct {
          union {
-            struct anv_buffer_view *buffer_view;
             struct anv_image_view *image_view;
          };
          struct anv_sampler *sampler;
@@ -738,6 +747,7 @@ struct anv_descriptor {
 };
 
 struct anv_descriptor_set {
+   const struct anv_descriptor_set_layout *layout;
    struct anv_descriptor descriptors[0];
 };
 
@@ -837,8 +847,11 @@ struct anv_push_constants {
    uint32_t base_vertex;
    uint32_t base_instance;
 
-   /* Offsets for dynamically bound buffers */
-   uint32_t dynamic_offsets[MAX_DYNAMIC_BUFFERS];
+   /* Offsets and ranges for dynamically bound buffers */
+   struct {
+      uint32_t offset;
+      uint32_t range;
+   } dynamic[MAX_DYNAMIC_BUFFERS];
 
    /* Image data for image_load_store on pre-SKL */
    struct brw_image_param images[MAX_IMAGES];
@@ -1194,7 +1207,7 @@ struct anv_format {
    const VkFormat vk_format;
    const char *name;
    uint16_t surface_format; /**< RENDER_SURFACE_STATE.SurfaceFormat */
-   uint8_t cpp; /**< Bytes-per-pixel of anv_format::surface_format. */
+   uint8_t bs; /**< Block size (in bytes) of anv_format::surface_format. */
    uint8_t num_channels;
    uint16_t depth_format; /**< 3DSTATE_DEPTH_BUFFER.SurfaceFormat */
    bool has_stencil;
@@ -1300,14 +1313,6 @@ struct anv_image {
    };
 };
 
-struct anv_buffer_view {
-   struct anv_state surface_state; /**< RENDER_SURFACE_STATE */
-   struct anv_bo *bo;
-   uint32_t offset; /**< Offset into bo. */
-   uint32_t range; /**< VkBufferViewCreateInfo::range */
-   const struct anv_format *format; /**< VkBufferViewCreateInfo::format */
-};
-
 struct anv_image_view {
    const struct anv_image *image; /**< VkImageViewCreateInfo::image */
    const struct anv_format *format; /**< VkImageViewCreateInfo::format */
@@ -1354,18 +1359,17 @@ gen8_image_view_init(struct anv_image_view *iview,
                      const VkImageViewCreateInfo* pCreateInfo,
                      struct anv_cmd_buffer *cmd_buffer);
 
-VkResult anv_buffer_view_create(struct anv_device *device,
-                                const VkBufferViewCreateInfo *pCreateInfo,
-                                struct anv_buffer_view **bview_out);
-
 void anv_fill_buffer_surface_state(struct anv_device *device, void *state,
                                    const struct anv_format *format,
-                                   uint32_t offset, uint32_t range);
+                                   uint32_t offset, uint32_t range,
+                                   uint32_t stride);
 
 void gen7_fill_buffer_surface_state(void *state, const struct anv_format *format,
-                                    uint32_t offset, uint32_t range);
+                                    uint32_t offset, uint32_t range,
+                                    uint32_t stride);
 void gen8_fill_buffer_surface_state(void *state, const struct anv_format *format,
-                                    uint32_t offset, uint32_t range);
+                                    uint32_t offset, uint32_t range,
+                                    uint32_t stride);
 
 struct anv_sampler {
    uint32_t state[4];
@@ -1399,11 +1403,6 @@ struct anv_render_pass_attachment {
 struct anv_render_pass {
    uint32_t                                     attachment_count;
    uint32_t                                     subpass_count;
-
-   uint32_t                                     num_color_clear_attachments;
-   bool                                         has_depth_clear_attachment;
-   bool                                         has_stencil_clear_attachment;
-
    struct anv_render_pass_attachment *          attachments;
    struct anv_subpass                           subpasses[0];
 };
@@ -1470,7 +1469,6 @@ ANV_DEFINE_HANDLE_CASTS(anv_queue, VkQueue)
 
 ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_cmd_pool, VkCmdPool)
 ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_buffer, VkBuffer)
-ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_buffer_view, VkBufferView);
 ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_descriptor_set, VkDescriptorSet)
 ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_descriptor_set_layout, VkDescriptorSetLayout)
 ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_device_memory, VkDeviceMemory)