Skip to content

Commit

Permalink
[Vk] Old Adreno driver workaround was buggy
Browse files Browse the repository at this point in the history
Do not apply Adreno workarounds for the Turnip driver.
  • Loading branch information
darksylinc committed Apr 5, 2024
1 parent c11f82c commit eee6a04
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 3 additions & 1 deletion RenderSystems/Vulkan/src/OgreVulkanRenderSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,9 @@ namespace Ogre
rsc->addShaderProfile( "glslvk" );
rsc->addShaderProfile( "glsl" );

if( rsc->getVendor() == GPU_QUALCOMM )
// Turnip is the Mesa driver.
// These workarounds are for the proprietary driver.
if( rsc->getVendor() == GPU_QUALCOMM && rsc->getDeviceName().find( "Turnip" ) == String::npos )
{
#ifdef OGRE_VK_WORKAROUND_BAD_3D_BLIT
Workarounds::mBad3DBlit = true;
Expand Down
6 changes: 6 additions & 0 deletions RenderSystems/Vulkan/src/OgreVulkanTextureGpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ namespace Ogre

const PixelFormatGpu finalPixelFormat = getWorkaroundedPixelFormat( mPixelFormat );

// Unfortunately this is necessary, which means the abstraction may leak to the user.
// The pixel format is used in PSO generation, which creates a lot of issues I'm not willing
// to fix just because one old driver is broken. Setting mPixelFormat here fixes all issues so
// far encountered with old Adreno drivers.
mPixelFormat = finalPixelFormat;

VkImageCreateInfo imageInfo;
makeVkStruct( imageInfo, VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO );
imageInfo.imageType = getVulkanTextureType();
Expand Down
3 changes: 2 additions & 1 deletion RenderSystems/Vulkan/src/Vao/OgreVulkanVaoManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ namespace Ogre
#ifdef OGRE_VK_WORKAROUND_ADRENO_UBO64K
Workarounds::mAdrenoUbo64kLimitTriggered = false;
Workarounds::mAdrenoUbo64kLimit = 0u;
if( renderSystem->getCapabilities()->getVendor() == GPU_QUALCOMM )
if( renderSystem->getCapabilities()->getVendor() == GPU_QUALCOMM &&
renderSystem->getCapabilities()->getDeviceName().find( "Turnip" ) == String::npos )
{
mConstBufferMaxSize =
std::min<size_t>( mConstBufferMaxSize, 64u * 1024u - mConstBufferAlignment );
Expand Down

0 comments on commit eee6a04

Please sign in to comment.