Skip to content
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

Switch doesn't support texture arrays properly #291

Closed
dizzy2003 opened this issue Jul 11, 2019 · 17 comments
Closed

Switch doesn't support texture arrays properly #291

dizzy2003 opened this issue Jul 11, 2019 · 17 comments
Assignees
Labels

Comments

@dizzy2003
Copy link

dizzy2003 commented Jul 11, 2019

EDIT FROM @moosichu : Scroll to bottom to see where things have landed.

Switch ocean is very flat and boat is hardly moving, debug info is all wrong :(

image

PC Image
image

Double checked shaders are compiling fine, no errors in log

I had to change #if SHADER_API_VULKAN to

#if SHADER_API_VULKAN ||SHADER_API_SWITCH

@moosichu
Copy link
Contributor

It looks like something is going wrong with the way texture arrays are being handled, an issue independent from the shaders themselves (seeing how it's affecting all of the lods in the same way). @huwb has a lot more experience debugging consoles than I do, do you have any thoughts on how to proceed with this?

@moosichu moosichu self-assigned this Jul 11, 2019
@moosichu
Copy link
Contributor

moosichu commented Jul 13, 2019

Hi @dizzy2003,
I've chatted with @huwb and we think we have a strategy to start debugging this. Having done some research, we don't see any reason why the new system shouldn't work on the Switch.

I'm going to work on putting together a branch this evening which will help test for some things.

However, in the meantime, it would be really helpful to be able to see the following:

  • Which version of Unity are you using?
  • If you go to the whirlpool scene, what is the flow LodData showing in the debug overlay?
  • If you change line ~112 in LodDataMgrSeaFloorDepth.cs from:
    buf.ClearRenderTarget(false, true, Color.white * 1000f); to
    buf.ClearRenderTarget(false, true, Color.white * 0.01f * lodIdx);, what do you see in the SeaFloorDepth lods?

And just to confirm, this is with UseGeometryShader set to false right?

Also, you can email me at readcuttingt at gmail dot comif you are more comfortable sharing any extra information you have there.

@moosichu
Copy link
Contributor

moosichu commented Jul 13, 2019

For the last bullet point, you should see something like this:
image

(Although we don't expect the geometry to render because that is what is broken, this was taken with the camera position of (0, 300, 0) in the main scene.)

@moosichu
Copy link
Contributor

@dizzy2003 I'm going to have a look at this tonight, but I was wondering if you managed to make any headway, obtain any new information including the extra lod info that could help.

@dizzy2003
Copy link
Author

Sorry for my late rely, just got back onto looking at this.. But will have my attention for the next few days to try things out..

Grabbed latest crest as of today, just incase anything new happened to fix it :)

Unity 2018.3.9f1

Yes usegeom shader is returning false

Image of the whirlpool scene

image

Sea floor depth with the white color scale changed (everything looks black)

image

same but with the original scale put back in just to double check.

image

Noticing I am getting these log messages, which I have never seen before in our main game or old crest. I did what it recommended and increased the NVN Queue Command Memory up to 200K but still got the message so something is a bit confused somewhere.. probably a unity bug (might try with a newer version of unity just incase)

NVN Device Debug callback:
source: 0x00000000
type: 0x00000001 (NVN_DEBUG_CALLBACK_TYPE_API_WARNING)
id: 0x000004da
severity: 0x00000003 (NVN_DEBUG_CALLBACK_SEVERITY_NOTIFICATION)
userParam: 0x0000000000000000
message:
nvnQueueFlush: queue submission stalled waiting for commands in queue command memory
Total queue command memory used before flush = 27312 bytes, recommended max size 884736 bytes
(Can be set from: Unity Editor / Edit / Project Settings / Player / Nintendo Switch / Application / NVN Queue Command Memory)

NVN Device Debug callback:
source: 0x00000000
type: 0x00000001 (NVN_DEBUG_CALLBACK_TYPE_API_WARNING)
id: 0x000004dc
severity: 0x00000003 (NVN_DEBUG_CALLBACK_SEVERITY_NOTIFICATION)
userParam: 0x0000000000000000
message:
nvnQueueSubmitCommands: flushing - queue command memory usage exceeded flush threshold. Please see nvnQueueBuilderSetCommandFlushThreshold documentation for details.

NVN Device Debug callback:
source: 0x00000000
type: 0x00000001 (NVN_DEBUG_CALLBACK_TYPE_API_WARNING)
id: 0x000004dc
severity: 0x00000003 (NVN_DEBUG_CALLBACK_SEVERITY_NOTIFICATION)
userParam: 0x0000000000000000
message:
nvnQueueSubmitCommands: flushing - queue command memory usage exceeded flush threshold. Please see nvnQueueBuilderSetCommandFlushThreshold documentation for details.

NVN Device Debug callback:
source: 0x00000000
type: 0x00000001 (NVN_DEBUG_CALLBACK_TYPE_API_WARNING)
id: 0x000004dc
severity: 0x00000003 (NVN_DEBUG_CALLBACK_SEVERITY_NOTIFICATION)
userParam: 0x0000000000000000
message:
nvnQueueSubmitCommands: flushing - queue command memory usage exceeded flush threshold. Please see nvnQueueBuilderSetCommandFlushThreshold documentation for details.

NVN Device Debug callback:
source: 0x00000000
type: 0x00000001 (NVN_DEBUG_CALLBACK_TYPE_API_WARNING)
id: 0x000004da
severity: 0x00000003 (NVN_DEBUG_CALLBACK_SEVERITY_NOTIFICATION)
userParam: 0x0000000000000000
message:
nvnQueueFlush: queue submission stalled waiting for commands in queue command memory
Total queue command memory used before flush = 27296 bytes, recommended max size 884736 bytes
(Can be set from: Unity Editor / Edit / Project Settings / Player / Nintendo Switch / Application / NVN Queue Command Memory)

@dizzy2003
Copy link
Author

tried switch build in unity 2019.1.10 exactly the same problem, and error messages

@dizzy2003
Copy link
Author

I have created a little testbed that clears a tex2darray rendertexture to 6 different colours, on switch all layers get set to whatever the last clear colour was.
I have submitted this bug to unity
next step is going to be seeing if I can actually get different data in each texture layer and see if the pixel shader side will work

@moosichu
Copy link
Contributor

Thanks a lot, seems like there is a bug on the switch then. Sorry that we are unable to debug this directly ourselves. :(

@dizzy2003
Copy link
Author

rendered a different colour cube to each layer of the rendertexture array, this did not show up either. Have submitted a bug to unity.

not sure of the chances of this being fixed any time soon though..

@moosichu
Copy link
Contributor

@dizzy2003 Not working on Switch isn't really an acceptable situation to be in. We are looking at partially rolling back some of the changes that have been made in order to get things working (and then revist re-implementing them in a year or so). We will keep you updated on how that goes!

@dizzy2003
Copy link
Author

dizzy2003 commented Jul 29, 2019 via email

@moosichu
Copy link
Contributor

That's really good news, hopefully we will be able to unblock you this week and then we can reimplement the changes if everything works.

@moosichu moosichu changed the title Switch doesnt mach PC (with useGeometryShader returning false) Switch doesn't support texture arrays properly Aug 5, 2019
@moosichu moosichu added the Bug label Aug 17, 2019
@moosichu
Copy link
Contributor

Hi @dizzy2003, did you get any updates with this?

@dizzy2003
Copy link
Author

dizzy2003 commented Aug 19, 2019

I just got an update back from unity, its not great

Dear Mike

Further to our conversation via email, I wanted to follow up directly from our bug system. Speaking to the devs involved - The team expects to fix this in time for 2020.1, and they tell me this is a simple candidate for a backport to your current version (2018.3) also.

Note that whilst we expect to ship this in 2020.1, which is expected in March, we would definitely hope to have a fix backported sooner than that, we cannot promise when, but would hope to deliver this before year end, if not early in 2020.

@moosichu moosichu reopened this Aug 20, 2019
@moosichu
Copy link
Contributor

That's a bit a pain :/ I will discuss with @huwb what the next step could be then.

@huwb
Copy link
Contributor

huwb commented Jan 11, 2020

Hi @dizzy2003 , thought i'd check in.

Out of interest have you heard anything about this? Do you know if a fix is still going to come through?

@huwb
Copy link
Contributor

huwb commented Jun 7, 2020

Closing due to inactivity

@huwb huwb closed this as completed Jun 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants