diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-07-07 22:40:03 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-07-07 22:40:03 +0000 |
| commit | 6896a3c7bae82319682f3bb0af80c20a0b907a1d (patch) | |
| tree | bf7e822be87f5a9dcfc9692d7aea3b622a205c77 /Graphics/GraphicsEngine | |
| parent | Fixed Vulkan swapchain present error when window is minimized (diff) | |
| download | DiligentCore-6896a3c7bae82319682f3bb0af80c20a0b907a1d.tar.gz DiligentCore-6896a3c7bae82319682f3bb0af80c20a0b907a1d.zip | |
Implemented mipmap generation in Vulkan
Diffstat (limited to 'Graphics/GraphicsEngine')
| -rw-r--r-- | Graphics/GraphicsEngine/include/DeviceObjectBase.h | 11 | ||||
| -rw-r--r-- | Graphics/GraphicsEngine/include/TextureBase.h | 5 | ||||
| -rw-r--r-- | Graphics/GraphicsEngine/interface/DeviceContext.h | 11 | ||||
| -rw-r--r-- | Graphics/GraphicsEngine/interface/GraphicsTypes.h | 27 |
4 files changed, 37 insertions, 17 deletions
diff --git a/Graphics/GraphicsEngine/include/DeviceObjectBase.h b/Graphics/GraphicsEngine/include/DeviceObjectBase.h index 37f7124a..522b40c1 100644 --- a/Graphics/GraphicsEngine/include/DeviceObjectBase.h +++ b/Graphics/GraphicsEngine/include/DeviceObjectBase.h @@ -26,6 +26,7 @@ /// \file /// Implementation of the Diligent::DeviceObjectBase template class +#include <sstream> #include "RefCntAutoPtr.h" #include "ObjectBase.h" #include "UniqueIdentifier.h" @@ -59,7 +60,7 @@ public: // Do not keep strong reference to the device if the object is an internal device object m_spDevice( bIsDeviceInternal ? nullptr : pDevice ), m_pDevice( pDevice ), - m_ObjectNameCopy(ObjDesc.Name ? ObjDesc.Name : ""), + m_ObjectNameCopy(ObjDesc.Name ? ObjDesc.Name : ThisToString()), m_Desc( ObjDesc ) { m_Desc.Name = m_ObjectNameCopy.c_str(); @@ -145,6 +146,14 @@ protected: // Template argument is only used to separate counters for // different groups of objects UniqueIdHelper<BaseInterface> m_UniqueID; + +private: + String ThisToString()const + { + std::stringstream ss; + ss << this; + return ss.str(); + } }; } diff --git a/Graphics/GraphicsEngine/include/TextureBase.h b/Graphics/GraphicsEngine/include/TextureBase.h index c2f11245..bd2a7b71 100644 --- a/Graphics/GraphicsEngine/include/TextureBase.h +++ b/Graphics/GraphicsEngine/include/TextureBase.h @@ -237,9 +237,10 @@ void TextureBase<BaseInterface, TTextureViewImpl, TTexViewObjAllocator> :: Corre break; case RESOURCE_DIM_TEX_2D: - if(ViewDesc.TextureDim != RESOURCE_DIM_TEX_2D ) + if(ViewDesc.TextureDim != RESOURCE_DIM_TEX_2D_ARRAY && + ViewDesc.TextureDim != RESOURCE_DIM_TEX_2D ) { - TEX_VIEW_VALIDATION_ERROR( "Incorrect texture type for Texture 2D view: only Texture 2D is allowed" ); + TEX_VIEW_VALIDATION_ERROR( "Incorrect texture type for Texture 2D view: only Texture 2D or Texture 2D Array are allowed" ); } break; diff --git a/Graphics/GraphicsEngine/interface/DeviceContext.h b/Graphics/GraphicsEngine/interface/DeviceContext.h index 460291a5..09fe545d 100644 --- a/Graphics/GraphicsEngine/interface/DeviceContext.h +++ b/Graphics/GraphicsEngine/interface/DeviceContext.h @@ -206,7 +206,16 @@ enum COMMIT_SHADER_RESOURCES_FLAG /// If this flag is specified when IDeviceContext::CommitShaderResources() is called, /// the engine will transition all shader resources to the correct state. - COMMIT_SHADER_RESOURCES_FLAG_TRANSITION_RESOURCES = 0x01 + COMMIT_SHADER_RESOURCES_FLAG_TRANSITION_RESOURCES = 0x01, + + + /// Verify resource states + + /// The flag is used in debug and development builds to verify + /// that all resources are transitioned to correct states when + /// COMMIT_SHADER_RESOURCES_FLAG_TRANSITION_RESOURCES flag is not set. + /// No resource state validation is performed in release build. + COMMIT_SHADER_RESOURCES_FLAG_VERIFY_STATES = 0x02 }; diff --git a/Graphics/GraphicsEngine/interface/GraphicsTypes.h b/Graphics/GraphicsEngine/interface/GraphicsTypes.h index beb8c8fa..f32afaf5 100644 --- a/Graphics/GraphicsEngine/interface/GraphicsTypes.h +++ b/Graphics/GraphicsEngine/interface/GraphicsTypes.h @@ -1295,19 +1295,20 @@ namespace Diligent /// see https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkPhysicalDeviceFeatures struct DeviceFeatures { - bool depthBiasClamp = false; - bool fillModeNonSolid = false; - bool depthClamp = false; - bool independentBlend = false; - bool samplerAnisotropy = true; - bool geometryShader = true; - bool tessellationShader = true; - bool dualSrcBlend = false; - bool multiViewport = false; - bool imageCubeArray = false; - bool textureCompressionBC = false; - bool vertexPipelineStoresAndAtomics = false; - bool fragmentStoresAndAtomics = false; + bool depthBiasClamp = false; + bool fillModeNonSolid = false; + bool depthClamp = false; + bool independentBlend = false; + bool samplerAnisotropy = true; + bool geometryShader = true; + bool tessellationShader = true; + bool dualSrcBlend = false; + bool multiViewport = false; + bool imageCubeArray = false; + bool textureCompressionBC = false; + bool vertexPipelineStoresAndAtomics = false; + bool fragmentStoresAndAtomics = false; + bool shaderStorageImageExtendedFormats = false; }EnabledFeatures; /// Descriptor pool size |
