<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Feb 14, 2017 at 9:35 AM, Connor Abbott <span dir="ltr"><<a href="mailto:cwabbott0@gmail.com" target="_blank">cwabbott0@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, Feb 14, 2017 at 12:33 PM, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
> On Tue, Feb 14, 2017 at 9:23 AM, Connor Abbott <<a href="mailto:cwabbott0@gmail.com">cwabbott0@gmail.com</a>> wrote:<br>
>><br>
>> Even though we supported both coherent and non-coherent memory types, we<br>
>> effectively forced apps to use the coherent types by accident. Found by<br>
>> inspection, only compile tested.<br>
>><br>
>> Signed-off-by: Connor Abbott <<a href="mailto:cwabbott0@gmail.com">cwabbott0@gmail.com</a>><br>
>> ---<br>
>> I sent this out a while ago, but it seems like it was lost.<br>
>> ---<br>
>>  src/intel/vulkan/anv_device.c | 14 ++++++++------<br>
>>  1 file changed, 8 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 46b83a3..57d70b6 100644<br>
>> --- a/src/intel/vulkan/anv_device.<wbr>c<br>
>> +++ b/src/intel/vulkan/anv_device.<wbr>c<br>
>> @@ -1554,11 +1554,12 @@ VkResult anv_<wbr>InvalidateMappedMemoryRanges(<br>
>>  }<br>
>><br>
>>  void anv_<wbr>GetBufferMemoryRequirements(<br>
>> -    VkDevice                                    device,<br>
>> +    VkDevice                                    _device,<br>
>>      VkBuffer                                    _buffer,<br>
>>      VkMemoryRequirements*                       pMemoryRequirements)<br>
>>  {<br>
>>     ANV_FROM_HANDLE(anv_buffer, buffer, _buffer);<br>
>> +   ANV_FROM_HANDLE(anv_device, device, _device);<br>
>><br>
>>     /* The Vulkan spec (git aaed022) says:<br>
>>      *<br>
>> @@ -1567,20 +1568,21 @@ void anv_<wbr>GetBufferMemoryRequirements(<br>
>>      *    only if the memory type `i` in the<br>
>> VkPhysicalDeviceMemoryProperti<wbr>es<br>
>>      *    structure for the physical device is supported.<br>
>>      *<br>
>> -    * We support exactly one memory type.<br>
>> +    * We support exactly one memory type on LLC, two on non-LLC.<br>
>>      */<br>
>> -   pMemoryRequirements-><wbr>memoryTypeBits = 1;<br>
>> +   pMemoryRequirements-><wbr>memoryTypeBits = device->info.has_llc ? 1 : 3;<br>
><br>
><br>
> Is it two or three?  The comment and code don't match.<br>
<br>
</div></div>It's a bitfield. See the comment above.</blockquote><div><br></div><div>Drp... Yeah, this looks fine.<br><br></div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br><br></div><div>I'll run it through CI and push it.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">><br><div class="HOEnZb"><div class="h5">
>><br>
>><br>
>>     pMemoryRequirements->size = buffer->size;<br>
>>     pMemoryRequirements->alignment = 16;<br>
>>  }<br>
>><br>
>>  void anv_<wbr>GetImageMemoryRequirements(<br>
>> -    VkDevice                                    device,<br>
>> +    VkDevice                                    _device,<br>
>>      VkImage                                     _image,<br>
>>      VkMemoryRequirements*                       pMemoryRequirements)<br>
>>  {<br>
>>     ANV_FROM_HANDLE(anv_image, image, _image);<br>
>> +   ANV_FROM_HANDLE(anv_device, device, _device);<br>
>><br>
>>     /* The Vulkan spec (git aaed022) says:<br>
>>      *<br>
>> @@ -1589,9 +1591,9 @@ void anv_<wbr>GetImageMemoryRequirements(<br>
>>      *    only if the memory type `i` in the<br>
>> VkPhysicalDeviceMemoryProperti<wbr>es<br>
>>      *    structure for the physical device is supported.<br>
>>      *<br>
>> -    * We support exactly one memory type.<br>
>> +    * We support exactly one memory type on LLC, two on non-LLC.<br>
>>      */<br>
>> -   pMemoryRequirements-><wbr>memoryTypeBits = 1;<br>
>> +   pMemoryRequirements-><wbr>memoryTypeBits = device->info.has_llc ? 1 : 3;<br>
>><br>
>>     pMemoryRequirements->size = image->size;<br>
>>     pMemoryRequirements->alignment = image->alignment;<br>
>> --<br>
>> 2.9.3<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>
><br>
><br>
</div></div></blockquote></div><br></div></div>