NVIDIAGameWorks / NRI

Low-level abstract render interface
MIT License
219 stars 25 forks source link

swapchain selections #102

Closed pollend closed 1 month ago

pollend commented 1 month ago

this is an older game so i want a swapchain that is unorm. The selection criteria is looking for VK_FORMAT_B8G8R8A8_UNORM but this is not a valid selection so this logic defaults to the first which is an SRGB texture.

image

image

dzhdanNV commented 1 month ago

I follow only partially. Which VkSurfaceFormatKHR formats are available? Which one is needed from this list?

dzhdanNV commented 1 month ago

I'm about to accept your changes. Please, answer my questions.

pollend commented 1 month ago

this game im working on is older so I'm expecting the swapchain to use unorm. This code defaults to is SRGB since its the first one in the list because the logic fails to resolve BGRA8, since the driver reports RGBA8. so it picks the first one on the list. would someone ever use an srgb swapchain?

I'm iffy on sRGB but from my understand the gpu has a transform function for the display gammit. Its so the software works in a linear color space because exponential tend to get messy to work with. whats happening to me is this is getting applied twice the game outputs to unorm but its getting transform back to non-linear srgb but the game was never built for srgb.

image

dzhdanNV commented 1 month ago

Your improvements have been integrated. Thanks again! Good luck with "War Fork" \O/

dzhdanNV commented 1 month ago

I committed formatting changes to your commit (no changes in the logic). Yeah, I agree that in VK case we need to find closest format. A similar logic has been used for a while for memory types and queues.