Commit graph

44 commits

Author SHA1 Message Date
ReinUsesLisp
f40daa777e shader: Add logging 2021-07-22 21:51:35 -04:00
ReinUsesLisp
5fa6d7a3b9 glasm: Use ARB_derivative_control conditionally 2021-07-22 21:51:34 -04:00
ReinUsesLisp
9750e0410b opengl: Declare fragment outputs even if they are not used
Fixes Ori and the Blind Forest's menu on GLASM. For some reason
(probably high level optimizations) it is not sanitized on SPIR-V for
OpenGL. Vulkan is unaffected by this change.
2021-07-22 21:51:34 -04:00
ReinUsesLisp
1a02dee23a glasm: Reduce reg allocation leaks from an exception to a log 2021-07-22 21:51:34 -04:00
ReinUsesLisp
ec19b0d7eb glasm: Implement Y direction 2021-07-22 21:51:33 -04:00
ReinUsesLisp
3e5b0c116d glasm: Release phi node registers after they are no longer needed 2021-07-22 21:51:33 -04:00
ReinUsesLisp
42a91d4366 glasm: Remove unnecessary value types 2021-07-22 21:51:33 -04:00
ReinUsesLisp
6bf6015548 glasm: Throw when there are register leaks 2021-07-22 21:51:33 -04:00
ReinUsesLisp
143db4b112 glasm: Catch more register leaks
Add support for null registers. These are used when an instruction has
no usages.

This comes handy when an instruction is only used for its CC value, with
the caveat of having to invalidate all pseudo-instructions before
defining the instruction itself in the register allocator. This commits
changes this.

Workaround a bug on Nvidia's condition codes conditional execution using
branches.
2021-07-22 21:51:33 -04:00
ReinUsesLisp
a5ce5f4a65 glasm: Fix usage counting on phi nodes 2021-07-22 21:51:33 -04:00
ReinUsesLisp
94d3b4d7e3 gl_shader_cache,glasm: Conditionally use typeless image reads extension 2021-07-22 21:51:33 -04:00
ReinUsesLisp
16c95ab56d glasm: Implement forced early Z 2021-07-22 21:51:33 -04:00
ReinUsesLisp
9452fe2dc6 shader: Split profile and runtime information in separate structs 2021-07-22 21:51:33 -04:00
ameerj
68fb25a223 glasm: Implement FSWZADD 2021-07-22 21:51:33 -04:00
ReinUsesLisp
53705226c6 glasm: Fix tessellation headers 2021-07-22 21:51:32 -04:00
ReinUsesLisp
e8289a4e5f glasm: Add tessellation shader declarations 2021-07-22 21:51:32 -04:00
ReinUsesLisp
1efc77e510 glasm: Declare geometry program headers 2021-07-22 21:51:32 -04:00
ReinUsesLisp
96d2dd78b0 glasm: Implement ImageRead 2021-07-22 21:51:32 -04:00
ReinUsesLisp
601f7bfd00 glasm: Implement stores to gl_ViewportIndex 2021-07-22 21:51:32 -04:00
ReinUsesLisp
0c82ee3444 glasm: Support textures used in more than one stage 2021-07-22 21:51:32 -04:00
ReinUsesLisp
5c6dc51c69 shader: Read branch conditions from an instruction
Fixes the identity removal pass.
2021-07-22 21:51:32 -04:00
ReinUsesLisp
0b3a3f35e8 glasm: Implement TEX and TEXS instructions
Remove lod clamp from texture instructions with lod, as this is not
needed (nor supported).
2021-07-22 21:51:31 -04:00
ReinUsesLisp
22fb9cc538 emit_glasm: Enable ARB_draw_buffers when needed 2021-07-22 21:51:31 -04:00
lat9nq
69210028b4 shader_recompiler: GCC fixes
Fixes members of unnamed union not being accessible, and one function
without a declaration.
2021-07-22 21:51:31 -04:00
ReinUsesLisp
58cf7baaea glasm: Add Void type to GLASM values 2021-07-22 21:51:31 -04:00
ReinUsesLisp
6758e3d946 glasm: Add graphics specific shader declarations to GLASM 2021-07-22 21:51:31 -04:00
ameerj
d0c4cca02d glasm: Implement local memory for glasm 2021-07-22 21:51:31 -04:00
ReinUsesLisp
f2ae32fa76 glasm: Initial implementation of phi nodes on GLASM 2021-07-22 21:51:31 -04:00
ReinUsesLisp
ffdaa42529 glasm: Declare NV_shader_thread_group when needed 2021-07-22 21:51:31 -04:00
ReinUsesLisp
03f6d424ce glasm: Rework control flow introducing a syntax list
This commit regresses VertexA shaders, their transformation pass has to
be adapted to the new control flow.
2021-07-22 21:51:31 -04:00
ameerj
8a556b49cf glasm: Implement Storage atomics
StorageAtomicExchangeU64 is failing test seemingly due to failure storing 64-bit
result into the register
2021-07-22 21:51:31 -04:00
ReinUsesLisp
8331e533f4 glasm: Ensure reg alloc order across compilers on GLASM
Use a struct constructor to serialize register allocation arguments to
ensure registers are allocated in the same order regardless of the
compiler used.

The A and B functions can be called in any order when passed as
arguments to "foo":

  foo(A(), B())

But the order is guaranteed for curly-braced constructor calls in
classes:

  Foo{A(), B()}

Use this to get consistent behavior.
2021-07-22 21:51:31 -04:00
ReinUsesLisp
d9a11b2388 glasm: Enable unintentionally disabled register aliasing on GLASM 2021-07-22 21:51:31 -04:00
ReinUsesLisp
7273fcab95 glasm: Implement shuffle and vote instructions on GLASM 2021-07-22 21:51:31 -04:00
ReinUsesLisp
cfff5bad59 glasm: Fix register allocation when moving immediate on GLASM 2021-07-22 21:51:31 -04:00
ReinUsesLisp
b5b5006016 glasm: Fix moving U64 immediates to registers in GLASM 2021-07-22 21:51:31 -04:00
ameerj
55801889e1 glasm: Implement storage atomic ops 2021-07-22 21:51:31 -04:00
ReinUsesLisp
cbac486530 glasm: Add conversion instructions to GLASM 2021-07-22 21:51:31 -04:00
ReinUsesLisp
fc009ca296 glasm: Initial GLASM fp64 support 2021-07-22 21:51:30 -04:00
ReinUsesLisp
8de3f88656 glasm: Implement GLASM fp16 packing and move bitwise insns 2021-07-22 21:51:30 -04:00
ReinUsesLisp
04ed27a997 glasm: Make GLASM aware of types 2021-07-22 21:51:30 -04:00
ReinUsesLisp
fdd87ffdb7 glasm: Remove unused argument in identity instructions on GLASM 2021-07-22 21:51:30 -04:00
ReinUsesLisp
6c0a696179 glasm: Implement basic GLASM instructions 2021-07-22 21:51:30 -04:00
ReinUsesLisp
d9b9c10f32 glasm: Add GLASM backend infrastructure 2021-07-22 21:51:30 -04:00