<div dir="ltr">Yes please!<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 6, 2017 at 12:40 PM, Chad Versace <span dir="ltr"><<a href="mailto:chadversary@chromium.org" target="_blank">chadversary@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Now that anv_image_create() is gone, there is no need for struct<br>
anv_image_create_info. The struct just adds an unused layer of<br>
indirection.<br>
---<br>
src/intel/vulkan/anv_image.c | 38 +++++++++++-------------------<wbr>--------<br>
src/intel/vulkan/anv_private.h | 9 ---------<br>
2 files changed, 11 insertions(+), 36 deletions(-)<br>
<br>
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c<br>
index 998b0b43391..e5e93f702f6 100644<br>
--- a/src/intel/vulkan/anv_image.c<br>
+++ b/src/intel/vulkan/anv_image.c<br>
@@ -106,7 +106,7 @@ get_surface(struct anv_image *image, VkImageAspectFlags aspect)<br>
}<br>
<br>
static isl_tiling_flags_t<br>
-choose_isl_tiling_flags(const struct anv_image_create_info *anv_info,<br>
+choose_isl_tiling_flags(const VkImageCreateInfo *base_info,<br>
const VkImportImageDmaBufInfoMESAX *import_dma_buf_info,<br>
const VkExportImageDmaBufInfoMESAX *export_dma_buf_info)<br>
{<br>
@@ -122,15 +122,12 @@ choose_isl_tiling_flags(const struct anv_image_create_info *anv_info,<br>
uint64_t mod = export_dma_buf_info-><wbr>pDrmFormatModifiers[i];<br>
flags |= 1 << isl_tiling_from_drm_format_<wbr>mod(mod);<br>
}<br>
- } else if (anv_info->vk_info->tiling == VK_IMAGE_TILING_LINEAR) {<br>
+ } else if (base_info->tiling == VK_IMAGE_TILING_LINEAR) {<br>
flags = ISL_TILING_LINEAR_BIT;<br>
} else {<br>
flags = ISL_TILING_ANY_MASK;<br>
}<br>
<br>
- if (anv_info->isl_tiling_flags)<br>
- flags &= anv_info->isl_tiling_flags;<br>
-<br>
assert(flags != 0);<br>
<br>
return flags;<br>
@@ -158,22 +155,6 @@ choose_isl_format(const struct anv_device *dev,<br>
}<br>
}<br>
<br>
-static uint32_t<br>
-choose_row_pitch(const struct anv_image_create_info *anv_info,<br>
- const VkImportImageDmaBufPlaneInfoME<wbr>SAX *plane_info)<br>
-{<br>
- if (anv_info->stride != 0)<br>
- return anv_info->stride;<br>
-<br>
- if (plane_info) {<br>
- assert(plane_info->rowPitch > 0);<br>
- return plane_info->rowPitch;<br>
- }<br>
-<br>
- /* Let isl choose the pitch. */<br>
- return 0;<br>
-}<br>
-<br>
static void<br>
set_min_surface_offset(const struct anv_image *image, struct anv_surface *surf)<br>
{<br>
@@ -318,14 +299,13 @@ make_aux_surface_maybe(const struct anv_device *dev,<br>
*/<br>
static void<br>
make_main_surface(const struct anv_device *dev,<br>
- const struct anv_image_create_info *anv_info,<br>
+ const VkImageCreateInfo *base_info,<br>
const VkImportImageDmaBufInfoMESAX *import_dma_buf_info,<br>
const VkExportImageDmaBufInfoMESAX *export_dma_buf_info,<br>
VkImageAspectFlags aspect,<br>
VkExternalMemoryHandleTypeFlag<wbr>sKHX handle_types,<br>
struct anv_image *image)<br>
{<br>
- const VkImageCreateInfo *base_info = anv_info->vk_info;<br>
bool ok UNUSED;<br>
<br>
static const enum isl_surf_dim vk_to_isl_surf_dim[] = {<br>
@@ -339,8 +319,13 @@ make_main_surface(const struct anv_device *dev,<br>
plane_info = &import_dma_buf_info->pPlanes[<wbr>0];<br>
<br>
const isl_tiling_flags_t tiling_flags =<br>
- choose_isl_tiling_flags(anv_<wbr>info, import_dma_buf_info, export_dma_buf_info);<br>
- const uint32_t row_pitch = choose_row_pitch(anv_info, plane_info);<br>
+ choose_isl_tiling_flags(base_<wbr>info, import_dma_buf_info, export_dma_buf_info);<br>
+<br>
+ uint32_t row_pitch = 0;<br>
+ if (plane_info) {<br>
+ assert(plane_info->rowPitch > 0);<br>
+ row_pitch = plane_info->rowPitch;<br>
+ }<br>
<br>
struct anv_surface *anv_surf = get_surface(image, aspect);<br>
<br>
@@ -386,7 +371,6 @@ anv_CreateImage(VkDevice _device,<br>
VkImage *pImage)<br>
{<br>
ANV_FROM_HANDLE(anv_device, device, _device);<br>
- const struct anv_image_create_info anv_info = { .vk_info = base_info };<br>
const VkImportImageDmaBufInfoMESAX *import_dma_buf_info = NULL;<br>
const VkExportImageDmaBufInfoMESAX *export_dma_buf_info = NULL;<br>
VkExternalMemoryHandleTypeFlag<wbr>sKHX handle_types = 0;<br>
@@ -444,7 +428,7 @@ anv_CreateImage(VkDevice _device,<br>
uint32_t b;<br>
for_each_bit(b, image->aspects) {<br>
VkImageAspectFlagBits aspect = 1 << b;<br>
- make_main_surface(device, &anv_info, import_dma_buf_info,<br>
+ make_main_surface(device, base_info, import_dma_buf_info,<br>
export_dma_buf_info, aspect, handle_types, image);<br>
make_aux_surface_maybe(device, base_info, aspect, handle_types, image);<br>
}<br>
diff --git a/src/intel/vulkan/anv_<wbr>private.h b/src/intel/vulkan/anv_<wbr>private.h<br>
index 2f62ec50c5b..a5dd0f72de1 100644<br>
--- a/src/intel/vulkan/anv_<wbr>private.h<br>
+++ b/src/intel/vulkan/anv_<wbr>private.h<br>
@@ -1860,15 +1860,6 @@ struct anv_image_view {<br>
struct brw_image_param storage_image_param;<br>
};<br>
<br>
-struct anv_image_create_info {<br>
- const VkImageCreateInfo *vk_info;<br>
-<br>
- /** An opt-in bitmask which filters an ISL-mapping of the Vulkan tiling. */<br>
- isl_tiling_flags_t isl_tiling_flags;<br>
-<br>
- uint32_t stride;<br>
-};<br>
-<br>
const struct anv_surface *<br>
anv_image_get_surface_for_<wbr>aspect_mask(const struct anv_image *image,<br>
VkImageAspectFlags aspect_mask);<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.12.0<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>