Skip to content

Commit

Permalink
[content automatically redacted] touching PlatformDependent folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduardas Vitkus authored and Evergreen committed Oct 6, 2023
1 parent eda1b5c commit ee2b0f0
Showing 1 changed file with 0 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1440,19 +1440,6 @@ static RenderTextureDescriptor CreateRenderTextureDescriptor(Camera camera, floa
desc.bindMS = false;
desc.useDynamicScale = camera.allowDynamicResolution;

// The way RenderTextures handle MSAA fallback when an unsupported sample count of 2 is requested (falling back to numSamples = 1), differs fom the way
// the fallback is handled when setting up the Vulkan swapchain (rounding up numSamples to 4, if supported). This caused an issue on Mali GPUs which don't support
// 2x MSAA.
// The following code makes sure that on Vulkan the MSAA unsupported fallback behaviour is consistent between RenderTextures and Swapchain.
// TODO: we should review how all backends handle MSAA fallbacks and move these implementation details in engine code.
if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Vulkan)
{
// if the requested number of samples is 2, and the supported value is 1x, it means that 2x is unsupported on this GPU.
// Then we bump up the requested value to 4.
if (desc.msaaSamples == 2 && SystemInfo.GetRenderTextureSupportedMSAASampleCount(desc) == 1)
desc.msaaSamples = 4;
}

// check that the requested MSAA samples count is supported by the current platform. If it's not supported,
// replace the requested desc.msaaSamples value with the actual value the engine falls back to
desc.msaaSamples = SystemInfo.GetRenderTextureSupportedMSAASampleCount(desc);
Expand Down

0 comments on commit ee2b0f0

Please sign in to comment.