AssetRipper icon indicating copy to clipboard operation
AssetRipper copied to clipboard

[Bug]: Shader decompilation issues

Open Zbuffers opened this issue 3 years ago • 1 comments

Are you on the latest version of AssetRipper?

Yes, I'm on the latest release of AssetRipper.

Which release are you using?

GUI Version Windows x64

Which game did this occur on?

SUPERHOT https://steamdb.info/app/322500/

Which Unity version did this occur on?

2020.3.24

Is the game Mono or IL2Cpp?

Mono

Describe the issue.

Hi, I am trying to export a single shader.

When i Choose Shader Decompile mode, I get a fatal error (sequence contains no matching elements). relevant line in USILCBufferMetadder.cs: ConstantBuffer constantBuffer = _shaderData.ConstantBuffers.First(b => b.Name == binding.Name);

the partially exported shader file ends at the beginning of the frag function : fout frag(v2f inp) { eof here ...

See attached log for details. side note: When I choose Shader Disassembly mode, it exports, but I notice a strange thing: all the 'Pass' keywords are written as '0'... (?) ( 'Pass {', is exported as '0 {'). Maybe a relation ?

I hope this can help, Kind regards, Zbuffer

Relevant log output

AssetRipper.log

Zbuffers avatar Aug 25 '22 15:08 Zbuffers

When i Choose Shader Decompile mode, I get a fatal error (sequence contains no matching elements).

The problem doesn't seem to be a decompiler error necessarily but it looks like metadata format changed and fragment shaders doesn't have cbuffer bindings anymore. I'll look into it when I have the time.

When I choose Shader Disassembly mode, it exports, but I notice a strange thing: all the 'Pass' keywords are written as '0'... (?) ( 'Pass {', is exported as '0 {'). Maybe a relation ?

Probably not. I think this is a mistake when AssetRipper was ported to the source gen version and some enum probably got broken somewhere.

nesrak1 avatar Aug 26 '22 18:08 nesrak1