summaryrefslogtreecommitdiffstats
path: root/Graphics
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-10-19 19:08:40 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-10-19 19:08:40 +0000
commite5f36378de4a7258fcc9d6ca7a349df1136b7444 (patch)
tree2470fdcc8e1ed3d029ce30f6ac8d63e6fba4f005 /Graphics
parentRenamed static sampler to immutable sampler (API240076) (diff)
downloadDiligentCore-e5f36378de4a7258fcc9d6ca7a349df1136b7444.tar.gz
DiligentCore-e5f36378de4a7258fcc9d6ca7a349df1136b7444.zip
Renamed USAGE_STATIC to USAGE_IMMUTABLE (API240077)
Diffstat (limited to 'Graphics')
-rw-r--r--Graphics/GraphicsAccessories/src/GraphicsAccessories.cpp12
-rw-r--r--Graphics/GraphicsEngine/interface/APIInfo.h2
-rw-r--r--Graphics/GraphicsEngine/interface/GraphicsTypes.h4
-rw-r--r--Graphics/GraphicsEngine/interface/RenderDevice.h4
-rw-r--r--Graphics/GraphicsEngine/src/BufferBase.cpp6
-rw-r--r--Graphics/GraphicsEngineD3D11/include/D3D11TypeConversions.hpp4
-rw-r--r--Graphics/GraphicsEngineD3D11/src/BufferD3D11Impl.cpp4
-rw-r--r--Graphics/GraphicsEngineD3D11/src/TextureBaseD3D11.cpp4
-rw-r--r--Graphics/GraphicsEngineD3D12/src/BufferD3D12Impl.cpp4
-rw-r--r--Graphics/GraphicsEngineD3D12/src/TextureD3D12Impl.cpp6
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/GLTypeConversions.hpp2
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/BufferGLImpl.cpp4
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp4
-rw-r--r--Graphics/GraphicsEngineVulkan/src/BufferVkImpl.cpp6
-rw-r--r--Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp6
15 files changed, 36 insertions, 36 deletions
diff --git a/Graphics/GraphicsAccessories/src/GraphicsAccessories.cpp b/Graphics/GraphicsAccessories/src/GraphicsAccessories.cpp
index 7cc46ea1..fc6939e9 100644
--- a/Graphics/GraphicsAccessories/src/GraphicsAccessories.cpp
+++ b/Graphics/GraphicsAccessories/src/GraphicsAccessories.cpp
@@ -765,16 +765,16 @@ const Char* GetUsageString(USAGE Usage)
{
// clang-format off
#define INIT_USGAGE_STR(Usage)UsageStrings[Usage] = #Usage
- INIT_USGAGE_STR( USAGE_STATIC );
- INIT_USGAGE_STR( USAGE_DEFAULT );
- INIT_USGAGE_STR( USAGE_DYNAMIC );
- INIT_USGAGE_STR( USAGE_STAGING );
- INIT_USGAGE_STR( USAGE_UNIFIED );
+ INIT_USGAGE_STR(USAGE_IMMUTABLE);
+ INIT_USGAGE_STR(USAGE_DEFAULT);
+ INIT_USGAGE_STR(USAGE_DYNAMIC);
+ INIT_USGAGE_STR(USAGE_STAGING);
+ INIT_USGAGE_STR(USAGE_UNIFIED);
#undef INIT_USGAGE_STR
// clang-format on
bUsageStringsInit = true;
}
- if (Usage >= USAGE_STATIC && Usage < USAGE_NUM_USAGES)
+ if (Usage >= USAGE_IMMUTABLE && Usage < USAGE_NUM_USAGES)
return UsageStrings[Usage];
else
{
diff --git a/Graphics/GraphicsEngine/interface/APIInfo.h b/Graphics/GraphicsEngine/interface/APIInfo.h
index a32511d2..327f54c7 100644
--- a/Graphics/GraphicsEngine/interface/APIInfo.h
+++ b/Graphics/GraphicsEngine/interface/APIInfo.h
@@ -30,7 +30,7 @@
/// \file
/// Diligent API information
-#define DILIGENT_API_VERSION 240076
+#define DILIGENT_API_VERSION 240077
#include "../../../Primitives/interface/BasicTypes.h"
diff --git a/Graphics/GraphicsEngine/interface/GraphicsTypes.h b/Graphics/GraphicsEngine/interface/GraphicsTypes.h
index 74e16535..0f6b4b82 100644
--- a/Graphics/GraphicsEngine/interface/GraphicsTypes.h
+++ b/Graphics/GraphicsEngine/interface/GraphicsTypes.h
@@ -103,7 +103,7 @@ DILIGENT_TYPED_ENUM(USAGE, Uint8)
/// when it is created, since it cannot be changed after creation. \n
/// D3D11 Counterpart: D3D11_USAGE_IMMUTABLE. OpenGL counterpart: GL_STATIC_DRAW
/// \remarks Static buffers do not allow CPU access and must use CPU_ACCESS_NONE flag.
- USAGE_STATIC = 0,
+ USAGE_IMMUTABLE = 0,
/// A resource that requires read and write access by the GPU and can also be occasionally
/// written by the CPU. \n
@@ -1706,7 +1706,7 @@ struct GraphicsAdapterInfo
/// The amount of local video memory that is inaccessible by CPU, in bytes.
- /// \note Device-local memory is where USAGE_DEFAULT and USAGE_STATIC resources
+ /// \note Device-local memory is where USAGE_DEFAULT and USAGE_IMMUTABLE resources
/// are typically allocated.
///
/// On some devices it may not be possible to query the memory size,
diff --git a/Graphics/GraphicsEngine/interface/RenderDevice.h b/Graphics/GraphicsEngine/interface/RenderDevice.h
index 5c72c81a..252daf1a 100644
--- a/Graphics/GraphicsEngine/interface/RenderDevice.h
+++ b/Graphics/GraphicsEngine/interface/RenderDevice.h
@@ -75,7 +75,7 @@ DILIGENT_BEGIN_INTERFACE(IRenderDevice, IObject)
/// \param [in] BuffDesc - Buffer description, see Diligent::BufferDesc for details.
/// \param [in] pBuffData - Pointer to Diligent::BufferData structure that describes
/// initial buffer data or nullptr if no data is provided.
- /// Static buffers (USAGE_STATIC) must be initialized at creation time.
+ /// Immutable buffers (USAGE_IMMUTABLE) must be initialized at creation time.
/// \param [out] ppBuffer - Address of the memory location where the pointer to the
/// buffer interface will be stored. The function calls AddRef(),
/// so that the new buffer will contain one reference and must be
@@ -106,7 +106,7 @@ DILIGENT_BEGIN_INTERFACE(IRenderDevice, IObject)
/// \param [in] TexDesc - Texture description, see Diligent::TextureDesc for details.
/// \param [in] pData - Pointer to Diligent::TextureData structure that describes
/// initial texture data or nullptr if no data is provided.
- /// Static textures (USAGE_STATIC) must be initialized at creation time.
+ /// Immutable textures (USAGE_IMMUTABLE) must be initialized at creation time.
///
/// \param [out] ppTexture - Address of the memory location where the pointer to the
/// texture interface will be stored.
diff --git a/Graphics/GraphicsEngine/src/BufferBase.cpp b/Graphics/GraphicsEngine/src/BufferBase.cpp
index 4aff91a0..0239ed92 100644
--- a/Graphics/GraphicsEngine/src/BufferBase.cpp
+++ b/Graphics/GraphicsEngine/src/BufferBase.cpp
@@ -71,7 +71,7 @@ void ValidateBufferDesc(const BufferDesc& Desc, const DeviceCaps& deviceCaps)
switch (Desc.Usage)
{
- case USAGE_STATIC:
+ case USAGE_IMMUTABLE:
case USAGE_DEFAULT:
VERIFY_BUFFER(Desc.CPUAccessFlags == CPU_ACCESS_NONE, "static and default buffers can't have any CPU access flags set.");
break;
@@ -114,8 +114,8 @@ void ValidateBufferDesc(const BufferDesc& Desc, const DeviceCaps& deviceCaps)
void ValidateBufferInitData(const BufferDesc& Desc, const BufferData* pBuffData)
{
- if (Desc.Usage == USAGE_STATIC && (pBuffData == nullptr || pBuffData->pData == nullptr))
- LOG_BUFFER_ERROR_AND_THROW("initial data must not be null as static buffers must be initialized at creation time.");
+ if (Desc.Usage == USAGE_IMMUTABLE && (pBuffData == nullptr || pBuffData->pData == nullptr))
+ LOG_BUFFER_ERROR_AND_THROW("initial data must not be null as immutable buffers must be initialized at creation time.");
if (Desc.Usage == USAGE_DYNAMIC && pBuffData != nullptr && pBuffData->pData != nullptr)
LOG_BUFFER_ERROR_AND_THROW("initial data must be null for dynamic buffers.");
diff --git a/Graphics/GraphicsEngineD3D11/include/D3D11TypeConversions.hpp b/Graphics/GraphicsEngineD3D11/include/D3D11TypeConversions.hpp
index 5a87cfd7..96de94f9 100644
--- a/Graphics/GraphicsEngineD3D11/include/D3D11TypeConversions.hpp
+++ b/Graphics/GraphicsEngineD3D11/include/D3D11TypeConversions.hpp
@@ -79,7 +79,7 @@ inline D3D11_USAGE UsageToD3D11Usage(USAGE Usage)
switch (Usage)
{
// clang-format off
- case USAGE_STATIC: return D3D11_USAGE_IMMUTABLE;
+ case USAGE_IMMUTABLE: return D3D11_USAGE_IMMUTABLE;
case USAGE_DEFAULT: return D3D11_USAGE_DEFAULT;
case USAGE_DYNAMIC: return D3D11_USAGE_DYNAMIC;
case USAGE_STAGING: return D3D11_USAGE_STAGING;
@@ -93,7 +93,7 @@ inline USAGE D3D11UsageToUsage(D3D11_USAGE D3D11Usage)
switch (D3D11Usage)
{
// clang-format off
- case D3D11_USAGE_IMMUTABLE: return USAGE_STATIC;
+ case D3D11_USAGE_IMMUTABLE: return USAGE_IMMUTABLE;
case D3D11_USAGE_DEFAULT: return USAGE_DEFAULT;
case D3D11_USAGE_DYNAMIC: return USAGE_DYNAMIC;
case D3D11_USAGE_STAGING: return USAGE_STAGING;
diff --git a/Graphics/GraphicsEngineD3D11/src/BufferD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/BufferD3D11Impl.cpp
index de7c843d..16e77806 100644
--- a/Graphics/GraphicsEngineD3D11/src/BufferD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/BufferD3D11Impl.cpp
@@ -62,8 +62,8 @@ BufferD3D11Impl::BufferD3D11Impl(IReferenceCounters* pRefCounters,
LOG_ERROR_AND_THROW("Unified resources are not supported in Direct3D11");
}
- if (m_Desc.Usage == USAGE_STATIC)
- VERIFY(pBuffData != nullptr && pBuffData->pData != nullptr, "Initial data must not be null for static buffers");
+ if (m_Desc.Usage == USAGE_IMMUTABLE)
+ VERIFY(pBuffData != nullptr && pBuffData->pData != nullptr, "Initial data must not be null for immutable buffers");
if (m_Desc.BindFlags & BIND_UNIFORM_BUFFER)
{
diff --git a/Graphics/GraphicsEngineD3D11/src/TextureBaseD3D11.cpp b/Graphics/GraphicsEngineD3D11/src/TextureBaseD3D11.cpp
index 7a744b57..0e9b217b 100644
--- a/Graphics/GraphicsEngineD3D11/src/TextureBaseD3D11.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/TextureBaseD3D11.cpp
@@ -51,8 +51,8 @@ TextureBaseD3D11::TextureBaseD3D11(IReferenceCounters* pRefCounters,
}
// clang-format on
{
- if (m_Desc.Usage == USAGE_STATIC && (pInitData == nullptr || pInitData->pSubResources == nullptr))
- LOG_ERROR_AND_THROW("Static textures must be initialized with data at creation time: pInitData can't be null");
+ if (m_Desc.Usage == USAGE_IMMUTABLE && (pInitData == nullptr || pInitData->pSubResources == nullptr))
+ LOG_ERROR_AND_THROW("Immutable textures must be initialized with data at creation time: pInitData can't be null");
SetState(RESOURCE_STATE_UNDEFINED);
}
diff --git a/Graphics/GraphicsEngineD3D12/src/BufferD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/BufferD3D12Impl.cpp
index c89a7423..d7cd54b6 100644
--- a/Graphics/GraphicsEngineD3D12/src/BufferD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/BufferD3D12Impl.cpp
@@ -68,8 +68,8 @@ BufferD3D12Impl::BufferD3D12Impl(IReferenceCounters* pRefCounters,
LOG_ERROR_AND_THROW("Unified resources are not supported in Direct3D12");
}
- if (m_Desc.Usage == USAGE_STATIC)
- VERIFY(pBuffData != nullptr && pBuffData->pData != nullptr, "Initial data must not be null for static buffers");
+ if (m_Desc.Usage == USAGE_IMMUTABLE)
+ VERIFY(pBuffData != nullptr && pBuffData->pData != nullptr, "Initial data must not be null for immutable buffers");
if (m_Desc.Usage == USAGE_DYNAMIC)
VERIFY(pBuffData == nullptr || pBuffData->pData == nullptr, "Initial data must be null for dynamic buffers");
diff --git a/Graphics/GraphicsEngineD3D12/src/TextureD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/TextureD3D12Impl.cpp
index a4033f51..22829770 100644
--- a/Graphics/GraphicsEngineD3D12/src/TextureD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/TextureD3D12Impl.cpp
@@ -135,8 +135,8 @@ TextureD3D12Impl::TextureD3D12Impl(IReferenceCounters* pRefCounters,
const TextureData* pInitData /*= nullptr*/) :
TTextureBase{pRefCounters, TexViewObjAllocator, pRenderDeviceD3D12, TexDesc}
{
- if (m_Desc.Usage == USAGE_STATIC && (pInitData == nullptr || pInitData->pSubResources == nullptr))
- LOG_ERROR_AND_THROW("Static textures must be initialized with data at creation time: pInitData can't be null");
+ if (m_Desc.Usage == USAGE_IMMUTABLE && (pInitData == nullptr || pInitData->pSubResources == nullptr))
+ LOG_ERROR_AND_THROW("Immutable textures must be initialized with data at creation time: pInitData can't be null");
if ((m_Desc.MiscFlags & MISC_TEXTURE_FLAG_GENERATE_MIPS) != 0)
{
@@ -149,7 +149,7 @@ TextureD3D12Impl::TextureD3D12Impl(IReferenceCounters* pRefCounters,
D3D12_RESOURCE_DESC Desc = GetD3D12TextureDesc();
auto* pd3d12Device = pRenderDeviceD3D12->GetD3D12Device();
- if (m_Desc.Usage == USAGE_STATIC || m_Desc.Usage == USAGE_DEFAULT || m_Desc.Usage == USAGE_DYNAMIC)
+ if (m_Desc.Usage == USAGE_IMMUTABLE || m_Desc.Usage == USAGE_DEFAULT || m_Desc.Usage == USAGE_DYNAMIC)
{
D3D12_CLEAR_VALUE ClearValue = {};
D3D12_CLEAR_VALUE* pClearValue = nullptr;
diff --git a/Graphics/GraphicsEngineOpenGL/include/GLTypeConversions.hpp b/Graphics/GraphicsEngineOpenGL/include/GLTypeConversions.hpp
index a93528ec..4c57652f 100644
--- a/Graphics/GraphicsEngineOpenGL/include/GLTypeConversions.hpp
+++ b/Graphics/GraphicsEngineOpenGL/include/GLTypeConversions.hpp
@@ -82,7 +82,7 @@ inline GLenum UsageToGLUsage(const BufferDesc& Desc)
// DYNAMIC: The data store contents will be modified repeatedly and used many times.
// clang-format off
- case USAGE_STATIC: return GL_STATIC_DRAW;
+ case USAGE_IMMUTABLE: return GL_STATIC_DRAW;
case USAGE_DEFAULT: return GL_STATIC_DRAW;
case USAGE_UNIFIED: return GL_STATIC_DRAW;
case USAGE_DYNAMIC: return GL_DYNAMIC_DRAW;
diff --git a/Graphics/GraphicsEngineOpenGL/src/BufferGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/BufferGLImpl.cpp
index 4bba7d46..ac99cfa0 100644
--- a/Graphics/GraphicsEngineOpenGL/src/BufferGLImpl.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/BufferGLImpl.cpp
@@ -96,8 +96,8 @@ BufferGLImpl::BufferGLImpl(IReferenceCounters* pRefCounters,
LOG_ERROR_AND_THROW("Unified resources are not supported in OpenGL/GLES");
}
- if (m_Desc.Usage == USAGE_STATIC)
- VERIFY(pBuffData != nullptr && pBuffData->pData != nullptr, "Initial data must not be null for static buffers");
+ if (m_Desc.Usage == USAGE_IMMUTABLE)
+ VERIFY(pBuffData != nullptr && pBuffData->pData != nullptr, "Initial data must not be null for immutable buffers");
// TODO: find out if it affects performance if the buffer is originally bound to one target
// and then bound to another (such as first to GL_ARRAY_BUFFER and then to GL_UNIFORM_BUFFER)
diff --git a/Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp b/Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp
index 564d16cb..243ab1c9 100644
--- a/Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp
@@ -63,8 +63,8 @@ TextureBaseGL::TextureBaseGL(IReferenceCounters* pRefCounters,
// clang-format on
{
VERIFY(m_GLTexFormat != 0, "Unsupported texture format");
- if (TexDesc.Usage == USAGE_STATIC && pInitData == nullptr)
- LOG_ERROR_AND_THROW("Static Texture must be initialized with data at creation time");
+ if (TexDesc.Usage == USAGE_IMMUTABLE && pInitData == nullptr)
+ LOG_ERROR_AND_THROW("Immutable textures must be initialized with data at creation time");
if (TexDesc.Usage == USAGE_STAGING)
{
diff --git a/Graphics/GraphicsEngineVulkan/src/BufferVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/BufferVkImpl.cpp
index 8edb3472..3e61a756 100644
--- a/Graphics/GraphicsEngineVulkan/src/BufferVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/BufferVkImpl.cpp
@@ -59,8 +59,8 @@ BufferVkImpl::BufferVkImpl(IReferenceCounters* pRefCounters,
{
ValidateBufferInitData(BuffDesc, pBuffData);
- if (m_Desc.Usage == USAGE_STATIC)
- VERIFY(pBuffData != nullptr && pBuffData->pData != nullptr, "Initial data must not be null for static buffers");
+ if (m_Desc.Usage == USAGE_IMMUTABLE)
+ VERIFY(pBuffData != nullptr && pBuffData->pData != nullptr, "Initial data must not be null for immutable buffers");
if (m_Desc.Usage == USAGE_DYNAMIC)
VERIFY(pBuffData == nullptr || pBuffData->pData == nullptr, "Initial data must be null for dynamic buffers");
@@ -186,7 +186,7 @@ BufferVkImpl::BufferVkImpl(IReferenceCounters* pRefCounters,
VkMemoryPropertyFlags vkMemoryFlags = 0;
switch (m_Desc.Usage)
{
- case USAGE_STATIC:
+ case USAGE_IMMUTABLE:
case USAGE_DEFAULT:
case USAGE_DYNAMIC: // Dynamic buffer with SRV or UAV bind flag
vkMemoryFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
diff --git a/Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp
index 313de089..488e4bf6 100644
--- a/Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp
@@ -54,13 +54,13 @@ TextureVkImpl::TextureVkImpl(IReferenceCounters* pRefCounters,
}
// clang-format on
{
- if (m_Desc.Usage == USAGE_STATIC && (pInitData == nullptr || pInitData->pSubResources == nullptr))
- LOG_ERROR_AND_THROW("Static textures must be initialized with data at creation time: pInitData can't be null");
+ if (m_Desc.Usage == USAGE_IMMUTABLE && (pInitData == nullptr || pInitData->pSubResources == nullptr))
+ LOG_ERROR_AND_THROW("Immutable textures must be initialized with data at creation time: pInitData can't be null");
const auto& FmtAttribs = GetTextureFormatAttribs(m_Desc.Format);
const auto& LogicalDevice = pRenderDeviceVk->GetLogicalDevice();
- if (m_Desc.Usage == USAGE_STATIC || m_Desc.Usage == USAGE_DEFAULT || m_Desc.Usage == USAGE_DYNAMIC)
+ if (m_Desc.Usage == USAGE_IMMUTABLE || m_Desc.Usage == USAGE_DEFAULT || m_Desc.Usage == USAGE_DYNAMIC)
{
VkImageCreateInfo ImageCI = {};