aboutsummaryrefslogtreecommitdiffstats
path: root/src/vulkan/anv_private.h
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2015-08-17 14:03:52 -0700
committerChad Versace <[email protected]>2015-08-17 14:08:55 -0700
commit6ff95bba8abd50b47117f733d3e46fb90333210f (patch)
treecfe146ab77cf559097c5beb767aa6fee9fae6e9e /src/vulkan/anv_private.h
parent5a6b2e6df0ac63e20856dfcd1fc9f0ff73ae67e2 (diff)
vk: Add anv_format reference to anv_render_pass_attachment
Change type of anv_render_pass_attachment::format from VkFormat to const struct anv_format*. This elimiates the repetitive lookups into the VkFormat -> anv_format table when looping over attachments during anv_cmd_buffer_clear_attachments().
Diffstat (limited to 'src/vulkan/anv_private.h')
-rw-r--r--src/vulkan/anv_private.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/vulkan/anv_private.h b/src/vulkan/anv_private.h
index ee2700254cd..1b2cfc6fa0c 100644
--- a/src/vulkan/anv_private.h
+++ b/src/vulkan/anv_private.h
@@ -888,7 +888,12 @@ extern const struct anv_format *const anv_format_s8_uint;
const struct anv_format *
anv_format_for_vk_format(VkFormat format);
-bool anv_is_vk_format_depth_or_stencil(VkFormat format);
+
+static inline bool
+anv_format_is_depth_or_stencil(const struct anv_format *format)
+{
+ return format->depth_format || format->has_stencil;
+}
/**
* A proxy for the color surfaces, depth surfaces, and stencil surfaces.
@@ -1042,7 +1047,7 @@ struct anv_subpass {
};
struct anv_render_pass_attachment {
- VkFormat format;
+ const struct anv_format *format;
uint32_t samples;
VkAttachmentLoadOp load_op;
VkAttachmentLoadOp stencil_load_op;