Skip to content

Commit

Permalink
[OpenGL] Fix handling of multisample texture storage extension.
Browse files Browse the repository at this point in the history
  • Loading branch information
mellinoe committed Apr 18, 2018
1 parent 6786ed6 commit 7911edf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/Veldrid/OpenGL/OpenGLExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public OpenGLExtensions(HashSet<string> extensions, GraphicsBackend backend, int

TextureStorage = IsExtensionSupported("GL_ARB_texture_storage") // OpenGL 4.2 / 4.3 (multisampled)
|| GLESVersion(3, 0);
TextureStorageMultisample = IsExtensionSupported("GL_ARB_texture_storage_multisample")
|| GLESVersion(3, 1);
ARB_DirectStateAccess = IsExtensionSupported("GL_ARB_direct_state_access");
ARB_MultiBind = IsExtensionSupported("GL_ARB_multi_bind");
ARB_TextureView = IsExtensionSupported("GL_ARB_texture_view"); // OpenGL 4.3
Expand Down Expand Up @@ -49,6 +51,8 @@ public OpenGLExtensions(HashSet<string> extensions, GraphicsBackend backend, int

// Differs between GL / GLES
public readonly bool TextureStorage;
public readonly bool TextureStorageMultisample;

public readonly bool CopyImage;
public readonly bool ComputeShaders;
public readonly bool TessellationShader;
Expand Down
4 changes: 2 additions & 2 deletions src/Veldrid/OpenGL/OpenGLTexture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ private void CreateGLResources()
}
else
{
if (_gd.Extensions.TextureStorage)
if (_gd.Extensions.TextureStorageMultisample)
{
glTexStorage2DMultisample(
TextureTarget.Texture2DMultisample,
Expand Down Expand Up @@ -336,7 +336,7 @@ private void CreateGLResources()
}
else
{
if (_gd.Extensions.TextureStorage)
if (_gd.Extensions.TextureStorageMultisample)
{
glTexStorage3DMultisample(
TextureTarget.Texture2DMultisampleArray,
Expand Down

0 comments on commit 7911edf

Please sign in to comment.