-
Notifications
You must be signed in to change notification settings - Fork 862
Fix GLES3 cubemap array support #2346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
phi-lira
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Do we need to have something similar to OpenGL core?
Had a quick look and I don't think we need to change the gl core version. |
|
Sorry, I ended up missing this PR. It should have been merged a while ago. Running yamato. |
# Conflicts: # com.unity.render-pipelines.universal/CHANGELOG.md
…hnologies/Graphics into universal/fix-gles3-api-macros # Conflicts: # com.unity.render-pipelines.universal/CHANGELOG.md
|
Failures not introduced by this PR. |
This change updates the platform shader macros in GLCore.hlsl to enable support for TextureGather operations on Unity's 4.5 shader target. The changes in this PR are based off of GH #2346 which modified the GLES3.hlsl file in order to fix cubemap array support. This PR basically takes those same changes and applies them to GLCore.hlsl in addition. This commit also adds some missing component specific macros for texture gather (red, green, blue, alpha).
* Update TextureGather Macros in GLCore.hlsl This change updates the platform shader macros in GLCore.hlsl to enable support for TextureGather operations on Unity's 4.5 shader target. The changes in this PR are based off of GH #2346 which modified the GLES3.hlsl file in order to fix cubemap array support. This PR basically takes those same changes and applies them to GLCore.hlsl in addition. This commit also adds some missing component specific macros for texture gather (red, green, blue, alpha). * Update Changelog This commit updates the changelog to reflect the recent changes to the GLCore.hlsl header.
Issue introduced at #2346 See this conversation
This change updates the platform shader macros in GLCore.hlsl to enable support for TextureGather operations on Unity's 4.5 shader target. The changes in this PR are based off of GH #2346 which modified the GLES3.hlsl file in order to fix cubemap array support. This PR basically takes those same changes and applies them to GLCore.hlsl in addition. This commit also adds some missing component specific macros for texture gather (red, green, blue, alpha).
This change updates the platform shader macros in GLCore.hlsl to enable support for TextureGather operations on Unity's 4.5 shader target. The changes in this PR are based off of GH #2346 which modified the GLES3.hlsl file in order to fix cubemap array support. This PR basically takes those same changes and applies them to GLCore.hlsl in addition. This commit also adds some missing component specific macros for texture gather (red, green, blue, alpha).
* Common FSR Utilities in SRP Core * Common FSR Utilities for SRPs This change adds two new utility files to SRP core to make it easier to use FSR in SRPs. The FSRUtils C# class contains a port of the FSR constant values setup code from the HLSL files. This is needed for SRPs that do not support writing to buffers from inside a shader. The FSRCommon HLSL include contains helper functions for using EASU and RCAS inside the Unity shader environment. The two files must be used together since they are tightly coupled by the identifiers used for the shader constants. * [URP] Upscaling Filters & FXAA Scaling Logic * Move FXAA Logic to Common.hlsl This change moves the FXAA HLSL implementation into the common post processing shader file. This will make it easier to execute the FXAA shader logic outside of the FinalPost pass which is a prerequisite for FSR. This change also modifies the FXAA Load helper function to make it use point sampling instead of linear sampling on GLES. This should yield more consistent behavior between GLES and non-GLES environments. * Upscaling Filter Controls This change adds a new property to the pipeline asset that allows users to control which filter is used when upscaling is performed. The current implementation supports selecting either bilinear or nearest-neighbor. Additional methods of filtering will be added in future changes. * Converted isScaledRender to an Enum This change adds a new enum called ImageScaling which enumerates all possible image scaling scenarios. This helps make the scaling related conditional logic easier to read. * Add Automatic Upscaling Filter This change splits the upscaling filter selected by the user from the one used within URP's implementation to allow for a "meta filter" called Auto. This new filter automatically switches between bilinear and nearest-neighbor filtering based on the current rendering environment's ability to perform integer scaling. * Rename Point Sampling Shader Macro This change renames the _FILTER_POINT macro to _POINT_SAMPLING to improve consistency with future FSR changes. * Fix XR Compatibility for FXAA Common Code This change updates the FXAA common shader functions to support 2d array input textures which are used in XR's single pass instanced mode. * Upscaling Filter Tests for URP This commit adds new test cases for the upscaling filters that were added in a previous change. * Replace TemporaryRT with RTHandle This change updates the upscaling setup logic to use an RTHandle instead of a temporary render target. * Updated Changelog Updated the URP changelog to reflect the upscaling filter changes and the FXAA scaling fix. * Fix Black Screen for XR This change resolves a black screen issue on XR platforms (tested in the mock HMD) which was caused by missing support for draw procedural in the upscaling setup shader. * Revert Auto-Format Changes This commit reverts the auto-format changes made in PostProcessData.asset. * Upscale Setup Shader Naming Consistency Fix This commit renames upscaleSetupPs -> upscaleSetupPS to make the naming consistent with other shaders. * Apply Review Feedback This commit addresses various pieces of review feedback such as missing docs, renames, and data visibility. It also fixes a draw procedural related multi-compile option. * Comment Updates for UpscaleSetup.shader This change adds a comment block in the upscaling setup shader that describes the cases where it's used and why. * Renamed UpscaleSetup to ScalingSetup This change renames the extra scaling blit pass to better communicate that it can be used in both upscaling and downscaling scenarios. * Reworded Changelog Notes This change adds additional information to the changelog notes for the upscaling filters. * [URP] Port HDRP Mip Bias Logic to URP * Port HDRP Mip Bias Logic to URP This change integrates the mip bias logic from HDRP into URP. This logic ensures that shaders select their mips based on the final screen resolution rather than the current render resolution. In cases where aggressive upscaling is taking place, this can significantly improve texture detail in the final image. * Combined Mip Bias Constants Into Vector This change combines the mip bias shader constants into a single vector rather than having two separate scalar values. This may improve performance on older mobile devices and shouldn't hurt performance on modern ones. * 16-Bit FSR Cleanup & Fixes This change removes the 16-bit option in the FSRCommon.hlsl in favor of an automatic solution based on REAL_IS_HALF. Users of the FSR code no longer need to explicitly opt-in to the 16-bit implementation. It will now be enabled automatically whenever the target platform has support. Some vendors have issues with 16-bit floating point casts to uint16 which are required for FSR's math approximations. This issue only occurs on DX11 drivers, so the 16-bit implementation is currently disabled whenever DX11 is in use until this is fixed. This change also contains a small modification for the uint to float conversion logic used inside FSRUtils.cs:SetRcasConstants. The updated logic avoids an unnecessary memory allocation which was causing failures in URP's graphics tests. * Add FSR Upscaling Filter to URP This change adds a new upscaling filter to URP that uses FidelityFX Super Resolution. It is only available on platforms that support shader target 4.5 or above. On unsupported platforms, it will behave as if the user selected the "Auto" filter in the pipeline asset. Unlike other filters, this filter will execute even when the renderer is not configured to scale. HDRP has the same behavior. This allows the FSR shaders to improve visual quality even when scaling is not active. * Misc Backport Merge Fixup This change removes some lines that were added by accident during the merge process and also adds some logic to release temporary render targets which were created during the backport process. * Add Updated Validation Exception File This file keeps getting automatically modified so it seems like it should be updated as part of the backport. * Fixed SetPerCameraShaderVariables * * Moved `SetPerCameraShaderVariables` into percamera setup scope. This call has to be called after SetupCameraProperties to reset the values. * * Moved SetCameraMatrices call inside the SetPerCameraShaderVariables * * Updated CHANGELOG.md. Co-authored-by: Felipe Lira <[email protected]> * Update TextureGather Macros in GLCore.hlsl This change updates the platform shader macros in GLCore.hlsl to enable support for TextureGather operations on Unity's 4.5 shader target. The changes in this PR are based off of GH #2346 which modified the GLES3.hlsl file in order to fix cubemap array support. This PR basically takes those same changes and applies them to GLCore.hlsl in addition. This commit also adds some missing component specific macros for texture gather (red, green, blue, alpha). Co-authored-by: thomas-zeng <[email protected]> Co-authored-by: Felipe Lira <[email protected]>
Bonus : Including changes from https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/295 (cc @gabriel-delacruz) commit c7ed2f6 Author: Paul Demeulenaere <[email protected]> Date: Mon Feb 21 15:38:13 2022 +0100 Update changelog.md commit 351ec2a Author: Paul Demeulenaere <[email protected]> Date: Mon Feb 21 15:13:10 2022 +0100 Fix OGL in Standalone - "opengl" corresponds to "kShaderCompPlatformGL_Obsolete" (GL2+) - "glcore" is "kShaderCompPlatformOpenGLCore" (GL 3+ supports compute) I don't explain why it sometimes works in editor or sometimes completly silent. ¯¯\_(ヅ)_/¯¯ See https://github.cds.internal.unity3d.com/unity/unity/blob/8d5d36f123d953029e8bf8f982576aa6a0696a2d/Tools/UnityShaderCompiler/ShaderCompilerClient.h#L35 See also special alias declaration https://github.cds.internal.unity3d.com/unity/unity/blob/5a8e0e752a3977687cd273e5692567e834e3f27b/Tools/UnityShaderCompiler/Utilities/ShaderImportUtils.cpp#L51 Fix case https://fogbugz.unity3d.com/f/cases/1403988/ commit 734850d Merge: a700c33 778ddac Author: Paul Demeulenaere <[email protected]> Date: Mon Feb 21 09:19:44 2022 +0100 Merge branch 'master' into vfx/fix/1392834-remove-invalid-vfx-passes-from-sg commit a700c33 Author: Paul Demeulenaere <[email protected]> Date: Thu Feb 17 17:01:26 2022 +0100 *Apply formatting commit bfd7d6c Author: Paul Demeulenaere <[email protected]> Date: Thu Feb 17 16:52:05 2022 +0100 kPragmaDescriptorNone isn't null Simpler to avoid multiple search for replacement Resolve issue #7025 (comment) commit 350e4aa Author: Paul Demeulenaere <[email protected]> Date: Thu Feb 17 12:01:07 2022 +0100 *Add correct support of #pragma require cubearray Several cases where needed - Compute (and implicit compute like sorting) - Builtin Output - SG Output commit 882bdb7 Author: Paul Demeulenaere <[email protected]> Date: Thu Feb 17 10:12:18 2022 +0100 Correct implementation VFXCommon.hlsl TODO: Add needed pragma dynamically https://unity.slack.com/archives/C02TGPN8MRV/p1644932447721759?thread_ts=1644242387.827459&cid=C02TGPN8MRV commit 4bb5cac Merge: da0454c a4b081a Author: Paul Demeulenaere <[email protected]> Date: Thu Feb 17 09:52:47 2022 +0100 Merge branch 'master' into vfx/fix/1392834-remove-invalid-vfx-passes-from-sg # Conflicts: # com.unity.visualeffectgraph/CHANGELOG.md commit da0454c Author: Paul Demeulenaere <[email protected]> Date: Thu Feb 17 09:52:10 2022 +0100 Revert "Workaround" This reverts commit 6a70285. commit 6a70285 Author: Paul Demeulenaere <[email protected]> Date: Fri Feb 11 09:28:49 2022 +0100 Workaround Issue introduced at #2346 See this conversation commit ca0371d Author: Gregory Mitrano <[email protected]> Date: Wed Feb 9 08:19:20 2022 -0500 Fix Regression in GLCore from GH #7029 The changes in GH #7029 accidentally broke the platform shader macro override system for GLCore's texture cube arrays. This change fixes the issue by restoring the missing platform macros. commit 3683c87 Author: Paul Demeulenaere <[email protected]> Date: Tue Feb 8 18:28:45 2022 +0100 Revert unexpected merge change commit dbf2964 Merge: 3032c86 f70620a Author: Paul Demeulenaere <[email protected]> Date: Tue Feb 8 18:03:15 2022 +0100 Merge branch 'master' into vfx/fix/1392834-remove-invalid-vfx-passes-from-sg commit 3032c86 Author: Paul Demeulenaere <[email protected]> Date: Mon Feb 7 16:44:26 2022 +0100 *Update changelog.md commit 033b409 Author: Paul Demeulenaere <[email protected]> Date: Mon Feb 7 16:40:32 2022 +0100 *Update comment To anticipate incoming change with GetInstancingAdditionalDefines commit 4f88add Author: Paul Demeulenaere <[email protected]> Date: Mon Feb 7 16:31:32 2022 +0100 Add OpenGL in target Early detecting VFX compilation error commit f4513a7 Author: Paul Demeulenaere <[email protected]> Date: Mon Feb 7 16:22:06 2022 +0100 Fix build of GLCore.hlsl Fix failure com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl(66) https://github.com/Unity-Technologies/Graphics/blob/65776aefaaa7f24455cc4b5fa8b3b90c8dd606b7/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl#L66 commit 7fed326 Author: Paul Demeulenaere <[email protected]> Date: Mon Feb 7 16:03:44 2022 +0100 Same instancing option removal in HDRP commit 16fae6c Author: Paul Demeulenaere <[email protected]> Date: Mon Feb 7 15:56:37 2022 +0100 Removing pass was wrong, replace pragma Some needed pass uses the default target 2.0 on URP and it can be problematic to change the pass count Bonus : add a mechanism to remove useless instancing multicompile commit 9789e99 Author: Paul Demeulenaere <[email protected]> Date: Fri Feb 4 17:19:30 2022 +0100 Statify kInvalidPassWithPragmas commit c26c54b Merge: e348f54 5850cf7 Author: Paul Demeulenaere <[email protected]> Date: Fri Feb 4 16:56:57 2022 +0100 Merge branch 'master' into vfx/fix/1392834-remove-invalid-vfx-passes-from-sg commit e348f54 Author: Paul Demeulenaere <[email protected]> Date: Tue Feb 1 17:37:43 2022 +0100 Draft removing target 2.0 See https://fogbugz.unity3d.com/f/cases/1392834/ See also this conversation https://unity.slack.com/archives/G1BTWN88Z/p1643362523117700 # Conflicts: # com.unity.visualeffectgraph/CHANGELOG.md # com.unity.visualeffectgraph/Shaders/SDFBaker/GenSdfRayMap.compute # com.unity.visualeffectgraph/Shaders/Sort.compute # com.unity.visualeffectgraph/Shaders/UpdateStrips.compute # com.unity.visualeffectgraph/Shaders/VFXCameraSort.template # com.unity.visualeffectgraph/Shaders/VFXCopyBuffer.compute # com.unity.visualeffectgraph/Shaders/VFXFillIndirectArgs.compute # com.unity.visualeffectgraph/Shaders/VFXInit.template # com.unity.visualeffectgraph/Shaders/VFXOutputUpdate.template # com.unity.visualeffectgraph/Shaders/VFXUpdate.template
Checklist for PR maker
need-backport-*label. After you backport the PR, the label changes tobackported-*.CHANGELOG.mdfile.Purpose of this PR
Fix case 1285132, a compile error when trying to use SAMPLE_TEXTURECUBE_ARRAY_LOD with OpenGL ES 3.x
Testing status
manual with repro project