Commit Graph

5028 Commits

Author SHA1 Message Date
wwylele 827a1616b3 pica/command_processor: build geometry pipeline and run geometry shader
The geometry pipeline manages data transfer between VS, GS and primitive assembler. It has known four modes:
 - no GS mode: sends VS output directly to the primitive assembler (what citra currently does)
 - GS mode 0: sends VS output to GS input registers, and sends GS output to primitive assembler
 - GS mode 1: sends VS output to GS uniform registers, and sends GS output to primitive assembler. It also takes an index from the index buffer at the beginning of each primitive for determine the primitive size.
 - GS mode 2: similar to mode 1, but doesn't take the index and uses a fixed primitive size.
hwtest shows that immediate mode also supports GS (at least for mode 0), so the geometry pipeline gets refactored into its own class for supporting both drawing mode.
In the immediate mode, some games don't set the pipeline registers to a valid value until the first attribute input, so a geometry pipeline reset flag is set in `pipeline.vs_default_attributes_setup.index` trigger, and the actual pipeline reconfigure is triggered in the first attribute input.
In the normal drawing mode with index buffer, the vertex cache is a little bit modified to support the geometry pipeline. Instead of OutputVertex, it now holds AttributeBuffer, which is the input to the geometry pipeline. The AttributeBuffer->OutputVertex conversion is done inside the pipeline vertex handler. The actual hardware vertex cache is believed to be implemented in a similar way (because this is the only way that makes sense).
Both geometry pipeline and GS unit rely on states preservation across drawing call, so they are put into the global state. In the future, the other three vertex shader units should be also placed in the global state, and a scheduler should be implemented on top of the four units. Note that the current gs_unit already allows running VS on it in the future.
2017-08-19 10:13:20 +03:00
wwylele 4793781619 pica/shader/jit: implement SETEMIT and EMIT 2017-08-19 10:13:20 +03:00
wwylele ab57d20528 pica/primitive_assembly: Handle winding for GS primitive
hwtest shows that, although GS always emit a group of three vertices as one primitive, it still respects to the topology type, as if the three vertices are input into the primitive assembler independently and sequentially. It is also shown that the winding flag in SETEMIT only takes effect for Shader topology type, which is believed to be the actual difference between List and Shader (hence removed the TODO). However, only Shader topology type is observed in official games when GS is in use, so the other mode seems to be just unintended usage.
2017-08-19 10:13:20 +03:00
wwylele b39b3acb4f correct constness 2017-08-19 10:13:20 +03:00
wwylele 3486396908 pica/shader/interpreter: implement SETEMIT and EMIT 2017-08-19 10:13:20 +03:00
wwylele c2f1572fa0 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 7741c8405a pica/regs: layout geometry shader configuration regs
All the register meanings are derived from ctrulib (3dbrew is outdated for most of them)
2017-08-10 01:53:08 +03:00
bunnei f91065e3e5 Merge pull request #2862 from j-selby/update-cryptopp
Update CryptoPP (byte ambiguity)
2017-08-09 16:18:43 -04:00
Weiyi Wang a55feb2008 Merge pull request #2822 from wwylele/sw_lighting-2
Implement fragment lighting in the sw renderer (take 2)
2017-08-09 18:54:29 +03:00
Weiyi Wang 6d71e67894 Merge pull request #2856 from wwylele/shader-share
pica: upload shared shader code & swizzle to both unit
2017-08-09 18:52:30 +03:00
bunnei b27b708931 Merge pull request #2864 from mailwl/dlp-update
Service/dlp: Update function tables according 3dbrew
2017-08-09 11:41:45 -04:00
mailwl 1ab7bac090 Service/dlp: Update function tables according 3dbrew 2017-08-09 16:14:07 +03:00
James e32cea33fc Update cryptopp 2017-08-08 17:50:09 +10:00
wwylele 4eef8ded72 pica: upload shared shader code to both unit 2017-08-07 10:30:05 +03:00
James Rowe 67a87fd514 Merge pull request #2860 from anodium/patch-1
Quickfix typo in OpenGL 3.3 error message
2017-08-04 21:14:49 -06:00
Andrea Pascal 81ef1274ef Quickfix typo in OpenGL 3.3 error message
User pointed out on the Discord server that "nothave" is erroneously concatenated. Added a space to prevent it.
2017-08-04 23:11:27 -04:00
James Rowe 7256b0536a Merge pull request #2855 from bunnei/telemetry-additional-fields
Telemetry: Add several more useful fields
2017-08-03 18:37:03 -06:00
bunnei 1198327f04 telemetry: Add field for OsPlatform. 2017-08-03 20:10:38 -04:00
bunnei 26f633f218 telemetry: Add field for BuildName. 2017-08-03 20:10:37 -04:00
bunnei a6a59bd889 telemetry: Add field for RequiresSharedFont. 2017-08-03 20:10:37 -04:00
bunnei 2f68c22ddd telemetry_session: Log BuildDate and ProgramName fields. 2017-08-03 20:10:37 -04:00
bunnei d10b614924 common: Add build timestamp to scm_rev. 2017-08-03 20:10:37 -04:00
bunnei 4e67d530ae core: Expose AppLoader as a public interface. 2017-08-03 20:10:37 -04:00
bunnei c52f6d31f2 loader: Expose program title. 2017-08-03 20:10:37 -04:00
wwylele 87f14a930c SwRasterizer/Lighting: shorten file name 2017-08-03 13:51:22 +03:00
wwylele 92d975e86c SwRasterizer/Lighting: move to its own file 2017-08-02 22:20:40 +03:00
wwylele 58d3ebcd08 SwRasterizer/Lighting: reduce confusion 2017-08-02 22:07:15 +03:00
wwylele 357251a777 SwRasterizer/Lighting: move quaternion normalization to the caller 2017-08-02 22:05:53 +03:00
Yuri Kunde Schlesner af8944fc30 Merge pull request #2850 from j-selby/fix_invalid_paths
Handle invalid filenames when renaming files/directories
2017-07-31 21:50:48 -07:00
James 615e75e6f2 Handle invalid filenames when renaming files/directories 2017-07-31 17:11:53 +10:00
Weiyi Wang ce05a88f81 Merge pull request #2848 from wwylele/shader-loop-fix
pica/shader_interpreter: fix off-by-one in LOOP
2017-07-29 12:34:28 +03:00
James Rowe 8eac1dbc81 Merge pull request #2849 from j-selby/master
Produce 7zip artifacts on Travis and Appveyor
2017-07-28 19:34:43 -06:00
j-selby c2f01a1e8d Produce 7zip artifacts on Travis and Appveyor 2017-07-28 14:22:43 +10:00
bunnei 26eb9b7e3b Merge pull request #2679 from MerryMage/interp-tests
DynCom VFP tests
2017-07-27 11:21:36 -04:00
bunnei 3a681fcc01 Merge pull request #2840 from Subv/apt_parameter
Services/APT: Corrected the behavior of the Receive/Send/Glance/CancelParameter functions
2017-07-27 11:14:27 -04:00
wwylele 4e6b5cb7a8 pica/shader_interpreter: fix off-by-one in LOOP 2017-07-27 13:48:27 +03:00
bunnei 98e28f3da5 Merge pull request #2837 from wwylele/shader-debugger-fix
Misc shader debugger fixes
2017-07-26 16:00:10 -04:00
bunnei 5b1e588c14 Merge pull request #2847 from B3n30/network_linux_fix
Fixed build error "too many initializers for ‘const MacAddress"
2017-07-26 15:59:43 -04:00
B3n30 6a1e479bac Network: Moved NintendoOUI initalization to RoomMember constructor 2017-07-26 21:06:40 +02:00
Weiyi Wang 92b087d99c Merge pull request #2844 from jroweboy/nightlyfix
Use WinSSPI instead of OpenSSL
2017-07-24 19:23:07 +03:00
James Rowe 815444371b Use WinSSPI instead of OpenSSL
Appveyor has OpenSSL installed, so cURL tries to link against it.
This causes dll not found errors because we would also need to ship
OpenSSL, so we link against Windows SSPI instead.
2017-07-24 09:56:44 -06:00
MerryMage 9a05e1960b tests: Add tests for vadd 2017-07-23 12:29:51 +01:00
MerryMage 303824a2c3 tests: Arm testing framework 2017-07-23 12:08:43 +01:00
Sebastian Valle 3b31080f9d Merge pull request #2816 from wwylele/proctex-lutlutlut
gl_rasterizer: use texture buffer for proctex LUT
2017-07-22 23:03:48 -05:00
Sebastian Valle d790197345 Merge pull request #2834 from wwylele/depth-enable-fix
gl_rasterizer_cache: fix using_depth_fb
2017-07-22 23:02:59 -05:00
Weiyi Wang e9ddcdbd0d Merge pull request #2799 from yuriks/virtual-cached-range-flush
Add address conversion functions returning optional, Add function to flush virtual region from rasterizer cache
2017-07-22 10:15:52 +03:00
Subv 18a83a3b7d Service/APT: Log Send/Cancel/Receive/GlanceParameter calls even if they return an error. 2017-07-21 15:03:06 -05:00
Subv 38433d6ca2 Services/APT: Return the proper error code when calling SendParameter with an outstanding parameter already in memory. 2017-07-21 14:59:26 -05:00
Subv 631b64d0df Services/APT: Reset the APT parameter inside CancelParameter if the conditions are met. 2017-07-21 14:59:25 -05:00
Subv ea70215f96 Services/APT: Properly clear the apt parameter after a successful ReceiveParameter call. 2017-07-21 14:59:22 -05:00