<div dir="auto"><div>21 lut 2017 03:47 "Jason Ekstrand" <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> napisał(a):<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Fine by me<br><br></div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>><br></div><div class="elided-text"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 20, 2017 at 6:26 PM, Dave Airlie <span dir="ltr"><<a href="mailto:airlied@gmail.com" target="_blank">airlied@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Dave Airlie <<a href="mailto:airlied@redhat.com" target="_blank">airlied@redhat.com</a>><br>
<br>
For prime support I need to access this, so move it in advance.<br>
<br>
Signed-off-by: Dave Airlie <<a href="mailto:airlied@redhat.com" target="_blank">airlied@redhat.com</a>><br>
---<br>
src/vulkan/wsi/wsi_common.h | 1 +<br>
src/vulkan/wsi/wsi_common_way<wbr>land.c | 20 +++++++++-----------<br>
src/vulkan/wsi/wsi_common_<wbr>x11.c | 29 ++++++++++++++---------------<br>
3 files changed, 24 insertions(+), 26 deletions(-)<br>
<br>
diff --git a/src/vulkan/wsi/wsi_common.h b/src/vulkan/wsi/wsi_common.h<br>
index ae9e587..1a22935 100644<br>
--- a/src/vulkan/wsi/wsi_common.h<br>
+++ b/src/vulkan/wsi/wsi_common.h<br>
@@ -54,6 +54,7 @@ struct wsi_swapchain {<br>
const struct wsi_image_fns *image_fns;<br>
VkFence fences[3];<br>
VkPresentModeKHR present_mode;<br>
+ int image_count;<br>
<br>
VkResult (*destroy)(struct wsi_swapchain *swapchain,<br>
const VkAllocationCallbacks *pAllocator);<br>
diff --git a/src/vulkan/wsi/wsi_common_wa<wbr>yland.c b/src/vulkan/wsi/wsi_common_wa<wbr>yland.c<br>
index 4489736..e6490ee 100644<br>
--- a/src/vulkan/wsi/wsi_common_wa<wbr>yland.c<br>
+++ b/src/vulkan/wsi/wsi_common_wa<wbr>yland.c<br>
@@ -495,7 +495,6 @@ struct wsi_wl_swapchain {<br>
VkPresentModeKHR present_mode;<br>
bool fifo_ready;<br>
<br>
- uint32_t image_count;<br>
struct wsi_wl_image images[0];<br>
};<br>
<br>
@@ -508,13 +507,13 @@ wsi_wl_swapchain_get_images(st<wbr>ruct wsi_swapchain *wsi_chain,<br>
VkResult result;<br>
<br>
if (pSwapchainImages == NULL) {<br>
- *pCount = chain->image_count;<br>
+ *pCount = chain->base.image_count;<br>
return VK_SUCCESS;<br>
}<br>
<br>
result = VK_SUCCESS;<br>
- ret_count = chain->image_count;<br>
- if (chain->image_count > *pCount) {<br>
+ ret_count = chain->base.image_count;<br>
+ if (chain->base.image_count > *pCount) {<br>
ret_count = *pCount;<br>
result = VK_INCOMPLETE;<br>
}<br>
@@ -543,7 +542,7 @@ wsi_wl_swapchain_acquire_next_<wbr>image(struct wsi_swapchain *wsi_chain,<br>
return VK_ERROR_OUT_OF_DATE_KHR;<br>
<br>
while (1) {<br>
- for (uint32_t i = 0; i < chain->image_count; i++) {<br>
+ for (uint32_t i = 0; i < chain->base.image_count; i++) {<br></blockquote></div></div></div></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">Looks like a comparison between signed and unsigned. Not sure if you care about this (it produces a warning at -Wall or -Wextra IIRC).</div><div dir="auto"><br></div><div dir="auto">Regards,</div><div dir="auto">Gustaw</div><div dir="auto"><div class="gmail_extra"><br></div></div></div>