Commit Graph

45 Commits

Author SHA1 Message Date
Jannik Vogel 54a038c69c 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 a06a119de1 VideoCore: Split regs.h inclusions 2017-02-09 00:04:24 -08:00
Yuri Kunde Schlesner 923814f99e VideoCore: Move Regs to its own file 2017-02-04 13:59:12 -08:00
Yuri Kunde Schlesner 622aff5d9b VideoCore: Split shader regs from Regs struct 2017-02-04 13:59:11 -08:00
Yuri Kunde Schlesner 140df6dd53 VideoCore: Split rasterizer regs from Regs struct 2017-02-04 13:08:47 -08:00
Yuri Kunde Schlesner de835f5f98 VideoCore: Extract swrast-specific data from OutputVertex 2017-01-29 21:31:38 -08:00
Yuri Kunde Schlesner 1c92cc7250 VideoCore: Split shader output writing from semantic loading 2017-01-29 21:31:37 -08:00
Yuri Kunde Schlesner b3b1d7fdd3 VideoCore: Consistently use shader configuration to load attributes 2017-01-29 21:31:37 -08:00
Yuri Kunde Schlesner 9f0f5d5937 VideoCore: Rename some types to more accurate names 2017-01-29 21:31:36 -08:00
Yuri Kunde Schlesner 18324c6e80 VideoCore/Shader: Move entry_point to SetupBatch 2017-01-25 18:53:25 -08:00
Yuri Kunde Schlesner 454b464c55 VideoCore/Shader: Move per-batch ShaderEngine state into ShaderSetup 2017-01-25 18:53:25 -08:00
Yuri Kunde Schlesner 8140f649a6 Shader: Remove OutputRegisters struct 2017-01-25 18:53:25 -08:00
Yuri Kunde Schlesner 80d3c9090f VideoCore/Shader: Move ProduceDebugInfo to InterpreterEngine 2017-01-25 18:53:24 -08:00
Yuri Kunde Schlesner f56a58b1e1 VideoCore/Shader: Split interpreter and JIT into separate ShaderEngines 2017-01-25 18:53:24 -08:00
Yuri Kunde Schlesner e38a8280e6 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 d08969675a VideoCore/Shader: Add constness to methods 2017-01-25 18:53:23 -08:00
Yuri Kunde Schlesner 20e3c94102 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
Yuri Kunde Schlesner 590b8ecaa9 VideoCore/Shader: Use self instead of g_state.vs in ShaderSetup 2017-01-25 18:53:23 -08:00
Yuri Kunde Schlesner 46c74145be VideoCore/Shader: Extract input vertex loading code into function 2017-01-25 18:53:20 -08:00
Yuri Kunde Schlesner 13b3d9b31d VideoCore/Shader: Extract DebugData out from UnitState 2016-12-16 00:16:25 -08:00
Yuri Kunde Schlesner f9aeb73bbf VideoCore/Shader: Remove dynamic control flow in (Get)UniformOffset 2016-12-15 23:08:05 -08:00
Yuri Kunde Schlesner 8f0e852aea VideoCore/Shader: Move DebugData to a separate file 2016-12-15 23:08:05 -08:00
Yuri Kunde Schlesner 9fa90e1c93 VideoCore: Eliminate an unnecessary copy in the drawcall loop 2016-12-14 21:00:29 -08:00
Emmanuel Gil Peyrot e4393f7ff2 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 0e23caf9fd Manually tweak source formatting and then re-run clang-format 2016-09-18 21:14:25 -07:00
Emmanuel Gil Peyrot 7e8d205414 Sources: Run clang-format on everything. 2016-09-18 09:38:01 +09:00
Jannik Vogel d66f7dda35 Retrieve shader result from new OutputRegisters-type 2016-05-16 18:55:51 +02:00
Jannik Vogel 3efb30631f Refactor access to state in shader-jit 2016-05-13 09:20:14 +02:00
Jannik Vogel ae5cec8040 Move program_counter and call_stack from UnitState to interpreter 2016-05-12 19:05:42 +02:00
Jannik Vogel 6db8a8fb39 Move default_attributes into Pica state 2016-05-12 19:05:41 +02:00
bunnei abad1b59c5 Merge pull request #1690 from JayFoxRox/tex-type-3
Pica: Implement texture type 3 (Projection2D)
2016-05-11 21:47:08 -04:00
Jannik Vogel 631bae020f Turn ShaderSetup into struct 2016-05-11 23:48:24 +02:00
Jannik Vogel 1fe9ac4c45 Pica: Add tc0.w to OutputVertex 2016-05-11 08:07:36 +02:00
Emmanuel Gil Peyrot d6164b8022 VideoCore: Run include-what-you-use and fix most includes. 2016-04-30 17:02:41 +01:00
Henrik Rydgard c1ee661492 Refactor: Extract VertexLoader from command_processor.cpp.
Preparation for a similar concept to Dolphin or PPSSPP. These can be JIT-ed and cached.
2016-04-28 19:05:55 +02:00
bunnei 110725828a shader: Remove unused 'state' argument from 'Setup' function. 2016-04-13 23:04:48 -04:00
Lioncash f932c2f4ac Common: Get rid of alignment macros
The gl rasterizer already uses alignas,
so we may as well move everything over.
2016-03-09 01:31:14 -05:00
Dwayne Slater 141fe87a0f Add immediate mode vertex submission 2016-03-02 22:16:38 -05:00
bunnei 3c3e328340 pica: Implement decoding of basic fragment lighting components.
- Diffuse
- Distance attenuation
- float16/float20 types
- Vertex Shader 'view' output
2016-02-05 17:17:28 -05:00
aroulin f588077bbb Shader: Fix size_t to int casts of register offsets 2015-09-07 16:50:28 +02:00
Tony Wasserka ca1fea38dc Build fix for Debug configurations. 2015-08-16 15:14:54 +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 c03924e60e Shader: Initial implementation of x86_x64 JIT compiler for Pica vertex shaders.
- Config: Add an option for selecting to use shader JIT or interpreter.
- Qt: Add a menu option for enabling/disabling the shader JIT.
2015-08-15 18:01:07 -04:00
bunnei 5794310781 Shader: Define a common interface for running vertex shader programs. 2015-08-15 17:33:44 -04:00