wave-harmonic / crest

A class-leading water system implemented in Unity
MIT License
3.45k stars 476 forks source link

Crest URP - Xbox one - compute shader support #423

Closed huwb closed 4 years ago

huwb commented 4 years ago

One of our Crest URP users seems to be getting errors on Xbox one.

First they got the error Crest requires a graphics device that support compute shaders which does not make sense as Xbox One uses DX12 and most certainly supports compute.

I asked them to remove the check to see what would happen. It gets further but the crest update is not running properly and they get this error:

rendertexture.create failed format unsupported for random writes R16 SFloat

I'm not actually sure which render texture we are randomly writing to (clipping data?). I'll suggest that they try turn on and off the ocean features to narrow it down.

daleeidd commented 4 years ago

Clipping is only R8. Shadow data is RG16 and has NeedToReadWriteTextureData set to true. Depth uses an R16, but NeedToReadWriteTextureData is set to false.

So it might be shadows?

markus2810 commented 4 years ago

Shadows are not enabled. Deactivating foam removed the R16 SFloat message. Now I get: rendertexture.create failed format unsupported for random writes RGBA16 SFloat (48) I tried to removing all Simulation parameters with no success.

Settings for ocean and render pipeline etc. are attached.

The issue only occurs on XBox one universal windows. On UWP windows 10 machines using the exact same configuration I could not reproduce this issues. Testing on windows was done with AMD RX590, NVidia gtx 1060 and Intel UHD 620 integated graphics. ocean oceaninputs playersettings qualityxbox urpxbox

huwb commented 4 years ago

Thanks for this.

I think the problem seems to be below the level Crest operates at - this platform should definitely support compute and we're not doing random writes to those textures.

I googled and the link below came up - is your project set to use DX12 as the first graphics API in the list in the platform settings?

https://issuetracker.unity3d.com/issues/xbox-one-uwp-blendshapes-are-not-rendered-when-dx11-is-used

I think Xbox One would be heavily targeted to DX12 so this would need to be the first API in the list.

markus2810 commented 4 years ago

Issue is solved! You can close it.

I created a new sample application with crest only and sure DX12 and had the same issues. Adding some debug output and your hint to DX12 made me solve this issue as follow: The missing thing was, that UWP is not treated as Game by default on XBox. It must be changed from app to game first. Apps are treaded as DX11 only. Infos on how to configure xbox can be found: https://walbourn.github.io/directx-and-uwp-on-xbox-one/

huwb commented 4 years ago

Great, glad to hear and thanks for the link

daleeidd commented 4 years ago

I've added this information to Platform Support. Thanks!