Commit Graph

163 Commits

Author SHA1 Message Date
ReinUsesLisp d28033adca shader_ir: Add comparison helpers 2019-01-15 17:54:49 -03:00
ReinUsesLisp c0d053482c shader_ir: Add half float helpers 2019-01-15 17:54:49 -03:00
ReinUsesLisp e46dd3ce5f shader_ir: Add integer helpers 2019-01-15 17:54:49 -03:00
ReinUsesLisp b91929bf10 shader_ir: Add float helpers 2019-01-15 17:54:49 -03:00
ReinUsesLisp 83e750c9ae shader_ir: Add setters 2019-01-15 17:54:49 -03:00
ReinUsesLisp 394f906044 shader_ir: Add local memory getters 2019-01-15 17:54:49 -03:00
ReinUsesLisp 311d1af657 shader_ir: Add internal flag getters 2019-01-15 17:54:49 -03:00
ReinUsesLisp a66682374f shader_ir: Add attribute getters 2019-01-15 17:54:49 -03:00
ReinUsesLisp 9d5d96500c shader_ir: Add constant buffer getters 2019-01-15 17:54:49 -03:00
ReinUsesLisp 7f89f99c60 shader_ir: Add register getter 2019-01-15 17:54:49 -03:00
ReinUsesLisp f43041efe1 shader_ir: Add immediate node constructors 2019-01-15 17:54:49 -03:00
ReinUsesLisp 25f868d8be shader_ir: Initial implementation 2019-01-15 17:54:49 -03:00
James Rowe a5b9cd4d18 Remove references to PICA and rasterizers in video_core 2018-01-12 19:11:03 -07:00
Huw Pascoe 1089bdda80 Improved performance of FromAttributeBuffer
Ternary operator is optimized by the compiler
whereas std::min() is meant to return a value.

I've noticed a 5%-10% emulation speed increase.
2017-09-17 15:56:36 +01:00
wwylele 6d51febdc4 pica/shader/jit: implement SETEMIT and EMIT 2017-08-19 10:13:20 +03:00
wwylele 4283f4b244 correct constness 2017-08-19 10:13:20 +03:00
wwylele 4d4dbc83a7 pica/shader/interpreter: implement SETEMIT and EMIT 2017-08-19 10:13:20 +03:00
wwylele 2599928707 pica/shader: extend UnitState for GS
Among four shader units in pica, a special unit can be configured to run both VS and GS program. GSUnitState represents this unit, which extends UnitState (which represents the other three normal units) with extra state for primitive emitting. It uses lots of raw pointers to represent internal structure in order to keep it standard layout type for JIT to access.
This unit doesn't handle triangle winding (inverting) itself; instead, it calls a WindingSetter handler. This will be explained in the following commits
2017-08-19 10:13:20 +03:00
wwylele dc6f41bcc5 pica/shader_interpreter: fix off-by-one in LOOP 2017-07-27 13:48:27 +03:00
Yuri Kunde Schlesner ccdeacf149 Stop using reserved operator names (and/or/xor) with Xbyak
Also has the Dynarmic upgrade with the same change
2017-06-17 12:20:22 -07:00
Jannik Vogel b9cc8596a2 Pica: Set program code / swizzle data limit to 4096
One of the later commits will enable writing to GS regs.
It turns out that on startup, most games will write 4096 GS program words.

The current limit of 1024 would hence result in 3072 (4096 - 1024) error messages:
```
HW.GPU <Error> video_core/shader/shader.cpp:WriteProgramCode:229: Invalid GS program offset 1024
```

