Skip to content

Commit

Permalink
Main: Texture - rename TU_NOT_SRV to TU_NOT_SAMPLED
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Jul 20, 2024
1 parent c70e2d9 commit 33b85d4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
16 changes: 9 additions & 7 deletions OgreMain/include/OgreTexture.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,23 @@ namespace Ogre {
/// Mipmaps will be automatically generated for this texture
TU_AUTOMIPMAP = 0x10,
/** This texture will be a render target, i.e. used as a target for render to texture
setting this flag will ignore all other texture usages except TU_AUTOMIPMAP, TU_UAV, TU_NOT_SRV */
setting this flag will ignore all other texture usages except TU_AUTOMIPMAP, TU_UNORDERED_ACCESS, TU_NOT_SAMPLED */
TU_RENDERTARGET = 0x20,
/// Texture would not be used as Shader Resource View, i.e. as regular texture.
/// That flag could be combined with TU_RENDERTARGET or TU_UAV to remove possible limitations on some hardware
TU_NOT_SRV = 0x40,
/// Texture will not be sampled inside a shader i.e. used as regular texture.
/// When used with TU_RENDERTARGET this can improve performance and compatibility with FL9.1 hardware
TU_NOT_SAMPLED = 0x40,
/// Texture can be bound as an Unordered Access View
/// (imageStore/imageRead/glBindImageTexture in GL jargon)
TU_UNORDERED_ACCESS = 0x80,
/// Texture can be used as an UAV, but not as a regular texture.
TU_UAV_NOT_SRV = TU_UNORDERED_ACCESS | TU_NOT_SRV,
/// Default to automatic mipmap generation static textures
TU_DEFAULT = TU_AUTOMIPMAP | HBU_GPU_ONLY,

/// @deprecated
TU_NOTSHADERRESOURCE = TU_NOT_SRV,
TU_UAV_NOT_SRV = TU_UNORDERED_ACCESS | TU_NOT_SAMPLED,
/// @deprecated
TU_NOT_SRV = TU_NOT_SAMPLED,
/// @deprecated
TU_NOTSHADERRESOURCE = TU_NOT_SAMPLED,
/// @deprecated
TU_UAV = TU_UNORDERED_ACCESS
};
Expand Down
2 changes: 1 addition & 1 deletion RenderSystems/Direct3D11/src/OgreD3D11Mappings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ namespace Ogre
}

UINT retVal = 0;
if( !(usage & TU_NOT_SRV) )
if( !(usage & TU_NOT_SAMPLED) )
retVal |= D3D11_BIND_SHADER_RESOURCE;

if( isRenderTarget )
Expand Down
2 changes: 1 addition & 1 deletion RenderSystems/Direct3D11/src/OgreD3D11Texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ namespace Ogre
D3D11RenderSystem* rsys = static_cast<D3D11RenderSystem*>(Root::getSingleton().getRenderSystem());
// http://msdn.microsoft.com/en-us/library/windows/desktop/ff476150%28v=vs.85%29.aspx#ID3D11Device_CreateTexture2D
// 10Level9, When using D3D11_BIND_SHADER_RESOURCE, SampleDesc.Count must be 1.
if(rsys->_getFeatureLevel() >= D3D_FEATURE_LEVEL_10_0 || (mUsage & TU_NOT_SRV))
if(rsys->_getFeatureLevel() >= D3D_FEATURE_LEVEL_10_0 || (mUsage & TU_NOT_SAMPLED))
rsys->determineFSAASettings(mFSAA, mFSAAHint, mD3DFormat, &mFSAAType);
}

Expand Down
2 changes: 1 addition & 1 deletion RenderSystems/Metal/src/OgreMetalTexture.mm
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ of this software and associated documentation files (the "Software"), to deal
if( mUsage & TU_UNORDERED_ACCESS )
desc.usage |= MTLTextureUsageShaderWrite;

if( mUsage & (TU_UNORDERED_ACCESS|TU_NOT_SRV|TU_RENDERTARGET) )
if( mUsage & (TU_UNORDERED_ACCESS|TU_NOT_SAMPLED|TU_RENDERTARGET) )
desc.storageMode = MTLStorageModePrivate;

mTexture = [mDevice->mDevice newTextureWithDescriptor:desc];
Expand Down
4 changes: 2 additions & 2 deletions RenderSystems/Vulkan/src/OgreVulkanTextureGpuManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ namespace Ogre
bool VulkanTextureGpuManager::checkSupport( PixelFormatGpu format, uint32 textureFlags ) const
{
OGRE_ASSERT_LOW(
textureFlags != TU_NOT_SRV &&
textureFlags != TU_NOT_SAMPLED &&
"Invalid textureFlags combination. Asking to check if format is supported to do nothing" );

const VkFormat vkFormat = VulkanMappings::get( format );
Expand All @@ -152,7 +152,7 @@ namespace Ogre

uint32 features = 0;

if( !( textureFlags & TU_NOT_SRV ) )
if( !( textureFlags & TU_NOT_SAMPLED ) )
features |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT;

if( textureFlags & TU_UNORDERED_ACCESS )
Expand Down

0 comments on commit 33b85d4

Please sign in to comment.