Commit graph

1143 commits

Author SHA1 Message Date
wwylele 7c5a76e58b log: replace all NGLOG with LOG 2018-06-29 14:18:07 +03:00
NarcolepticK 9ae70e733f video-core: Migrate logging macros (#3878)
* video-core: Migrate logging macros

* video-core: Fixed missed clang format

* video-core: Migrated LOG_GENERIC macro
2018-06-29 00:13:30 +03:00
Weiyi Wang 80f6510355
Merge pull request #3851 from wwylele/shut-up-texture3
gl_shader_gen: lower log level of using disabled proctex
2018-06-28 18:03:05 +03:00
Markus Wick c4ff0ba137 renderer_opengl: Renumber all texture units.
We spend lots of texture units for our texture buffers. As they are now feed from
one buffer, there is no need to have the big gap in the list of IDs.
2018-06-22 17:21:28 +02:00
Markus Wick 46f18d6800 gl_shader_gen: Inline now constant texture buffer. 2018-06-22 17:20:55 +02:00
Markus Wick 0838c87dac gl_stream_buffer: Only flush the host buffer if anything was written.
This might happen in the new TBO upload path.
2018-06-22 17:20:55 +02:00
Markus Wick 831d4f9aeb gl_rasterizer: Use the shared texture buffer for the proctex lut. 2018-06-22 17:20:55 +02:00
Markus Wick 1ca6d2ea8d gl_rasterizer: Use the shared texture buffer for the noise, color and alpha map. 2018-06-22 17:20:55 +02:00
Markus Wick 63fb7dcc1b gl_rasterizer: Use the shared texture buffer for the fog lut. 2018-06-22 17:20:55 +02:00
Markus Wick 4679487640 gl_rasterizer: Use the shared texture buffer for the lighting lut. 2018-06-22 17:20:54 +02:00
Markus Wick 5a9cde138d gl_rasterizer: Add a new dirty flag for any lighting lut. 2018-06-22 17:17:48 +02:00
Markus Wick a8396cdbed renderer_opengl: Create shared texture buffer. 2018-06-22 17:05:40 +02:00
Markus Wick 298ebe3752 gl_rasterizer: Inline texture buffer uploads. 2018-06-22 17:04:47 +02:00
Markus Wick 8a8c6f059f gl_rasterizer: Move TBO syncing helper to one function. 2018-06-22 17:04:47 +02:00
Markus Wick 10fba63b94 gl_rasterizer: Provide texture buffer offsets.
This allows us to move all data into one TBO.
2018-06-22 17:03:38 +02:00
Weiyi Wang f50e505a5a
Merge pull request #3778 from wwylele/shadow-hw-image-load-store
gl_rasterizer: implement shadow map 2D/Cube - Image load/store version
2018-06-22 17:47:09 +03:00
wwylele 2f9b7bdfa9 gl_shader_gen: lower log level of using disabled proctex 2018-06-20 18:34:01 +03:00
James Rowe 574824a26c
Merge pull request #3632 from N00byKing/3dtv_botenable
Add Support for Stereoscopic 3D
2018-06-17 21:05:15 -06:00
James Rowe cf9bfe0690
Merge pull request #3787 from wwylele/shader-jit-state
shader/jit: preserve integer & condition register across invocation
2018-06-09 18:38:05 -06:00
James Rowe 2dac1a9590
Merge pull request #3788 from wwylele/shader-jit-breakc
shader/jit: implement breakc
2018-06-09 18:36:46 -06:00
N00byKing 523c52c708 renderer_opengl: Add Universal 3D Layout Adaption 2018-06-01 18:24:26 +02:00
jmorriz124 8c0ede544f 3dtv botenable improved (#1)
* Fixed crash when right eye isn't available

* Enabled swap screens in stereo views.  Fixed window alignment in stereo
views to handle all screen aspect ratios.

* Minor code cleanup and clang fomat updates.

* Minor cleanup of swapped and aspect ratio code
2018-06-01 17:05:29 +02:00
N00byKing 2814bbc3da renderer_opengl: Allow usage of Stereoscopic 3D 2018-06-01 17:01:06 +02:00
wwylele 781912e854 gl_rasterize: implement shadow mapping using image load/store 2018-06-01 14:26:44 +03:00
Weiyi Wang 08b119153d
Merge pull request #3799 from wwylele/sigh
gl_rasterizer: reset texture state context after every draw
2018-06-01 14:24:28 +03:00
wwylele 9060e08e49 shader/jit: implement breakc 2018-06-01 13:04:39 +03:00
wwylele f0ee4c0595 gl_rasterizer: reset texture state context after every draw 2018-06-01 12:05:30 +03:00
James Rowe 7715fd2c19
Merge pull request #3750 from wwylele/cube-watcher-fix
gl_rasterizer_cache: add missing watcher invalidation
2018-05-31 23:11:39 -06:00
James Rowe f7f5a54bc3
Merge pull request #3751 from wwylele/shader-warning-shutup
gl_shader_gen: rearrange function definition to avoid suprious warnings
2018-05-31 23:10:42 -06:00
James Rowe e63c374ff0
Merge pull request #3714 from wwylele/primitive-restart-guard
video_core/command_processor: correctly handles 0xFFFF index as a normal index
2018-05-29 23:22:00 -06:00
Markus Wick caba02d42a gl_rasterizer: Don't flip the texture bindings.
The state object isn't used anywhere else, so there
is no need to revert the state.
And the comment is just wrong: It doesn't matter
which textures are bound on framebuffer binding, it
only matters at draw time. And we reset all bindings
before the draw call. So let's use gl_state as it is
designed to avoid flipping states.
2018-05-28 21:04:59 +02:00
wwylele 874cb42e70 shader/jit: preserve integer & condition register across invocation 2018-05-28 14:41:47 +03:00
wwylele 92a1252835 gl_shader_gen: rearrange function definition to avoid suprious warnings 2018-05-19 00:36:33 +03:00
wwylele 8b4e832c5f gl_rasterizer_cache: add missing watcher invalidation 2018-05-18 23:58:43 +03:00
Markus Wick 8e1e52cad9 gl_rasterizer_cache: Use clean state for glBlitFramebuffer.
Framebuffer blits depends on pixel tests:
Ownership (is fine)
Scissor (is broken on the last commit)
Masking (is broken on master for a while)

So let's be honest and start with a clean state in
those helper functions.
2018-05-18 21:13:56 +02:00
Markus Wick 301073334a gl_rasterizer: Remove redundant scissor state change.
There is no need to disable this state after the draw call,
gl_state will handle this for us if needed. This kind of
redundant state changes are bad for the driver overhead,
as flipping bits will invalidate the driver state.
2018-05-18 21:13:56 +02:00
wwylele 129b893509 gl_stream_buffer: update the information about the AMD hack 2018-05-18 14:08:12 +03:00
wwylele dd6252a676 gl_rasterizer: fallback to software shader path if buffer overflow happens on hardware shader path 2018-05-18 13:55:19 +03:00
wwylele 6985b13439 [HACK] AMD workaround 2018-05-14 10:17:36 +03:00
wwylele ede0d15fec video_core/command_processor: attempt accelerate draw in draw trigger 2018-05-14 10:17:36 +03:00
wwylele 9b448a0739 gl_rasterizer: implement AccelerateDrawBatch to emulate PICA shader on hardware 2018-05-14 10:17:36 +03:00
MerryMage 15d14be3cc primitive_assembly: Add getters for internal state 2018-05-14 10:17:35 +03:00
wwylele 06815ec905 video_core: receive hardware shader settings 2018-05-14 10:17:35 +03:00
wwylele 68b0a3e19e regs_pipeline: use proper unsigned type where applicable 2018-05-06 15:57:48 +03:00
Weiyi Wang f85e71c37c
Merge pull request #3715 from wwylele/hardware-vertex-vector
gl_rasterizer: Use GLvec* instead of C arrays
2018-05-06 07:19:06 +03:00
Weiyi Wang 0da3b75c9e
Merge pull request #3700 from wwylele/texcache-watcher
gl_rasterizer_cache: cache texture cube
2018-05-05 16:30:39 +03:00
Markus Wick 5960282303 gl_rasterizer: Use buffer_storage for uniform data.
This replaces the glBufferData logic with the shared stream buffer code.
The new code doesn't need a temporary staging buffer any more, so the
performance should imrpove quite a bit.
2018-05-05 09:22:02 +02:00
MerryMage d6cd1a8712 gl_rasterizer: Use GLvec* instead of C arrays 2018-05-05 04:37:04 +03:00
wwylele 08a38370b0 video_core/command_processor: correctly handles 0xFFFF index as a normal index 2018-05-05 04:24:31 +03:00
Weiyi Wang be5777f3de
Merge pull request #3686 from wwylele/glvtx-shader-gen
gl_shader_gen: generate programmable vs/gs and fixed gs
2018-05-01 21:27:48 +03:00
wwylele 1762ad2dcc gl_rasterizer_cache: cache texture cube 2018-05-01 21:26:43 +03:00
bunnei ed42b4b0d2
Merge pull request #3678 from wwylele/b15-fallback
gl_shader_decompiler: fallback to CPU shader on GS b15 access
2018-04-25 00:03:11 -04:00
wwylele 191b29e402 gl_shader_gen: generate programmable vs/gs and fixed gs 2018-04-24 20:39:10 +03:00
MerryMage 8186820d16 pica_to_gl: Add GLuvec{2,3,4} aliases
To allow for transfer for integers into shaders.
2018-04-23 20:21:24 +03:00
wwylele e56128683c gl_shader_decompiler: fallback to CPU shader on GS b15 access 2018-04-23 12:45:56 +03:00
Markus Wick c4010e3f93 renderer_opengl: Drop GLSync, unused. 2018-04-21 16:12:30 +02:00
Markus Wick 5d1dd205c4 renderer_opengl: Rewrite stream buffer. 2018-04-21 16:12:30 +02:00
wwylele d52ddd0ec4 shader: avoid recomputing hash for the same program 2018-04-17 09:47:59 +03:00
wwylele 3cc460ab34 shader_jit: change passing ShaderSetup to passing uniforms struct into the program
We are going to add private memebers to ShaderSetup, which forbids the usage of offsetof. The JIT program only use the uniform part of the setup, so we can just isolate it.
2018-04-17 09:35:43 +03:00
Weiyi Wang cb36f9fad2
Merge pull request #3645 from wwylele/shader-manager
renderer_opengl: refactor shader & program objects and add shader manager for rasterizer
2018-04-16 16:38:38 +03:00
Weiyi Wang bfd1d963ba
Merge pull request #3638 from ds84182/we-need-more-rounds
Round TEV outputs and the final fragment output in GLSL
2018-04-12 23:32:27 +03:00
Weiyi Wang 9772513141
Merge pull request #3639 from wwylele/texture-cude-fix
gl_rasterizer_cache: exit FillTextureCube when address is invalid
2018-04-12 22:54:14 +03:00
wwylele 8dc75598a4 gl_rasterizer: isolate shader management into its own class 2018-04-11 14:52:37 +03:00
wwylele 36bc92273b gl_shader_gen: accept an option to generate separable shaders 2018-04-11 14:52:37 +03:00
wwylele bdab18d2d9 gl_resource_manager: add OGLPipeline 2018-04-11 14:52:37 +03:00
wwylele 4f9b9c4b80 gl_state: add pipeline state 2018-04-11 14:41:43 +03:00
wwylele 48869c768f gl_resource_manager: separate OGLShader and OGLProgram 2018-04-11 14:41:43 +03:00
wwylele d2ee40dc45 gl_shader_util: separate shader object creation and program object creation 2018-04-11 14:41:43 +03:00
wwylele 4256641da4 gl_rasterizer/lighting: implement shadow attenuation 2018-04-10 20:26:55 +03:00
wwylele b5763cb952 pica/lighting: split FresnelSelector into bitfields
The FresnelSelector was already working like a bitfield, so just make it actual bitfield to reduce redundant code. Also, it is already confirmed that this field also affects shadow on alpha. Given that the only two source that can affect alpha components are both controlled by this field, this field should be renamed to a general alpha switch
2018-04-10 20:25:56 +03:00
wwylele 7e7de7d3ab gl_rasterizer_cache: exit FillTextureCube when address is invalid 2018-04-08 12:34:50 +03:00
Dwayne Slater 234161ba62 Make byteround less expensive (thanks hrydgard!) 2018-04-07 18:26:14 -04:00
Dwayne Slater 734279ff22 Round TEV outputs and the final fragment output in GLSL
Fixes water effect in SM3DL
2018-04-07 16:43:56 -04:00
Weiyi Wang 972db17247
Merge pull request #3497 from wwylele/texture-cube-new
gl_rasterizer: implement TextureCube
2018-04-06 12:41:40 +03:00
Weiyi Wang a9544ca015
Merge pull request #3580 from daniellimws/common-fmt
common: Migrate logging macros
2018-04-06 12:38:08 +03:00
Weiyi Wang e3d25bc6d0
Merge pull request #3567 from wwylele/pica-glsl
renderer_opengl: add PICA->GLSL shader decompiler
2018-04-05 14:39:27 +03:00
Weiyi Wang acb02d300c
Merge pull request #3518 from wwylele/hashable-struct
Common/Hash: abstract HashableStruct from GLShader::PicaShaderConfig
2018-04-05 14:39:12 +03:00
James Rowe 1fecead2ff
Merge pull request #3624 from wwylele/sync-uniform
gl_rasterizer: move shader uniform sync from SetShader() to ctor
2018-04-05 00:30:38 -06:00
wwylele 0d84c5a0b6 gl_rasterizer: move state syncing from ctor to its own function 2018-04-04 17:23:55 +03:00
wwylele c2719feda2 gl_rasterizer: move shader uniform sync from SetShader() to ctor 2018-04-03 09:27:23 +03:00
Valentin Vanelslande c9ab184ec7 pica_to_gl: Migrate logging macros (#3608) 2018-04-02 09:31:28 -06:00
wwylele 9ffd400685 gl_shader_decompiler: add missing headers/rename GetXXX to MoveXXX to reflect that they move the data 2018-04-02 17:34:54 +03:00
wwylele 11c2f11872 gl_shader_decompiler: return error on decompilation failure
Internally these errors are handled by exceptions. Only fallbackable errors (that can be handled by CPU shader emulation) is reported. Completely ill-formed shader is still ASSERTed. Code logic related stuff is DEBUG_ASSERTed
2018-04-02 17:34:54 +03:00
wwylele 4991b15ee5 gl_shader_decompiler: some small fixes
- remove unnecessary ";"
- use std::tie for lexicographical ordering
- simplify loop condition
    The offset always has step +1 on each iteration, so it would just hit one of the two boundary anyway
2018-04-02 17:34:54 +03:00
wwylele f8a292f920 renderer_opengl: add PICA->GLSL shader decompiler 2018-04-02 17:34:54 +03:00
James Rowe 384849232b
Merge pull request #3516 from wwylele/shadow-sw
SwRasterizer: Implement shadow mapping
2018-03-31 23:29:22 -06:00
Lioncash 7d331a469f pica_to_gl: Use std::array where applicable
Removes the need to use the ARRAY_SIZE macro
2018-03-31 00:58:49 -04:00
Tobias bb6251f35f video_core: Remove Unreachable for invalid BlendEquation modes (#3595)
* video_core: Remove Unreachable statement

* Lower log level to ERROR
2018-03-29 17:53:55 -06:00
Lioncash 27a3d44b16 gl_rasterizer: Fix incorrect comparison against src_surface in AccelerateTextureCopy()
This should actually be comparing the validity of the destination
surface.
2018-03-28 21:13:57 -04:00
Daniel Lim Wee Soong 98760336be video_core/shader/shader: Remove include cinttypes 2018-03-28 22:40:16 +08:00
Daniel Lim Wee Soong 968569aa61 Replace format specifiers for all usages of ASSERT_MSG 2018-03-27 23:28:42 +08:00
Weiyi Wang 9e4f670ea9
Merge pull request #3484 from wwylele/highlight-fix
pica/lighting: compute highlight clamp after one-/two-sided diffuse pass
2018-03-18 23:41:27 +02:00
Mat M 79d1bcf5ba
Merge pull request #3506 from MerryMage/mov-gl_resource_manager
gl_resource_manager: Use std::exchange in move assignment operators and constructors
2018-03-17 16:30:58 -04:00
Markus Wick ac92664aa7 OGL: Use stream buffer for vertex data. 2018-03-17 02:02:39 +01:00
Phantom 50598fbbf4 stream buffer 2018-03-17 02:02:39 +01:00
MerryMage e3f9bfd850 gl_resource_manager: Use std::exchange instead of std::swap in move assignment operators and constructors
Move assignment operators and move constructors should ideally leave the object moved from in a state where resources aren't accessable.
2018-03-16 23:47:49 +00:00
wwylele 30cc8c10cd
Common/Hash: abstract HashableStruct from GLShader::PicaShaderConfig 2018-03-14 00:12:40 +02:00
wwylele 9f8ff7b04e swrasterizer: implement shadow map rendering 2018-03-13 13:07:07 +02:00
wwylele ae75d3032f swrasterizer: implement shadow map sampling 2018-03-13 12:56:19 +02:00
wwylele ce2ad7436e swrasterizer/lighting: implement shadow attenuation 2018-03-13 12:56:19 +02:00