Commit graph

1223 commits

Author SHA1 Message Date
Weiyi Wang 909d04ddea Remove unused stuff
Some unused variables are still kept in services, as they are parameters passed from the command buffer and might be used in the future
2019-07-16 20:27:03 -04:00
Weiyi Wang 99136ec592 gl_rasterizer: correct supress_mipmap_for_cube logic
The previous version would break when the state changes from (cube=true,mipmap=false) -> (cube=true,mipmap=true)
2019-07-06 08:03:01 -04:00
Weiyi Wang bb776e25a9 pica: move global shader buffer state into Pica::State (#4796) 2019-06-20 00:39:08 +02:00
BreadFish64 aaf496dec7 video_core: change "left + width" to "right" in CanSubRect
the constructed rectangle from GetSubRect already has the right info
2019-06-04 17:03:31 -05:00
Aner Torre 4b0ce1b770 video_core: Fix fragment_shader compilation failure due to different type variable multiplication 2019-05-19 14:45:41 +02:00
James Rowe 3f2c7eb471
Merge pull request #4738 from FearlessTobi/port-1020-new
Port yuzu-emu/yuzu#1020: "core: Namespace EmuWindow"
2019-04-26 08:58:09 -06:00
Lioncash 6e22891761 core: Namespace EmuWindow
Gets the class out of the global namespace.
2019-04-21 14:16:16 +02:00
Weiyi Wang 0ec45f694c
Merge pull request #3910 from wwylele/mipmap
gl_rasterizer: implement mipmap by forwarding PICA mipmap configuration
2019-04-17 14:10:42 -04:00
Weiyi Wang e3b6bf93bc gl_rasterizer_cache: validate surface in mipmap/cubemap if the children is not validated yet 2019-04-15 09:07:36 -04:00
Weiyi Wang 4a206237be
Merge pull request #4726 from FearlessTobi/port-2312
Port yuzu-emu/yuzu#2312: "general: Use deducation guides for std::lock_guard and std::unique_lock"
2019-04-13 18:00:09 -04:00
Tobias e9c2b27c68
Merge pull request #4681 from FearlessTobi/port-2188-2190
Port yuzu-emu/yuzu#2188 and yuzu-emu/yuzu#2190: various minor code refactoring changes
2019-04-09 21:18:34 +02:00
Lioncash 21c71d21ae general: Use deducation guides for std::lock_guard and std::unique_lock
Since C++17, the introduction of deduction guides for locking facilities
means that we no longer need to hardcode the mutex type into the locks
themselves, making it easier to switch mutex types, should it ever be
necessary in the future.
2019-04-07 15:14:29 +02:00
fearlessTobi d755a15891 fix compilation problems 2019-03-23 12:43:03 +01:00
Weiyi Wang 1f233e4365
Merge pull request #4691 from liushuyu/oes_fix
video_core: renderer_opengl: gles color fix
2019-03-18 19:01:13 -04:00
xperia64 fa0919915c Fix GLES version header on picky drivers 2019-03-15 23:32:29 +00:00
liushuyu 71b0eab85c
video_core: renderer_opengl: addressed comments...
use indexing to make code more concise; use const bool instead of bool
2019-03-14 10:58:29 -06:00
liushuyu 476df9debf
video_core: renderer_opengl: addressed comments...
... removed incorrect comments and removed incorrect value calculations
2019-03-13 19:17:29 -06:00
liushuyu 164eb100eb video_core: renderer_opengl: addressed comments...
... removed redundant comments and removed incorrect value assignments
2019-03-12 22:56:11 -06:00
liushuyu 3983b12086
video_core: renderer_opengl: gles color fix 2019-03-12 22:28:54 -06:00
Weiyi Wang 88a011ec8e GetTextureSurface: return on invalid physical address early
Previously this check is in GetSurface (if (addr == 0)). This worked fine because GetTextureSurface directly forwarded the address value to GetSurface. However, now with mipmap support, GetTextureSurface would call GetSurface several times with different address offset, resulting some >0 but still invalid address in case the input is 0. We should error out early on invalid address instead of sending it furthor down which would cause invalid memory access
2019-03-10 11:06:08 -04:00
wwylele ebdef4fd69 gl_rasterizer_cache: unlink watchers if surface is moved to remove_surfaces but is not immediately removed 2019-03-08 09:37:25 -05:00
wwylele 777af04f4a gl_rasterizer: ignore mipmap setting for cubemap before we implements it 2019-03-08 09:37:25 -05:00
wwylele d7196b5573 gl_rasterizer_cache: invalidate watchers on (partial) surface invalidation 2019-03-08 09:37:25 -05:00
wwylele fa141c799b gl_shader_gen: use accurate LOD formula for texture 2D 2019-03-08 09:37:25 -05:00
wwylele ca78d34933 gl_rasterizer: implement mipmap 2019-03-08 09:37:24 -05:00
Lioncash e1a4912ade common/math_util: Move contents into the Common namespace
These types are within the common library, so they should be within the
Common namespace.
2019-03-02 18:13:10 +01:00
Lioncash 643472e24a common/vector_math: Move Vec[x] types into the Common namespace
These types are within the common library, so they should be using the
Common namespace.
2019-03-02 15:04:13 +01:00
tgsm d6c530d08c video_core: use nested namespaces 2019-02-19 03:09:57 -05:00
Weiyi Wang f409342ab5
Merge pull request #4613 from BreadFish64/gles5
video_core: add GLES support
2019-02-17 15:44:39 -05:00
Weiyi Wang de1128c60d
Merge pull request #4628 from FearlessTobi/backport-some-stuff
Backport various minor frontend review changes from yuzu and port minor PR from yuzu
2019-02-14 11:45:27 -05:00
Weiyi Wang 4b2397aa77
Merge pull request #4633 from BreadFish64/fully-invalid
video_core: improve efficiency of CachedSurface::IsSurfaceFullyInvalid
2019-02-14 11:44:46 -05:00
ReinUsesLisp fc6e33d812 video_core: Sort predicate order to have semantically positive value first 2019-02-13 21:06:37 +01:00
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
BreadFish64 d90f733330 video_core: improve efficiency of CachedSurface::IsSurfaceFullyInvalid 2019-02-09 17:33:18 -06:00
fearlessTobi 6be1b4d293 renderer_base: backport minor changes from yuzu 2019-02-06 17:16:27 +01:00
Weiyi Wang b5f2318ae7 gl_rasterizer: change shadow_texture_bias from shader config var to shader uniform
Games can frequently change this register. Using it as shader config var would generates a lot of shaders
2019-02-02 20:40:08 -05:00
Lioncash d2aac218a6 renderer_opengl: Correct forward declaration of FramebufferLayout
This is actually a struct, not a class, which can lead to compilation
warnings.
2018-12-27 02:48:05 +01:00
Weiyi Wang 07d6d90bb3 gl_rasterizer_cache/MortonCopy: avoid read/write to invalid address 2018-12-09 13:20:44 -05:00
Weiyi Wang 7e8ba6ed8e Memory: move memory chunk into pImpl and make them dynamically allocated
Otherwise MSVC would give out-of-memory error on compile time
2018-12-06 13:30:47 -05:00
Weiyi Wang d18cda5a5d Memory: move MarkRegionCached into class 2018-12-05 20:21:14 -05:00
Weiyi Wang 296c458e0e Memory: move GetPhysicalPointer and IsValidPhysicalAddress into class 2018-12-05 20:21:14 -05:00
Weiyi Wang 8bb404c82a VideoCore: pass in memory system
currently set as global. Will change when videocore itself is wrapped as a class
2018-12-05 20:16:42 -05:00
Francois Berder c598fd7228 renderer_opengl: Fix string comparison
Signed-off-by: Francois Berder <fberder@outlook.fr>
2018-12-04 22:12:35 +00:00
zhupengfei 071b41cb61
citra_qt, video_core: Screenshot functionality
Allows capturing screenshot at the current internal resolution (native for software renderer), but a setting is available to capture it in other resolutions. The screenshot is saved to a single PNG in the current layout.
2018-11-30 14:14:41 +08:00
Markus Wick 62036bdea8 gl_rasterizer_cache: Add profiles for Copy and Blit
They were missed, and Copy is very high in profile here. It doesn't block the GPU,
but it stalls the driver thread. So with our bad GL instructions, this might block quite a while.
2018-11-17 15:11:56 +01:00
Markus Wick 2b793797e0 gl_resource_manager: Profile creation and deletion 2018-11-17 15:07:30 +01:00
Markus Wick 79696a1a43 gl_stream_buffer: Profile orphaning of stream buffer.
This serialize to the driver thread and so it may block for a while.
So if it is in the benchmark, we get noticed if it happens too often.
2018-11-17 15:03:20 +01: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
Tobias 46e8237e7e Port yuzu-emu/yuzu#1137: "renderer_opengl: Namespace OpenGL code" (#4423)
* renderer_opengl: Namespace OpenGL code

Namespaces all OpenGL code under the OpenGL namespace.

Prevents polluting the global namespace and allows clear distinction
between other renderers' code in the future.

* Also namespace TextureCubeConfig
2018-11-16 23:29:10 -08:00
Weiyi Wang 9458e4d8ec CoreTiming: wrap into class 2018-11-04 10:26:38 -05:00
B3n30 2306af3600 Handle cases when std::optional does not contain a value 2018-10-05 16:51:33 +02:00
B3n30 d37a2270d6 Replace boost::optional with std::optional where possible 2018-10-05 13:51:09 +02:00
Lioncash 333b6a556a gl_stream_buffer: Fix use of bitwise OR instead of logical OR in Map()
This was very likely intended to be a logical OR based off the
conditioning and testing of inversion in one case.

Even if this was intentional, this is the kind of non-obvious thing one
should be clarifying with a comment.
2018-09-21 17:20:42 -05:00
Weiyi Wang 7d8f115185 Prefix all size_t with std::
done automatically by executing regex replace `([^:0-9a-zA-Z_])size_t([^0-9a-zA-Z_])` -> `$1std::size_t$2`
2018-09-06 16:03:28 -04:00
Weiyi Wang 12bba80d48
Merge pull request #4174 from wwylele/proctex-round-fix
gl_rasiterzer/proctex: revert back to round() for Nearest sampling
2018-09-04 01:36:16 +03:00
fearlessTobi 488694d01f Replace ToBool() with static_cast() 2018-09-01 15:50:57 +02:00
Weiyi Wang 99f4ea999c gl_rasiterzer/proctex: revert back to round() for Nearest sampling
This change to floor() was made in 2927c88, which was a result of doing some hwtest. It turned out that it was buggy edge cases in PICA, and for most cases round() still applies
2018-09-01 09:11:15 -04:00
Weiyi Wang ffd78b635e
Merge pull request #4163 from FearlessTobi/port-1097
Port #1097 from yuzu: "renderer_opengl: Treat OpenGL errors as critical."
2018-08-31 21:43:52 +03:00
bunnei ffdc27351a renderer_opengl: Treat OpenGL errors as critical. 2018-08-31 01:56:38 +02:00
Lioncash 6d280cb49a gl_stream_buffer: Add missing header guard
Prevents potential compilation errors from occuring due to multiple
inclusions
2018-08-31 01:45:44 +02:00
fearlessTobi f61c9c3eb7 video_core: Make global EmuWindow instance part of the base renderer …
…class

Makes the global a member of the RendererBase class. We also change this
to be a reference. Passing any form of null pointer to these functions
is incorrect entirely, especially given the code itself assumes that the
pointer would always be in a valid state.

This also makes it easier to follow the lifecycle of instances being
used, as we explicitly interact the renderer with the rasterizer, rather
than it just operating on a global pointer.
2018-08-25 15:20:40 +02:00
Merry 0a5621fafc
Merge pull request #3970 from FearlessTobi/more-popup-madness
citra_qt: Add more verbose popups for video_core errors
2018-08-24 19:21:35 +01:00
Lioncash d944d1120f video_core: Remove unimplemented Start() function prototype
Given this has no definition, we can just remove it entirely.
2018-08-23 16:58:30 +02:00
fearlessTobi d1c5f01afe Add more verbose popups for video_core errors 2018-08-19 15:48:40 +02:00
zhupengfei 0c37140690 video_core: Allow changing background color while emulation is running
As @jroweboy stated, this is just one more atomic in VideoCore.
2018-08-04 15:11:51 +08:00
James Rowe 14b0435df2
Merge pull request #3994 from FearlessTobi/replace-clamp-functions
Remove MathUtil::Clamp and replace it with its std:: counterpart
2018-08-02 11:08:07 -06:00
James Rowe 4b59c1b601
Merge pull request #4042 from wwylele/i-love-drivers
gl_rasterizer: apply AMD hack only when the vendor is AMD
2018-08-02 11:01:25 -06:00
wwylele 266f2b6242 gl_rasterizer: only apply AMD hack when the vendor is AMD 2018-07-31 22:58:17 +03:00
Valentin Vanelslande b2ad88dac1
swrasterizer/lighting: remove newline in logging macro
Software rasterizer version of #3904
2018-07-30 16:09:16 -05:00
fearlessTobi 15abf35889 Address feedback by wwylele 2018-07-30 14:46:13 +02:00
fearlessTobi 71e1d6e25d Fix compile errors 2018-07-26 13:23:25 +02:00
fearlessTobi 7a3e126a4f Replace MathUtil::Clamp with its std counterpart 2018-07-24 19:08:17 +02:00
Weiyi Wang 78685065cf
Merge pull request #3916 from wwylele/mipmap-proctex
gl_rasterizer: implement mipmap for procedural texture
2018-07-19 11:51:57 +03:00
wwylele 431fe444a9 gl_rasterizer: call glTextureBarrier when an image is bound to both texture and framebuffer 2018-07-09 23:11:29 +03:00
Weiyi Wang 7c7adc64fd
Merge pull request #3898 from wwylele/shut-up-texture5
swrasterizer, gl_shader_gen: return 0.0 for Disabled texture unit 0
2018-07-07 18:45:13 +03:00
wwylele 2927c88fd3 gl_rasterizer: implement mipmap for proctex 2018-07-06 01:13:02 +03:00
Valentin Vanelslande b12942a231
gl_shader_gen: remove newline in logging macro 2018-06-30 19:15:15 -05:00
Valentin Vanelslande fef231dc5b
gl_shader_manager: fix macro 2018-06-30 11:24:38 -05:00
wwylele 4d4b833a00 swrasterizer, gl_shader_gen: return 0.0 for Disabled texture unit 0 2018-06-30 11:36:39 +03:00
wwylele 0eab948728 reformat all files with clang-format 2018-06-29 16:56:12 +03:00
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