Commit graph

65 commits

Author SHA1 Message Date
SachinVin d63acfc1e9 video_core: add workarounds to enable GLES support
video_core: shorten GetGLSLVersionString

video_core: make GLES version and extensions consistent

video_core: move some logic to LoadShader

video_core: deduplicate fragment shader precision specifier
2019-02-12 16:57:18 -06:00
Markus Wick 392547a97c gl_resource_manager: Split implementations in .cpp file
Those implementations are quite costly, so there is no need to inline them to the caller.
Ressource deletion is often a performance bug, so in this way, we support to add breakpoints to them.
2018-11-17 15:01:40 +01:00
wwylele 8dc75598a4 gl_rasterizer: isolate shader management into its own class 2018-04-11 14:52:37 +03:00
wwylele f8a292f920 renderer_opengl: add PICA->GLSL shader decompiler 2018-04-02 17:34:54 +03:00
Phantom 50598fbbf4 stream buffer 2018-03-17 02:02:39 +01:00
James 9829a84fc6 Remove PICA image dumping/libpng 2018-03-07 09:10:54 +11:00
Lioncash ab021d163e CMakeLists: Derive the source directory grouping from targets themselves
Removes the need to store to separate SRC and HEADER variables,
and then construct the target in most cases.
2017-12-11 21:11:52 -05:00
MerryMage 235a251d3c tests: Add tests for x64 shader jit
Tests LG2 and EX2 instructions
2017-11-30 18:17:35 +00:00
wwylele 0f35755572 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 2252a63f80 SwRasterizer/Lighting: shorten file name 2017-08-03 13:51:22 +03:00
wwylele eda28266fb SwRasterizer/Lighting: move to its own file 2017-08-02 22:20:40 +03:00
Yuri Kunde Schlesner d736cca848 CMake: Create INTERFACE targets for microprofile and nihstro 2017-05-27 22:34:52 -07:00
Yuri Kunde Schlesner 4660bc1c78 CMake: Use IMPORTED target for libpng 2017-05-27 20:44:51 -07:00
Yuri Kunde Schlesner 7b81903756 CMake: Correct inter-module dependencies and library visibility
Modules didn't correctly define their dependencies before, which relied
on the frontends implicitly including every module for linking to
succeed.

