<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 19, 2017 at 2:53 PM, Gustaw Smolarczyk <span dir="ltr"><<a href="mailto:wielkiegie@gmail.com" target="_blank">wielkiegie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">2017-05-18 23:01 GMT+02:00 Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>>:<br>
> ---<br>
>  src/intel/vulkan/anv_device.c | 42 ++++++++++++++++++++++++++++++<wbr>++++++------<br>
>  1 file changed, 36 insertions(+), 6 deletions(-)<br>
><br>
> diff --git a/src/intel/vulkan/anv_device.<wbr>c b/src/intel/vulkan/anv_device.<wbr>c<br>
> index 6ea8dfe..8eed7f3 100644<br>
> --- a/src/intel/vulkan/anv_device.<wbr>c<br>
> +++ b/src/intel/vulkan/anv_device.<wbr>c<br>
> @@ -112,12 +112,42 @@ anv_physical_device_init_<wbr>heaps(struct anv_physical_device *device, int fd)<br>
>     if (result != VK_SUCCESS)<br>
>        return result;<br>
><br>
> -   device->memory.heap_count = 1;<br>
> -   device->memory.heaps[0] = (struct anv_memory_heap) {<br>
> -      .size = heap_size,<br>
> -      .flags = VK_MEMORY_HEAP_DEVICE_LOCAL_<wbr>BIT,<br>
> -      .supports_48bit_addresses = device->supports_48bit_<wbr>addresses,<br>
> -   };<br>
> +   if (heap_size <= 3ull * (1ull << 30)) {<br>
> +      /* In this case, everything fits nicely into the 32-bit address space,<br>
> +       * so there's no need for supporting 48bit addresses on clinet-allocated<br>
<br>
</span>Probably a typo: s/clinet/client/<span class=""><br></span></blockquote><div><br></div><div>Thanks.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
> +       * memory objects.<br>
> +       */<br>
> +      device->memory.heap_count = 1;<br>
> +      device->memory.heaps[0] = (struct anv_memory_heap) {<br>
> +         .size = heap_size,<br>
> +         .flags = VK_MEMORY_HEAP_DEVICE_LOCAL_<wbr>BIT,<br>
> +         .supports_48bit_addresses = false,<br>
> +      };<br>
> +   } else {<br>
> +      /* Not everything will fit nicely into a 32-bit address space.  In this<br>
> +       * case we need a 64-bit heap.  Advertise a small 32-bit heap and a<br>
> +       * larger 48-bit heap.  If we're in this case, then we have a total heap<br>
> +       * size larger than 3GiB which most likely means they have 8 GiB of<br>
> +       * video memory and so carving off 2 GiB for the 32-bit heap should be<br>
> +       * reasonable.<br>
> +       */<br>
> +      const uint32_t heap_size_32bit = 2ull * (1ull << 30);<br>
> +      const uint32_t heap_size_48bit = heap_size - heap_size_32bit;<br>
<br>
</span>Is it really a good idea for these variables to be only 32-bit?<br>
Especially the second one. <br></blockquote><div><br></div><div>Ugh... Good catch.  I've fixed both locally.  Thanks! <br></div></div></div></div>