Open Nukem9 opened 6 years ago
That is correct, it presently just drops the 'precise' keyword, and is something we should pass through.
However, if you really need the precision, you are probably better off to use our Assembler instead of the Decompiler. The Decompiler also generates a lot of ftoi and itof instructions, as the types are not well defined at ASM level. This can lead to shaders compiling successfully, but failing when in use.
Let me also add here that is ignoring 'linear centroid' modifiers as well.
I didn't see this anywhere so I'm hoping it's not a duplicate. Game: TES: Skyrim Special Edition.
Incorrect code: https://gist.github.com/Nukem9/46166358785a3502bb7887792b85a8c0 image
Corrected code: (Change
float4 r0,r1,r2;
toprecise float4 r0,r1,r2;
) imageIt completely ignores the [precise] modifier in the disassembly. I checked the compiled shader and it gets optimized to
mad
instead ofmul + add
.