/* Index into the sampler table for the associated sampler */
int16_t sampler_index;
+
+ /* Index into the image table for the associated image */
+ int16_t image_index;
} stage[MESA_SHADER_STAGES];
/* Immutable samplers (or NULL if no immutable samplers) */
struct anv_sampler *sampler;
};
+ struct anv_buffer_view *buffer_view;
+
struct {
struct anv_buffer *buffer;
uint64_t offset;
struct {
uint32_t surface_start;
uint32_t sampler_start;
+ uint32_t image_start;
} stage[MESA_SHADER_STAGES];
} set[MAX_SETS];
struct anv_pipeline_binding *surface_to_descriptor;
uint32_t sampler_count;
struct anv_pipeline_binding *sampler_to_descriptor;
+ uint32_t image_count;
} stage[MESA_SHADER_STAGES];
struct anv_pipeline_binding entries[0];
struct anv_state
anv_cmd_buffer_push_constants(struct anv_cmd_buffer *cmd_buffer,
gl_shader_stage stage);
+struct anv_state
+anv_cmd_buffer_cs_push_constants(struct anv_cmd_buffer *cmd_buffer);
void anv_cmd_buffer_clear_attachments(struct anv_cmd_buffer *cmd_buffer,
struct anv_render_pass *pass,
return format->depth_format || format->has_stencil;
}
-struct anv_image_view_info {
- uint8_t surface_type; /**< RENDER_SURFACE_STATE.SurfaceType */
- bool is_array:1; /**< RENDER_SURFACE_STATE.SurfaceArray */
- bool is_cube:1; /**< RENDER_SURFACE_STATE.CubeFaceEnable* */
-};
-
-struct anv_image_view_info
-anv_image_view_info_for_vk_image_view_type(VkImageViewType type);
-
/**
* Subsurface of an anv_image.
*/
struct anv_bo *bo;
VkDeviceSize offset;
- uint8_t surface_type; /**< RENDER_SURFACE_STATE.SurfaceType */
-
bool needs_nonrt_surface_state:1;
bool needs_color_rt_surface_state:1;
+ bool needs_storage_surface_state:1;
/**
* Image subsurfaces
/** RENDER_SURFACE_STATE when using image as a non render target. */
struct anv_state nonrt_surface_state;
+
+ /** RENDER_SURFACE_STATE when using image as a storage image. */
+ struct anv_state storage_surface_state;
};
struct anv_image_create_info {
const VkImageCreateInfo *vk_info;
- bool force_tiling;
- enum isl_tiling tiling;
+ isl_tiling_flags_t isl_tiling_flags;
uint32_t stride;
};
const VkImageViewCreateInfo* pCreateInfo,
struct anv_cmd_buffer *cmd_buffer);
+struct anv_buffer_view {
+ struct anv_bo *bo;
+ uint32_t offset; /**< Offset into bo. */
+
+ struct anv_state surface_state;
+};
+
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 anv_image_view_fill_image_param(struct anv_device *device,
+ struct anv_image_view *view,
+ struct brw_image_param *param);
+
struct anv_sampler {
uint32_t state[4];
};
ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_cmd_pool, VkCommandPool)
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)