Skip to content

Commit

Permalink
Add missing depth buffer formats to the OpenGL backend
Browse files Browse the repository at this point in the history
  • Loading branch information
feliwir committed Apr 9, 2018
1 parent c288fe5 commit e525d94
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Veldrid.StartupUtilities/VeldridStartup.cs
Expand Up @@ -232,7 +232,7 @@ public static unsafe GraphicsDevice CreateDefaultOpenGLGraphicsDevice(GraphicsDe
if (backend == GraphicsBackend.OpenGL)
{
Sdl2Native.SDL_GL_SetAttribute(SDL_GLAttribute.ContextProfileMask, (int)SDL_GLProfile.Core);
Sdl2Native.SDL_GL_SetAttribute(SDL_GLAttribute.ContextMajorVersion, 3);
Sdl2Native.SDL_GL_SetAttribute(SDL_GLAttribute.ContextMajorVersion, 3);
Sdl2Native.SDL_GL_SetAttribute(SDL_GLAttribute.ContextMinorVersion, 0);
}
else
Expand All @@ -246,10 +246,14 @@ public static unsafe GraphicsDevice CreateDefaultOpenGLGraphicsDevice(GraphicsDe
if (options.SwapchainDepthFormat.HasValue)
{
switch (options.SwapchainDepthFormat)
{
{
case PixelFormat.R16_UNorm:
depthBits = 16;
break;
case PixelFormat.D24_UNorm_S8_UInt:
depthBits = 24;
break;
case PixelFormat.D32_Float_S8_UInt:
case PixelFormat.R32_Float:
depthBits = 32;
break;
Expand Down

0 comments on commit e525d94

Please sign in to comment.