On 2019-04-09 10:03 a.m., Eric Engestrom wrote:
> On Tuesday, 2019-04-09 09:08:36 +0200, Samuel Pitoiset wrote:
>>
>> +      if (!strcmp(mode, "fifo")) {
>> +         swapchain->present_mode = VK_PRESENT_MODE_FIFO_KHR;
>> +      } else if (!strcmp(mode, "mailbox")) {
>> +         swapchain->present_mode = VK_PRESENT_MODE_MAILBOX_KHR;
>> +      } else if (!strcmp(mode, "immediate")) {
>> +         swapchain->present_mode = VK_PRESENT_MODE_IMMEDIATE_KHR;
>> +      } else {
>> +         unreachable("Invalid MESA_VK_WSI_PRESENT_MODE value");
> 
> unreachable() means the compiler is allowed to do anything, including
> considering the application as dead.
> 
> Not something we want user to be able to do with a simple
> `MESA_VK_WSI_PRESENT_MODE=0` :)
> 
> With an assert() instead, this is:
> Reviewed-by: Eric Engestrom <eric.engest...@intel.com>

With assertions enabled, the application is most certainly dead after a
failed assertion. :)

I'd just print something along the lines of "Invalid
MESA_VK_WSI_PRESENT_MODE value, ignoring" and continue as if it wasn't
set at all.


-- 
Earthling Michel Dänzer               |              https://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to