Also changed every target_link_libraries call to specify visibility of
dependencies to avoid leaking definitions to dependents when not
necessary.
2017-05-27 18:41:24 -07:00
wwylele ade45b5b99 pica/swrasterizer: implement procedural texture 2017-05-20 13:50:50 +03:00
Yuri Kunde Schlesner 1683cb0ec9 SWRasterizer: Move texturing functions to their own file 2017-02-12 18:12:37 -08:00
Yuri Kunde Schlesner e1ad7d69b9 SWRasterizer: Move framebuffer operation functions to their own file 2017-02-12 18:11:03 -08:00
Yuri Kunde Schlesner e24717bca0 VideoCore: Move software rasterizer files to sub-directory 2017-02-12 18:08:11 -08:00
Yuri Kunde Schlesner 5759d94b5c VideoCore: Move Regs to its own file 2017-02-04 13:59:12 -08:00
Yuri Kunde Schlesner f7c7f422c6 VideoCore: Split shader regs from Regs struct 2017-02-04 13:59:11 -08:00
Yuri Kunde Schlesner 8fca90b5d5 VideoCore: Split geometry pipeline regs from Regs struct 2017-02-04 13:59:11 -08:00
Yuri Kunde Schlesner f443c7e5b0 VideoCore: Split lighting regs from Regs struct 2017-02-04 13:59:11 -08:00
Yuri Kunde Schlesner 23713d5dee VideoCore: Split framebuffer regs from Regs struct 2017-02-04 13:59:11 -08:00
Yuri Kunde Schlesner 9017093f58 VideoCore: Split texturing regs from Regs struct 2017-02-04 13:59:09 -08:00
Yuri Kunde Schlesner 000e78144c VideoCore: Split rasterizer regs from Regs struct 2017-02-04 13:08:47 -08:00
Yuri Kunde Schlesner c74787a11c Pica/Texture: Move part of ETC1 decoding to new file and cleanups 2017-02-04 12:33:28 -08:00
Yuri Kunde Schlesner a1c9ac7845 VideoCore: Move LookupTexture out of debug_utils.h 2017-02-04 12:31:40 -08:00
Yuri Kunde Schlesner 114d6b2f97 VideoCore/Shader: Split interpreter and JIT into separate ShaderEngines 2017-01-25 18:53:24 -08:00
Yuri Kunde Schlesner 8eefc62833 VideoCore/Shader: Rename shader_jit_x64{ => _compiler}.{cpp,h} 2017-01-25 18:53:23 -08:00
Yuri Kunde Schlesner d27cb1dedc VideoCore/Shader: Move DebugData to a separate file 2016-12-15 23:08:05 -08:00
Yuri Kunde Schlesner f4e98ecf3f VideoCore: Convert x64 shader JIT to use Xbyak for assembly 2016-12-14 20:06:08 -08:00
Jannik Vogel 49bfe9bf91 Remove TGA dumper 2016-04-30 09:43:59 +02:00
Henrik Rydgard 47ff008817 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
Dwayne Slater 6b775034dd Add immediate mode vertex submission 2016-03-02 22:16:38 -05:00
bunnei 38c7b20475 pica: Add pica_types module and move float24 definition. 2016-02-05 17:17:26 -05:00
Yuri Kunde Schlesner 195fedccf0 VideoCore: Unify interface to OpenGL and SW rasterizers
This removes explicit checks sprinkled all over the codebase to instead
just have the SW rasterizer expose an implementation with no-ops for
most operations.
2015-12-07 20:20:38 -08:00
bunnei c86b9d4242 renderer_opengl: Refactor shader generation/caching to be more organized + various cleanups. 2015-10-21 21:53:14 -04:00
Yuri Kunde Schlesner a1a5570e97 Replace the previous OpenGL loader with a glad-generated 3.3 one
The main advantage of switching to glad from glLoadGen is that, apart
from being actively maintained, it supports a customizable entrypoint
loader function, which makes it possible to also support OpenGL ES.
2015-08-30 08:45:56 -03:00
bunnei b39c053785 Rename ARCHITECTURE_X64 definition to ARCHITECTURE_x86_64. 2015-08-15 18:03:27 -04:00
bunnei bd7e691f78 x64: Refactor to remove fake interfaces and general cleanups. 2015-08-15 18:03:25 -04:00
bunnei 094ae6fadb 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 3f69c2039d Shader: Define a common interface for running vertex shader programs. 2015-08-15 17:33:44 -04:00
bunnei 18527b9e21 Shader: Move shader code to its own subdirectory, "shader". 2015-08-15 17:33:42 -04:00
bunnei 642b9b5030 GPU: Refactor "VertexShader" namespace to "Shader".
- Also renames "vertex_shader.*" to "shader_interpreter.*"
2015-08-15 17:33:41 -04:00
Yuri Kunde Schlesner 1762267de4 OpenGL: Make OpenGL object resource wrappers fully inline
The functions are so simple that having them separate only bloats the
code and hinders optimization.
2015-07-26 10:58:58 -03:00
archshift 76690392bf Move video_core/color.h to common/color.h 2015-05-30 11:17:37 -07:00
archshift 5df2d1b5f7 Move video_core/math.h to common/vector_math.h
The file only contained vector manipulation code, and such widely-useable code doesn't belong in video_core.
2015-05-30 11:17:36 -07:00
bunnei 1b42d55a9d Pica: Create 'State' structure and move state memory there. 2015-05-22 22:59:42 -04:00
tfarley 05dc633a8c OpenGL renderer 2015-05-22 15:51:18 -07:00
bunnei 34c31db14a GPU: Added RGB565/RGB8 framebuffer support and various cleanups.
- Centralizes color format encode/decode functions.
- Fixes endianness issues.
- Implements remaining framebuffer formats in the debugger.
2015-03-03 18:26:03 -05:00