New constants have been introduced to represent these limits.
The swizzle data size has also been raised. This matches the given field sizes of [GPUREG_SH_OPDESCS_INDEX](https://3dbrew.org/wiki/GPU/Internal_Registers#GPUREG_SH_OPDESCS_INDEX) and [GPUREG_SH_CODETRANSFER_INDEX](https://www.3dbrew.org/wiki/GPU/Internal_Registers#GPUREG_SH_CODETRANSFER_INDEX) (12 bit = [0; 4095]).
2017-05-11 15:01:27 +02:00
Mat M dc1927a9d1 Doxygen: Amend minor issues (#2593)
Corrects a few issues with regards to Doxygen documentation, for example:

- Incorrect parameter referencing.
- Missing @param tags.
- Typos in @param tags.

and a few minor other issues.
2017-02-26 17:58:51 -08:00
Yuri Kunde Schlesner 653723399c video_core/shader: Document sanitized MUL operation 2017-02-12 13:29:14 -08:00
Yuri Kunde Schlesner 84f423dea6 Merge pull request #2550 from yuriks/pica-refactor2
Small VideoCore cleanups
2017-02-12 12:33:26 -08:00
Yuri Kunde Schlesner ef90a662f2 video_core: Fix benign out-of-bounds indexing of array (#2553)
The resulting pointer wasn't written to unless the index was verified as
valid, but that's still UB and triggered debug checks in MSVC.

Reported by garrettboast on IRC
2017-02-10 20:51:09 -08:00
Yuri Kunde Schlesner ddf23d4a2e VideoCore: Split regs.h inclusions 2017-02-09 00:04:24 -08:00
Yuri Kunde Schlesner a0b1957425 VideoCore: Move Regs to its own file 2017-02-04 13:59:12 -08:00
Yuri Kunde Schlesner 08df8f7d7a VideoCore: Split shader regs from Regs struct 2017-02-04 13:59:11 -08:00
Yuri Kunde Schlesner d3928b7f9a VideoCore: Split rasterizer regs from Regs struct 2017-02-04 13:08:47 -08:00
Yuri Kunde Schlesner cb89a67a80 Merge pull request #2476 from yuriks/shader-refactor3
Oh No! More shader changes!
2017-02-04 13:02:48 -08:00
wwylele 2bc786be73 ShaderJIT: add 16 dummy bytes at the bottom of the stack 2017-02-03 14:53:38 +02:00
Weiyi Wang 6580180759 Common/x64: remove legacy emitter and abi (#2504)
These are not used any more since we moved shader JIT to xbyak.
2017-01-31 01:06:42 -08:00
Merry 6b2f12869e shader_jit_x64_compiler: esi and edi should be persistent (#2500) 2017-01-31 00:38:31 -08:00
Yuri Kunde Schlesner 1a3c583a0f VideoCore: Extract swrast-specific data from OutputVertex 2017-01-29 21:31:38 -08:00
Yuri Kunde Schlesner bf1614c693 VideoCore/Shader: Clean up OutputVertex::FromAttributeBuffer
This also fixes a long-standing but neverthless harmless memory
corruption bug, whech the padding of the OutputVertex struct would get
corrupted by unused attributes.
2017-01-29 21:31:38 -08:00
Yuri Kunde Schlesner dcdaff5ecc VideoCore: Split shader output writing from semantic loading 2017-01-29 21:31:37 -08:00
Yuri Kunde Schlesner 067b9b54bd VideoCore: Consistently use shader configuration to load attributes 2017-01-29 21:31:37 -08:00
Yuri Kunde Schlesner a4a4b6408c VideoCore: Rename some types to more accurate names 2017-01-29 21:31:36 -08:00
Yuri Kunde Schlesner ab0b74b0f3 VideoCore/Shader: Move entry_point to SetupBatch 2017-01-25 18:53:25 -08:00
Yuri Kunde Schlesner 1994f1a6f2 VideoCore/Shader: Move per-batch ShaderEngine state into ShaderSetup 2017-01-25 18:53:25 -08:00
Yuri Kunde Schlesner c863fc36ce Shader: Remove OutputRegisters struct 2017-01-25 18:53:25 -08:00
Yuri Kunde Schlesner b0ec4da3b0 Shader: Initialize conditional_code in interpreter
This doesn't belong in LoadInputVertex because it also happens for
non-VS invocations. Since it's not used by the JIT it seems adequate to
initialize it in the interpreter which is the only thing that cares
about them.
2017-01-25 18:53:24 -08:00
Yuri Kunde Schlesner e500250c97 Shader: Don't read ShaderSetup from global state 2017-01-25 18:53:24 -08:00
Yuri Kunde Schlesner 5b046f49c9 shader_jit_x64: Don't read program from global state 2017-01-25 18:53:24 -08:00
Yuri Kunde Schlesner 46fc50931f VideoCore/Shader: Move ProduceDebugInfo to InterpreterEngine 2017-01-25 18:53:24 -08:00
Yuri Kunde Schlesner 931a2b0ca4 VideoCore/Shader: Split interpreter and JIT into separate ShaderEngines 2017-01-25 18:53:24 -08:00
Yuri Kunde Schlesner 88b533871e VideoCore/Shader: Rename shader_jit_x64{ => _compiler}.{cpp,h} 2017-01-25 18:53:23 -08:00
Yuri Kunde Schlesner 73e7bc2592 VideoCore/Shader: Split shader uniform state and shader engine
Currently there's only a single dummy implementation, which will be
split in a following commit.
2017-01-25 18:53:23 -08:00
Yuri Kunde Schlesner f887eccd74 VideoCore/Shader: Add constness to methods 2017-01-25 18:53:23 -08:00
Yuri Kunde Schlesner 03d2b6aa89 VideoCore/Shader: Use only entry_point as ShaderSetup param
This removes all implicit dependency of ShaderState on global PICA
state.
2017-01-25 18:53:23 -08:00