On 2019-04-09 at 10:56, Michel Dänzer <mic...@daenzer.net> wrote:
> 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. :)

Sure, but the difference is in prod, where you want to just silently ignore the 
invalid override, not die ;)

> 
> 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.

Sure, that works too 👍
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to