Huw Pascoe
a234e4c200
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.
8 years ago
wwylele
bb63ae3052
correct constness
8 years ago
wwylele
46c6973d2b
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
8 years ago
Yuri Kunde Schlesner
443bb3d522
Merge pull request #2550 from yuriks/pica-refactor2
...
Small VideoCore cleanups
8 years ago
Yuri Kunde Schlesner
e2fa1ca5e1
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
8 years ago
Yuri Kunde Schlesner
60fc0b086f
VideoCore: Split regs.h inclusions
8 years ago
Yuri Kunde Schlesner
5759d94b5c
VideoCore: Move Regs to its own file
8 years ago
Yuri Kunde Schlesner
f7c7f422c6
VideoCore: Split shader regs from Regs struct
8 years ago
Yuri Kunde Schlesner
000e78144c
VideoCore: Split rasterizer regs from Regs struct
8 years ago
Yuri Kunde Schlesner
dcdffabfe6
VideoCore: Extract swrast-specific data from OutputVertex
8 years ago
Yuri Kunde Schlesner
8ed9f9d49f
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.
8 years ago
Yuri Kunde Schlesner
92bf5c88e6
VideoCore: Split shader output writing from semantic loading
8 years ago
Yuri Kunde Schlesner
335df895b9
VideoCore: Consistently use shader configuration to load attributes
8 years ago
Yuri Kunde Schlesner
ab6954e942
VideoCore: Rename some types to more accurate names
8 years ago
Yuri Kunde Schlesner
6fa3687afc
Shader: Remove OutputRegisters struct
8 years ago
Yuri Kunde Schlesner
9ea5eacf91
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.
8 years ago
Yuri Kunde Schlesner
114d6b2f97
VideoCore/Shader: Split interpreter and JIT into separate ShaderEngines
8 years ago
Yuri Kunde Schlesner
8eefc62833
VideoCore/Shader: Rename shader_jit_x64{ => _compiler}.{cpp,h}
8 years ago
Yuri Kunde Schlesner
dd4a1672a7
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.
8 years ago
Yuri Kunde Schlesner
bd82cffd0b
VideoCore/Shader: Add constness to methods
8 years ago
Yuri Kunde Schlesner
1e1f939817
VideoCore/Shader: Use only entry_point as ShaderSetup param
...
This removes all implicit dependency of ShaderState on global PICA
state.
8 years ago
Yuri Kunde Schlesner
e3caf669b0
VideoCore/Shader: Use self instead of g_state.vs in ShaderSetup
8 years ago
Yuri Kunde Schlesner
34d581f2dc
VideoCore/Shader: Extract input vertex loading code into function
8 years ago
Kloen
5cc94c17f6
video_core: fix shader.cpp signed / unsigned warning
8 years ago
Yuri Kunde Schlesner
c135317de1
VideoCore/Shader: Extract DebugData out from UnitState
8 years ago
Yuri Kunde Schlesner
f00ada3363
VideoCore: Eliminate an unnecessary copy in the drawcall loop
8 years ago
Yuri Kunde Schlesner
26b68313b9
VideoCore: Fix out-of-bounds read in ShaderSetup::ProduceDebugInfo
...
As far as I can tell, memset was replaced by a fill without correcting
the parameter type, causing an out-of-bounds array read in the Vec4
constructor.
9 years ago
Yuri Kunde Schlesner
84fbbe2629
Use negative priorities to avoid special-casing the self-include
9 years ago
Emmanuel Gil Peyrot
ebdae19fd2
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
396a8d91a4
Manually tweak source formatting and then re-run clang-format
9 years ago
Emmanuel Gil Peyrot
dc8479928c
Sources: Run clang-format on everything.
9 years ago
Jannik Vogel
ff0fa86b17
Retrieve shader result from new OutputRegisters-type
9 years ago
Jannik Vogel
1308afe2c2
Use new shader-jit signature for interpreter
9 years ago
Jannik Vogel
4e01e9ffc5
Refactor access to state in shader-jit
9 years ago
Jannik Vogel
7e756faaba
Move program_counter and call_stack from UnitState to interpreter
9 years ago
Jannik Vogel
ae7a82fa1c
Turn ShaderSetup into struct
9 years ago
Jannik Vogel
696cb197a5
Pica: Replace logic in shader.cpp with loop
9 years ago
Emmanuel Gil Peyrot
691a42fe98
VideoCore: Run include-what-you-use and fix most includes.
9 years ago
Yuri Kunde Schlesner
e3a8292495
Common: Remove section measurement from profiler ( #1731 )
...
This has been entirely superseded by MicroProfile. The rest of the code
can go when a simpler frametime/FPS meter is added to the GUI.
9 years ago
bunnei
3f623b2561
shader_jit_x64.cpp: Rename JitCompiler to JitShader.
9 years ago
bunnei
ffcf7ecee9
shader: Remove unused 'state' argument from 'Setup' function.
9 years ago
bunnei
a5a74eb121
shader_jit_x64: Specify shader main offset at runtime.
9 years ago
bunnei
c9d10de644
shader_jit_x64: Allocate each program independently and persist for emu session.
9 years ago
Mathew Maidment
aa6380e5bc
Merge pull request #1643 from MerryMage/make_unique
...
Common: Remove Common::make_unique, use std::make_unique
9 years ago
MerryMage
a06dcfeb61
Common: Remove Common::make_unique, use std::make_unique
9 years ago
bunnei
ebbba0d381
Merge pull request #1508 from JayFoxRox/vs-output-map
...
Respect vs output map
9 years ago
Jannik Vogel
f746a00964
Respect vs output map
9 years ago
bunnei
6efb710b28
shader_jit_x64: Clear cache after code space fills up.
9 years ago
bunnei
46f78b7f19
shader: Update log message to use proper log class.
9 years ago
Dwayne Slater
6b775034dd
Add immediate mode vertex submission
9 years ago