Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions com.unity.render-pipelines.universal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fix for rendering thumbnails. [case 1348209](https://issuetracker.unity3d.com/issues/preview-of-assets-do-not-show-in-the-project-window)
- Fixed a regression bug where XR camera postion can not be modified in beginCameraRendering [case 1365000]
- Fixed an issue in where installing the Adaptive Performance package caused errors to the inspector UI [1368161](https://issuetracker.unity3d.com/issues/urp-package-throws-compilation-error-cs1525-when-imported-together-with-adaptive-performance-package)
- Fixed an issue with MSAA falling back to the incorrect value when sample count 2 is not supported on some Android GPUs

## [13.1.0] - 2021-09-24
### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,19 @@ 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
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ bool CanCopyDepth(ref CameraData cameraData)

// copying depth on GLES3 is giving invalid results. Needs investigation (Fogbugz issue 1339401)
if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.OpenGLES3)
msaaDepthResolve = false;
return false;

return supportsDepthCopy || msaaDepthResolve;
}
Expand Down