diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-04-02 01:53:10 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-04-02 01:53:10 +0000 |
| commit | e03a728e5fd120c285e2d7321bb9a77abedb6759 (patch) | |
| tree | 16a3784b80924f9d79453d49e44b0b86b85d0838 /Graphics/GraphicsEngine | |
| parent | Added ScreenCapture class (diff) | |
| download | DiligentCore-e03a728e5fd120c285e2d7321bb9a77abedb6759.tar.gz DiligentCore-e03a728e5fd120c285e2d7321bb9a77abedb6759.zip | |
Implemented staging textures in D3D12 back-end
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"); + } } |
