diff --git a/LocalTestProjects/HDRP_DebugCrossFade_Tests/Packages/manifest.json b/LocalTestProjects/HDRP_DebugCrossFade_Tests/Packages/manifest.json index 8a66eb82fcc..5ff88c912ad 100644 --- a/LocalTestProjects/HDRP_DebugCrossFade_Tests/Packages/manifest.json +++ b/LocalTestProjects/HDRP_DebugCrossFade_Tests/Packages/manifest.json @@ -10,7 +10,6 @@ "com.unity.ide.vscode": "1.0.7", "com.unity.multiplayer-hlapi": "1.0.2", "com.unity.package-manager-ui": "2.2.0", - "com.unity.purchasing": "2.0.6", "com.unity.render-pipelines.core": "file:../../../com.unity.render-pipelines.core", "com.unity.render-pipelines.high-definition": "file:../../../com.unity.render-pipelines.high-definition", "com.unity.shadergraph": "file:../../../com.unity.shadergraph", diff --git a/TestProjects/HDRP_DXR_Tests/Packages/manifest.json b/TestProjects/HDRP_DXR_Tests/Packages/manifest.json index f1f36045302..d2883506f56 100644 --- a/TestProjects/HDRP_DXR_Tests/Packages/manifest.json +++ b/TestProjects/HDRP_DXR_Tests/Packages/manifest.json @@ -7,7 +7,6 @@ "com.unity.collab-proxy": "1.3.7", "com.unity.ide.visualstudio": "2.0.0", "com.unity.ide.vscode": "1.1.4", - "com.unity.purchasing": "2.0.6", "com.unity.render-pipelines.core": "file:../../../com.unity.render-pipelines.core", "com.unity.render-pipelines.high-definition": "file:../../../com.unity.render-pipelines.high-definition", "com.unity.render-pipelines.high-definition-config": "file:../../../com.unity.render-pipelines.high-definition-config", diff --git a/TestProjects/HDRP_HybridTests/Packages/packages-lock.json b/TestProjects/HDRP_HybridTests/Packages/packages-lock.json index 2afdeb9ad61..52f463f5236 100644 --- a/TestProjects/HDRP_HybridTests/Packages/packages-lock.json +++ b/TestProjects/HDRP_HybridTests/Packages/packages-lock.json @@ -199,13 +199,6 @@ }, "url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" }, - "com.unity.purchasing": { - "version": "2.0.6", - "depth": 0, - "source": "registry", - "dependencies": {}, - "url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" - }, "com.unity.render-pipelines.core": { "version": "file:../../../com.unity.render-pipelines.core", "depth": 0, diff --git a/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/OSXPlayer/Metal/None/003-VirtualTexturing.png b/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/OSXPlayer/Metal/None/003-VirtualTexturing.png index 88ffdf677b0..bcf7d4ce328 100644 --- a/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/OSXPlayer/Metal/None/003-VirtualTexturing.png +++ b/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/OSXPlayer/Metal/None/003-VirtualTexturing.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ea5c4c862a23ef93713d95d88c267258de3f0f39f3e1a421e78f1d93a15d47f3 -size 786703 +oid sha256:b1e3a6fdf60f1f619fe0aa2befb99df9474c9b7776ce0cfa49c69e52ad278f25 +size 681436 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1207_Lit_Displacement.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1207_Lit_Displacement.png index cc3b18b9b50..25663708eaa 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1207_Lit_Displacement.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1207_Lit_Displacement.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2acb5f1070bf20a54a426f30a8177f3f70907a1c1f31fdb1817418c3980c0c8d -size 700760 +oid sha256:f220d924f3f7d05ea6ddb08ff75e09da1071684365c9022b251571f41c421b0e +size 811091 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1214_Lit_LowResTransparent.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1214_Lit_LowResTransparent.png index 589fbe15e21..f3e87e326ea 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1214_Lit_LowResTransparent.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1214_Lit_LowResTransparent.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6de0cd25415389166baaff6079c3962450e70c40a90f4fce9179b5cb29166ad5 -size 553698 +oid sha256:035494ce41a09ca616c8d0473f7493e8a0dcb68623b9678af81928fe46c36b64 +size 625342 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1701_Decals.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1701_Decals.png index 14af021ce44..00a19a6ca17 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1701_Decals.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1701_Decals.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dcbee784cf9350d8c46a904abe5bf433a67d83bbaa6c50db6c99269e94038420 -size 221689 +oid sha256:dc307d608b073604a5558d18fa6c1f6657dedc7feab335f7f9e34ce92ebd030e +size 257905 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1702_MeshDecals.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1702_MeshDecals.png index 3caa95c569e..1a170140cbe 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1702_MeshDecals.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1702_MeshDecals.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:15edb32713e1f8ee997943047af1785e414ca659b1948112efba910c06ac17e3 -size 218170 +oid sha256:9b49bd17ebf2c033dd3d2cb6b61e45434ac6f1377b5f0b3278df0aba101613ce +size 253798 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1704_Decals-Settings.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1704_Decals-Settings.png index b5f8361464d..2a1caa8ec8f 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1704_Decals-Settings.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1704_Decals-Settings.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f5dce3836c79dfbc63551ab6394717f221acbf6206c821d76f130b1b41db5d31 -size 209208 +oid sha256:be6f836ca07f6071a17d2677bb0e62ea0227eca170b0f70bdbc9540aede65262 +size 243784 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1706_DecalsSG.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1706_DecalsSG.png index abb8f566f47..4951ef28c71 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1706_DecalsSG.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1706_DecalsSG.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d8d03eb3ef66fe14244d8fa8212cd28dd6d3594b54bb8b0ab98df08c395b65b5 -size 221615 +oid sha256:e374b254c3d3f8afe558a520435a886fbbf9c61c49b8648e4189526db755a52c +size 257834 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1707-Decals-FadeFactorAndDistance.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1707-Decals-FadeFactorAndDistance.png index 2fe52cdce39..0418f6ce942 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1707-Decals-FadeFactorAndDistance.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1707-Decals-FadeFactorAndDistance.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0e0d33c6984900be44cc5f2338fc1f96fc7773b018935205530b17a139364cbb -size 227256 +oid sha256:787c55dfea473d2293517a72e9b957d6614b24d8f1af666ff8ef6421bbf27456 +size 263615 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1708_DecalsSG_on_SG.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1708_DecalsSG_on_SG.png index 4ccec79df00..0154a52b682 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1708_DecalsSG_on_SG.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1708_DecalsSG_on_SG.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2dc755b309fae1396979f37c4c829f2599ba916f2217af554c1111955d6089c3 -size 105986 +oid sha256:b609bcab110973dfb656b6581e146fd69b84acbf95f9d97183a5d20e74547082 +size 124455 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1709_DecalLayer_ForwardMSAA.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1709_DecalLayer_ForwardMSAA.png index 3d6e7d70624..7013d314558 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1709_DecalLayer_ForwardMSAA.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1709_DecalLayer_ForwardMSAA.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d461c59beecfd2e4446dd44191193a2f82da406a3fe646c28620edb492dcc7b1 -size 39579 +oid sha256:103c35ee3685183e507c01ef898f76255d419c5efe8cb1fe431962323adbdae8 +size 33502 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1711_DecalMasks_3RT.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1711_DecalMasks_3RT.png index 440e7e6c148..776b4e6c51e 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1711_DecalMasks_3RT.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1711_DecalMasks_3RT.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ccb3947455e8a764bc4ceae7f606f4b67c5208997699819b1e011e8362710b03 -size 253363 +oid sha256:f3316fff7f958e7587d5518a2af3dfab868a6127960305af54f6dd607baa2033 +size 291242 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1711_DecalMasks_4RT.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1711_DecalMasks_4RT.png index 1006dcfa9ac..c92ec512e48 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1711_DecalMasks_4RT.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1711_DecalMasks_4RT.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ac87e11014e92ec596a7ad29a9889dc0d0d48404c2b50212863256094de74064 -size 260399 +oid sha256:c33e4bab097c0c93fcc301488a811b641d43fce3b6f09c38ff306f4d6c8d639a +size 299546 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/2001_Light_DynamicDirectional.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/2001_Light_DynamicDirectional.png index 8cb1bdef24e..f15596da520 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/2001_Light_DynamicDirectional.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/2001_Light_DynamicDirectional.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bed75ddf764d56fd5b7ec51a5f40ef2a99c1b6f61baf8ceb658d0ad924c6a66c -size 145538 +oid sha256:dfad02a84d358bcdf353eeb8c1bcf328d2ac38d7686e08018fc021bebc063e9e +size 163889 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/2205_LightLoopCullWOblique.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/2205_LightLoopCullWOblique.png index a2866c99a10..c3d16dcbf9f 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/2205_LightLoopCullWOblique.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/2205_LightLoopCullWOblique.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:19cd459f73f4e2478900b941b9dce51393013e1ade954ecb89216abc81acb8f4 -size 395760 +oid sha256:4e02122a854e791c7d2d82037cb53dcec6df46cf95144bff14f3d6bf3016ced9 +size 452154 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/3003_LightingMode.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/3003_LightingMode.png index 31231c25685..a4b62356031 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/3003_LightingMode.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/3003_LightingMode.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:07379891af802972bdfd165060448090a73a668c090f1cd9106c79bb95eb6fda -size 293728 +oid sha256:3cfaa03d03fae33d071465ddd2c7fcdf3df6f6be6a5703c133c59a0e173780d9 +size 334889 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4075_PhysicalCamera-gateFit.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4075_PhysicalCamera-gateFit.png index 2c8846eae89..821989bc3a3 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4075_PhysicalCamera-gateFit.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4075_PhysicalCamera-gateFit.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f3a6c10a9277a8234cf24e195c322f0b2479d5c2f54e81111c849e6e6aa51925 -size 965712 +oid sha256:64a50525ee5779fffe7ce645682dba3c49f033838356c413c1e2e6fbd563aea4 +size 1117746 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4076_PhysicalCamera-lensShift.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4076_PhysicalCamera-lensShift.png index a2153e5dcae..ca2620106ca 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4076_PhysicalCamera-lensShift.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/4076_PhysicalCamera-lensShift.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a21ee2256d6b95dbbcc659ff75ac036a4f9e34b00ba7368f858efcb3b9b458f8 -size 510116 +oid sha256:59757b8cb36ef23b809101fd1d8e9c472577670ef5be859f3c3f0ce8ab2c859c +size 596984 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5009_HDRI_Sky_Flow.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5009_HDRI_Sky_Flow.png index c2708ea8cf0..2a949a1cf37 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5009_HDRI_Sky_Flow.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5009_HDRI_Sky_Flow.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f6a0299253321dc2d79afe80aa1ea4880bca64435c31b0140ec65f04e362f687 -size 282630 +oid sha256:30b219cd45b6a4d28268a6eec99e000ea7098f043fc70ef7842ee7569f692635 +size 330520 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/8101_Opaque.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/8101_Opaque.png index e18912142f9..6be792f4f4e 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/8101_Opaque.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/8101_Opaque.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b96212feafb179a4a7419f1332d5821827dd1d01dedff20e7948cafd800dab41 -size 168811 +oid sha256:54c472263a3d4357e14c83b490c0ebb726f10710da398c961b18e4a1ab4f0452 +size 194706 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/8204_CustomSpecOcclusion.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/8204_CustomSpecOcclusion.png index a97006b3d0c..d21eb5c8ee3 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/8204_CustomSpecOcclusion.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/8204_CustomSpecOcclusion.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ea3b11d2f2369d7f303d2eb0946f5a2a61ad2fed91ea156eb474c48ad7514c82 -size 22417 +oid sha256:2d0cd94ecf301a55ee93474d3c9676b9bc7ac80604d1f58f6b8df79c382ac26f +size 26254 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9402_AlphaToMask-Graph.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9402_AlphaToMask-Graph.png index 6cbfda557a2..974683ec7d4 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9402_AlphaToMask-Graph.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9402_AlphaToMask-Graph.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:faf1bea27fa7778d0cf669585ef3217462777a2fc660fcc3e692790b0c5a15fd -size 31667 +oid sha256:97337c2c8e4a9fdc79478b79cca5c222e79685bd5c2f2b12543981e7f791dc9e +size 33636 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9402_AlphaToMask-HDRP.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9402_AlphaToMask-HDRP.png index 765fb27d9fb..3a4888404f0 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9402_AlphaToMask-HDRP.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9402_AlphaToMask-HDRP.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bd7205c20fb386500274fe63a9ee16270ff5c228d0366db8f6bd2f7dde2130bf -size 75576 +oid sha256:3304525da2e3daedb6843c1c456d2d064f135896b18afa46d8c88fc2edba1f9a +size 82969 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9500_LightScripting.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9500_LightScripting.png index bac737b0d83..07220f4dfda 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9500_LightScripting.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9500_LightScripting.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e759384bce30ed31474523daa080c93315c84244a8c1ea69740a9f3015e9f387 -size 203960 +oid sha256:5814fc24ac14214de30c9935fca7fe1be383f5e900baabf23c7ccc3e4e5b3137 +size 242213 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9601_SkinnedMeshBatching-Off.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9601_SkinnedMeshBatching-Off.png index c00deef22d9..e3dc14f3dec 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9601_SkinnedMeshBatching-Off.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9601_SkinnedMeshBatching-Off.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4079daaa42dfe27688b9e9898fca21642b1436c6a8459392e7f4a2e1713c13cd -size 96785 +oid sha256:896979e15ab271de271393fb8cc3f4c63eae94004ecc805d7126819fa5528ce3 +size 111203 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9602_SkinnedMeshBatching-On.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9602_SkinnedMeshBatching-On.png index 984da1852d2..1710da66bdd 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9602_SkinnedMeshBatching-On.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9602_SkinnedMeshBatching-On.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:374a147412a217c19f788d4e1778da11cfbfb2d6e68d7a4a594b29b43cb47955 -size 96775 +oid sha256:31cd0cf7450d55e0c02ed260112aafc375245a6ae4976071e73917645a5f3815 +size 111206 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9603_MeshRendererBatching-Off.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9603_MeshRendererBatching-Off.png index 6fa75cdfc25..82a2c779b81 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9603_MeshRendererBatching-Off.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9603_MeshRendererBatching-Off.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3a7b786ca6795ef090b6c9de34c91b76e6c9629a1f441edbae5a2f6eac399942 -size 513181 +oid sha256:bd2c6682542c4f53292e393f34232a0cbb24a4d86fc37d03893937407e275ae8 +size 581563 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9604_MeshRendererBatching-On.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9604_MeshRendererBatching-On.png index da8a4555d5f..7b93deda64a 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9604_MeshRendererBatching-On.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9604_MeshRendererBatching-On.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:58679cffb86978280daa375fe87e4e1604893f8d0d99d0345e85677835b04b44 -size 512995 +oid sha256:92b89448382c0142837649ddfb4eecbceed320cd6b00b2c393f128c204d1654c +size 581359 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9801_ShurikenLightModule.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9801_ShurikenLightModule.png index 71e2a533a05..e50fd69355f 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9801_ShurikenLightModule.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/9801_ShurikenLightModule.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:df00be913a0c8aec5ba165605e5566ed567c44d3557c52639d2ae645be00b308 -size 75727 +oid sha256:964354fb99677036032f90c13c50d59d5e61d689221138d137448046d69b53fd +size 85901 diff --git a/TestProjects/UniversalHybridTest/Packages/packages-lock.json b/TestProjects/UniversalHybridTest/Packages/packages-lock.json index 0a90af1ee9d..b46c543b750 100644 --- a/TestProjects/UniversalHybridTest/Packages/packages-lock.json +++ b/TestProjects/UniversalHybridTest/Packages/packages-lock.json @@ -191,13 +191,6 @@ }, "url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" }, - "com.unity.purchasing": { - "version": "2.0.6", - "depth": 0, - "source": "registry", - "dependencies": {}, - "url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" - }, "com.unity.render-pipelines.core": { "version": "file:../../../com.unity.render-pipelines.core", "depth": 0, diff --git a/com.unity.render-pipelines.core/Runtime/Textures/MSAASamples.cs b/com.unity.render-pipelines.core/Runtime/Textures/MSAASamples.cs index 894ec48e6d8..4dad117edb1 100644 --- a/com.unity.render-pipelines.core/Runtime/Textures/MSAASamples.cs +++ b/com.unity.render-pipelines.core/Runtime/Textures/MSAASamples.cs @@ -1,3 +1,7 @@ +using System; +using UnityEngine; +using UnityEngine.Experimental.Rendering; + namespace UnityEngine.Rendering { /// @@ -14,4 +18,52 @@ public enum MSAASamples /// MSAA 8X. MSAA8x = 8 } + + public static class MSAASamplesExtensions + { + public static FormatUsage AsFormatUsage(this MSAASamples samples) + { + switch (samples) + { + case MSAASamples.MSAA2x: + return FormatUsage.MSAA2x; + case MSAASamples.MSAA4x: + return FormatUsage.MSAA4x; + case MSAASamples.MSAA8x: + return FormatUsage.MSAA8x; + default: + return FormatUsage.Render; + } + } + + public static MSAASamples Validate(this MSAASamples samples) + { + if (samples == MSAASamples.None) + return samples; + + GraphicsFormat ldrFormat = SystemInfo.GetGraphicsFormat(DefaultFormat.LDR); + MSAASamples[] probe = {MSAASamples.MSAA2x, MSAASamples.MSAA4x, MSAASamples.MSAA8x}; + + int minSampleCount = 0; + int maxSampleCount = 0; + + // Some GPUs might not support MSAA2x, so probe the supported range for clamping + foreach (MSAASamples entry in probe) + { + bool supported = SystemInfo.IsFormatSupported(ldrFormat, entry.AsFormatUsage()); + if (!supported) + continue; + if (minSampleCount == 0) + minSampleCount = maxSampleCount = (int)entry; + maxSampleCount = (int)entry; + } + + MSAASamples origSampleCount = samples; + samples = (MSAASamples) Math.Min(Math.Max((int) samples, minSampleCount), maxSampleCount); + + if (origSampleCount != samples) + Debug.LogWarning($"MSAASamples changed from {origSampleCount} into {samples} (Supported MSAA sampleCount range {minSampleCount}-{maxSampleCount})"); + return samples; + } + } } diff --git a/com.unity.render-pipelines.core/Runtime/Textures/TextureXR.cs b/com.unity.render-pipelines.core/Runtime/Textures/TextureXR.cs index afe525c02ec..5cc88e63263 100644 --- a/com.unity.render-pipelines.core/Runtime/Textures/TextureXR.cs +++ b/com.unity.render-pipelines.core/Runtime/Textures/TextureXR.cs @@ -42,12 +42,37 @@ public static bool useTexArray case GraphicsDeviceType.Vulkan: return true; + // VFX basically depends on texture arrays, so TextureXR should be enabled even on platforms without SPI support + // SPI technically available on Metal, but due to fragmented OS/GPU matrix, let's not enable it yet + case GraphicsDeviceType.Metal: + return true; + default: return false; } } } + // Must be in sync with shader define in TextureXR.hlsl + /// + /// Returns true if the XR system uses texture arrays for MSAA. + /// + public static bool useTexArrayMSAA + { + get + { + switch (SystemInfo.graphicsDeviceType) + { + // Metal supports texture arrays with MSAA, but due to fragmented OS/GPU matrix, let's not enable it yet + case GraphicsDeviceType.Metal: + return false; + + default: + return useTexArray; + } + } + } + /// /// Dimension of XR textures. /// @@ -60,6 +85,18 @@ public static TextureDimension dimension } } + /// + /// Dimension of XR MSAA textures. + /// + public static TextureDimension dimensionMSAA + { + get + { + // TEXTURE2D_X_MSAA/LOAD_TEXTURE2D_X_MSAA macros will now expand to TEXTURE2D or TEXTURE2D_ARRAY + return useTexArrayMSAA ? TextureDimension.Tex2DArray : TextureDimension.Tex2D; + } + } + // Need to keep both the Texture and the RTHandle in order to be able to track lifetime properly. static Texture m_BlackUIntTexture2DArray; static Texture m_BlackUIntTexture; diff --git a/com.unity.render-pipelines.core/ShaderLibrary/API/GLES3.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/API/GLES3.hlsl index b5e27f281ea..401ba9ee37f 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/API/GLES3.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/API/GLES3.hlsl @@ -52,15 +52,15 @@ #define TEXTURE3D(textureName) Texture3D textureName #define TEXTURE2D_FLOAT(textureName) Texture2D_float textureName -#define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray textureName // no support to _float on Array, it's being added +#define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray_float textureName #define TEXTURECUBE_FLOAT(textureName) TextureCube_float textureName -#define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added +#define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray_float textureName #define TEXTURE3D_FLOAT(textureName) Texture3D_float textureName #define TEXTURE2D_HALF(textureName) Texture2D_half textureName -#define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray textureName // no support to _float on Array, it's being added +#define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray_half textureName #define TEXTURECUBE_HALF(textureName) TextureCube_half textureName -#define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added +#define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray_half textureName #define TEXTURE3D_HALF(textureName) Texture3D_half textureName #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) diff --git a/com.unity.render-pipelines.core/ShaderLibrary/API/Metal.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/API/Metal.hlsl index 42342c6201e..f74388020bb 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/API/Metal.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/API/Metal.hlsl @@ -44,15 +44,15 @@ #define TEXTURE3D(textureName) Texture3D textureName #define TEXTURE2D_FLOAT(textureName) Texture2D_float textureName -#define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray textureName // no support to _float on Array, it's being added +#define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray_float textureName #define TEXTURECUBE_FLOAT(textureName) TextureCube_float textureName -#define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added +#define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray_float textureName #define TEXTURE3D_FLOAT(textureName) Texture3D_float textureName #define TEXTURE2D_HALF(textureName) Texture2D_half textureName -#define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray textureName // no support to _float on Array, it's being added +#define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray_half textureName #define TEXTURECUBE_HALF(textureName) TextureCube_half textureName -#define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added +#define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray_half textureName #define TEXTURE3D_HALF(textureName) Texture3D_half textureName #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) diff --git a/com.unity.render-pipelines.core/ShaderLibrary/API/Switch.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/API/Switch.hlsl index 1edac845bf8..88a42dd8861 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/API/Switch.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/API/Switch.hlsl @@ -44,15 +44,15 @@ #define TEXTURE3D(textureName) Texture3D textureName #define TEXTURE2D_FLOAT(textureName) Texture2D_float textureName -#define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray textureName // no support to _float on Array, it's being added +#define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray_float textureName #define TEXTURECUBE_FLOAT(textureName) TextureCube_float textureName -#define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added +#define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray_float textureName #define TEXTURE3D_FLOAT(textureName) Texture3D_float textureName #define TEXTURE2D_HALF(textureName) Texture2D_half textureName -#define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray textureName // no support to _float on Array, it's being added +#define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray_half textureName #define TEXTURECUBE_HALF(textureName) TextureCube_half textureName -#define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added +#define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray_half textureName #define TEXTURE3D_HALF(textureName) Texture3D_half textureName #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) diff --git a/com.unity.render-pipelines.core/ShaderLibrary/API/Vulkan.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/API/Vulkan.hlsl index e84aa940fd6..e536ac06ab8 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/API/Vulkan.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/API/Vulkan.hlsl @@ -44,15 +44,15 @@ #define TEXTURE3D(textureName) Texture3D textureName #define TEXTURE2D_FLOAT(textureName) Texture2D_float textureName -#define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray textureName // no support to _float on Array, it's being added +#define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray_float textureName #define TEXTURECUBE_FLOAT(textureName) TextureCube_float textureName -#define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added +#define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray_float textureName #define TEXTURE3D_FLOAT(textureName) Texture3D_float textureName #define TEXTURE2D_HALF(textureName) Texture2D_half textureName -#define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray textureName // no support to _float on Array, it's being added +#define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray_half textureName #define TEXTURECUBE_HALF(textureName) TextureCube_half textureName -#define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added +#define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray_half textureName #define TEXTURE3D_HALF(textureName) Texture3D_half textureName #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) diff --git a/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl index eefe74e8c1b..7c0eec3f4e1 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl @@ -77,7 +77,13 @@ #define PREFER_HALF 1 #endif -#if HAS_HALF && PREFER_HALF +// Unity historically has a mixed stance on default sampler precision between mobiles and other platforms, +// and changes without altering existing behavior/performance is difficult. +// +// When UNITY_UNIFIED_SHADER_PRECISION_MODEL is defined, the expectation is to have full precision +// on all platforms and explicitly optimize against lower precision when useful. + +#if !defined(UNITY_UNIFIED_SHADER_PRECISION_MODEL) && HAS_HALF && PREFER_HALF #define REAL_IS_HALF 1 #else #define REAL_IS_HALF 0 @@ -221,6 +227,12 @@ #define LANE_SWIZZLE_OFFSET(andMask, orMask, xorMask) (andMask | (orMask << 5) | (xorMask << 10)) #endif +// For multi_compile +#ifdef PLATFORM_LANE_COUNT_32 +#undef PLATFORM_LANE_COUNT +#define PLATFORM_LANE_COUNT 32 +#endif + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/CommonDeprecated.hlsl" #if !defined(SHADER_API_GLES) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Core/Textures/TextureCache.cs b/com.unity.render-pipelines.high-definition/Runtime/Core/Textures/TextureCache.cs index 4f9283aa887..fb3baa8b7eb 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Core/Textures/TextureCache.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Core/Textures/TextureCache.cs @@ -312,25 +312,6 @@ protected int GetNumMips(int dim) return iNumMips; } - public static bool isMobileBuildTarget - { - get - { -#if UNITY_EDITOR - switch (EditorUserBuildSettings.activeBuildTarget) - { - case BuildTarget.iOS: - case BuildTarget.Android: - return true; - default: - return false; - } -#else - return Application.isMobilePlatform; -#endif - } - } - public static TextureFormat GetPreferredHDRCompressedTextureFormat { get diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs index 4f2f3e8068c..ad94cda421c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs @@ -40,7 +40,6 @@ unsafe struct ShaderVariablesDebugDisplay public int _DebugSingleShadowIndex; public int _DebugProbeVolumeMode; - public Vector3 _DebugDisplayPad0; } /// diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs.hlsl index f27b672a72a..30bf99fa5c3 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs.hlsl @@ -64,7 +64,6 @@ CBUFFER_START(ShaderVariablesDebugDisplay) float _MatcapViewScale; int _DebugSingleShadowIndex; int _DebugProbeVolumeMode; - float3 _DebugDisplayPad0; CBUFFER_END diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/ClearLightLists.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/ClearLightLists.compute index 32274fae94b..f5b5a54d64c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/ClearLightLists.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/ClearLightLists.compute @@ -1,9 +1,18 @@ #pragma kernel ClearList +// TODO: Fix PLATFORM_LANE_COUNT=32 support here and in Lightloop.cs if needed +//#pragma multi_compile _ PLATFORM_LANE_COUNT_32 + RWStructuredBuffer _LightListToClear; int _LightListEntries; -[numthreads(64, 1, 1)] +#ifdef PLATFORM_LANE_COUNT +#define NR_THREADS PLATFORM_LANE_COUNT +#else +#define NR_THREADS 64 // default to 64 threads per group +#endif + +[numthreads(NR_THREADS, 1, 1)] void ClearList(uint3 id : SV_DispatchThreadID) { if (id.x < (uint)_LightListEntries) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs index 134e4f2d9b2..99f99743f33 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs @@ -280,23 +280,6 @@ public partial class HDRenderPipeline internal const int k_MaxLightsPerClusterCell = 24; internal static readonly Vector3 k_BoxCullingExtentThreshold = Vector3.one * 0.01f; - #if UNITY_SWITCH - static bool k_PreferFragment = true; - #else - static bool k_PreferFragment = false; - #endif - #if !UNITY_EDITOR && UNITY_SWITCH - const bool k_HasNativeQuadSupport = true; - #else - const bool k_HasNativeQuadSupport = false; - #endif - - #if !UNITY_EDITOR && UNITY_SWITCH - const int k_ThreadGroupOptimalSize = 32; - #else - const int k_ThreadGroupOptimalSize = 64; - #endif - int m_MaxDirectionalLightsOnScreen; int m_MaxPunctualLightsOnScreen; int m_MaxAreaLightsOnScreen; @@ -464,7 +447,7 @@ public void AllocateNonRenderGraphResolutionDependentBuffers(HDCamera hdCamera, var nrClustersY = (height + LightDefinitions.s_TileSizeClustered - 1) / LightDefinitions.s_TileSizeClustered; var nrClusterTiles = nrClustersX * nrClustersY * viewCount; - perVoxelOffset = new ComputeBuffer((int)LightCategory.Count * (1 << k_Log2NumClusters) * nrClusterTiles, sizeof(uint)); + perVoxelOffset = new ComputeBuffer((int)LightCategory.Count * (1 << DeviceInfo.log2NumClusters) * nrClusterTiles, sizeof(uint)); perVoxelLightLists = new ComputeBuffer(NumLightIndicesPerClusteredTile() * nrClusterTiles, sizeof(uint)); if (clusterNeedsDepth) @@ -720,11 +703,6 @@ enum ClusterDepthSource : int const bool k_UseDepthBuffer = true; // only has an impact when EnableClustered is true (requires a depth-prepass) -#if !UNITY_EDITOR && UNITY_SWITCH - const int k_Log2NumClusters = 5; // accepted range is from 0 to 5 (NR_THREADS is set to 32 on Switch). NumClusters is 1< 4 x 8x8) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/builddispatchindirect.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/builddispatchindirect.compute index 0afe7a4306c..81ce638d8b8 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/builddispatchindirect.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/builddispatchindirect.compute @@ -1,6 +1,7 @@ #pragma kernel BuildIndirect #pragma multi_compile _ IS_DRAWPROCEDURALINDIRECT +#pragma multi_compile _ PLATFORM_LANE_COUNT_32 #pragma only_renderers d3d11 playstation xboxone vulkan metal switch @@ -12,10 +13,10 @@ #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" -#ifdef PLATFORM_LANE_COUNT // We can infer the size of a wave. This is currently not possible on non-consoles, so we have to fallback to a sensible default in those cases. +#ifdef PLATFORM_LANE_COUNT #define NR_THREADS PLATFORM_LANE_COUNT #else -#define NR_THREADS 64 // default to 64 threads per group on other platforms.. +#define NR_THREADS 64 // default to 64 threads per group #endif RWBuffer g_DispatchIndirectBuffer : register( u0 ); // Indirect arguments have to be in a _buffer_, not a structured buffer diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/cleardispatchindirect.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/cleardispatchindirect.compute index cce3f47aedf..5c9976b611d 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/cleardispatchindirect.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/cleardispatchindirect.compute @@ -1,5 +1,8 @@ #pragma kernel ClearDispatchIndirect #pragma kernel ClearDrawProceduralIndirect + +#pragma multi_compile _ PLATFORM_LANE_COUNT_32 + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch RWBuffer g_DispatchIndirectBuffer : register( u0 ); // Indirect arguments have to be in a _buffer_, not a structured buffer @@ -8,9 +11,9 @@ RWBuffer g_DispatchIndirectBuffer : register( u0 ); // Indirect argument #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs.hlsl" #ifdef PLATFORM_LANE_COUNT -#define NR_THREADS PLATFORM_LANE_COUNT +#define NR_THREADS PLATFORM_LANE_COUNT #else -#define NR_THREADS 64 // default to 64 threads per group on other platforms.. +#define NR_THREADS 64 // default to 64 threads per group #endif uniform uint g_NumTiles; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild-bigtile.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild-bigtile.compute index aa9b402db5d..8a0e6736b19 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild-bigtile.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild-bigtile.compute @@ -1,5 +1,7 @@ #pragma kernel BigTileLightListGen +#pragma multi_compile _ PLATFORM_LANE_COUNT_32 + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition-config/Runtime/ShaderConfig.cs.hlsl" @@ -8,6 +10,7 @@ #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightingConvexHullUtils.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/SortingComputeUtils.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightCullUtils.hlsl" + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #define EXACT_EDGE_TESTS @@ -22,11 +25,10 @@ StructuredBuffer g_vBoundsBuffer : register( t1 ); StructuredBuffer _LightVolumeData : register(t2); StructuredBuffer g_data : register( t3 ); - -#ifdef PLATFORM_LANE_COUNT // We can infer the size of a wave. This is currently not possible on non-consoles, so we have to fallback to a sensible default in those cases. +#ifdef PLATFORM_LANE_COUNT #define NR_THREADS PLATFORM_LANE_COUNT #else -#define NR_THREADS 64 // default to 64 threads per group on other platforms.. +#define NR_THREADS 64 // default to 64 threads per group #endif // output buffer @@ -144,7 +146,7 @@ void BigTileLightListGen(uint threadID : SV_GroupIndex, uint3 u3GroupID : SV_Gro } } -#if NR_THREADS > PLATFORM_LANE_COUNT || defined(SHADER_API_XBOXONE) || defined(SHADER_API_SWITCH) // not sure why XB1 and Switch need the barrier (it will not be correct without) +#if NR_THREADS > PLATFORM_LANE_COUNT || defined(SHADER_API_XBOXONE) || (defined(PLATFORM_LANE_COUNT) && PLATFORM_LANE_COUNT==32) // not sure why the barrier is needed GroupMemoryBarrierWithGroupSync(); #endif diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild-clustered.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild-clustered.compute index 944a0bb582c..4cdda8b1bc3 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild-clustered.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild-clustered.compute @@ -10,6 +10,18 @@ #pragma kernel TileLightListGen_DepthRT_SrcBigTile_Oblique LIGHTLISTGEN=TileLightListGen_DepthRT_SrcBigTile_Oblique ENABLE_DEPTH_TEXTURE_BACKPLANE USE_TWO_PASS_TILED_LIGHTING USE_OBLIQUE_MODE #pragma kernel TileLightListGen_DepthRT_MSAA_SrcBigTile_Oblique LIGHTLISTGEN=TileLightListGen_DepthRT_MSAA_SrcBigTile_Oblique ENABLE_DEPTH_TEXTURE_BACKPLANE MSAA_ENABLED USE_TWO_PASS_TILED_LIGHTING USE_OBLIQUE_MODE +#pragma kernel TileLightListGen_NoDepthRT_LE LIGHTLISTGEN=TileLightListGen_NoDepthRT_LE PLATFORM_LANE_COUNT_32 +#pragma kernel TileLightListGen_DepthRT_LE LIGHTLISTGEN=TileLightListGen_DepthRT_LE PLATFORM_LANE_COUNT_32 ENABLE_DEPTH_TEXTURE_BACKPLANE +#pragma kernel TileLightListGen_DepthRT_MSAA_LE LIGHTLISTGEN=TileLightListGen_DepthRT_MSAA_LE PLATFORM_LANE_COUNT_32 ENABLE_DEPTH_TEXTURE_BACKPLANE MSAA_ENABLED +#pragma kernel TileLightListGen_NoDepthRT_SrcBigTile_LE LIGHTLISTGEN=TileLightListGen_NoDepthRT_SrcBigTile_LE PLATFORM_LANE_COUNT_32 USE_TWO_PASS_TILED_LIGHTING +#pragma kernel TileLightListGen_DepthRT_SrcBigTile_LE LIGHTLISTGEN=TileLightListGen_DepthRT_SrcBigTile_LE PLATFORM_LANE_COUNT_32 ENABLE_DEPTH_TEXTURE_BACKPLANE USE_TWO_PASS_TILED_LIGHTING +#pragma kernel TileLightListGen_DepthRT_MSAA_SrcBigTile_LE LIGHTLISTGEN=TileLightListGen_DepthRT_MSAA_SrcBigTile_LE PLATFORM_LANE_COUNT_32 ENABLE_DEPTH_TEXTURE_BACKPLANE MSAA_ENABLED USE_TWO_PASS_TILED_LIGHTING + +#pragma kernel TileLightListGen_DepthRT_Oblique_LE LIGHTLISTGEN=TileLightListGen_DepthRT_Oblique_LE PLATFORM_LANE_COUNT_32 ENABLE_DEPTH_TEXTURE_BACKPLANE USE_OBLIQUE_MODE +#pragma kernel TileLightListGen_DepthRT_MSAA_Oblique_LE LIGHTLISTGEN=TileLightListGen_DepthRT_MSAA_Oblique_LE PLATFORM_LANE_COUNT_32 ENABLE_DEPTH_TEXTURE_BACKPLANE MSAA_ENABLED USE_OBLIQUE_MODE +#pragma kernel TileLightListGen_DepthRT_SrcBigTile_Oblique_LE LIGHTLISTGEN=TileLightListGen_DepthRT_SrcBigTile_Oblique_LE PLATFORM_LANE_COUNT_32 ENABLE_DEPTH_TEXTURE_BACKPLANE USE_TWO_PASS_TILED_LIGHTING USE_OBLIQUE_MODE +#pragma kernel TileLightListGen_DepthRT_MSAA_SrcBigTile_Oblique_LE LIGHTLISTGEN=TileLightListGen_DepthRT_MSAA_SrcBigTile_Oblique_LE PLATFORM_LANE_COUNT_32 ENABLE_DEPTH_TEXTURE_BACKPLANE MSAA_ENABLED USE_TWO_PASS_TILED_LIGHTING USE_OBLIQUE_MODE + // #pragma enable_d3d11_debug_symbols #define REQUEST_DISABLE_OPTIMISTIC_SCALAR_ALLOCATION @@ -22,10 +34,7 @@ #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightingConvexHullUtils.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightCullUtils.hlsl" - -#if !defined(SHADER_API_XBOXONE) && !defined(SHADER_API_PSSL) && !defined(SHADER_API_SWITCH) #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/SortingComputeUtils.hlsl" -#endif #pragma only_renderers d3d11 playstation xboxone vulkan metal switch @@ -45,11 +54,10 @@ StructuredBuffer g_data : register( t3 ); StructuredBuffer g_vBigTileLightList : register( t4 ); // don't support Buffer yet in unity #endif - -#ifdef PLATFORM_LANE_COUNT // We can infer the size of a wave. This is currently not possible on non-consoles, so we have to fallback to a sensible default in those cases. -#define NR_THREADS PLATFORM_LANE_COUNT +#ifdef PLATFORM_LANE_COUNT +#define NR_THREADS PLATFORM_LANE_COUNT #else -#define NR_THREADS 64 // default to 64 threads per group on other platforms.. +#define NR_THREADS 64 // default to 64 threads per group #endif RWStructuredBuffer g_vLayeredLightList : register( u0 ); // don't support RWBuffer yet in unity @@ -324,7 +332,7 @@ void LIGHTLISTGEN(uint threadID : SV_GroupIndex, uint3 u3GroupID : SV_GroupID) #endif // sort lights (gives a more efficient execution in both deferred and tiled forward lighting). -#if NR_THREADS > PLATFORM_LANE_COUNT +#if NR_THREADS > PLATFORM_LANE_COUNT || (defined(PLATFORM_LANE_COUNT) && PLATFORM_LANE_COUNT==32) SORTLIST(coarseList, iNrCoarseLights, MAX_NR_COARSE_ENTRIES, t, NR_THREADS); #endif @@ -488,7 +496,7 @@ int SphericalIntersectionTests(uint threadID, int iNrCoarseLights, float2 screen lightOffsSph = offs; } -#if NR_THREADS > PLATFORM_LANE_COUNT +#if NR_THREADS > PLATFORM_LANE_COUNT || (defined(PLATFORM_LANE_COUNT) && PLATFORM_LANE_COUNT==32) GroupMemoryBarrierWithGroupSync(); #endif diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild.compute index 49a88c59d47..1a1b691d9aa 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild.compute @@ -6,6 +6,7 @@ #pragma multi_compile _ USE_TWO_PASS_TILED_LIGHTING #pragma multi_compile _ USE_FEATURE_FLAGS #pragma multi_compile _ USE_OBLIQUE_MODE +#pragma multi_compile _ PLATFORM_LANE_COUNT_32 //#pragma #pragma enable_d3d11_debug_symbols @@ -37,14 +38,10 @@ StructuredBuffer g_data : register( t3 ); StructuredBuffer g_vBigTileLightList : register( t4 ); // don't support Buffer yet in unity #endif -#if defined(SHADER_API_MOBILE) || defined(SHADER_API_SWITCH) -#define PLATFORM_LANE_COUNT 32 -#endif - -#ifdef PLATFORM_LANE_COUNT // We can infer the size of a wave. This is currently not possible on non-consoles, so we have to fallback to a sensible default in those cases. -#define NR_THREADS PLATFORM_LANE_COUNT +#ifdef PLATFORM_LANE_COUNT +#define NR_THREADS PLATFORM_LANE_COUNT #else -#define NR_THREADS 64 // default to 64 threads per group on other platforms.. +#define NR_THREADS 64 // default to 64 threads per group #endif #define PIXEL_PER_THREAD ((TILE_SIZE_FPTL*TILE_SIZE_FPTL) / NR_THREADS) // 8 or 4 @@ -196,7 +193,7 @@ void TileLightListGen(uint3 dispatchThreadId : SV_DispatchThreadID, uint threadI InterlockedMax(ldsZMax, asuint(dpt_ma)); InterlockedMin(ldsZMin, asuint(dpt_mi)); -#if NR_THREADS > PLATFORM_LANE_COUNT || defined(SHADER_API_SWITCH) // not sure why Switch needs the barrier (it will not be correct without) +#if NR_THREADS > PLATFORM_LANE_COUNT || (defined(PLATFORM_LANE_COUNT) && PLATFORM_LANE_COUNT==32) // not sure why the barrier is needed GroupMemoryBarrierWithGroupSync(); #endif } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/materialflags.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/materialflags.compute index 4ac95c5b265..4fc28881330 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/materialflags.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/materialflags.compute @@ -2,6 +2,9 @@ #pragma multi_compile _ USE_OR +// TODO: Fix PLATFORM_LANE_COUNT=32 support here and in Lightloop.cs if needed +//#pragma multi_compile _ PLATFORM_LANE_COUNT_32 + // #pragma enable_d3d11_debug_symbols #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" @@ -18,10 +21,10 @@ #define USE_MATERIAL_FEATURE_FLAGS -#ifdef PLATFORM_LANE_COUNT // We can infer the size of a wave. This is currently not possible on non-consoles, so we have to fallback to a sensible default in those cases. -#define NR_THREADS PLATFORM_LANE_COUNT +#ifdef PLATFORM_LANE_COUNT +#define NR_THREADS PLATFORM_LANE_COUNT #else -#define NR_THREADS 64 // default to 64 threads per group on other platforms.. +#define NR_THREADS 64 // default to 64 threads per group #endif groupshared uint ldsFeatureFlags; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/scrbound.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/scrbound.compute index be07511307d..6d8caac2881 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/scrbound.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/scrbound.compute @@ -4,7 +4,8 @@ #pragma kernel ScreenBoundsAABB #pragma multi_compile _ USE_OBLIQUE_MODE - +// TODO: Fix PLATFORM_LANE_COUNT=32 support here and in Lightloop.cs if needed +//#pragma multi_compile _ PLATFORM_LANE_COUNT_32 #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition-config/Runtime/ShaderConfig.cs.hlsl" @@ -15,7 +16,11 @@ StructuredBuffer g_data : register( t0 ); -#define NR_THREADS 64 +#ifdef PLATFORM_LANE_COUNT +#define NR_THREADS PLATFORM_LANE_COUNT +#else +#define NR_THREADS 64 // default to 64 threads per group +#endif // output buffer RWStructuredBuffer g_vBoundsBuffer : register( u0 ); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLighting.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLighting.cs index db409abb3da..ffba024c293 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLighting.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLighting.cs @@ -261,9 +261,10 @@ static internal Vector3Int ComputeVolumetricViewportSize(HDCamera hdCamera, ref float screenFraction = controller.screenResolutionPercentage.value * 0.01f; int sliceCount = controller.volumeSliceCount.value; - int w = Mathf.RoundToInt(viewportWidth * screenFraction); - int h = Mathf.RoundToInt(viewportHeight * screenFraction); - int d = sliceCount; + const int kMax3DTextureSize = 2048; // TODO: There's no SystemInfo.maxTextureSize equivalent for 3D textures + int w = Math.Min(Mathf.RoundToInt(viewportWidth * screenFraction), kMax3DTextureSize); + int h = Math.Min(Mathf.RoundToInt(viewportHeight * screenFraction), kMax3DTextureSize); + int d = Math.Min(sliceCount, kMax3DTextureSize); if (controller.screenResolutionPercentage.value == (1.0f/8.0f) * 100) voxelSize = 8; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/GGXConvolution/ComputeGgxIblSampleData.compute b/com.unity.render-pipelines.high-definition/Runtime/Material/GGXConvolution/ComputeGgxIblSampleData.compute index d8445386ed7..bd84500812d 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/GGXConvolution/ComputeGgxIblSampleData.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/GGXConvolution/ComputeGgxIblSampleData.compute @@ -5,20 +5,15 @@ #pragma only_renderers d3d11 playstation xboxone vulkan metal switch -#if defined(SHADER_API_MOBILE) || defined(SHADER_API_SWITCH) -#define MAX_IBL_SAMPLE_CNT 34 -#else -#define MAX_IBL_SAMPLE_CNT 89 -#endif - RWTexture2D outputResult; // [MAX_SAMPLE_CNT x UNITY_SPECCUBE_LOD_STEPS] -#pragma kernel ComputeGgxIblSampleData +#pragma kernel ComputeGgxIblSampleData COMPUTEGGGXIBLSAMPLEDATA=ComputeGgxIblSampleData MAX_IBL_SAMPLE_CNT=89 +#pragma kernel ComputeGgxIblSampleData_LE COMPUTEGGGXIBLSAMPLEDATA=ComputeGgxIblSampleData_LE MAX_IBL_SAMPLE_CNT=34 // Cannot use (MAX_SAMPLE_CNT x UNITY_SPECCUBE_LOD_STEPS) since // the thread group becomes too large for some platforms. [numthreads(8, UNITY_SPECCUBE_LOD_STEPS, 1)] -void ComputeGgxIblSampleData(uint3 groupThreadId : SV_GroupThreadID) +void COMPUTEGGGXIBLSAMPLEDATA(uint3 groupThreadId : SV_GroupThreadID) { uint numSamplesPerThread = (MAX_IBL_SAMPLE_CNT + 7) / 8; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/GGXConvolution/IBLFilterGGX.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/GGXConvolution/IBLFilterGGX.cs index 4c4c4101dd4..b7a420af50a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/GGXConvolution/IBLFilterGGX.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/GGXConvolution/IBLFilterGGX.cs @@ -5,7 +5,7 @@ namespace UnityEngine.Rendering.HighDefinition class IBLFilterGGX : IBLFilterBSDF { RenderTexture m_GgxIblSampleData; - int m_GgxIblMaxSampleCount = TextureCache.isMobileBuildTarget ? 34 : 89; // Width + int m_GgxIblMaxSampleCount; // Width const int k_GgxIblMipCountMinusOne = 6; // Height (UNITY_SPECCUBE_LOD_STEPS) ComputeShader m_ComputeGgxIblSampleDataCS; @@ -44,7 +44,8 @@ public override void Initialize(CommandBuffer cmd) if (!m_ComputeGgxIblSampleDataCS) { m_ComputeGgxIblSampleDataCS = m_RenderPipelineResources.shaders.computeGgxIblSampleDataCS; - m_ComputeGgxIblSampleDataKernel = m_ComputeGgxIblSampleDataCS.FindKernel("ComputeGgxIblSampleData"); + m_ComputeGgxIblSampleDataKernel = DeviceInfo.FindKernel(m_ComputeGgxIblSampleDataCS, "ComputeGgxIblSampleData"); + m_GgxIblMaxSampleCount = m_ComputeGgxIblSampleDataKernel == 0 ? 89 : 34; } if (!m_BuildProbabilityTablesCS) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/SharedRTManager.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/SharedRTManager.cs index 508a41be18b..6048d2cc03d 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/SharedRTManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/SharedRTManager.cs @@ -86,7 +86,7 @@ public void InitSharedBuffers(GBufferManager gbufferManager, RenderPipelineSetti m_MotionVectorsRT = RTHandles.Alloc(Vector2.one, TextureXR.slices, colorFormat: Builtin.GetMotionVectorFormat(), dimension: TextureXR.dimension, useDynamicScale: true, name: "MotionVectors"); if (m_MSAASupported) { - m_MotionVectorsMSAART = RTHandles.Alloc(Vector2.one, TextureXR.slices, colorFormat: Builtin.GetMotionVectorFormat(), dimension: TextureXR.dimension, enableMSAA: true, bindTextureMS: true, useDynamicScale: true, name: "MotionVectorsMSAA"); + m_MotionVectorsMSAART = RTHandles.Alloc(Vector2.one, TextureXR.slices, colorFormat: Builtin.GetMotionVectorFormat(), dimension: TextureXR.dimensionMSAA, enableMSAA: true, bindTextureMS: true, useDynamicScale: true, name: "MotionVectorsMSAA"); } } @@ -94,13 +94,16 @@ public void InitSharedBuffers(GBufferManager gbufferManager, RenderPipelineSetti if (m_MSAASupported) { // Let's create the MSAA textures - m_CameraDepthStencilMSAABuffer = RTHandles.Alloc(Vector2.one, TextureXR.slices, DepthBits.Depth24, dimension: TextureXR.dimension, bindTextureMS: true, enableMSAA: true, useDynamicScale: true, name: "CameraDepthStencilMSAA"); + m_CameraDepthStencilMSAABuffer = RTHandles.Alloc(Vector2.one, TextureXR.slices, DepthBits.Depth24, dimension: TextureXR.dimensionMSAA, bindTextureMS: true, enableMSAA: true, useDynamicScale: true, name: "CameraDepthStencilMSAA"); m_CameraDepthValuesBuffer = RTHandles.Alloc(Vector2.one, TextureXR.slices, colorFormat: GraphicsFormat.R32G32B32A32_SFloat, dimension: TextureXR.dimension, useDynamicScale: true, name: "DepthValuesBuffer"); - m_DepthAsColorMSAART = RTHandles.Alloc(Vector2.one, TextureXR.slices, colorFormat: GraphicsFormat.R32_SFloat, dimension: TextureXR.dimension, bindTextureMS: true, enableMSAA: true, useDynamicScale: true, name: "DepthAsColorMSAA"); + GraphicsFormat depthAsColorMSAAFormat = GraphicsFormat.R32_SFloat; + if (!SystemInfo.IsFormatSupported(depthAsColorMSAAFormat, m_MSAASamples.AsFormatUsage())) + depthAsColorMSAAFormat = GraphicsFormat.R16_SFloat; + m_DepthAsColorMSAART = RTHandles.Alloc(Vector2.one, TextureXR.slices, colorFormat: depthAsColorMSAAFormat, dimension: TextureXR.dimensionMSAA, bindTextureMS: true, enableMSAA: true, useDynamicScale: true, name: "DepthAsColorMSAA"); m_StencilBufferResolved = RTHandles.Alloc(Vector2.one, TextureXR.slices, colorFormat: GraphicsFormat.R8G8_UInt, dimension: TextureXR.dimension, enableRandomWrite: true, useDynamicScale: true, name: "StencilBufferResolved"); // We need to allocate this texture as long as msaa is supported because on both mode, one of the cameras can be forward only using the framesettings - m_NormalMSAART = RTHandles.Alloc(Vector2.one, TextureXR.slices, colorFormat: GraphicsFormat.R8G8B8A8_UNorm, dimension: TextureXR.dimension, enableMSAA: true, bindTextureMS: true, useDynamicScale: true, name: "NormalBufferMSAA"); + m_NormalMSAART = RTHandles.Alloc(Vector2.one, TextureXR.slices, colorFormat: GraphicsFormat.R8G8B8A8_UNorm, dimension: TextureXR.dimensionMSAA, enableMSAA: true, bindTextureMS: true, useDynamicScale: true, name: "NormalBufferMSAA"); // Create the required resolve materials m_DepthResolveMaterial = CoreUtils.CreateEngineMaterial(resources.shaders.depthValuesPS); @@ -108,7 +111,7 @@ public void InitSharedBuffers(GBufferManager gbufferManager, RenderPipelineSetti m_MotionVectorResolve = CoreUtils.CreateEngineMaterial(resources.shaders.resolveMotionVecPS); if (m_DecalLayersSupported) - m_DecalPrePassBufferMSAA = RTHandles.Alloc(Vector2.one, TextureXR.slices, dimension: TextureXR.dimension, colorFormat: GraphicsFormat.R8G8B8A8_UNorm, enableMSAA: true, useDynamicScale: true, name: "Decal PrePass Buffer MSAA"); + m_DecalPrePassBufferMSAA = RTHandles.Alloc(Vector2.one, TextureXR.slices, dimension: TextureXR.dimensionMSAA, colorFormat: GraphicsFormat.R8G8B8A8_UNorm, enableMSAA: true, useDynamicScale: true, name: "Decal PrePass Buffer MSAA"); CoreUtils.SetKeyword(m_DepthResolveMaterial, "_HAS_MOTION_VECTORS", m_MotionVectorsSupport); } @@ -439,6 +442,11 @@ public void BindNormalBuffer(CommandBuffer cmd, bool isMSAA = false) cmd.SetGlobalTexture(HDShaderIDs._NormalBufferTexture, GetNormalBuffer(isMSAA)); } + private bool CompareRTHandle(RTHandle a, RTHandle b) + { + return (a != null && b != null && a.rt.graphicsFormat == b.rt.graphicsFormat); + } + public void ResolveSharedRT(CommandBuffer cmd, HDCamera hdCamera) { if (hdCamera.frameSettings.IsEnabled(FrameSettingsField.MSAA)) @@ -446,31 +454,44 @@ public void ResolveSharedRT(CommandBuffer cmd, HDCamera hdCamera) Debug.Assert(m_MSAASupported); using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.ResolveMSAADepth))) { - if (m_MotionVectorsSupport) + if (DeviceInfo.requiresExplicitMSAAResolve == false && + (m_MotionVectorsSupport == true ? CompareRTHandle(m_MotionVectorsMSAART, m_MotionVectorsRT) : true) && + CompareRTHandle(m_NormalMSAART, m_NormalRT) && + CompareRTHandle(m_DepthAsColorMSAART, m_CameraDepthValuesBuffer)) { - // Grab the RTIs and set the output render targets - m_RTIDs3[0] = m_CameraDepthValuesBuffer.nameID; - m_RTIDs3[1] = m_NormalRT.nameID; - m_RTIDs3[2] = m_MotionVectorsRT.nameID; - CoreUtils.SetRenderTarget(cmd, m_RTIDs3, m_CameraDepthStencilBuffer); - - // Set the motion vector input texture - Shader.SetGlobalTexture(HDShaderIDs._MotionVectorTextureMS, m_MotionVectorsMSAART); + if (m_MotionVectorsSupport) + cmd.ResolveAntiAliasedSurface(m_MotionVectorsMSAART.rt, m_MotionVectorsRT.rt); + cmd.ResolveAntiAliasedSurface(m_NormalMSAART.rt, m_NormalRT.rt); + cmd.ResolveAntiAliasedSurface(m_DepthAsColorMSAART.rt, m_CameraDepthValuesBuffer.rt); } else { - // Grab the RTIs and set the output render targets - m_RTIDs2[0] = m_CameraDepthValuesBuffer.nameID; - m_RTIDs2[1] = m_NormalRT.nameID; - CoreUtils.SetRenderTarget(cmd, m_RTIDs2, m_CameraDepthStencilBuffer); + if (m_MotionVectorsSupport) + { + // Grab the RTIs and set the output render targets + m_RTIDs3[0] = m_CameraDepthValuesBuffer.nameID; + m_RTIDs3[1] = m_NormalRT.nameID; + m_RTIDs3[2] = m_MotionVectorsRT.nameID; + CoreUtils.SetRenderTarget(cmd, m_RTIDs3, m_CameraDepthStencilBuffer); + + // Set the motion vector input texture + Shader.SetGlobalTexture(HDShaderIDs._MotionVectorTextureMS, m_MotionVectorsMSAART); + } + else + { + // Grab the RTIs and set the output render targets + m_RTIDs2[0] = m_CameraDepthValuesBuffer.nameID; + m_RTIDs2[1] = m_NormalRT.nameID; + CoreUtils.SetRenderTarget(cmd, m_RTIDs2, m_CameraDepthStencilBuffer); + } + + // Set the depth and normal input textures + Shader.SetGlobalTexture(HDShaderIDs._NormalTextureMS, m_NormalMSAART); + Shader.SetGlobalTexture(HDShaderIDs._DepthTextureMS, m_DepthAsColorMSAART); + + // Resolve the buffers + cmd.DrawProcedural(Matrix4x4.identity, m_DepthResolveMaterial, SampleCountToPassIndex(m_MSAASamples), MeshTopology.Triangles, 3, 1); } - - // Set the depth and normal input textures - Shader.SetGlobalTexture(HDShaderIDs._NormalTextureMS, m_NormalMSAART); - Shader.SetGlobalTexture(HDShaderIDs._DepthTextureMS, m_DepthAsColorMSAART); - - // Resolve the buffers - cmd.DrawProcedural(Matrix4x4.identity, m_DepthResolveMaterial, SampleCountToPassIndex(m_MSAASamples), MeshTopology.Triangles, 3, 1); } } } @@ -481,9 +502,17 @@ public void ResolveMotionVectorTexture(CommandBuffer cmd, HDCamera hdCamera) { using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.ResolveMSAAMotionVector))) { - CoreUtils.SetRenderTarget(cmd, m_MotionVectorsRT); - Shader.SetGlobalTexture(HDShaderIDs._MotionVectorTextureMS, m_MotionVectorsMSAART); - cmd.DrawProcedural(Matrix4x4.identity, m_MotionVectorResolve, SampleCountToPassIndex(m_MSAASamples), MeshTopology.Triangles, 3, 1); + if (DeviceInfo.requiresExplicitMSAAResolve == false && + CompareRTHandle(m_MotionVectorsMSAART, m_MotionVectorsRT)) + { + cmd.ResolveAntiAliasedSurface(m_MotionVectorsMSAART.rt, m_MotionVectorsRT.rt); + } + else + { + CoreUtils.SetRenderTarget(cmd, m_MotionVectorsRT); + Shader.SetGlobalTexture(HDShaderIDs._MotionVectorTextureMS, m_MotionVectorsMSAART); + cmd.DrawProcedural(Matrix4x4.identity, m_MotionVectorResolve, SampleCountToPassIndex(m_MSAASamples), MeshTopology.Triangles, 3, 1); + } } } } @@ -495,14 +524,22 @@ public void ResolveMSAAColor(CommandBuffer cmd, HDCamera hdCamera, RTHandle msaa Debug.Assert(m_MSAASupported); using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.ResolveMSAAColor))) { - // Grab the RTIs and set the output render targets - CoreUtils.SetRenderTarget(cmd, simpleTarget); + if (DeviceInfo.requiresExplicitMSAAResolve == false && + CompareRTHandle(msaaTarget, simpleTarget)) + { + cmd.ResolveAntiAliasedSurface(msaaTarget.rt, simpleTarget.rt); + } + else + { + // Grab the RTIs and set the output render targets + CoreUtils.SetRenderTarget(cmd, simpleTarget); - // Set the input textures - m_PropertyBlock.SetTexture(HDShaderIDs._ColorTextureMS, msaaTarget); + // Set the input textures + m_PropertyBlock.SetTexture(HDShaderIDs._ColorTextureMS, msaaTarget); - // Resolve the depth and normal buffers - cmd.DrawProcedural(Matrix4x4.identity, m_ColorResolveMaterial, SampleCountToPassIndex(m_MSAASamples), MeshTopology.Triangles, 3, 1, m_PropertyBlock); + // Resolve the depth and normal buffers + cmd.DrawProcedural(Matrix4x4.identity, m_ColorResolveMaterial, SampleCountToPassIndex(m_MSAASamples), MeshTopology.Triangles, 3, 1, m_PropertyBlock); + } } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs index 5e28d7abae8..d25681af605 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs @@ -49,7 +49,7 @@ void InitSSSBuffers() // We need to allocate the texture if we are in forward or both in case one of the cameras is in enable forward only mode if (settings.supportMSAA && settings.supportedLitShaderMode != RenderPipelineSettings.SupportedLitShaderMode.DeferredOnly) { - m_SSSColorMSAA = RTHandles.Alloc(Vector2.one, TextureXR.slices, colorFormat: GraphicsFormat.R8G8B8A8_SRGB, dimension: TextureXR.dimension, enableMSAA: true, bindTextureMS: true, useDynamicScale: true, name: "SSSBufferMSAA"); + m_SSSColorMSAA = RTHandles.Alloc(Vector2.one, TextureXR.slices, colorFormat: GraphicsFormat.R8G8B8A8_SRGB, dimension: TextureXR.dimensionMSAA, enableMSAA: true, bindTextureMS: true, useDynamicScale: true, name: "SSSBufferMSAA"); } if ((settings.supportedLitShaderMode & RenderPipelineSettings.SupportedLitShaderMode.DeferredOnly) != 0) //deferred or both diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs index 51bc4527a55..dc7af325b42 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs @@ -183,7 +183,7 @@ BuildGPULightListOutput BuildGPULightList( RenderGraph rend var nrClusterTiles = nrClustersX * nrClustersY * m_MaxViewCount; passData.output.perVoxelOffset = builder.WriteComputeBuffer( - renderGraph.CreateComputeBuffer(new ComputeBufferDesc((int)LightCategory.Count * (1 << k_Log2NumClusters) * nrClusterTiles, sizeof(uint)) { name = "PerVoxelOffset" })); + renderGraph.CreateComputeBuffer(new ComputeBufferDesc((int)LightCategory.Count * (1 << DeviceInfo.log2NumClusters) * nrClusterTiles, sizeof(uint)) { name = "PerVoxelOffset" })); passData.output.perVoxelLightLists = builder.WriteComputeBuffer( renderGraph.CreateComputeBuffer(new ComputeBufferDesc(NumLightIndicesPerClusteredTile() * nrClusterTiles, sizeof(uint)) { name = "PerVoxelLightList" })); if (tileAndClusterData.clusterNeedsDepth) @@ -372,7 +372,7 @@ LightingOutput RenderDeferredLighting( RenderGraph renderGraph, if (data.parameters.enableTile) { - bool useCompute = data.parameters.useComputeLightingEvaluation && !k_PreferFragment; + bool useCompute = data.parameters.useComputeLightingEvaluation && DeviceInfo.preferComputeKernels; if (useCompute) RenderComputeDeferredLighting(data.parameters, resources, context.cmd); else diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs index fdca52eacbe..92cdb2c94b5 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs @@ -319,8 +319,11 @@ bool RenderDepthPrepass(RenderGraph renderGraph, CullingResults cull, HDCamera h // The solution that we went for is writing the depth in an additional color buffer (10x cheaper to solve on ps4) if (msaa) { + GraphicsFormat depthAsColorMSAAFormat = GraphicsFormat.R32_SFloat; + if (!SystemInfo.IsFormatSupported(depthAsColorMSAAFormat, m_MSAASamples.AsFormatUsage())) + depthAsColorMSAAFormat = GraphicsFormat.R16_SFloat; passData.depthAsColorBuffer = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R32_SFloat, clearBuffer = true, clearColor = Color.black, bindTextureMS = true, enableMSAA = true, name = "DepthAsColorMSAA" })); + { colorFormat = depthAsColorMSAAFormat, clearBuffer = true, clearColor = Color.black, bindTextureMS = true, enableMSAA = true, name = "DepthAsColorMSAA" })); } if (passData.hasDepthDeferredPass) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index d64b8a66602..c7c00de7bff 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -411,6 +411,8 @@ public HDRenderPipeline(HDRenderPipelineAsset asset, HDRenderPipelineAsset defau return; } + DeviceInfo.ProbeDeviceInfo(); + var defaultLensAttenuation = m_DefaultAsset.lensAttenuationMode; if (defaultLensAttenuation == LensAttenuationMode.ImperfectLens) { @@ -749,9 +751,9 @@ void InitializeRenderTextures() // Let's create the MSAA textures if (m_Asset.currentPlatformRenderPipelineSettings.supportMSAA && m_Asset.currentPlatformRenderPipelineSettings.supportedLitShaderMode != RenderPipelineSettings.SupportedLitShaderMode.DeferredOnly) { - m_CameraColorMSAABuffer = RTHandles.Alloc(Vector2.one, TextureXR.slices, dimension: TextureXR.dimension, colorFormat: GetColorBufferFormat(), bindTextureMS: true, enableMSAA: true, useDynamicScale: true, name: "CameraColorMSAA"); - m_OpaqueAtmosphericScatteringMSAABuffer = RTHandles.Alloc(Vector2.one, TextureXR.slices, dimension: TextureXR.dimension, colorFormat: GetColorBufferFormat(), bindTextureMS: true, enableMSAA: true, useDynamicScale: true, name: "OpaqueAtmosphericScatteringMSAA"); - m_CameraSssDiffuseLightingMSAABuffer = RTHandles.Alloc(Vector2.one, TextureXR.slices, dimension: TextureXR.dimension, colorFormat: GetColorBufferFormat(), bindTextureMS: true, enableMSAA: true, useDynamicScale: true, name: "CameraSSSDiffuseLightingMSAA"); + m_CameraColorMSAABuffer = RTHandles.Alloc(Vector2.one, TextureXR.slices, dimension: TextureXR.dimensionMSAA, colorFormat: GetColorBufferFormat(), bindTextureMS: true, enableMSAA: true, useDynamicScale: true, name: "CameraColorMSAA"); + m_OpaqueAtmosphericScatteringMSAABuffer = RTHandles.Alloc(Vector2.one, TextureXR.slices, dimension: TextureXR.dimensionMSAA, colorFormat: GetColorBufferFormat(), bindTextureMS: true, enableMSAA: true, useDynamicScale: true, name: "OpaqueAtmosphericScatteringMSAA"); + m_CameraSssDiffuseLightingMSAABuffer = RTHandles.Alloc(Vector2.one, TextureXR.slices, dimension: TextureXR.dimensionMSAA, colorFormat: GetColorBufferFormat(), bindTextureMS: true, enableMSAA: true, useDynamicScale: true, name: "CameraSSSDiffuseLightingMSAA"); } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineAsset.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineAsset.cs index 53a483111ae..cf9fb84d530 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineAsset.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineAsset.cs @@ -56,6 +56,7 @@ protected override void OnValidate() base.OnValidate(); UpdateRenderingLayerNames(); + m_RenderPipelineSettings.msaaSampleCount = m_RenderPipelineSettings.msaaSampleCount.Validate(); isInOnValidateCall = false; } diff --git a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/TextureXR.hlsl b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/TextureXR.hlsl index 556accc54e7..923cefbab6d 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/TextureXR.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/TextureXR.hlsl @@ -4,13 +4,23 @@ // single-pass instancing is the default VR method for HDRP // multi-pass is working but not recommended due to lower performance // single-pass multi-view is not yet supported -// single-pass doule-wide is deprecated +// single-pass double-wide is deprecated // Must be in sync with C# with property useTexArray in TextureXR.cs #if (defined(SHADER_API_D3D11) && !defined(SHADER_API_XBOXONE)) || defined(SHADER_API_PSSL) || defined(SHADER_API_VULKAN) #define UNITY_TEXTURE2D_X_ARRAY_SUPPORTED #endif +// Must be in sync with C# with property useTexArray in TextureXR.cs +#if (defined(SHADER_API_METAL)) + #define UNITY_TEXTURE2D_X_ARRAY_SUPPORTED_NO_SPI +#endif + +// Must be in sync with C# with property useTexArrayMSAA in TextureXR.cs +#if (defined(SHADER_API_METAL)) + #define UNITY_TEXTURE2D_X_ARRAY_SUPPORTED_NO_MSAA +#endif + // Validate supported platforms #if defined(STEREO_INSTANCING_ON) && !defined(UNITY_TEXTURE2D_X_ARRAY_SUPPORTED) #error Single-pass instancing is not supported on this platform (see UNITY_TEXTURE2D_X_ARRAY_SUPPORTED). @@ -21,7 +31,7 @@ #endif // Control if TEXTURE2D_X macros will expand to texture arrays -#if defined(UNITY_TEXTURE2D_X_ARRAY_SUPPORTED) && !defined(DISABLE_TEXTURE2D_X_ARRAY) +#if (defined(UNITY_TEXTURE2D_X_ARRAY_SUPPORTED) || defined(UNITY_TEXTURE2D_X_ARRAY_SUPPORTED_NO_SPI)) && !defined(DISABLE_TEXTURE2D_X_ARRAY) #define USE_TEXTURE2D_X_AS_ARRAY #endif @@ -63,12 +73,9 @@ #define TEXTURE2D_X_UINT(textureName) Texture2DArray textureName #define TEXTURE2D_X_UINT2(textureName) Texture2DArray textureName #define TEXTURE2D_X_UINT4(textureName) Texture2DArray textureName - //Using explicit sample count of 1 to force DXC to actually reflect the texture as MS. The actual count appears to be irrelevant and any 2D MS texture array should bind to it - #define TEXTURE2D_X_MSAA(type, textureName) Texture2DMSArray textureName #define RW_TEXTURE2D_X(type, textureName) RW_TEXTURE2D_ARRAY(type, textureName) #define LOAD_TEXTURE2D_X(textureName, unCoord2) LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, SLICE_ARRAY_INDEX) - #define LOAD_TEXTURE2D_X_MSAA(textureName, unCoord2, sampleIndex) LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, SLICE_ARRAY_INDEX, sampleIndex) #define LOAD_TEXTURE2D_X_LOD(textureName, unCoord2, lod) LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, SLICE_ARRAY_INDEX, lod) #define SAMPLE_TEXTURE2D_X(textureName, samplerName, coord2) SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, SLICE_ARRAY_INDEX) #define SAMPLE_TEXTURE2D_X_LOD(textureName, samplerName, coord2, lod) SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, SLICE_ARRAY_INDEX, lod) @@ -91,12 +98,9 @@ #define TEXTURE2D_X_UINT(textureName) Texture2D textureName #define TEXTURE2D_X_UINT2(textureName) Texture2D textureName #define TEXTURE2D_X_UINT4(textureName) Texture2D textureName - //Using explicit sample count of 1 to force DXC to actually reflect the texture as MS. The actual count appears to be irrelevant and any 2D MS texture should bind to it - #define TEXTURE2D_X_MSAA(type, textureName) Texture2DMS textureName #define RW_TEXTURE2D_X RW_TEXTURE2D #define LOAD_TEXTURE2D_X LOAD_TEXTURE2D - #define LOAD_TEXTURE2D_X_MSAA LOAD_TEXTURE2D_MSAA #define LOAD_TEXTURE2D_X_LOD LOAD_TEXTURE2D_LOD #define SAMPLE_TEXTURE2D_X SAMPLE_TEXTURE2D #define SAMPLE_TEXTURE2D_X_LOD SAMPLE_TEXTURE2D_LOD @@ -107,6 +111,15 @@ #define GATHER_ALPHA_TEXTURE2D_X GATHER_ALPHA_TEXTURE2D #endif +// Using explicit sample count of 1 to force DXC to actually reflect the texture as MS. The actual count appears to be irrelevant and any 2D MS texture should bind to it +#if defined(USE_TEXTURE2D_X_AS_ARRAY) && !defined(UNITY_TEXTURE2D_X_ARRAY_SUPPORTED_NO_MSAA) + #define TEXTURE2D_X_MSAA(type, textureName) Texture2DMSArray textureName + #define LOAD_TEXTURE2D_X_MSAA(textureName, unCoord2, sampleIndex) LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, SLICE_ARRAY_INDEX, sampleIndex) +#else + #define TEXTURE2D_X_MSAA(type, textureName) Texture2DMS textureName + #define LOAD_TEXTURE2D_X_MSAA LOAD_TEXTURE2D_MSAA +#endif + // see Unity\Shaders\Includes\UnityShaderVariables.cginc for impl used by the C++ renderer #if defined(USING_STEREO_MATRICES) && defined(UNITY_STEREO_INSTANCING_ENABLED) static uint unity_StereoEyeIndex; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Utilities/DeviceInfo.cs b/com.unity.render-pipelines.high-definition/Runtime/Utilities/DeviceInfo.cs new file mode 100644 index 00000000000..877e9f69a27 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Runtime/Utilities/DeviceInfo.cs @@ -0,0 +1,86 @@ +using System; +using UnityEngine; +#if UNITY_EDITOR +using UnityEditor; +#endif + +namespace UnityEngine.Rendering.HighDefinition +{ + public class DeviceInfo + { + public static int optimalThreadGroupSize; + public static int log2NumClusters; // / MSB of optimalThreadGroupSize, NumClusters is 1<