Yuri Kunde Schlesner
d4bcba2ca1
VideoCore: Shader interpreter cleanups
9 years ago
Yuri Kunde Schlesner
fa5d9d8266
Use negative priorities to avoid special-casing the self-include
9 years ago
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.
9 years ago
Yuri Kunde Schlesner
1e4a5da9f4
Manually tweak source formatting and then re-run clang-format
9 years ago
Emmanuel Gil Peyrot
628ed4376a
Sources: Run clang-format on everything.
9 years ago
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.
9 years ago
Jannik Vogel
df3eeea302
Retrieve shader result from new OutputRegisters-type
10 years ago
Jannik Vogel
208a74a882
Use new shader-jit signature for interpreter
10 years ago
Jannik Vogel
ad0acfea14
Move program_counter and call_stack from UnitState to interpreter
10 years ago
Emmanuel Gil Peyrot
c39a267974
VideoCore: Run include-what-you-use and fix most includes.
10 years ago
Lioncash
7b2af63608
video_core: Don't cast away const
10 years ago
Lioncash
6d9e7e962b
shader_interpreter: use std::inner_product for the dot product
Same thing, less code.
10 years ago
Jannik Vogel
9e29ed3f66
PICA: Fix MAD/MADI encoding
10 years ago
Dwayne Slater
141fe87a0f
Add immediate mode vertex submission
10 years ago
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.
10 years ago
Lioncash
2cd98a45cb
video_core: Reorganize headers
10 years ago
Yuri Kunde Schlesner
8b0a7e7afe
Shaders: Explicitly conform to PICA semantics in MAX/MIN
10 years ago
aroulin
8367db5dcd
Shader: Use std::sqrt for float instead of sqrt
10 years ago
aroulin
2bcee80587
Shader: RCP and RSQ computes only the 1st component
10 years ago
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.
10 years ago
aroulin
76afa48b0c
Shader: implement SGE, SGEI in interpreter
10 years ago
aroulin
7ca01b779f
Shader: implement EX2 and LG2 in interpreter
11 years ago
Tony Wasserka
1c1a9ab09b
Introduce a shader tracer to allow inspection of input/output values for each processed instruction.
11 years ago
bunnei
5c7e9ffce7
Shader: Use a POD struct for registers.
11 years ago
bunnei
5794310781
Shader: Define a common interface for running vertex shader programs.
11 years ago
bunnei
2d100ebae3
Shader: Move shader code to its own subdirectory, "shader".
11 years ago
bunnei
f622a78544
GPU: Refactor "VertexShader" namespace to "Shader".
- Also renames "vertex_shader.*" to "shader_interpreter.*"
11 years ago
Yuri Kunde Schlesner
4909a1486e
Videocore: Simplify variables in vertex shader interpreter
Simplifies the code and gives a tiny speed-up.
11 years ago
Yuri Kunde Schlesner
877d2a0e48
Videocore: Replace std::stack in shader interpreter with static_vector
Shaves off 1/3rd of the vertex shader time in Fire Emblem
11 years ago
Yuri Kunde Schlesner
13347997ba
VideoCore: #ifdef out some debugging routines
Some disabled debugging functionality was being called from rendering
routines in VideoCore. Although disabled, many of them still allocated
memory or did some extra work that was enough to show up in a profiler.
Gives a slight (~2ms) speedup.
11 years ago
Yuri Kunde Schlesner
4e09202226
VideoCore: Saturate vertex colors before interpolating
During testing, it was discovered that hardware does not interpolate
colors output by the vertex shader as-is. Rather, it drops the sign and
saturates the value to 1.0. This is done before interpolation, such that
(e.g.) interpolating outputs 1.5 and -0.5 is equivalent to as if the
shader had output the values 1.0 and 0.5 instead, with the interpolated
value never crossing 0.0.
This change has been tested against hardware.
11 years ago
Yuri Kunde Schlesner
5a75cf8fd2
Pica: Fix DP3 instruction, which wasn't assigning to the w component
11 years ago
zawata
6933a50aeb
Vertex Shader : Undo casting
11 years ago
zawata
716120da3d
Video_Core : Fix Conversion Warnings
11 years ago
Tony Wasserka
33568494af
Pica/Shader: Add geometry shader definitions.
11 years ago
bunnei
1574c44586
vertex_shader: Use address offset on src2 in inverted mode.
11 years ago
bunnei
4ac6c1a3b5
vertex_shader: Implement SLT/SLTI instructions.
11 years ago
bunnei
875bd29766
vertex_shader: Implement MIN instruction.
11 years ago
Emmanuel Gil Peyrot
b1503b2020
Remove every trailing whitespace from the project (but externals).
11 years ago
bunnei
1b42d55a9d
Pica: Create 'State' structure and move state memory there.
11 years ago
Yuri Kunde Schlesner
7ada357b2d
Memmap: Re-organize memory function in two files
memory.cpp/h contains definitions related to acessing memory and
configuring the address space
mem_map.cpp/h contains higher-level definitions related to configuring
the address space accoording to the kernel and allocating memory.
11 years ago
Yuri Kunde Schlesner
def5913d19
GPU: Add more fine grained profiling for vertex shader and rasterization
11 years ago
bunnei
692a74c09e
vertex_shader: Implement FLR instruction.
11 years ago
bunnei
f935130a0f
vertex_shader: Implement MADI instruction.
nihstro: Update submodule to latest upstream/master to support MADI instruction decoding.
11 years ago
Subv
0e5ca080a8
GPU: Implemented default vertex shader attributes.
Fixes some games crashing.
11 years ago
Tony Wasserka
e4f5ec6272
Pica/VertexShader: Fix a bug caused due to incorrect assumptions of consecutive output register tables.
We now write create a temporary buffer for output registers and copy all of them to the actual output vertex structure after the shader has run. This is technically not necessary, but it's easier to vectorize in the future.
11 years ago
archshift
7d43aef4d0
Update nihstro submodule to the initial release version.
Includes more opcodes to implement in the future.
11 years ago
Subv
9a03e9c61d
Pica/VertexShader: Fixed LOOP with more than one iteration.
Previously it wouldn't jump back to the start of the loop code once it reached the end of the block.
Fixes the texture problems in a lot of games.
11 years ago
Tony Wasserka
70a764d992
Pica/VertexShader: Implement the LOOP instruction.
11 years ago
Subv
8e2b248e05
Build: Fixed some warnings
11 years ago