summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_texture_cache.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* gl_texture_cache: Create image storage viewsReinUsesLisp2021-07-231-33/+99
| | | | Fixes SULD.D tests.
* shader: Initial OpenGL implementationReinUsesLisp2021-07-231-179/+78
|
* shader: Interact texture buffers with buffer cacheReinUsesLisp2021-07-231-0/+4
|
* Merge pull request #6537 from Morph1984/warningsbunnei2021-07-061-1/+2
|\ | | | | general: Enforce multiple warnings in MSVC
| * video_core: Silence signed/unsigned mismatch warningsMorph2021-06-281-1/+2
| |
* | TextureCacheOGL: Implement Image Copies for 1D and 1D Array.Fernando Sahmkow2021-07-031-0/+26
|/
* Reaper: Guarantee correct deletion.Fernando Sahmkow2021-06-201-0/+2
|
* configure_graphics: Add Accelerate ASTC decoding settingameerj2021-06-161-1/+5
|
* texture_cache: Handle out of bound texture blitsameerj2021-05-081-5/+4
| | | | Some games interleave a texture blit using regions which are out-of-bounds. This addresses the interleaving to avoid oob reads from the src texture.
* astc_decoder: Refactor for style and more efficient memory useameerj2021-03-251-5/+6
|
* renderer_opengl: Accelerate ASTC texture decoding with a compute shaderameerj2021-03-131-1/+9
| | | | | | ASTC texture decoding is currently handled by a CPU decoder for GPU's without native ASTC decoding support (most desktop GPUs). This is the cause for noticeable performance degradation in titles which use the format extensively. This commit adds support to accelerate ASTC decoding using a compute shader on OpenGL for GPUs without native support.
* renderer_opengl: Swizzle BGR textures on copyameerj2021-03-041-2/+18
| | | | | | OpenGL does not natively support BGR internal formats, which causes many BGR textures to render incorrectly, with Red and Blue channels swapped. This commit aims to address this by swizzling the blue and red channels on texture copies when a BGR format is encountered.
* gl_texture_cache: Lazily create non-sRGB texture views for sRGB formatsameerj2021-02-131-0/+31
| | | | | | This creates non-sRGB texture views for sRGB texture formats to allow for interfacing with these views in compute shaders using imageLoad and imageStore. Co-Authored-By: Rodrigo Locatti <reinuseslisp@airmail.cc>
* vk_staging_buffer_pool: Add stream buffer for small uploadsReinUsesLisp2021-02-131-11/+10
| | | | | | | | This uses a ring buffer similar to OpenGL's stream buffer for small uploads. This stops us from allocating several small buffers, reducing memory fragmentation and cache locality. It uses dedicated allocations when possible.
* video_core: Reimplement the buffer cacheReinUsesLisp2021-02-131-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reimplement the buffer cache using cached bindings and page level granularity for modification tracking. This also drops the usage of shared pointers and virtual functions from the cache. - Bindings are cached, allowing to skip work when the game changes few bits between draws. - OpenGL Assembly shaders no longer copy when a region has been modified from the GPU to emulate constant buffers, instead GL_EXT_memory_object is used to alias sub-buffers within the same allocation. - OpenGL Assembly shaders stream constant buffer data using glProgramBufferParametersIuivNV, from NV_parameter_buffer_object. In theory this should save one hash table resolve inside the driver compared to glBufferSubData. - A new OpenGL stream buffer is implemented based on fences for drivers that are not Nvidia's proprietary, due to their low performance on partial glBufferSubData calls synchronized with 3D rendering (that some games use a lot). - Most optimizations are shared between APIs now, allowing Vulkan to cache more bindings than before, skipping unnecesarry work. This commit adds the necessary infrastructure to use Vulkan object from OpenGL. Overall, it improves performance and fixes some bugs present on the old cache. There are still some edge cases hit by some games that harm performance on some vendors, this are planned to be fixed in later commits.
* gl_texture_cache: Avoid format views on Intel and AMDReinUsesLisp2021-01-041-0/+2
| | | | | | | Intel and AMD proprietary drivers are incapable of rendering to texture views of different formats than the original texture. Avoid creating these at a cache level. This will consume more memory, emulating them with copies.
* gl_texture_cache: Create base images with sRGBReinUsesLisp2021-01-041-98/+95
| | | | | | This breaks accelerated decoders trying to imageStore into images with sRGB. The decoders are currently disabled so this won't cause issues at runtime.
* video_core: Rewrite the texture cacheReinUsesLisp2020-12-301-553/+901
| | | | | | | | | | | | | | The current texture cache has several points that hurt maintainability and performance. It's easy to break unrelated parts of the cache when doing minor changes. The cache can easily forget valuable information about the cached textures by CPU writes or simply by its normal usage.The current texture cache has several points that hurt maintainability and performance. It's easy to break unrelated parts of the cache when doing minor changes. The cache can easily forget valuable information about the cached textures by CPU writes or simply by its normal usage. This commit aims to address those issues.
* video_core: Remove unnecessary enum class casting in logging messagesLioncash2020-12-071-2/+1
| | | | | | | fmt now automatically prints the numeric value of an enum class member by default, so we don't need to use casts any more. Reduces the line noise a bit.
* video_core: Resolve more variable shadowing scenarios pt.3Lioncash2020-12-051-9/+9
| | | | | Cleans out the rest of the occurrences of variable shadowing and makes any further occurrences of shadowing compiler errors.
* video_core: Resolve more variable shadowing scenariosLioncash2020-12-041-10/+10
| | | | | | Resolves variable shadowing scenarios up to the end of the OpenGL code to make it nicer to review. The rest will be resolved in a following commit.
* video_core: Remove all Core::System references in rendererReinUsesLisp2020-09-061-4/+6
| | | | | | | | | Now that the GPU is initialized when video backends are initialized, it's no longer needed to query components once the game is running: it can be done when yuzu is booting. This allows us to pass components between constructors and in the process remove all Core::System references in the video backend.
* gl_texture_cache: Take std::string by reference in DecorateViewName()Lioncash2020-08-241-1/+1
| | | | | LabelGLObject takes a string_view, so we don't need to make copies of the std::string.
* video_core: Rearrange pixel format namesReinUsesLisp2020-07-131-86/+87
| | | | | | Normalizes pixel format names to match Vulkan names. Previous to this commit pixel formats had no convention, leading to confusion and potential bugs.
* video_core: Fix DXT4 and RGB565ReinUsesLisp2020-07-131-1/+3
|
* video_core: Fix B5G6R5_UNORM render target formatReinUsesLisp2020-07-131-0/+1
|
* video_core: Fix B5G6R5UReinUsesLisp2020-07-131-1/+1
|
* video_core: Implement RGBA32_SINT render targetReinUsesLisp2020-07-131-58/+59
|
* video_core: Implement RGBA32_SINT render targetReinUsesLisp2020-07-131-0/+1
|
* video_core: Implement RGBA16_SINT render targetReinUsesLisp2020-07-131-0/+1
|
* video_core: Implement RGBA8_SINT render targetReinUsesLisp2020-07-131-0/+1
|
* video_core: Implement RG32_SINT render targetReinUsesLisp2020-07-131-0/+1
|
* video_core: Implement RG8_SINT render target and fix RG8_UINTReinUsesLisp2020-07-131-1/+2
|
* video_core: Implement R8_SINT render targetReinUsesLisp2020-07-131-0/+1
|
* video_core: Implement R8_SNORM render targetReinUsesLisp2020-07-131-0/+1
|
* texture_cache: Handle 3D texture blits with one layerReinUsesLisp2020-06-081-2/+2
|
* texture_cache: Implement rendering to 3D texturesReinUsesLisp2020-06-081-18/+31
| | | | | | | | | | | | | | This allows rendering to 3D textures with more than one slice. Applications are allowed to render to more than one slice of a texture using gl_Layer from a VTG shader. This also requires reworking how 3D texture collisions are handled, for now, this commit allows rendering to slices but not to miplevels. When a render target attempts to write to a mipmap, we fallback to the previous implementation (copying or flushing as needed). - Fixes color correction 3D textures on UE4 games (rainbow effects). - Allows Xenoblade games to render to 3D textures directly.
* gl_device: Avoid devices with CAVEAT_SUPPORT on ASTCReinUsesLisp2020-06-011-2/+1
| | | | | | | | This avoids using Nvidia's ASTC decoder on OpenGL. The last time it was profiled, it was slower than yuzu's decoder. While we are at it, fix a bug in the texture cache when native ASTC is not supported.
* gl_texture_cache: Implement small texture view cache for swizzlesReinUsesLisp2020-05-261-16/+26
| | | | | This fixes cases where the texture swizzle was applied twice on the same draw to a texture bound to two different slots.
* texture_cache: Implement depth stencil texture swizzlesReinUsesLisp2020-05-261-11/+28
| | | | | | | | Stop ignoring image swizzles on depth and stencil images. This doesn't fix a known issue on Xenoblade Chronicles 2 where an OpenGL texture changes swizzles twice before being used. A proper fix would be having a small texture view cache for this like we do on Vulkan.
* texture: Implement R8G8UIMorph2020-04-301-0/+1
| | | | - Used by The Walking Dead: The Final Season
* gl_texture_cache: Fix layered texture attachment base levelReinUsesLisp2020-04-131-1/+1
| | | | | | The base level is already included in the texture view. If we specify the base level in the texture again, this will end up in the incorrect level and potentially out of bounds.
* gl_texture_cache: Attach view instead of base texture for layered attachmentsReinUsesLisp2020-04-091-2/+2
| | | | This way we are not ignoring the base layer of the current texture.
* gl_texture_cache: Fix software ASTC fallbackReinUsesLisp2020-04-011-7/+12
|
* video_core: Use native ASTC when availableReinUsesLisp2020-04-011-99/+95
|
* video_core: Implement RGBA16_SNORMReinUsesLisp2020-03-131-0/+1
| | | | Implement RGBA16_SNORM with the current API. Nothing special here.
* gl_texture_cache: Remove blending disable on blitsReinUsesLisp2020-02-281-5/+0
| | | | | Blending doesn't affect blits. Rasterizer discard does, update the commentaries.
* gl_state_tracker: Implement dirty flags for clip controlReinUsesLisp2020-02-281-2/+0
|
* gl_state_tracker: Implement dirty flags for sRGBReinUsesLisp2020-02-281-0/+1
|
* gl_state_tracker: Implement dirty flags for rasterize enableReinUsesLisp2020-02-281-0/+1
|
* gl_state_tracker: Implement dirty flags for blendingReinUsesLisp2020-02-281-0/+1
|
* gl_state_tracker: Implement dirty flags for scissorsReinUsesLisp2020-02-281-0/+1
|
* renderer_opengl: Reintroduce dirty flags for render targetsReinUsesLisp2020-02-281-2/+5
|
* gl_state: Remove completelyReinUsesLisp2020-02-281-1/+0
|
* gl_state: Remove framebuffer trackingReinUsesLisp2020-02-281-12/+5
|
* gl_state: Remove image trackingReinUsesLisp2020-02-281-10/+4
|
* gl_state: Remove blend state trackingReinUsesLisp2020-02-281-0/+3
|
* gl_state: Remove clip control trackingReinUsesLisp2020-02-281-0/+1
|
* gl_state: Remove rasterizer disable trackingReinUsesLisp2020-02-281-0/+2
|
* gl_state: Remove scissor test trackingReinUsesLisp2020-02-281-0/+1
|
* gl_state: Remove framebuffer sRGB trackingReinUsesLisp2020-02-281-1/+7
|
* gl_rasterizer: Remove dirty flagsReinUsesLisp2020-02-281-2/+0
|
* Merge pull request #3417 from ReinUsesLisp/r32ibunnei2020-02-251-0/+1
|\ | | | | texture: Implement R32I
| * texture: Implement R32IReinUsesLisp2020-02-151-0/+1
| |
* | Merge pull request #3425 from ReinUsesLisp/layered-framebufferbunnei2020-02-241-8/+20
|\ \ | | | | | | texture_cache: Implement layered framebuffer attachments
| * | texture_cache: Implement layered framebuffer attachmentsReinUsesLisp2020-02-161-8/+20
| |/ | | | | | | | | | | Layered framebuffer attachments is a feature that allows applications to write attach layered textures to a single attachment. What layer the fragments are written to is decided from the shader using gl_Layer.
* / surface_base: Implement texture buffer flushesReinUsesLisp2020-02-161-0/+7
|/ | | | | Implement downloads to guest memory from texture buffers on the generic cache and OpenGL.
* Merge pull request #3358 from ReinUsesLisp/implicit-texture-cachebunnei2020-01-291-3/+6
|\ | | | | gl_texture_cache: Silence implicit sign cast warnings
| * gl_texture_cache: Silence implicit sign cast warningsReinUsesLisp2020-01-281-3/+6
| |
* | gl_texture_cache: Properly implement depth/stencil samplingReinUsesLisp2020-01-271-4/+27
|/ | | | | | This addresses the long standing issue of compatibility vs. core profiles on OpenGL, properly implementing depth vs. stencil sampling depending on the texture swizzle.
* gl_texture_cache: Use local variables to simplify DownloadTextureReinUsesLisp2020-01-141-6/+4
|
* gl_texture_cache: Fix format for RGBX16FReinUsesLisp2020-01-141-1/+1
|
* gl_texture_cache: Use Snorm internal format for RG8SReinUsesLisp2020-01-141-1/+1
|
* gl_texture_cache: Use Snorm internal format for ABGR8SReinUsesLisp2020-01-141-1/+1
|
* gl_texture_cache: Apply sRGB on blitsReinUsesLisp2019-11-241-0/+1
| | | | | glBlitFramebuffer keeps in mind GL_FRAMEBUFFER_SRGB's state. Enable this depending on the target surface pixel format.
* texture_cache: Drop abstracted ComponentTypeReinUsesLisp2019-11-141-103/+82
| | | | | | | | | Abstracted ComponentType was not being used in a meaningful way. This commit drops its usage. There is one place where it was being used to test compatibility between two cached surfaces, but this one is implied in the pixel format. Removing the component type test doesn't change the behaviour.
* Video_Core: Implement texture format E5B9G9R9_SHAREDEXP.Fernando Sahmkow2019-10-271-0/+1
| | | | | This commit implements the E5B9G9R9 Texture format into the general system and OpenGL backend.
* Surfaces: Implement R4G4B4A4U format.Fernando Sahmkow2019-10-091-1/+2
|
* Surfaces: Implement ASTC 6x6 10x10 12x12 8x6 6x5Fernando Sahmkow2019-10-091-0/+10
|
* Fix clang-formatFearlessTobi2019-09-221-1/+1
|
* video_core: Implement RGBX16F PixelFormatFearlessTobi2019-09-221-0/+1
|
* Merge pull request #2742 from ReinUsesLisp/fix-texture-buffersbunnei2019-08-291-0/+4
|\ | | | | gl_texture_cache: Miscellaneous texture buffer fixes
| * gl_texture_cache: Do not set texture parameters to buffersReinUsesLisp2019-07-181-0/+3
| |
| * gl_texture_cache: Add missing break in CreateTextureReinUsesLisp2019-07-181-0/+1
| |
* | Merge pull request #2743 from FernandoS27/surpress-assertbunnei2019-07-251-1/+0
|\ \ | | | | | | Downgrade and suppress a series of GPU asserts and debug messages.
| * | Gl_Texture_Cache: Remove assert on component type in GetFormatTupleFernando Sahmkow2019-07-181-1/+0
| |/ | | | | | | | | | | Textures can have different components types in different orders. This assert was completely inprecise and the effectiveness of such is better handled by case and within the texture cache.
* / Maxwell3D: Implement State Dirty Flags.Fernando Sahmkow2019-07-171-1/+5
|/
* GPU: Add a microprofile for macro interpreterFernando Sahmkow2019-07-141-1/+2
|
* Gl_Texture_Cache: Measure Buffer Copy TimesFernando Sahmkow2019-07-141-0/+2
|
* texture_cache: Address FeedbackFernando Sahmkow2019-07-051-3/+3
|
* texture_cache: Correct Texture Buffer UploadingFernando Sahmkow2019-07-051-2/+15
|
* texture_cache: Address feedbackReinUsesLisp2019-06-291-4/+1
|
* gl_texture_cache: Correct assertsFernando Sahmkow2019-06-261-1/+1
|
* gl_texture_cache: Corrections and fixesFernando Sahmkow2019-06-251-10/+6
|
* gl_texture_cache: Explicitly add indirect includeReinUsesLisp2019-06-241-0/+1
|
* gl_texture_cache: Use Stream Buffers instead of Persistant for Buffer Copies.Fernando Sahmkow2019-06-211-1/+1
|
* gl_texture_cache: Correct Image BlitFernando Sahmkow2019-06-211-1/+1
|
* texture_cache: Use siblings textures on Rebuild and fix possible error on blittingFernando Sahmkow2019-06-211-1/+1
|
* texture_cache: eliminate accelerated depth->color/color->depth copies due to driver instability.Fernando Sahmkow2019-06-211-8/+5
|
* texture_cache: Optimize GetSurface and use references on functions that don't change a surface.Fernando Sahmkow2019-06-211-3/+3
|
* texture_cache: Implement Buffer Copy and detect Turing GPUs Image CopiesFernando Sahmkow2019-06-211-1/+91
|
* texture_cache uncompress-compress is untopological.Fernando Sahmkow2019-06-211-5/+5
| | | | | | This makes conflicts between non compress and compress textures to be auto recycled. It also limits the amount of mipmaps a texture can have if it goes above it's limit.
* texture_cache: Fermi2D reform and implement View MirageFernando Sahmkow2019-06-211-30/+24
| | | | | This also does some fixes on compressed textures reinterpret and on the Fermi2D engine in general.
* texture_cache: General FixesFernando Sahmkow2019-06-211-3/+8
| | | | | | | Fixed ASTC mipmaps loading Fixed alignment on openGL upload/download Fixed Block Height Calculation Removed unalign_height
* gl_texture_cache: Make main views be proxy textures instead of a full view.Fernando Sahmkow2019-06-211-10/+18
|
* Reduce amount of size calculations.Fernando Sahmkow2019-06-211-1/+0
|
* Texture Cache: Implement Blitting and Fermi CopiesFernando Sahmkow2019-06-211-1/+69
|
* surface_view: Add constructor for ViewParamsReinUsesLisp2019-06-211-11/+4
|
* Correct Mipmaps View method in Texture CacheFernando Sahmkow2019-06-211-21/+23
|
* Implement Texture Cache V2Fernando Sahmkow2019-06-211-183/+103
|
* texture_cache: Remove execution context copies from the texture cacheReinUsesLisp2019-06-211-6/+10
| | | | | This is done to simplify the OpenGL implementation, it is needed for Vulkan.
* texture_cache: Split texture cache into different filesReinUsesLisp2019-06-211-1/+1
|
* texture_cache: Move staging buffer into a generic implementationReinUsesLisp2019-06-211-107/+7
|
* texture_cache: Flush 3D textures in the order they are drawnReinUsesLisp2019-06-211-2/+3
|
* gl_texture_cache: Minor changesReinUsesLisp2019-06-211-22/+28
|
* gl_texture_cache: Add copy from multiple overlaps into a single surfaceReinUsesLisp2019-06-211-4/+50
|
* gl_texture_cache: Attach surface textures instead of viewsReinUsesLisp2019-06-211-6/+21
|
* gl_texture_cache: Add fast copy pathReinUsesLisp2019-06-211-3/+48
|
* gl_texture_cache: Initial implementationReinUsesLisp2019-06-211-0/+514