Commit graph

1550 commits

Author SHA1 Message Date
Stuart Kenny 691e09473e
video_core: Add MMPX texture filter (#6564)
* video_core: Add MMPX texture shader

* mmpx: Apply mix to mask alpha edge artifacting

* mmpx: Do not use deprecated texture fuction.
2023-05-31 11:55:46 +03:00
GPUCode b9d644b777
Fix additional reinterpretation nonsense (#6521)
* surface_params: Ensure pixel formats are not the same

* rasterizer_cache: Check copyable interval
2023-05-09 12:01:15 +03:00
GPUCode f9ab0b3042
rasterizer_cache: Make reinterpretation stricter (#6515) 2023-05-07 23:13:01 +03:00
SachinVin b4db9aebf2
gl_shader_disk_cache.cpp: Flush transferable_file and precompiled_file more often (#6483) 2023-05-07 02:34:40 +03:00
GPUCode 2e655f73b8
Rasterizer cache refactor v2 (#6479)
* rasterizer_cache: Switch to template

* Eliminates all opengl references in the rasterizer cache headers
  thus completing the backend abstraction

* rasterizer_cache: Switch to page table

* Surface storage isn't particularly interval sensitive so we can use a page table to make it faster

* rasterizer_cache: Move sampler management out of rasterizer cache

* rasterizer_cache: Remove shared_ptr usage

* Switches to yuzu's slot vector for improved memory locality.

* rasterizer_cache: Rework reinterpretation lookup

* citra_qt: Per game texture filter

* rasterizer_cache: Log additional settings

* gl_texture_runtime: Resolve shadow map comment

* rasterizer_cache: Don't use float for viewport

* gl_texture_runtime: Fix custom allocation recycling

* rasterizer_cache: Minor cleanups

* Cleanup texture cubes when all the faces have been unregistered from the cache

* custom_tex_manager: Allow multiple hash mappings per texture

* code: Move slot vector to common

* rasterizer_cache: Prevent texture cube crashes

* rasterizer_cache: Improve mipmap validation

* CanSubRect now works properly when validating multi-level surfaces, for example Dark Moon validates a 4 level surface from a 3 level one and it works

* gl_blit_handler: Unbind sampler on reinterpretation
2023-05-07 02:34:28 +03:00
luc-git 322d7a8287
Textures loading screen (#6478)
* Add a loading screen for the preloading textures

*The PreloadTextures() function is called from the EmuThread to prevent citra to freezing

*Add a the preloading textures loadingscreen in loading_screen.cpp

*Add custom_tex_manager.reset() in core.cpp to release ram memory after exiting a game

* Add custom textures loading in EmuThread

* Remove useless variable

* Revert "Add custom textures loading in EmuThread"

This reverts commit 45ed46fa09.

* Moved include from bootmanager.h to bootmanager.cpp
2023-05-07 02:34:14 +03:00
Vitor K 34de77d429
Various miscelaneous changes (#6496) 2023-05-03 17:24:10 +02:00
SachinVin 41f13456c0
Chore: Enable warnings as errors on MSVC (#6456)
* tests: add Sanity test for SplitFilename83

fix test

fix test

* disable `C4715:not all control paths return a value` for nihstro includes

nihstro: no warn

* Chore: Enable warnings as errors on msvc + fix warnings

fixes

some more warnings

clang-format

* more fixes

* Externals: Add target_compile_options `/W0` nihstro-headers and ...

Revert "disable `C4715:not all control paths return a value` for nihstro includes"
This reverts commit 606d79b55d.

* src\citra\config.cpp: ReadSetting: simplify type casting

* settings.cpp: Get*Name: remove superflous logs
2023-05-01 22:38:58 +03:00
SachinVin ce553ab995
renderer_opengl: DrawSingleScreen*: remove duplicate code (#6426)
Co-authored-by: Tobias <thm.frey@gmail.com>
2023-05-01 16:27:42 +02:00
Steveice10 ea649263b7
build: Improvements to bundled libraries support. (#6435) 2023-04-28 13:02:53 -07:00
GPUCode 06f3c90cfb
Custom textures rewrite (#6452)
* common: Add thread pool from yuzu

* Is really useful for asynchronous operations like shader compilation and custom textures, will be used in following PRs

* core: Improve ImageInterface

* Provide a default implementation so frontends don't have to duplicate code registering the lodepng version

* Add a dds version too which we will use in the next commit

* rasterizer_cache: Rewrite custom textures

* There's just too much to talk about here, look at the PR description for more details

* rasterizer_cache: Implement basic pack configuration file

* custom_tex_manager: Flip dumped textures

* custom_tex_manager: Optimize custom texture hashing

* If no convertions are needed then we can hash the decoded data directly removing the needed for duplicate decode

* custom_tex_manager: Implement asynchronous texture loading

* The file loading and decoding is offloaded into worker threads, while the upload itself still occurs in the main thread to avoid having to manage shared contexts

* Address review comments

* custom_tex_manager: Introduce custom material support

* video_core: Move custom textures to separate directory

* Also split the files to make the code cleaner

* gl_texture_runtime: Generate mipmaps for material

* custom_tex_manager: Prevent memory overflow when preloading

* externals: Add dds-ktx as submodule

* string_util: Return vector from SplitString

* No code benefits from passing it as an argument

* custom_textures: Use json config file

* gl_rasterizer: Only bind material for unit 0

* Address review comments
2023-04-27 07:38:28 +03:00
GPUCode 227926c1fa
Remove remnants of separable shader setting (#6403) 2023-04-26 00:19:02 +02:00
GPUCode 2c74ed1a6d
Rasterizer refactor hotfixes (#6465)
* texture_codec: Clamp buffer end to tiled buffer size

* Fixes crash on Pokemon Super Mystery Dungeon

* rasterizer_cache: Use rect for duplicate surface

* Fixes broken bloom in fire emblem

* surface_params: Check levels for exact match

* It was removed previously to prevent copies when games used the base level of a multi level surface. FE on the other hand will first use the base level and then use it as a face of a cubemap with many levels. So instead check if the surface equal or more levels and consider it an exact match in that case

* gl_texture_runtime: Bind old tex to 2D target

* Fixes a small error opengl would print when creating texture cubes

* gl_blit_helper: Fix nearest filter

* Use texture unit 2 which has the nearest sampler bound
2023-04-23 22:46:08 +03:00
GPUCode 9ba6a90193
gl_format_reinterpreter: Don't release unconditionally (#6459) 2023-04-23 00:35:25 +03:00
Vitor K 1b944f3255
gl_rasterizer: Fix texel buffer size overflow (#6458)
Co-authored-by: GPUCode <geoster3d@gmail.com>
2023-04-22 20:43:29 +02:00
GPUCode 26d6f9d1c6
Rasterizer cache refactor (#6375)
* rasterizer_cache: Remove custom texture code

* It's a hacky buggy mess, will be reimplemented later when the cache is in a better state

* rasterizer_cache: Refactor surface upload/download

* Switch to the texture_codec header which was written as part of the vulkan backend by steveice and me

* Move most of the upload logic to the rasterizer cache and out of the surface object

* Scaled uploads/downloads have been disabled for now since they require more runtime infrastructure

* rasterizer_cache: Refactor runtime interface

* Remove aspect enum which is the same as SurfaceType

* Replace Subresource with specific structures for each operation (blit/copy/clear). This mimics moderns APIs vulkan much better

* Pass the surface to the runtime instead of the texture

* Implement CopyTextures with glCopyImageSubData which is available on 4.3 and gles.
  This function also has an overload for cubes which will be removed later.

* rasterizer_cache: Move texture allocation to the runtime

* renderer_opengl: Remove TextureDownloaderES

* It's overly compilcated and unused at the moment. Will be replaced with a simple compute shader in a later commit

* rasterizer_cache: Split CachedSurface

* This commit splits CachedSurface into two classes, SurfaceBase which contains the backend agnostic functions and Surface which is the opengl specific part

* For now the cache uses the opengl surface directly and there are a few ugly casts with watchers, those will be taken care of when the template convertion and watcher removal are added respectively

* rasterizer_cache: Move reinterpreters to the runtime

* rasterizer_cache: Move some pixel format function to the cpp file

* rasterizer_cache: Common texture acceleration functions

* They don't contain any backend specific code so they shouldn't be duplicated

* rasterizer_cache: Remove BlitSurfaces

* It's better to prefer copy/blit in the caller anyway

* rasterizer_cache: Only allocate needed levels

* rasterizer_cache: Move texture runtime out of common dir

* Also shorten the util header filename

* surface_params: Cleanup code

* Add more comments, organize it a bit etc

* rasterizer_cache: Move texture filtering to the runtime

* rasterizer_cache: Move to VideoCore

* renderer_opengl: Reimplement scaled uploads/downloads

* Instead of looking up for temporary textures, each allocation now contains both a scaled and unscaled handle
  This allows the scale operations to be done inside the surface object itself and improves performance in general

* In particular the scaled download code has been expanded to use ARB_get_texture_sub_image when possible
  which is faster and more convenient than glReadPixels. The latter is still relevant for OpenGLES though.

* Finally allocations are now given a handy debug name that can be viewed from renderdoc.

* rasterizer_cache: Remove global state

* gl_rasterizer: Abstract common draw operations to Framebuffer

* This also allows to cache framebuffer objects instead of always swapping the textures, something that particularly benefits mali gpus

* rasterizer_cache: Implement multi-level surfaces

* With this commit the cache can now directly upload and use mipmaps
  without needing to sync them with watchers. By using native mimaps
  directly this also adds support for mipmap for cube

* Texture cubes have also been updated to drop the watcher requirement

* host_shaders: Add CMake integration for string shaders

* Improves build time shader generation making it much less prone to errors.
  Also moves the presentation shaders here to avoid embedding them to the cpp file.

* Texture filter shaders now make explicit use of uniform bindings for better vulkan compatibility

* renderer_opengl: Emulate lod bias in the shader

* This way opengles can emulate it correctly

* gl_rasterizer: Respect GL_MAX_TEXTURE_BUFFER_SIZE

* Older Bifrost Mali GPUs only support up to 64kb texture buffers. Citra would try to allocate a much larger buffer the first 64kb of which would work fine but after that the driver starts misbehaving and showing various graphical glitches

* rasterizer_cache: Cleanup CopySurface

* renderer_opengl: Keep frames synchronized when using a GPU debugger

* rasterizer_cache: Rename Surface to SurfaceRef

* Makes it clear that surface is a shared_ptr and not an object

* rasterizer_cache: Cleanup

* Move constructor to the top of the file

* Move FindMatch to the top as well and remove the Invalid flag which was redudant;
  all FindMatch calls used it expect from MatchFlags::Copy which ignores it anyway

* gl_texture_runtime: Make driver const

* gl_texture_runtime: Fix RGB8 format handling

* The texture_codec header, being written with vulkan in mind converts RGB8 to RGBA8. The backend wasn't adjusted to account for this though and treated the data as RGB8.

* Also remove D16 convertions, both opengl and vulkan are required to support this format so these are not needed

* gl_texture_runtime: Reduce state switches during FBO blits

* glBlitFramebuffer is only affected by the scissor rectangle so just disable scissor testing instead of resetting our entire state

* surface_params: Prevent texcopy that spans multiple levels

* It would have failed before as well, with multi-level surfaces it triggers the assert though

* renderer_opengl: Centralize texture filters

* A lot of code is shared between the filters thus is makes it sense to centralize them

* Also fix an issue with partial texture uploads

* Address review comments

* rasterizer_cache: Use leading return types

* rasterizer_cache: Cleanup null checks

* renderer_opengl: Add additional logging

* externals: Actually downgrade glad

* For some reason I missed adding the files to git

* surface_params: Do not check for levels in exact match

* Some games will try to use the base level of a multi level surface. Checking for levels forces another surface to be created and a copy to be made which is both unncessary and breaks custom textures

---------

Co-authored-by: bunnei <bunneidev@gmail.com>
2023-04-21 10:14:55 +03:00
SachinVin 0da25736d9
renderer_opengl.cpp: Draw{Top, Bottom}Screen Clean up (#6422) 2023-04-16 19:51:21 +02:00
SachinVin e283de9b6d
gl_shader_disk_cache.cpp: Invalidate Tranferable cache on error (#6392) 2023-04-09 21:16:44 +02:00
SachinVin e4e9fb4aed
Merge pull request #6412 from GPUCode/wayland-oops
Port yuzu-emu/yuzu#7410: "Wayland fixes"
2023-04-08 16:51:56 +05:30
PolarZero 29aed69734
gl_rasterizer: HP Bar Fix for some games (#6334)
* HP Bar Fix for some games

Can fix #5139 #5563 and log spam

* HP Bar Fix for some games

Can fix #5139 #5563 and log spam

* Add TODO about HP Bar Fix
2023-04-04 20:32:14 +03:00
GPUCode 71d4a85957 video_core: Disable async shader loading with strict contexts 2023-04-03 14:32:13 +03:00
Steveice10 506644b9d6
video_core: Fix distance vector used when calculating lighting distance attenuation. (#6366) 2023-03-30 15:12:09 +03:00
GPUCode ffc95eb59b
Frontend PR fixes (#6378)
* citra_qt: Check if renderer is null

* core: Fix dynarmic use-after-free error

* bootmanager: Add current context check in DoneCurrent

* Loading a save state would destroy the frame dumper class, which contains a shared context. That context would call DoneCurrent without checking if it was actually bound or not, resulting in crashes when calling opengl functions

* externals: Correct glad readme

* common: Log renderer debug setting

* citra: Make lambda lower case

* Consistency with review comments on the PR

* video_core: Kill more global state

* GetResolutionScaleFactor would be called somewhere in the renderer constructor chain but it relies on the yet unitialized g_renderer, resulting in crashes when the resolution scale is set to auto. Rather than adding a workaround, let's kill this global state to fix this for good
2023-03-30 14:24:49 +03:00
GPUCode b5d6f645bd
Prepare frontend for multiple graphics APIs (#6347)
* externals: Update dynarmic

* settings: Introduce GraphicsAPI enum

* For now it's OpenGL only but will be expanded upon later

* citra_qt: Introduce backend agnostic context management

* Mostly a direct port from yuzu

* core: Simplify context acquire

* settings: Add option to create debug contexts

* renderer_opengl: Abstract initialization to Driver

* This commit also updates glad and adds some useful extensions which we will use in part 2

* Rasterizer construction is moved to the specific renderer instead of RendererBase.
  Software rendering has been disable to achieve this but will be brought back in the next commit.

* video_core: Remove Init/Shutdown methods from renderer

* The constructor and destructor can do the same job

* In addition move opengl function loading to Qt since SDL already does this. Also remove ErrorVideoCore which is never reached

* citra_qt: Decouple software renderer from opengl part 1

* citra: Decouple software renderer from opengl part 2

* android: Decouple software renderer from opengl part 3

* swrasterizer: Decouple software renderer from opengl part 4

* This commit simply enforces the renderer naming conventions in the software renderer

* video_core: Move RendererBase to VideoCore

* video_core: De-globalize screenshot state

* video_core: Pass system to the renderers

* video_core: Commonize shader uniform data

* video_core: Abstract backend agnostic rasterizer operations

* bootmanager: Remove references to OpenGL for macOS

OpenGL macOS headers definitions clash heavily with each other

* citra_qt: Proper title for api settings

* video_core: Reduce boost usage

* bootmanager: Fix hide mouse option

Remove event handlers from RenderWidget for events that are
already handled by the parent GRenderWindow.
Also enable mouse tracking on the RenderWidget.

* android: Remove software from graphics api list

* code: Address review comments

* citra: Port per-game settings read

* Having to update the default value for all backends is a pain so lets centralize it

* android: Rename to OpenGLES

---------

Co-authored-by: MerryMage <MerryMage@users.noreply.github.com>
Co-authored-by: Vitor Kiguchi <vitor-kiguchi@hotmail.com>
2023-03-27 14:29:17 +03:00
SachinVin 44097c2a8d
gl_shader_disk_cache: Avoid reopening files every time a shader need to be written. (#6344)
Hopefully reduces stutters with Android SAF
2023-03-25 23:35:17 +02:00
hank121314 8d563d37b4
citra_android: Storage Access Framework implementation (#6313) 2023-03-23 14:30:52 +01:00
Vitor K 6fbc54b0c5
citra-qt: fixes to per game settings (#6298)
* citra-qt config: small misc changes

Remove unused ReadSettingGlobal

Remove unused WriteSetting overload

ReadGlobalSetting: rename default value variable

* qt config: fix u16 values being written as QMetaType

* qt config: rework post processing shader setting

handles post processing setting properly when per-game settings are used.
the anaglyph shader is given its own setting, separate from the post
processing name.

* qt config: use u32 instead of unsigned int when casting
2023-03-13 23:02:07 +02:00
SomeDudeOnDiscord d8c9335ef0
Resolve Black Screen on Intel GPU Regression (#6306)
* Get value for swap screen setting and check mono_render_option again

* resolve clang-format issue

* do not disable opengl blending since it is enabled by default

* reset blending state to default values after drawing second screen

* prevent resetting state blending when custom opacity is not used
2023-02-18 18:54:12 +02:00
SomeDudeOnDiscord a8e4e11cd5
Better Support for Picture-in-Picture Custom Layouts (Based on #6127) (#6247) 2023-02-14 22:06:11 +01:00
Steveice10 a8848cce43 build: Update to support multi-arch builds. 2023-01-07 01:09:32 -08:00
Vitor K c8ff1d744a
Change Monoscopic Render mode to a dropdown (#6215) 2022-12-24 03:17:49 +01:00
Tobias ccb50e7f2c
Port yuzu-emu/yuzu#9300: "CMake: Use precompiled headers to improve compile times" (#6213)
Co-authored-by: Ameer J <52414509+ameerj@users.noreply.github.com>
2022-12-17 16:06:38 +01:00
GPUCode 48ee112ceb
Add per game configuration options (#6187)
* common: Move settings to common from core.

- Removes a dependency on core and input_common from common.

* code: Wrap settings values

* Port from yuzu to allow per game settings

* citra_qt: Initial per-game settings dialog

* citra_qt: Use new API for read/save of config values

* citra_qt: Per game audio settings

* citra_qt: Per game graphics settings

* citra_qt: Per game system settings

* citra_qt: Per game general settings

* citra_qt: Document and run clang format

* citra_qt: Make icon smaller and centered

* citra_qt: Remove version number

* Not sure how to extract that, can always add it back later

* citra_qt: Wrap UISettings

* citra_qt: Fix unthottled fps setting

* citra_qt: Remove margin in emulation tab

* citra_qt: Implement some suggestions

* Bring back speed switch hotkey

* Allow configuration when game is running

* Rename/adjust UI stuff

* citra_qt: Fix build with separate windows

* citra_qt: Address feedback

* citra_qt: Log per-game settings before launching games

* citra_qt: Add shader cache options

* Also fix android build

* citra_qt: Add DLC menu option

* citra_qt: Run clang-format

* citra_qt: Adjust for time offset

* citra_qt: Implement suggestions

* Run clang-format

Co-authored-by: bunnei <bunneidev@gmail.com>
2022-12-08 13:27:25 +02:00
Ameer J f44c95d638
Add "Separate Windows" LayoutOption (#6177) 2022-11-17 16:37:30 +01:00
Venkat Rao 4f715b6718
Add nearest neighbor texture filter (#6189)
Closes https://github.com/citra-emu/citra/issues/4707
closes https://github.com/citra-emu/citra/issues/5274
2022-11-16 18:55:14 +01:00
Jake Downs 664562f988
add mono_render_left_eye option (#6140) 2022-11-16 18:54:26 +01:00
FearlessTobi 95c7bac8a6 Resolve compilation errors related to the Color namespace change 2022-11-15 11:25:51 +01:00
Venkat Rao f6320c8de9
Reduce bugginess when texture filtering and custom textures both enabled (#6184)
* fixed some (but not all) glitchy behavior when texture filtering & custom textures both enabled

* fix clang format
2022-11-12 08:08:26 +02:00
Tobias bb05d8c12a
src/CMakeLists: Enforce multiple warnings on MSVC (#5692) 2022-11-09 23:14:28 +01:00
Tobias 1ddea27ac8
code: Cleanup and warning fixes from the Vulkan PR (#6163)
Co-authored-by: emufan4568 <geoster3d@gmail.com>
Co-authored-by: Kyle Kienapfel <Docteh@users.noreply.github.com>
2022-11-04 23:32:57 +01:00
SachinVin 4a590d1fcb xbyak: Correct xbyak include directory
xbyak is intended to be installed in /usr/local/include/xbyak.
Since we desire not to install xbyak before using it, we copy the headers
to the appropriate directory structure and use that instead
Co-authored-by: merry <git@mary.rs>
2022-10-23 13:19:32 +05:30
GPUCode ea26f46b0d
renderer_opengl: Fix flashlight problems in Luigi's Mansion (#6160) 2022-10-16 20:19:29 +05:30
GPUCode b05b5b3bd8
renderer_opengl: Address cubemap related errors (#6158) 2022-10-14 22:28:38 +05:30
liushuyu c6153bb32e
CI: fix recent build issues (#6148)
Co-authored-by: Vitor K <vitor-kiguchi@hotmail.com>
2022-10-05 18:43:07 +02:00
Jake Downs a44c77351b
Update renderer_opengl.cpp
pass false for bool anaglyph when calling OpenGL::GetPostProcessingShaderCode in Interlaced conditional branch

fixes https://github.com/citra-emu/citra/issues/6132
2022-09-22 15:57:00 -07:00
GPUCode cbd5d1c15c
Upgrade codebase to C++ 20 + fix warnings + update submodules (#6115) 2022-09-21 18:36:12 +02:00
SachinVin baecc18d8c
Partially Revert "renderer_opengl: Remove amd hacks and legacy paths" (#6122)
This reverts commit 07a69b7c7b.
2022-09-10 15:35:13 +05:30
GPUCode fd40880127
rasterizer_cache: Ignore fill surfaces
* Causes graphical bugs in Yokai games
2022-09-04 12:54:52 +03:00
Vitor Kiguchi c6fc00bc77 GetShaderCacheVersionHash: add comment explaining where the hash comes from 2022-09-03 15:09:09 +02:00
emufan4568 10c7aa402d gl_shader_util: Downgrade GLSL to 430
* Older intel drivers don'tsupport 450 as a version string
2022-08-29 21:44:07 +03:00
emufan4568 926d604312 Run clang format once more 2022-08-29 21:37:38 +03:00
GPUCode 64e7f5929d
gl_rasterizer: Fix build on MacOS 2022-08-23 16:48:19 +03:00
emufan4568 12f84e18dc externals: Upgrade glad to latest version
* Also change some mentions to OpenGL 3.3 to 4.3
2022-08-22 23:44:03 +03:00
emufan4568 7bcf753a21 renderer_opengl: Apply styling suggestions 2022-08-22 13:13:41 +03:00
GPUCode 6109935b73
gl_rasterizer: BindCubeFace is const
Co-authored-by: SachinVin <26602104+SachinVin@users.noreply.github.com>
2022-08-22 11:11:28 +03:00
emufan4568 31e6b553dc video_core: Run clang format 2022-08-22 08:00:30 +03:00
GPUCode f478e3093f rasterizer_cache: Drop warning in IntervalHasInvalidPixelFormat to debug 2022-08-22 07:59:04 +03:00
GPUCode cc5a88a864 rasterizer_cache: Make cache reset on resolution/filter change more explicit 2022-08-22 07:58:04 +03:00
GPUCode 14aea56fa1
pixel_format: Constexpr implies inline 2022-08-21 21:57:33 +03:00
emufan4568 2ed89b6448 cached_surface: Add missing include 2022-08-21 17:47:47 +03:00
emufan4568 9b5230c60e rasterizer_cache: Always create TextureDownloaderES
* It's used when dumping textures on desktop, so create it upfront to avoid null checks
2022-08-21 13:35:06 +03:00
emufan4568 1579f96397 rasterizer_cache: Remove remaining OpenGL code 2022-08-21 13:32:02 +03:00
emufan4568 fc450edd14 gl_rasterizer: Fix minor warnings and improve readability 2022-08-21 12:42:32 +03:00
emufan4568 e6137d7874 renderer_opengl: Remove GLvec* types
* The common types already exist and provide all the functionality required, why invent new types?
2022-08-21 12:22:58 +03:00
emufan4568 e834f2b049 gl_resource_manager: Fix bug when allocating 3D textures 2022-08-21 02:24:13 +03:00
emufan4568 2726fe66db renderer_opengl: Header cleanup
* Should help with building times
2022-08-21 02:22:57 +03:00
emufan4568 07a69b7c7b renderer_opengl: Remove amd hacks and legacy paths
* AMDs new driver fixed many issues in the OpenGL driver. No reason to
  keep these hacks. In addition the upgrade to 4.3 guarantees the
  existance of required extensions, so no need to check for them
2022-08-21 01:52:49 +03:00
emufan4568 025cd31420 video_core: Bump OpenGL version to 4.3 on desktop
* The current backend heavily depends on many extensions for shadow
  rendering and texture cubes in the fragment shaders. All these
  extensions were incorporated to core in 4.3. Support is practically
  ubiquitous and requiring support for it makes things a lot easier
2022-08-21 01:39:16 +03:00
emufan4568 17ad594a62 rasterizer_cache: Introduce TextureRuntime and separate CachedSurface
* This commit aims to both continue the rasterizer cache cleanup by
  separating CachedSurface into a dedicated header and to start weeding
  out the raw OpenGL code from the cache.

* The latter is achieved by abstracting most texture operations in a new
  class called TextureRuntime. This has many benefits such as making it easier
  to port the functionality to other graphics APIs and the removal of the need
  to pass (read/draw) framebuffer handles everywhere. The filterer and
  reinterpreter get their own sets of FBOs due to this, something that
  might be a performance win since it reduces the state switching
  overhead on the runtime FBOs.
2022-08-21 01:16:48 +03:00
emufan4568 199671301d rasterizer_cache: Header cleanup and copyright date update 2022-08-21 01:16:48 +03:00
emufan4568 f6e3bb54f4 rasterizer_cache: Move utlities and type to separate headers 2022-08-21 01:16:48 +03:00
emufan4568 0fedf11be1 rasterizer_cache: Move depth tuples to cpp file 2022-08-21 01:16:47 +03:00
emufan4568 22acfe4d41 rasterizer_cache: SurfaceParams interface cleanup 2022-08-21 01:16:47 +03:00
emufan4568 cb0816c987 rasterizer_cache: Compute width and height only when used
Solves the compiler warning
2022-08-21 01:16:47 +03:00
emufan4568 6a7d601e42 rasterizer_cache: Factor morton swizzle and pixel format to dedicate headers
* Makes the code cleaner in general by not having to alias PixelFormat and SurfaceType everywhere
2022-08-21 01:16:47 +03:00
emufan4568 efc2db4088 rasterizer_cache: Separate into common directory 2022-08-21 01:16:42 +03:00
pawelniegowski b0c72c2ea7 revert GLSL version change 2022-08-10 16:36:23 +02:00
pawelniegowski ff81fb04b4 Fix MakeCurrent and shader issues with AMD 22.7 driver 2022-07-29 12:26:18 +02:00
BreadFish64 353aaaf665
Merge pull request #6010 from SachinVin/gunman
shader_jit: Fixes for Gunman clive
2022-07-06 23:45:44 -05:00
SachinVin 65611e5b51 Shader jit: Save and restore LOOPCOUNT_REG for nested loops,
also add the assert back for nested loops
update test
2022-05-21 11:24:32 +05:30
Morph de1374c1b9 video_core: Resolve C4267 warning on MSVC 2022-05-18 00:05:41 -04:00
SachinVin 047e238d09 shader_jit: Compile nested loops
and use `T_NEAR` instead of the default in Compile_BREAKC
2022-04-24 23:12:53 +05:30
SachinVin b5ac9e4946
Backport non-seperable disk shader from android (#5976)
* VideoCore: Backport Shader cache for non separable shaders

android: disk_shader_cache: remove redundant lookup

* disk_shader_cache: dont compile dumped shaders

* cleanup Seperable shader loading

* gl_shader_disk_cache.cpp: remove redundant checks

* Skip compiling non seperable raws

* gl_shader_manager.cpp: Skip `GLAD_GL_ARB_get_program_binary` check on GLES
2022-04-02 11:57:14 +05:30
SachinVin d35a7a8e23
Merge pull request #5804 from weihuoya/minorfx
Minor fx
2022-01-30 21:51:11 +05:30
SachinVin 4e15823db2
gl_format_reinterpreter.cpp: fallback to PBO path on obsolete intel drivers (#5928) 2022-01-24 14:14:28 +05:30
zhang wei afa7f4996f
fx bgr write back on gles (#5924) 2022-01-24 14:14:12 +05:30
trimental 2670b951e1
Fix software renderer for empty texture addresses (#5893) 2022-01-07 11:36:01 -06:00
bunnei 83913e68f3
Merge pull request #5905 from SachinVin/intel
Remove CopyImageSubData; and enable TextureView reinterpreter only on nvidia
2022-01-04 17:41:14 -08:00
SachinVin 5bd146b569 gl_format_reinterpreter.cpp: remove CopyImageSubData; and enable TextureView reinterpreter only on nvidia 2021-12-19 00:38:24 +05:30
SutandoTsukai181 60235827c5 Add Cardboard VR
Based on hrydgard/ppsspp/pull/12449
2021-12-18 16:52:24 +05:30
bunnei b7a156f7c8 android: frontend: Track screen layout separately for orientation.
android framebuffer
2021-12-18 16:52:17 +05:30
SachinVin e8269a9e36 gl_format_reinterpreter.cpp: attempt to skip D24S8 to RGBA8 reinterpretation fast path for older nvidia GPUs,
additionally check for GL_ARB_copy_image in the fallback path
2021-10-06 22:22:26 +05:30
SachinVin 6183b5d76c
Merge pull request #5823 from SachinVin/dyn
Android: Backport easy stuff
2021-10-03 18:58:20 +05:30
SachinVin d4e85e2bb5
video_core: Disable disk shader cache when GL_ARB_get_program_binary is unsupported (#5785) 2021-10-03 18:57:34 +05:30
SachinVin 80799b1e5d gl_shader_gen.cpp: Fix separable shaders when GL_EXT_clip_cull_distance is not supported 2021-10-02 16:38:29 +05:30
SachinVin 80b8d66017 gl_rasterizer.cpp: don't check for GL_ARB_copy_image when using GLES 2021-10-02 16:38:27 +05:30
SachinVin 228f648e3f video_core/CMakeLists.txt: Use toolchain cmake in shader header generator 2021-10-02 16:38:26 +05:30
bunnei 9fbda04891 gl_shader_decompiler: Improve performance of accurate_mul on Android. 2021-10-02 16:38:24 +05:30
xperia64 8a68c58070 Shield TV driver bug workaround
shield tv
2021-10-02 16:38:22 +05:30
SachinVin 703ef0e6f0 gl_shader_gen.cpp:fix implicit type conversion error for gles 2021-10-02 16:38:20 +05:30