Prowl
Prowl copied to clipboard
Fix Swapchain Implementation
Describe the bug We don't know what is the best supported PixelFormat is until we create a graphics device, but for some reason we do:
public static partial class Graphics
{
//...
public static void Initialize(bool VSync = true, GraphicsBackend preferredBackend = GraphicsBackend.OpenGL)
{
GraphicsDeviceOptions deviceOptions = new()
{
SyncToVerticalBlank = VSync,
ResourceBindingModel = ResourceBindingModel.Default,
HasMainSwapchain = true,
SwapchainDepthFormat = PixelFormat.D16_UNorm,
SwapchainSrgbFormat = false,
};
//....
}
//...
}
To Reproduce Steps to reproduce the behavior:
- Open prowl on mac-os m1 and run
- You should see
-[MTLTextureDescriptorInternal validateWithDevice:]:1405: failed assertionTexture Descriptor Validation MTLTextureDescriptor has invalid pixelFormat (255).'`
Expected behavior It should use the correct pixel format.
Because of the way things are setup you can't call TextureUtility.GetBestSupportedDepthFormat() when initializing the GraphicsDeviceOptions