Commit graph

44 commits

Author SHA1 Message Date
wwylele
dc6f41bcc5 pica/shader_interpreter: fix off-by-one in LOOP 2017-07-27 13:48:27 +03: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
Yuri Kunde Schlesner
08df8f7d7a VideoCore: Split shader regs from Regs struct 2017-02-04 13:59:11 -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
931a2b0ca4 VideoCore/Shader: Split interpreter and JIT into separate ShaderEngines 2017-01-25 18:53:24 -08:00
Jonathan Hao
1df720ed08 Fix some warnings (#2399) 2017-01-04 13:48:29 -03:00
Yuri Kunde Schlesner
7d4827f520 VideoCore/Shader: Extract DebugData out from UnitState 2016-12-16 00:16:25 -08:00
Yuri Kunde Schlesner
d94a04ced7 VideoCore/Shader: Extract evaluate_condition lambda to function scope 2016-12-16 00:15:51 -08:00
Yuri Kunde Schlesner
fc3d8c77c8 VideoCore/Shader: Extract call lambda up a scope and remove unused param 2016-12-15 23:08:05 -08:00
Yuri Kunde Schlesner
ec7b3940b0 VideoCore/Shader: Move DebugData to a separate file 2016-12-15 23:08:05 -08:00
Yuri Kunde Schlesner
d4bcba2ca1 VideoCore: Shader interpreter cleanups 2016-09-29 21:15:49 -07:00
Yuri Kunde Schlesner
fa5d9d8266 Use negative priorities to avoid special-casing the self-include 2016-09-21 00:15:56 -07:00
Emmanuel Gil Peyrot
1138ec0d49 Remove empty newlines in #include blocks.
This makes clang-format useful on those.

Also add a bunch of forgotten transitive includes, which otherwise
prevented compilation.
2016-09-21 11:15:47 +09:00
Yuri Kunde Schlesner
1e4a5da9f4 Manually tweak source formatting and then re-run clang-format 2016-09-18 21:14:25 -07:00
Emmanuel Gil Peyrot
628ed4376a Sources: Run clang-format on everything. 2016-09-18 09:38:01 +09:00
Yuri Kunde Schlesner
300e68c5df VideoCore: Fix dangling lambda context in shader interpreter
The static meant that after the first execution, these lambda context
would be pointing to a random location on the stack. Fixes a random
crash when using the interpreter.
2016-09-15 22:15:11 -07:00
Jannik Vogel
df3eeea302 Retrieve shader result from new OutputRegisters-type 2016-05-16 18:55:51 +02:00
Jannik Vogel
208a74a882 Use new shader-jit signature for interpreter 2016-05-13 09:41:55 +02:00
Jannik Vogel
ad0acfea14 Move program_counter and call_stack from UnitState to interpreter 2016-05-12 19:05:42 +02:00
Emmanuel Gil Peyrot
c39a267974 VideoCore: Run include-what-you-use and fix most includes. 2016-04-30 17:02:41 +01:00
bunnei
07fe93e886 Merge pull request #1538 from lioncash/dot
shader_interpreter: use std::inner_product for the dot product
2016-03-20 00:35:06 -04:00
Lioncash
7b2af63608 video_core: Don't cast away const 2016-03-17 02:01:38 -04:00
Lioncash
6d9e7e962b shader_interpreter: use std::inner_product for the dot product
Same thing, less code.
2016-03-17 01:00:30 -04:00
Jannik Vogel
9e29ed3f66 PICA: Fix MAD/MADI encoding 2016-03-15 20:01:25 +01:00
Dwayne Slater
141fe87a0f Add immediate mode vertex submission 2016-03-02 22:16:38 -05:00
Yuri Kunde Schlesner
b4c68589f6 Shader: Implement "invert condition" feature of IFU instruction
If the bit 0 of the JMPU instruction is set, then the jump condition
will be inverted. That is, a jump will happen when the boolean is false
instead of when it is true.
2016-01-24 20:29:06 -08:00
Lioncash
2cd98a45cb video_core: Reorganize headers 2015-09-11 07:31:15 -04:00
Yuri Kunde Schlesner
8b0a7e7afe Shaders: Explicitly conform to PICA semantics in MAX/MIN 2015-08-24 01:46:58 -03:00
bunnei
986b526e83 Merge pull request #1062 from aroulin/shader-rcp-rsq
Shader: RCP and RSQ computes only the 1st component
2015-08-23 17:56:35 -04:00
aroulin
8367db5dcd Shader: Use std::sqrt for float instead of sqrt 2015-08-23 22:03:07 +02:00
aroulin
2bcee80587 Shader: RCP and RSQ computes only the 1st component 2015-08-23 22:01:17 +02:00
aroulin
677a97c8bf Shader: implement DPH/DPHI in interpreter
Tests revealed that the component with w=1 is
SRC1 and not SRC2, it is now fixed on 3dbrew.
2015-08-22 11:09:53 +02:00
aroulin
76afa48b0c Shader: implement SGE, SGEI in interpreter 2015-08-19 14:29:39 +02:00
aroulin
7ca01b779f Shader: implement EX2 and LG2 in interpreter 2015-08-16 15:54:30 +02:00
Tony Wasserka
1c1a9ab09b Introduce a shader tracer to allow inspection of input/output values for each processed instruction. 2015-08-16 14:12:11 +02:00
bunnei
5c7e9ffce7 Shader: Use a POD struct for registers. 2015-08-15 18:03:27 -04:00
bunnei
5794310781 Shader: Define a common interface for running vertex shader programs. 2015-08-15 17:33:44 -04:00
bunnei
2d100ebae3 Shader: Move shader code to its own subdirectory, "shader". 2015-08-15 17:33:42 -04:00
Renamed from src/video_core/shader_interpreter.cpp (Browse further)