Commit graph

36 commits

Author SHA1 Message Date
ReinUsesLisp
ca05a13c62 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
9fbfe7d676 glasm: Fix usage counting on phi nodes 2021-07-22 21:51:33 -04:00
ReinUsesLisp
c31521512f gl_shader_cache,glasm: Conditionally use typeless image reads extension 2021-07-22 21:51:33 -04:00
ReinUsesLisp
84feabac88 glasm: Implement forced early Z 2021-07-22 21:51:33 -04:00
ReinUsesLisp
9e7b6622c2 shader: Split profile and runtime information in separate structs 2021-07-22 21:51:33 -04:00
ameerj
36d040da70 glasm: Implement FSWZADD 2021-07-22 21:51:33 -04:00
ReinUsesLisp
48d4e26326 glasm: Fix tessellation headers 2021-07-22 21:51:32 -04:00
ReinUsesLisp
9ec2303ad6 glasm: Add tessellation shader declarations 2021-07-22 21:51:32 -04:00
ReinUsesLisp
fad139a3e6 glasm: Declare geometry program headers 2021-07-22 21:51:32 -04:00
ReinUsesLisp
dadd192b30 glasm: Implement ImageRead 2021-07-22 21:51:32 -04:00
ReinUsesLisp
accad56ee7 glasm: Implement stores to gl_ViewportIndex 2021-07-22 21:51:32 -04:00
ReinUsesLisp
8b7d5912d6 glasm: Support textures used in more than one stage 2021-07-22 21:51:32 -04:00
ReinUsesLisp
9bb3e008c9 shader: Read branch conditions from an instruction
Fixes the identity removal pass.
2021-07-22 21:51:32 -04:00
ReinUsesLisp
ec6fc5fe78 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
db2f0f4108 emit_glasm: Enable ARB_draw_buffers when needed 2021-07-22 21:51:31 -04:00
lat9nq
f7a2340205 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
31d402ee74 glasm: Add Void type to GLASM values 2021-07-22 21:51:31 -04:00
ReinUsesLisp
3764750339 glasm: Add graphics specific shader declarations to GLASM 2021-07-22 21:51:31 -04:00
ameerj
057dee4856 glasm: Implement local memory for glasm 2021-07-22 21:51:31 -04:00
ReinUsesLisp
bf5e48ffe4 glasm: Initial implementation of phi nodes on GLASM 2021-07-22 21:51:31 -04:00
ReinUsesLisp
d4385c34e3 glasm: Declare NV_shader_thread_group when needed 2021-07-22 21:51:31 -04:00
ReinUsesLisp
d54d7de40e 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
7ff5851608 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
8c81a20ace 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
c917290497 glasm: Enable unintentionally disabled register aliasing on GLASM 2021-07-22 21:51:31 -04:00
ReinUsesLisp
c4fd6b55bc glasm: Implement shuffle and vote instructions on GLASM 2021-07-22 21:51:31 -04:00
ReinUsesLisp
deda89372f glasm: Fix register allocation when moving immediate on GLASM 2021-07-22 21:51:31 -04:00
ReinUsesLisp
8eb72ff0dc glasm: Fix moving U64 immediates to registers in GLASM 2021-07-22 21:51:31 -04:00
ameerj
80813b1d14 glasm: Implement storage atomic ops 2021-07-22 21:51:31 -04:00
ReinUsesLisp
ad61b47f80 glasm: Add conversion instructions to GLASM 2021-07-22 21:51:31 -04:00
ReinUsesLisp
4502595bc2 glasm: Initial GLASM fp64 support 2021-07-22 21:51:30 -04:00
ReinUsesLisp
9f851e3832 glasm: Implement GLASM fp16 packing and move bitwise insns 2021-07-22 21:51:30 -04:00
ReinUsesLisp
1c9307969c glasm: Make GLASM aware of types 2021-07-22 21:51:30 -04:00
ReinUsesLisp
2b04b4d27f glasm: Remove unused argument in identity instructions on GLASM 2021-07-22 21:51:30 -04:00
ReinUsesLisp
6fd190d1ae glasm: Implement basic GLASM instructions 2021-07-22 21:51:30 -04:00
ReinUsesLisp
b10cf64c48 glasm: Add GLASM backend infrastructure 2021-07-22 21:51:30 -04:00