diff options
Diffstat (limited to 'Graphics/GraphicsEngine')
| -rw-r--r-- | Graphics/GraphicsEngine/src/Texture.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Graphics/GraphicsEngine/src/Texture.cpp b/Graphics/GraphicsEngine/src/Texture.cpp index 8054ae5f..d33701ea 100644 --- a/Graphics/GraphicsEngine/src/Texture.cpp +++ b/Graphics/GraphicsEngine/src/Texture.cpp @@ -109,6 +109,21 @@ void ValidateTextureDesc( const TextureDesc& Desc ) "There might be an issue in OpenGL driver on NVidia hardware: when rendering to SNORM textures, all negative values are clamped to zero.\n" "Use UNORM format instead." ); } + + if (Desc.Usage == USAGE_STAGING) + { + if (Desc.BindFlags != 0) + LOG_TEXTURE_ERROR_AND_THROW("Staging textures cannot be bound to any GPU pipeline stage"); + + if (Desc.MiscFlags & MISC_TEXTURE_FLAG_GENERATE_MIPS) + LOG_TEXTURE_ERROR_AND_THROW("Mipmaps cannot be autogenerated for staging textures"); + + if (Desc.CPUAccessFlags == 0) + LOG_TEXTURE_ERROR_AND_THROW("Staging textures must specify CPU access flags"); + + if ( (Desc.CPUAccessFlags & (CPU_ACCESS_READ | CPU_ACCESS_WRITE)) == (CPU_ACCESS_READ | CPU_ACCESS_WRITE)) + LOG_TEXTURE_ERROR_AND_THROW("Staging textures must use exactly one of ACESS_READ or ACCESS_WRITE flags"); + } } |
