Commit graph

2728 commits

Author SHA1 Message Date
ameerj
d618bba8a6 general: Reduce core.h includes 2022-03-18 02:13:02 -04:00
Ameer J
370e480c8c
gl_graphics_pipeline: Improve shader builder synchronization using fences (#7969)
* gl_graphics_pipeline: Improve shader builder synchronization

Make use of GLsync objects to ensure better synchronization between shader builder threads and the main context

* gl_graphics_pipeline: Make built_fence access threadsafe

* gl_graphics_pipeline: Use GLsync objects only when building in parallel

* gl_graphics_pipeline: Replace GetSync calls with non-blocking waits

The spec states that a ClientWait on a Fence object ensures the changes propagate to the calling context
2022-03-06 16:46:49 +01:00
ameerj
7f7df43da2 gl_fence_manager: Minor optimization to signal querying
Per the spec, bufSize is the number of integers that will be written, in this case, 1.

Also, the length argument is optional if the information of the number of elements written is not needed.
2022-02-27 17:57:33 -05:00
Morph
e292b2d991 maxwell_to_(gl/vk): Add 11_11_10 float vertex format
- Used by パワプロクンポケットR
2022-02-25 17:11:17 -05:00
Lioncash
f785f73e92 general: Replace NonCopyable struct with equivalents 2022-02-02 13:17:12 -05:00
Fernando Sahmkow
8a6e6465a7 Rasterizer: Refactor inlineToMemory. 2022-02-01 01:47:28 +01:00
Fernando Sahmkow
4258d515e6 Rasterizer: Implement Inline2Memory Acceleration. 2022-01-29 22:53:27 +01:00
Fernando Sahmkow
f58ee3f15f ShaderDecompiler: Add a debug option to dump the game's shaders. 2022-01-04 02:39:00 +01:00
Fernando S
ae7da0b12d
Merge pull request #7629 from ameerj/nv-driver-fixes
shaders: Add fixes for NVIDIA drivers 495+
2022-01-03 00:39:59 +01:00
ameerj
8c907c620d glsl: Add boolean reference workaround 2021-12-29 19:03:50 -05:00
ameerj
b84d429c2e glsl_context_get_set: Add alternative cbuf type for broken drivers
some drivers have a bug bitwise converting floating point cbuf values to uint variables. This adds a workaround for these drivers to make all cbufs uint and convert to floating point as needed.
2021-12-29 19:03:50 -05:00
ameerj
481b210c0d vk_texture_cache: Fix invalidated pointer access
The vulkan ImageView held a reference to its source image for rescale status checking. This pointer is sometimes invalidated when the texture cache slot_images container is resized.
To avoid an invalid pointer dereference, the ImageView now holds a reference to the container itself.
2021-12-23 20:55:48 -05:00
Fernando S
648c7b4ed6
Merge pull request #7375 from vonchenplus/convert_legacy
Convert all legacy attributes to generic attributes
2021-12-22 17:36:05 +01:00
4908a07c20 Address format clang 2021-12-18 14:27:07 +08:00
e49184e606
Merge branch 'yuzu-emu:master' into convert_legacy 2021-12-18 13:57:14 +08:00
ameerj
c22c4f5d59 renderer_opengl: Minor refactoring of filter selection 2021-12-05 15:42:45 -05:00
ameerj
b8f3e5157b blit_image: Refactor upscale factors usage
The image view itself can be queried to see if it is being rescaled or not, removing the need to pass the upscale/down shift factors from the texture cache.
2021-12-05 15:42:44 -05:00
bunnei
ea6fa044f3
Merge pull request #7368 from FernandoS27/vulkan-conv
Fix ART Blit detection regression and add D24S8 <-> RGBA8 conv to Vulkan
2021-11-20 16:51:13 -08:00
Fernando Sahmkow
da2fe81905 TextureCache: Refactor and fix linux compiling. 2021-11-20 14:46:19 +01:00
Fernando Sahmkow
0857f82913 TextureCache: Implement buffer copies on Vulkan. 2021-11-20 06:15:29 +01:00
bunnei
c3e1ffc44b
Merge pull request #7294 from vonchenplus/fix_image_update_error_when_width_too_small
Fix image update/download error when width too small
2021-11-19 15:56:27 -08:00
4dd85f86a8 Implement convert legacy to generic 2021-11-19 22:53:58 +08:00
bunnei
c45af76ea0
Merge pull request #7357 from Morph1984/s8_uint
video_core: Implement S8_UINT format
2021-11-19 01:16:49 -08:00
ameerj
f7e155d8b9 gl_texture_cache: Round format conversion PBO to next power of 2 2021-11-17 23:49:44 -05:00
Morph
6dd6dc046c renderer_opengl: Implement S8_UINT stencil format 2021-11-17 15:05:07 -05:00
894cc9d876 Fix image update/download error when width too small 2021-11-17 12:21:17 +08:00
ameerj
20ed7ba441 texture_cache: Use pixel format conversion when supported by the runtime 2021-11-16 22:32:46 -05:00
ameerj
50c3d53076 gl_texture_cache: Make FormatConversionPass more generic
This allows the usage of the FormatConversionPass to be applied to more than the previously used BGR conversion scenarios.
2021-11-16 22:32:11 -05:00
ameerj
35ca6274f4 gl_texture_cache: Rename BGRCopyPass to FormatConversionPass 2021-11-16 22:31:58 -05:00
FernandoS27
1128cc35b9 TextureCache: OGL query device memory if possible. 2021-11-17 01:45:50 +01:00
Fernando Sahmkow
978f598ff6 TextureCache: Fix OGL cleaning 2021-11-17 00:59:46 +01:00
Fernando Sahmkow
282e04bffb TextureCache: Add automatic anisotropic filtering and refactor code. 2021-11-16 23:14:51 +01:00
Fernando Sahmkow
5230378709 TextureCache: Make a better Anisotropic setter. 2021-11-16 22:11:33 +01:00
FernandoS27
de1c8c5c2c Texture Cahe/Shader decompiler: Resize PointSize on rescaling, refactor and make reaper more agressive on 4Gb GPUs. 2021-11-16 22:11:33 +01:00
ameerj
9fc1fa1b0d gl_resource_manager: Ensure non EXT_framebuffer objects are created 2021-11-16 22:11:33 +01:00
FernandoS27
9189aacfe2 OpenGL: Fix viewport/Scissor scaling on downscaling. 2021-11-16 22:11:33 +01:00
Marshall Mohror
dcc5b4f6b0 Presentation: Only use FP16 in scaling shaders on supported devices in Vulkan 2021-11-16 22:11:32 +01:00
ameerj
93c9eb196f gl_rasterizer: Fix ScissorTest and Clear when scaling 2021-11-16 22:11:32 +01:00
ameerj
172d4f1e3b gl_texture_cache: Simplify scaling procedures 2021-11-16 22:11:32 +01:00
Fernando Sahmkow
5c6fa88935 OpenGlTextureCache: Fix state invalidation on rescaling. 2021-11-16 22:11:32 +01:00
Marshall Mohror
056894f07a OpenGL: fix FXAA with scaling 2021-11-16 22:11:32 +01:00
Marshall Mohror
48cf376462 OpenGL: Implement FXAA 2021-11-16 22:11:32 +01:00
FernandoS27
2eff80b47f QtGUI: Add buttton to toggle the filter. 2021-11-16 22:11:32 +01:00
FernandoS27
9e065b9c7d VideoCore: Add gaussian filtering. 2021-11-16 22:11:32 +01:00
Fernando Sahmkow
3b61de74e6 Texture Cache: fix memory managment and optimize scaled downloads, uploads. 2021-11-16 22:11:31 +01:00
Fernando Sahmkow
425ab9ef4b Texture Cache: Fix downscaling and correct memory comsumption. 2021-11-16 22:11:31 +01:00
Fernando Sahmkow
b60966041c Presentation: add Nearest Neighbor filter. 2021-11-16 22:11:31 +01:00
FernandoS27
d4f5193bd3 Texture Cache: Rescale conversions between depth and color 2021-11-16 22:11:31 +01:00
Fernando Sahmkow
ef1dc42635 Texture cache: Fix memory consumption and ignore rating when a depth texture is rendered. 2021-11-16 22:11:31 +01:00
ameerj
abd07e4158 video_core: Refactor resolution scale function 2021-11-16 22:11:31 +01:00
ameerj
3233fa5dc8 gl_texture_cache: Disable scissor test when scaling textures
Fixes a bug on BOTW where some objects were no longer being rendered after blitting
2021-11-16 22:11:30 +01:00
ameerj
31478c6c1b video_core: Misc resolution scaling related refactoring 2021-11-16 22:11:30 +01:00
ameerj
e0a3830855 gl_texture_cache: Fix BGR pbo size for scaled textures 2021-11-16 22:11:30 +01:00
ameerj
8183142cd4 gl_texture_cache: Fix scaling backup logic 2021-11-16 22:11:30 +01:00
ameerj
16017ac450 vk_texture_cache: Use nearest neighbor scaling when available 2021-11-16 22:11:30 +01:00
ameerj
27af298e78 gl_texture_cache: Fix depth and integer format scaling blits 2021-11-16 22:11:30 +01:00
ameerj
b027fac794 gl_texture_cache/rescaling_pass: minor cleanup 2021-11-16 22:11:30 +01:00
ameerj
fcf2b2c78a gl_texture_cache: Simplify scaling
We don't need to reconstruct new textures every time we ScaleUp/ScaleDown. We can scale up once, and revert to the original texture whenever scaling down.
Fixes memory leaks due to glDeleteTextures being deferred for later handling on some drivers
2021-11-16 22:11:29 +01:00
ameerj
ae8d19d17e Renderers: Unify post processing filter shaders 2021-11-16 22:11:29 +01:00
ameerj
29710f3250 gl_texture_cache: fix scaling on upload 2021-11-16 22:11:29 +01:00
Fernando Sahmkow
a6b88e85bf Renderer: Implement Bicubic and ScaleForce filters. 2021-11-16 22:11:29 +01:00
ameerj
68e038404c shader, video_core: Fix GCC build errors 2021-11-16 22:11:29 +01:00
ReinUsesLisp
e66d5b88a6 shader: Properly scale image reads and add GL SPIR-V support
Thanks for everything!
2021-11-16 22:11:29 +01:00
ReinUsesLisp
fc9bb3c3fe shader: Properly blacklist and scale image loads 2021-11-16 22:11:29 +01:00
ReinUsesLisp
c7a1cbad44 texture_cache: Add getter to query if image view is rescaled 2021-11-16 22:11:29 +01:00
ReinUsesLisp
c9238555f7 gl_texture_cache: Fix scaling blits 2021-11-16 22:11:29 +01:00
ReinUsesLisp
cfeb161c7e glsl/glasm: Pass and use scaling parameters in shaders 2021-11-16 22:11:29 +01:00
ReinUsesLisp
4a512d6827 gl_rasterizer: Properly scale viewports and scissors 2021-11-16 22:11:29 +01:00
ameerj
05d98d9bbf gl_texture_cache: Fix multi layered texture Scale 2021-11-16 22:11:29 +01:00
ameerj
b6060873ce gl_compute_pipeline: Add downscale factor to shader uniforms 2021-11-16 22:11:29 +01:00
ameerj
9bc7b04ca5 gl_rasterizer: Fix rescale dirty state checking 2021-11-16 22:11:29 +01:00
ameerj
f086c82e1f gl_graphics_pipeline: Add downscale factor to shader uniforms 2021-11-16 22:11:28 +01:00
ReinUsesLisp
56ccda1d99 texture_cache: Simplify image view queries and blacklisting 2021-11-16 22:11:28 +01:00
Fernando Sahmkow
cee7eba64e OpenGL: set linear mag filter when blitting a downscaled image. 2021-11-16 22:11:28 +01:00
ReinUsesLisp
6f3a41abe2 opengl: Use Shader::NumDescriptors when possible 2021-11-16 22:11:28 +01:00
ameerj
fad2c92a39 gl_texture_cache: Simplify rescaling 2021-11-16 22:11:28 +01:00
ameerj
fddf372c68 gl_texture_cache: Implement ScaleDown 2021-11-16 22:11:27 +01:00
ameerj
0a6c895af7 gl_texture_cache: Rescale fixes for multi-layered textures 2021-11-16 22:11:27 +01:00
ameerj
de66a69ed4 renderer_gl: Resolution scaling fixes 2021-11-16 22:11:27 +01:00
Fernando Sahmkow
84f2aea896 Texture Cache: More rescaling fixes. 2021-11-16 22:11:27 +01:00
ameerj
10e5065a5c gl_texture_cache: WIP texture rescale 2021-11-16 22:11:27 +01:00
Fernando Sahmkow
ba18047e8d Texture Cache: Implement Vulkan UpScaling & DownScaling 2021-11-16 22:11:27 +01:00
Fernando Sahmkow
22f4b290b6 VideoCore: Initial Setup for the Resolution Scaler. 2021-11-16 22:11:27 +01:00
Morph
d607ceacf4 gl_rasterizer: Remove unused includes
This removes unused includes, especially the core includes which were causing this file to be recompiled every time files included by those headers are modified.
2021-10-31 23:57:51 -04:00
lat9nq
61121d1b22 gl_device: Force GLASM on NVIDIA drivers 495-496
GLSL shaders currently do not render correctly on the recent NVIDIA
drivers. This adds a check that forces assembly shaders for these
drivers since they seem unaffected and adds a warning informing of the
decision.

Developers can disable the check by enabling graphics debugging.
2021-10-28 19:38:49 -04:00
ameerj
ef811c6425 settings: Remove std::chrono usage
Alleviates the dependency on chrono for all files that include settings.h
2021-10-17 00:37:49 -04:00
ameerj
427bf76e62 gpu: Migrate implementation to the cpp file 2021-10-03 00:35:57 -04:00
bunnei
8bd5742349
Merge pull request #7061 from ameerj/dma-buffer-misc
buffer_cache, maxwell_dma: Minor refactoring and code fixes
2021-09-30 12:34:28 -07:00
bunnei
91341b421d
Merge pull request #7036 from ameerj/ogl-bgr-v2
gl_texture_cache: Unify BGR copy passes using PBOs
2021-09-29 16:10:56 -07:00
ameerj
1ea8073783 buffer_cache: Minor fixes
Loop through the tmp_intervals by reference, rather than by copy, and fix gl clear buffer size calculation.
2021-09-19 20:35:07 -04:00
ameerj
22162f906b host_shaders: Remove opengl_copy_bgra.comp 2021-09-16 19:49:13 -04:00
ameerj
ab808fe7cf gl_texture_cache: Migrate BGRCopyPass from util_shaders
The BGR copies no longer use shaders.
2021-09-16 19:49:12 -04:00
ameerj
7f737b022a util_shaders: Unify BGRA copy passes 2021-09-15 21:10:52 -04:00
Morph
2df2b3719a renderers: Log total pipeline count 2021-09-14 13:18:26 -04:00
ameerj
4fda7f1c82 structured_control_flow: Conditionally invoke demote reorder pass
This is only needed on select drivers when a fragment shader discards/demotes.
2021-08-30 11:46:24 -04:00
Fernando S
6a082df427
Merge pull request #6820 from yzct12345/split-cache
texture_cache: Split out template definitions
2021-08-10 12:23:05 +02:00
bunnei
268b5764c7
Merge pull request #6791 from ameerj/astc-opt
astc_decoder: Various performance and memory optimizations
2021-08-06 21:45:24 -07:00
yzct12345
e80323b8b0
texture_cache: Address ameerj's review 2021-08-07 01:27:47 +00:00
yzct12345
02e98f6c93
texture_cache: Don't change copyright year 2021-08-05 20:52:12 +00:00
yzct12345
5566f3dbc0
texture_cache: Address ameerj's review 2021-08-05 20:46:24 +00:00