summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_rasterizer.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2023-01-01MacroHLE: Final cleanup and fixes.Fernando Sahmkow1-2/+1
2023-01-01Rasterizer: Setup skeleton for Host Conditional renderingFernando Sahmkow1-0/+1
2023-01-01RasterizerMemory: Add filtering for flushing/invalidation operations.Fernando Sahmkow1-4/+9
2023-01-01MacroHLE: Add OpenGL SupportFernando Sahmkow1-0/+4
2022-11-17maxwell3d: full HLE for multi-layer clearsLiam1-1/+1
2022-11-15video_core: Reimplement inline index buffer bindingFeng Chen1-2/+0
2022-10-22video_core: Implement maxwell inline_index methodFengChen1-0/+2
2022-10-21video_coare: Reimplementing the maxwell drawing trigger mechanismFengChen1-1/+1
2022-10-06DMA & InlineToMemory Engines Rework.bunnei1-1/+1
2022-10-06VideoCore: Refactor fencing system.Fernando Sahmkow1-2/+3
2022-10-06Texture cache: Fix the remaining issues with memory mnagement and unmapping.Fernando Sahmkow1-1/+1
2022-10-06OpenGl: Implement Channels.Fernando Sahmkow1-4/+9
2022-07-27chore: make yuzu REUSE compliantAndrea Pappacoda1-3/+2
[REUSE] is a specification that aims at making file copyright information consistent, so that it can be both human and machine readable. It basically requires that all files have a header containing copyright and licensing information. When this isn't possible, like when dealing with binary assets, generated files or embedded third-party dependencies, it is permitted to insert copyright information in the `.reuse/dep5` file. Oh, and it also requires that all the licenses used in the project are present in the `LICENSES` folder, that's why the diff is so huge. This can be done automatically with `reuse download --all`. The `reuse` tool also contains a handy subcommand that analyzes the project and tells whether or not the project is (still) compliant, `reuse lint`. Following REUSE has a few advantages over the current approach: - Copyright information is easy to access for users / downstream - Files like `dist/license.md` do not need to exist anymore, as `.reuse/dep5` is used instead - `reuse lint` makes it easy to ensure that copyright information of files like binary assets / images is always accurate and up to date To add copyright information of files that didn't have it I looked up who committed what and when, for each file. As yuzu contributors do not have to sign a CLA or similar I couldn't assume that copyright ownership was of the "yuzu Emulator Project", so I used the name and/or email of the commit author instead. [REUSE]: https://reuse.software Follow-up to 01cf05bc75b1e47beb08937439f3ed9339e7b254
2022-03-19video_core: Reduce unused includesameerj1-10/+0
2022-02-01Rasterizer: Refactor inlineToMemory.Fernando Sahmkow1-1/+2
2022-01-29Rasterizer: Implement Inline2Memory Acceleration.Fernando Sahmkow1-0/+1
2021-07-23glasm: Use storage buffers instead of global memory when possibleReinUsesLisp1-1/+2
2021-07-23gl_shader_cache: Rename Program abstractions into PipelineReinUsesLisp1-1/+1
2021-07-23glasm: Set transform feedback stateReinUsesLisp1-5/+1
2021-07-23shader: Move pipeline cache logic to separate filesReinUsesLisp1-1/+1
Move code to separate files to be able to reuse it from OpenGL. This greatly simplifies the pipeline cache logic on Vulkan. Transform feedback state is not yet abstracted and it's still intrusively stored inside vk_pipeline_cache. It will be moved when needed on OpenGL.
2021-07-23shader: Remove old shader managementReinUsesLisp1-32/+1
2021-07-13DMAEngine: Accelerate BufferClearFernando Sahmkow1-0/+2
2021-07-11accelerateDMA: Accelerate Buffer Copies.Fernando Sahmkow1-0/+13
2021-07-09Fence Manager: Add fences on Reference Count.Fernando Sahmkow1-0/+1
2021-07-04Texture Cache: Initial Implementation of Sparse Textures.Fernando Sahmkow1-0/+1
2021-06-22bootmanager: Use std::stop_source for stopping emulationReinUsesLisp1-1/+1
Use its std::stop_token to abort shader cache loading. Using std::stop_token instead of std::atomic_bool allows the usage of other utilities like std::stop_callback.
2021-06-01buffer_cache: Simplify uniform disabling logicameerj1-0/+1
2021-02-13renderer_opengl: Remove interopReinUsesLisp1-7/+0
Remove unused interop code from the OpenGL backend.
2021-02-13video_core: Reimplement the buffer cacheReinUsesLisp1-51/+22
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.
2020-12-30video_core: Rewrite the texture cacheReinUsesLisp1-33/+30
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.
2020-12-05video_core: Resolve more variable shadowing scenarios pt.3Lioncash1-4/+4
Cleans out the rest of the occurrences of variable shadowing and makes any further occurrences of shadowing compiler errors.
2020-10-20gl_arb_decompiler: Implement robust buffer operationsReinUsesLisp1-1/+8
This emulates the behavior we get on GLSL with regular SSBOs with a pointer + length pair. It aims to be consistent with the crashes we might get. Out of bounds stores are ignored. Atomics are ignored and return zero. Reads return zero.
2020-09-06video_core: Remove all Core::System references in rendererReinUsesLisp1-11/+15
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.
2020-07-18gl_arb_decompiler: Use NV_shader_buffer_{load,store} on assembly shadersReinUsesLisp1-2/+2
NV_shader_buffer_{load,store} is a 2010 extension that allows GL applications to use what in Vulkan is known as physical pointers, this is basically C pointers. On GLASM these is exposed through the LOAD/STORE/ATOM instructions. Up until now, assembly shaders were using NV_shader_storage_buffer_object. These work fine, but have a (probably unintended) limitation that forces us to have the limit of a single stage for all shader stages. In contrast, with NV_shader_buffer_{load,store} we can pass GPU addresses to the shader through local parameters (GLASM equivalent uniform constants, or push constants on Vulkan). Local parameters have the advantage of being per stage, allowing us to generate code without worrying about binding overlaps.
2020-07-17async shadersDavid Marcec1-0/+10
2020-06-07rasterizer_cache: Remove files and includesReinUsesLisp1-1/+0
The rasterizer cache is no longer used. Each cache has its own generic implementation optimized for the cached data.
2020-06-07gl_shader_cache: Use generic shader cacheReinUsesLisp1-8/+8
Trivially port the generic shader cache to OpenGL.
2020-06-04gl_rasterizer: Use NV_transform_feedback for XFB on assembly shadersReinUsesLisp1-0/+4
NV_transform_feedback, NV_transform_feedback2 and ARB_transform_feedback3 with NV_transform_feedback interactions allows implementing transform feedbacks as dynamic state. Maxwell implements transform feedbacks as dynamic state, so using these extensions with TransformFeedbackStreamAttribsNV allows us to properly emulate transform feedbacks without having to recompile shaders when the state changes.
2020-06-01glsl: Squash constant buffers into a single SSBO when we hit the limitReinUsesLisp1-1/+3
Avoids compilation errors at the cost of shader build times and runtime performance when a game hits the limit of uniform buffers we can use.
2020-05-19renderer_opengl: Add assembly program code pathsReinUsesLisp1-5/+11
Add code required to use OpenGL assembly programs based on NV_gpu_program5. Decompilation for ARB programs is intended to be added in a follow up commit. This does **not** include ARB decompilation and it's not in an usable state. The intention behind assembly programs is to reduce shader stutter significantly on drivers supporting NV_gpu_program5 (and other required extensions). Currently only Nvidia's proprietary driver supports these extensions. Add a UI option hidden for now to avoid people enabling this option accidentally. This code path has some limitations that OpenGL compatibility doesn't have: - NV_shader_storage_buffer_object is limited to 16 entries for a single OpenGL context state (I don't know if this is an intended limitation, an specification issue or I am missing something). Currently causes issues on The Legend of Zelda: Link's Awakening. - NV_parameter_buffer_object can't bind buffers using an offset different to zero. The used workaround is to copy to a temporary buffer (this doesn't happen often so it's not an issue). On the other hand, it has the following advantages: - Shaders build a lot faster. - We have control over how floating point rounding is done over individual instructions (SPIR-V on Vulkan can't do this). - Operations on shared memory can be unsigned and signed. - Transform feedbacks are dynamic state (not yet implemented). - Parameter buffers (uniform buffers) are per stage, matching NVN and hardware's behavior. - The API to bind and create assembly programs makes sense, unlike ARB_separate_shader_objects.
2020-04-28{maxwell_3d,buffer_cache}: Implement memory barriers using 3D registersReinUsesLisp1-0/+1
Drop MemoryBarrier from the buffer cache and use Maxwell3D's register WaitForIdle. To implement this on OpenGL we just call glMemoryBarrier with the necessary bits. Vulkan lacks this synchronization primitive, so we set an event and immediately wait for it. This is not a pretty solution, but it's what Vulkan can do without submitting the current command buffer to the queue (which ends up being more expensive on the CPU).
2020-04-27texture_cache: Reintroduce preserve_contents accuratelyReinUsesLisp1-1/+2
This reverts commit 94b0e2e5dae4e0bd0021ac2d8fe1ff904a93ee69. preserve_contents proved to be a meaningful optimization. This commit reintroduces it but properly implemented on OpenGL. We have to make sure the clear removes all the previous contents of the image. It's not currently implemented on Vulkan because we can do smart things there that's preferred to be introduced in a separate commit.
2020-04-22Fix GCC error.Fernando Sahmkow1-1/+1
2020-04-22FenceManager: Manage syncpoints and rename fences to semaphores.Fernando Sahmkow1-1/+2
2020-04-22ThreadManager: Sync async reads on accurate gpu.Fernando Sahmkow1-0/+1
2020-04-22GPU: Implement a Fence Manager.Fernando Sahmkow1-0/+2
2020-04-22OpenGL: Implement Fencing backend.Fernando Sahmkow1-0/+2
2020-04-22GPU: Refactor synchronization on Async GPUFernando Sahmkow1-0/+2
2020-04-16buffer_cache: Return handles instead of pointer to handlesReinUsesLisp1-3/+1
The original idea of returning pointers is that handles can be moved. The problem is that the implementation didn't take that in mind and made everything harder to work with. This commit drops pointer to handles and returns the handles themselves. While it is still true that handles can be invalidated, this way we get an old handle instead of a dangling pointer. This problem can be solved in the future with sparse buffers.
2020-04-13gl_rasterizer: Implement line widths and smooth linesReinUsesLisp1-0/+3
Implements "legacy" features from OpenGL present on hardware such as smooth lines and line width.
2020-04-06GPU: Setup Flush/Invalidate to use VAddr instead of CacheAddrFernando Sahmkow1-3/+3
2020-03-13gl_rasterizer: Implement transform feedback bindingsReinUsesLisp1-3/+11
2020-03-10gl_rasterizer: Implement polygon modes and fill rectanglesReinUsesLisp1-0/+3
2020-03-09gl_shader_cache: Rework shader cache and remove post-specializationsReinUsesLisp1-5/+4
Instead of pre-specializing shaders and then post-specializing them, drop the later and only "specialize" the shader while decoding it.
2020-02-28gl_state_tracker: Track state of index buffersReinUsesLisp1-1/+1
2020-02-28gl_state_tracker: Implement dirty flags for clip distances and shadersReinUsesLisp1-2/+3
2020-02-28renderer_opengl: Reintroduce dirty flags for render targetsReinUsesLisp1-1/+5
2020-02-28gl_state: Remove completelyReinUsesLisp1-4/+1
2020-02-28gl_state: Remove program trackingReinUsesLisp1-3/+2
2020-02-28gl_state: Remove rasterizer disable trackingReinUsesLisp1-1/+1
2020-02-28gl_state: Remove viewport and depth range trackingReinUsesLisp1-1/+1
2020-02-28gl_state: Remove scissor test trackingReinUsesLisp1-1/+1
2020-02-28gl_state: Remove framebuffer sRGB trackingReinUsesLisp1-0/+3
2020-02-28gl_state: Remove VAO cache and trackingReinUsesLisp1-8/+4
2020-02-28gl_state: Remove depth clamp trackingReinUsesLisp1-0/+3
2020-02-14maxwell_3d: Unify draw methodsReinUsesLisp1-5/+1
Pass instanced state of a draw invocation as an argument instead of having two separate virtual methods.
2020-02-14gl_query_cache: Optimize query cacheReinUsesLisp1-1/+1
Use a custom cache instead of relying on a ranged cache.
2020-02-14gl_query_cache: Implement host queries using a deferred cacheReinUsesLisp1-3/+7
Instead of waiting immediately for executed commands, defer the query until the guest CPU reads it. This way we get closer to what the guest program is doing. To archive this we have to build a dependency queue, because host APIs (like OpenGL and Vulkan) use ranged queries instead of counters like NVN. Waiting for queries implicitly uses fences and this requires a command being queued, otherwise the driver will lock waiting until a timeout. To fix this when there are no commands queued, we explicitly call glFlush.
2020-02-14gl_rasterizer: Sort method declarationsReinUsesLisp1-16/+15
2020-02-14gl_rasterizer: Add queued commands counterReinUsesLisp1-0/+3
Keep track of the queued OpenGL commands that can signal a fence if waited on. As a side effect, we avoid calls to glFlush when no commands are queued.
2020-02-14maxwell_3d: Slow implementation of passed samples (query 21)ReinUsesLisp1-0/+5
Implements GL_SAMPLES_PASSED by waiting immediately for queries.
2020-01-30gl_rasterizer: Fix instanced draw arraysReinUsesLisp1-6/+1
glDrawArrays was being used when the draw had a base instance specified. This commit removes the draw parameters abstraction and fixes the mentioned issue.
2019-12-18gl_rasterizer: Implement RASTERIZE_ENABLEReinUsesLisp1-0/+3
RASTERIZE_ENABLE is the opposite of GL_RASTERIZER_DISCARD. Implement it naturally using this. NVN games expect rasterize to be enabled by default, reflect that in our initial GPU state.
2019-11-29gl_rasterizer: Re-enable framebuffer cache for clear buffersReinUsesLisp1-2/+0
2019-11-23gl_shader_cache: Remove dynamic BaseBinding specializationReinUsesLisp1-5/+4
2019-11-23video_core: Unify ProgramType and ShaderStage into ShaderTypeReinUsesLisp1-7/+4
2019-11-23gl_rasterizer: Bind graphics images to draw commandsReinUsesLisp1-0/+4
Images were not being bound to draw invocations because these would require a cache invalidation.
2019-11-23shader/texture: Deduce texture buffers from lockerReinUsesLisp1-8/+7
Instead of specializing shaders to separate texture buffers from 1D textures, use the locker to deduce them while they are being decoded.
2019-10-27rasterizer_accelerated: Add intermediary for GPU rasterizersReinUsesLisp1-9/+2
Add an intermediary class that implements common functions across GPU accelerated rasterizers. This avoids code repetition on different backends.
2019-10-05Gl_Rasterizer: Protect CPU Memory mapping from multiple threads.Fernando Sahmkow1-0/+3
2019-09-19Rasterizer: Refactor and simplify DrawBatch Interface.Fernando Sahmkow1-4/+2
2019-09-19Rasterizer: Refactor draw calls, remove deadcode and clean up.Fernando Sahmkow1-2/+1
2019-09-19Video Core: initial Implementation of InstanceDraw PackagingFernando Sahmkow1-0/+6
2019-09-17gl_rasterizer: Remove unused code paths from ConfigureFramebuffersReinUsesLisp1-36/+2
2019-09-06gl_rasterizer: Add samplers to compute dispatchesReinUsesLisp1-0/+3
2019-09-06gl_rasterizer: Minor code changesReinUsesLisp1-2/+6
2019-09-06kepler_compute: Implement texture queriesReinUsesLisp1-0/+2
2019-09-06gl_rasterizer: Split SetupTexturesReinUsesLisp1-2/+8
2019-07-26GPU: Flush commands on every dma pusher step.Fernando Sahmkow1-0/+1
This commit ensures that the host gpu is constantly fed with commands to work with, while the guest gpu keeps producing the rest of the commands. This reduces syncing time between host and guest gpu.
2019-07-17GL_Rasterizer: Rework RenderTarget/DepthBuffer clearingFernando Sahmkow1-0/+5
2019-07-17Maxwell3D: Rework the dirty system to be more consistant and scaleableFernando Sahmkow1-0/+1
2019-07-15gl_rasterizer: Implement compute shadersReinUsesLisp1-2/+13
2019-07-09gl_rasterizer: Amend documentation comment for ConfigureFramebuffers()Lioncash1-7/+9
must_reconfigure isn't a parameter for this function any more, so it can be replaced with current_state. While we're at it, we can make the parameters of the declaration match the same name as the ones in the definition.
2019-07-06gl_rasterizer: Minor style changesReinUsesLisp1-5/+0
2019-07-06gl_rasterizer: Fix vertex and index data invalidationsReinUsesLisp1-1/+2
2019-07-06gl_buffer_cache: Implement with generic buffer cacheReinUsesLisp1-0/+1
2019-07-06gl_rasterizer: Drop gl_global_cache in favor of gl_buffer_cacheReinUsesLisp1-2/+0
2019-07-06gl_buffer_cache: Return used buffer from Upload functionReinUsesLisp1-1/+1
2019-07-06gl_rasterizer: Move index buffer uploading to its own methodReinUsesLisp1-1/+3
2019-06-25texture_cache: Query MemoryManager from the systemFernando Sahmkow1-2/+0
2019-06-21texture_cache: Fermi2D reform and implement View MirageFernando Sahmkow1-2/+1
This also does some fixes on compressed textures reinterpret and on the Fermi2D engine in general.
2019-06-21gl_rasterizer: Track texture buffer usageReinUsesLisp1-3/+4
2019-06-21gl_framebuffer_cache: Use a hashed struct to cache framebuffersReinUsesLisp1-4/+2
2019-06-21Remove Framebuffer reconfiguration and restrict rendertarget protectionFernando Sahmkow1-3/+2
2019-06-21texture_cache: Correct premature texceptionsFernando Sahmkow1-2/+5
Due to our current infrastructure, it is possible for a mipmap to be set on as a render target before a texception of that mipmap's superset be set afterwards. This is problematic as we rely on texture views to set up texceptions and protecting render targets targets for 3D texture rendering. One simple solution is to configure framebuffers after texture setup but this brings other problems. This solution, forces a reconfiguration of the framebuffers after such event happens.
2019-06-21Texture Cache: Implement Blitting and Fermi CopiesFernando Sahmkow1-1/+0
2019-06-21Change texture_cache chaching from GPUAddr to CacheAddrFernando Sahmkow1-2/+0
This also reverses the changes to make invalidation and flushing through the GPU address.
2019-06-21Deglobalize Memory Manager on texture cahe and Implement Invalidation and Flushing using GPUVAddrFernando Sahmkow1-0/+8
2019-06-21gl_texture_cache: Implement fermi copiesReinUsesLisp1-0/+1
2019-06-21gl_texture_cache: Initial implementationReinUsesLisp1-2/+2
2019-06-08gl_rasterizer: Remove unused parameters in descriptor uploadsReinUsesLisp1-3/+2
2019-06-08video_core/engines: Move ConstBufferInfo out of Maxwell3DReinUsesLisp1-2/+8
2019-05-30gl_rasterizer: Move alpha testing to the OpenGL pipelineReinUsesLisp1-2/+2
Removes the alpha testing code from each fragment shader invocation.
2019-05-30gl_rasterizer: Use GL_QUADS to emulate quads renderingReinUsesLisp1-2/+0
2019-05-21gl_shader_cache: Use shared contexts to build shaders in parallelReinUsesLisp1-1/+2
2019-04-14gl_shader_decompiler: Use variable AOFFI on supported hardwareReinUsesLisp1-3/+1
2019-04-14shader_ir: Implement STG, keep track of global memory usage and flushReinUsesLisp1-4/+0
2019-04-10gl_device: Implement interface and add uniform offset alignmentReinUsesLisp1-1/+3
2019-04-08Simplify ConstBufferAccessorFernando Sahmkow1-3/+0
2019-04-08Implement Const Buffer AccessorFernando Sahmkow1-0/+3
2019-04-06gl_rasterizer: Use ARB_multi_bind to update SSBOsReinUsesLisp1-0/+1
2019-04-06gl_rasterizer: Use ARB_multi_bind to update UBOs across stagesReinUsesLisp1-0/+3
2019-04-04video_core/renderer_opengl: Remove unnecessary includesLioncash1-5/+0
Quite a few unused includes have built up over time, particularly on core/memory.h. Removing these includes means the source files including those files will no longer need to be rebuilt if they're changed, making compilation slightly faster in this scenario.
2019-04-02gl_sampler_cache: Port sampler cache to OpenGLReinUsesLisp1-30/+2
2019-03-27gl_rasterizer: Remove unused reference member variable from RasterizerOpenGLLioncash1-3/+1
This member variable is no longer being used, so it can be removed, removing a dependency on EmuWindow from the rasterizer's interface"
2019-03-15gpu: Use host address for caching instead of guest address.bunnei1-4/+4
2019-03-11gl_rasterizer: Use system instance passed from argumentReinUsesLisp1-0/+1
2019-03-09gl_rasterizer: Encapsulate sampler queries into methodsReinUsesLisp1-2/+3
2019-02-27common/math_util: Move contents into the Common namespaceLioncash1-2/+2
These types are within the common library, so they should be within the Common namespace.
2019-02-07gl_rasterizer: Implement a more accurate fermi 2D copy.bunnei1-1/+3
- This is a blit, use the blit registers.
2019-02-07gl_shader_cache: Link loading screen with disk shader cache loadReinUsesLisp1-1/+3
2019-02-07gl_shader_disk_cache: Pass core system as argument and guard against games without title idsReinUsesLisp1-1/+6
2019-02-07rasterizer_interface: Add disk cache entry for the rasterizerReinUsesLisp1-0/+1
2019-02-01rasterizer_interface: Remove unused AccelerateFill operationReinUsesLisp1-1/+0
2019-01-30gl_shader_cache: Use explicit bindingsReinUsesLisp1-29/+12
2019-01-30gl_rasterizer: Implement global memory managementReinUsesLisp1-0/+10
2019-01-30gl_rasterizer: Workaround invalid zeta clearsReinUsesLisp1-3/+6
Some games (like Xenoblade Chronicles 2) clear both depth and stencil buffers while there's a depth-only texture attached (e.g. D16 Unorm). This commit reads the zeta format of the bound surface on ConfigureFramebuffers and returns if depth and/or stencil attachments were set. This is ignored on DrawArrays but on Clear it's used to just clear those attachments, bypassing an OpenGL error.
2019-01-08gl_global_cache: Add dummy global cache managerReinUsesLisp1-2/+8
2019-01-07gl_rasterizer: Skip framebuffer configuration if rendertargets have not been changedReinUsesLisp1-0/+18
2019-01-06gl_rasterizer: Use DSA for vertex array objectsReinUsesLisp1-2/+4
2018-11-29gl_rasterizer: Enable clip distances when set in register and in shaderReinUsesLisp1-1/+2
2018-11-29gl_rasterizer: Implement a framebuffer cacheReinUsesLisp1-1/+5
2018-11-29gl_rasterizer: Remove unused struct declarationsReinUsesLisp1-14/+0
2018-11-29gl_rasterizer: Remove extension booleansReinUsesLisp1-3/+0
2018-11-27Implement depth clampRodolfo Bogado1-0/+4
2018-11-27GPU States: Implement Polygon Offset. This is used in SMO all the time. (#1784)Marcos1-0/+3
* GPU States: Implement Polygon Offset. This is used in SMO all the time. * Clang Format fixes. * Initialize polygon_offset in the constructor.
2018-11-24Add support for clear_flags registerRodolfo Bogado1-14/+15
2018-11-21Removed pre 4.3 ARB extensionsFernandoS271-2/+0
2018-11-17fix sampler configuration, thanks to Marcos for his investigationRodolfo Bogado1-1/+5
2018-11-17add AlphaToCoverage and AlphaToOneRodolfo Bogado1-0/+3
2018-11-17add support for fragment_color_clampRodolfo Bogado1-0/+3
2018-11-11Improve state management by splitting some of the states id separated function to avoid a full apply overheadRodolfo Bogado1-3/+3
2018-11-11set sampler max lod, min lod, lod bias and max anisotropyRodolfo Bogado1-1/+1
2018-11-06gl_rasterizer: Split VAO and VB setup functions.Markus Wick1-1/+2
2018-11-05Add support to color mask to avoid issues in blending caused by wrong values in the alpha channel in some render targets.Rodolfo Bogado1-0/+3
2018-11-05Implement multi-target viewports and blendingRodolfo Bogado1-4/+1
2018-10-30global: Use std::optional instead of boost::optional (#1578)Frederic L1-2/+2
* get rid of boost::optional * Remove optional references * Use std::reference_wrapper for optional references * Fix clang format * Fix clang format part 2 * Adressed feedback * Fix clang format and MacOS build
2018-10-29Implement Mip FilterFernandoS271-0/+1
2018-10-26gl_rasterizer: Implement primitive restart.bunnei1-0/+3
2018-10-26gl_rasterizer: Implement depth range.bunnei1-5/+2
2018-10-22Assert that multiple render targets are not set while alpha testingFernandoS271-0/+3
2018-10-22Use standard UBO and fix/stylize the codeFernandoS271-3/+0
2018-10-22Remove SyncAlphaTest and clang formatFernandoS271-3/+1
2018-10-22Implemented Alpha TestingFernandoS271-0/+2
2018-10-09Assert Scissor testsFernandoS271-0/+3
2018-10-07gl_shader_decompiler: Implement geometry shadersReinUsesLisp1-3/+3
2018-10-06Implemented Depth Compare and Shadow SamplersFernandoS271-0/+2
2018-10-06gl_rasterizer: Add rasterizer cache code to handle accerated fermi copies.bunnei1-2/+2
2018-10-04gl_rasterizer: Implement quads topologyReinUsesLisp1-0/+7
2018-09-28video_core: Implement point_size and add point state syncReinUsesLisp1-0/+3
2018-09-28gl_state: Pack sampler bindings into a single ARB_multi_bindReinUsesLisp1-1/+1
2018-09-26video_core: Add asserts for CS, TFB and alpha testingReinUsesLisp1-0/+6
Add asserts for compute shader dispatching, transform feedback being enabled and alpha testing. These have in common that they'll probably break rendering without logging.
2018-09-15Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi1-4/+4
2018-09-13Use ARB_multi_bind for uniform buffers (#1287)ReinUsesLisp1-0/+1
* gl_rasterizer: use ARB_multi_bind for uniform buffers * address feedback
2018-09-10rasterizer: Drop unused handler.Markus Wick1-1/+0
This virtual function is called in a very hot spot, and it does nothing. If this kind of feature is required, please be more specific and add callbacks in the switch statement within Maxwell3D::WriteReg. There is no point in having another switch statement within the rasterizer.
2018-09-10gl_rasterizer: Implement clear for non-zero render targets.bunnei1-2/+11
- Several misc. changes to ConfigureFramebuffers in support of this.
2018-09-10gl_rasterizer: Implement multiple color attachments.bunnei1-9/+3
2018-09-08gl_rasterizer: Implement texture wrap mode p.bunnei1-0/+1
2018-09-05gl_rasterizer: Implement a VAO cache.Markus Wick1-3/+5
This patch caches VAO objects instead of re-emiting all pointers per draw call. Configuring this pointers is known as a fast task, but it yields too many GL calls. So for better performance, just bind the VAO instead of 16 pointers.
2018-09-05renderer_opengl: Implement a buffer cache.Markus Wick1-12/+7
The idea of this cache is to avoid redundant uploads. So we are going to cache the uploaded buffers within the stream_buffer and just reuse the old pointers. The next step is to implement a VBO cache on GPU memory, but for now, I want to check the overhead of the cache management. Fetching the buffer over PCI-E should be quite fast.
2018-08-31gl_renderer: Cache textures, framebuffers, and shaders based on CPU address.bunnei1-3/+3
2018-08-31gl_rasterizer: Fix issues with the rasterizer cache.bunnei1-0/+8
- Use a single cached page map. - Fix calculation of ending page.
2018-08-28renderer_opengl: Implement a new shader cache.bunnei1-8/+7
2018-08-23gl_rasterizer: Implement stencil test.bunnei1-0/+3
- Used by Splatoon 2.
2018-08-22renderer_opengl: Namespace OpenGL codeLioncash1-2/+6
Namespaces all OpenGL code under the OpenGL namespace. Prevents polluting the global namespace and allows clear distinction between other renderers' code in the future.
2018-08-21GPU: Implemented the logic op functionality of the GPU.Subv1-0/+3
This will ASSERT if blending is enabled at the same time as logic ops.
2018-08-21rasterizer_interface: Remove ScreenInfo from AccelerateDraw()'s signatureLioncash1-3/+5
This is an OpenGL renderer-specific data type. Given that, this type shouldn't be used within the base interface for the rasterizer. Instead, we can pass this information to the rasterizer via reference.
2018-08-20Rasterizer: Don't attempt to copy over the old texture's data when doing a format reinterpretation if we're only going to clear the framebuffer.Subv1-1/+2
2018-08-12gl_rasterizer: Use a shared helper to upload from CPU memory.Markus Wick1-0/+4
2018-08-12gl_rasterizer: Use the stream buffer for constant buffers.Markus Wick1-6/+5
2018-08-12gl_rasterizer: Use the streaming buffer itself for the constant buffer.Markus Wick1-2/+1
Don't emut copies, especially not for data, which is used once. They just end in a huge GPU overhead.
2018-08-12gl_rasterizer: Use a helper for aligning the buffer.Markus Wick1-1/+3
2018-08-12Update the stream_buffer helper from Citra.Markus Wick1-2/+1
Please see https://github.com/citra-emu/citra/pull/3666 for more details.
2018-08-12core: Namespace EmuWindowLioncash1-3/+6
Gets the class out of the global namespace.
2018-08-02video_core: Make global EmuWindow instance part of the base renderer classLioncash1-1/+4
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-07-24gl_rasterizer: Use in-class member initializers where applicableLioncash1-5/+5
We can just assign to the members directly in these cases.
2018-07-24gl_rasterizer: Implement texture border color.bunnei1-4/+1
2018-07-04GPU: Only configure the used framebuffers during clear.Subv1-1/+1
Don't try to configure the color buffer if it is not being cleared, it may not be completely valid at this point.
2018-07-03GPU: Factor out the framebuffer configuration code for both Clear and Draw commands.Subv1-0/+5
2018-07-03GPU: Bind and clear the render target when the CLEAR_BUFFERS register is written to.Subv1-0/+1
2018-07-02GPU: Set up the depth test state on every draw.Subv1-0/+3
2018-06-27gl_rasterizer_cache: Remove Citra's rasterizer cache, always load/flush surfaces.bunnei1-1/+1
2018-06-27gl_rasterizer: Workaround for when exceeding max UBO size.bunnei1-1/+1
2018-06-10Rasterizer: Use UBOs instead of SSBOs for uploading const buffers.Subv1-0/+5
This should help a bit with GPU performance once we're GPU-bound.
2018-06-09GPU: Synchronize the blend state on every draw call.Subv1-8/+2
Only independent blending on render target 0 is implemented for now. This fixes the elongated squids in Splatoon 2's boot screen.
2018-06-06GPU: Implement sampling multiple textures in the generated glsl shaders.Subv1-3/+11
All tested games that use a single texture show no regression. Only Texture2D textures are supported right now, each shader gets its own "tex_fs/vs/gs" sampler array to maintain independent textures between shader stages, the textures themselves are reused if possible.
2018-05-19GLRenderer: Remove unused hw_vao_enabled_attributes variable.Subv1-1/+0
2018-05-19GLRenderer: Remove unused vertex buffer and increase the size of the stream buffer to 128 MB.Subv1-5/+2
The stream buffer is where all the vertex data is copied, some games require this to be much bigger than the 4 MB we used to have.
2018-04-25gl_rasterizer_cache: Update to be based on GPU addresses, not CPU addresses.bunnei1-3/+4
2018-04-23GPU: Support multiple enabled vertex arrays.Subv1-3/+3
The vertex arrays will be copied to the stream buffer one after the other, and the attributes will be set using the ARB_vertex_attrib_binding extension. yuzu now thus requires OpenGL 4.3 or the ARB_vertex_attrib_binding extension.
2018-04-21opengl: Remove unnecessary header inclusionsLioncash1-5/+0
2018-04-18renderer_opengl: Implement BlendEquation and BlendFunc.bunnei1-1/+1
2018-04-17gl_rasterizer: Implement indexed vertex mode.bunnei1-1/+0
2018-04-15GPU: Use the same buffer names in the generated GLSL and the buffer uploading code.Subv1-3/+2
2018-04-15GPU: Don't use explicit binding points when uploading the constbuffers to opengl.Subv1-2/+11
The bindpoints will now be dynamically calculated based on the number of buffers used by the previous shader stage.
2018-04-15GPU: Use the buffer hints from the shader decompiler to upload only the necessary const buffers for each shader stage.Subv1-1/+2
2018-04-15GPU: Upload the entirety of each constbuffer for each shader stage as SSBOs.Subv1-1/+6
We're going to need the shader generator to give us a mapping of the actual used const buffers to properly bind them to the shader.
2018-04-15GPU: Allow configuring ssbos in the opengl state manager.Subv1-0/+2
2018-04-15shaders: Add NumTextureSamplers const, remove unused #pragma.bunnei1-1/+1
2018-04-14gl_rasterizer: Generate shaders and upload uniforms.bunnei1-4/+3
2018-04-14gl_rasterizer: Use shader program manager, remove test shader.bunnei1-53/+4
2018-04-14renderer_opengl: Use OGLProgram instead of OGLShader.bunnei1-1/+1
2018-04-07GL: Set up the textures used for each draw call.Subv1-0/+3
Each Maxwell shader stage can have an arbitrary number of textures, but we're limited to a certain number in OpenGL. We try to only use the minimum amount of host textures by not keeping a 1:1 relation between guest texture ids and host texture ids, ie, guest texture id 8 can be host texture id 0 if it's the only texture used in the guest shader program. This mapping will have to be passed to the shader decompiler so it can rewrite the texture accesses.
2018-04-07GL: Ported the SamplerInfo struct from citra.Subv1-1/+20
2018-03-27gl_rasterizer: Move code to bind framebuffer surfaces before draw to its own function.bunnei1-0/+4
2018-03-27gl_rasterizer: Add a SyncViewport method.bunnei1-0/+3
2018-03-27rasterizer: Rename DrawTriangles to DrawArrays.bunnei1-1/+1
2018-03-27gl_rasterizer: Use 32 texture units instead of 3.bunnei1-1/+1
2018-03-23rasterizer: Flush and invalidate regions should be 64-bit.bunnei1-3/+3
2018-03-23video_core: Remove usage of PAddr and replace with VAddr.bunnei1-4/+4
2018-03-23video_core: Move FramebufferInfo to FramebufferConfig in GPU.bunnei1-2/+2
2018-03-23gl_rasterizer: Add a simple passthrough shader in lieu of shader generation.bunnei1-2/+12
2018-03-20renderer_gl: Port boilerplate rasterizer code over from Citra.bunnei1-0/+162
2018-01-13Remove references to PICA and rasterizers in video_coreJames Rowe1-316/+0
2018-01-01core/video_core: Fix a bunch of u64 -> u32 warnings.bunnei1-2/+2
2017-08-25gl_rasterizer: implement custom clip planewwylele1-1/+8
2017-07-01gl_rasterizer: use texture buffer for proctex LUTwwylele1-0/+5
2017-06-22gl_rasterizer: use texture buffer for fog LUTwwylele1-1/+2
2017-06-21gl_rasterizer/lighting: fix LUT interpolationwwylele1-3/+4
2017-05-30gl_rasterizer: sync spot light statuswwylele1-1/+5
2017-05-20gl_rasterizer: implement procedural texturewwylele1-1/+34
2017-04-17OpenGL: Move PicaShaderConfig to gl_shader_gen.hYuri Kunde Schlesner1-199/+2
Also move the implementation of CurrentConfig to the cpp file.
2017-02-09VideoCore: Split regs.h inclusionsYuri Kunde Schlesner1-1/+4
2017-02-04VideoCore: Move Regs to its own fileYuri Kunde Schlesner1-1/+1
2017-02-04VideoCore: Split lighting regs from Regs structYuri Kunde Schlesner1-4/+4
2017-02-04VideoCore: Split framebuffer regs from Regs structYuri Kunde Schlesner1-4/+4
2017-02-04VideoCore: Split texturing regs from Regs structYuri Kunde Schlesner1-12/+13
2017-02-04VideoCore: Split rasterizer regs from Regs structYuri Kunde Schlesner1-4/+4
2017-01-30VideoCore: Change misleading register namesYuri Kunde Schlesner1-1/+1
A few registers had names such as "count" or "number" when they actually contained the maximum (that is, count - 1). This can easily lead to hard to notice off by one errors.
2017-01-23video_core: fix gl_rasterizer warning on MSVCKloen1-1/+1
2016-09-30OpenGL: Take cached viewport sub-rect into account for scissorYuri Kunde Schlesner1-3/+0
Fixes #1938
2016-09-29rasterizer: separate TextureCopy from DisplayTransferwwylele1-0/+1
2016-09-21Remove empty newlines in #include blocks.Emmanuel Gil Peyrot1-4/+0
This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation.
2016-09-19Manually tweak source formatting and then re-run clang-formatYuri Kunde Schlesner1-6/+3
2016-09-18Sources: Run clang-format on everything.Emmanuel Gil Peyrot1-21/+29
2016-06-28OpenGL: Add scaled resolution support to scissorYuri Kunde Schlesner1-1/+2
2016-06-28PICA: Scissor fixes and cleanupsYuri Kunde Schlesner1-4/+4
2016-06-28PICA: Implement scissor testSubv1-1/+11
2016-06-07OpenGL: Implement fogJannik Vogel1-2/+15
2016-06-07OpenGL: Avoid undefined behaviour for UNIFORM_BLOCK_DATA_SIZEJannik Vogel1-4/+6
2016-05-23Pica: Name LightSrc.config registerJannik Vogel1-2/+2
2016-05-23Pica: Name lighting.config0 and .config1 registersJannik Vogel1-12/+12
2016-05-23OpenGL: Use uniforms for dist_atten_bias and dist_atten_scaleJannik Vogel1-5/+9
2016-05-14OpenGL: Only update depth uniforms if the depth changedJannik Vogel1-2/+5
2016-05-14OpenGL: value-initialize variables which cause uninitialised access otherwiseJannik Vogel1-2/+2
2016-05-11OpenGL: Implement texture type 3Jannik Vogel1-0/+5
2016-05-10gl_rasterizer: Fix compilation for debug buildsLioncash1-1/+1
2016-05-10OpenGL: Implement W-Buffers and fix depth-mappingJannik Vogel1-0/+5
2016-05-03Pica: Use a union for PicaShaderConfigJannik Vogel1-87/+97
2016-05-03Pica: Add TevStageConfigRaw to PicaShaderConfig (MSVC workaround)Jannik Vogel1-1/+22
2016-05-03Pica: Make PicaShaderConfig trivially_copyable and clear it before useJannik Vogel1-21/+28
2016-05-03OpenGL: Don't copy const_color (Reverts #1745)Jannik Vogel1-2/+3
2016-05-01OpenGL: Copy TevStageConfig using a loop. Fixes bug: const_color not copiedJannik Vogel1-30/+11
2016-04-30VideoCore: Run include-what-you-use and fix most includes.Emmanuel Gil Peyrot1-2/+12
2016-04-22HWRasterizer: reorder declarations to match defstfarley1-9/+9
2016-04-21HWRasterizer: Texture forwardingtfarley1-66/+10
2016-04-08OpenGL: Split buffer-write mask sync into seperate functionsJannik Vogel1-0/+9
2016-03-03Add immediate mode vertex submissionDwayne Slater1-0/+1
2016-02-05pica: Cleanup lighting register definitions and documentation.bunnei1-15/+15
2016-02-05gl_rasterizer: Use alignas(16) instead of explicit padding.bunnei1-13/+6
2016-02-05renderer_opengl: Use GLvec3/GLvec4 aliases for commonly used types.bunnei1-9/+10
2016-02-05gl_rasterizer: Fix issue with interpolation of opposite quaternions.bunnei1-1/+7
2016-02-05pica_types: Replace float24/20/16 with a template class.bunnei1-2/+2
2016-02-05gl_rasterizer: Remove unnecessary casts.bunnei1-6/+6
2016-02-05gl_rasterizer: Fix PicaShaderConfig on GCC.bunnei1-29/+27
2016-02-05gl_rasterizer: Initial implementation of bump mapping.bunnei1-0/+6
2016-02-05gl_shader_gen: Implement lighting red, green, and blue reflection.bunnei1-1/+17
2016-02-05gl_shader_gen: Implement fragment lighting fresnel effect.bunnei1-0/+7
2016-02-05gl_shader_gen: Implement fragment lighting specular 1 component.bunnei1-0/+8
2016-02-05gl_shader_gen: Add support for D0 LUT scaling.bunnei1-1/+3
2016-02-05gl_shader_gen: Refactor lighting config to match Pica register naming.bunnei1-28/+32
- Also implement D0 LUT enable.
2016-02-05pica: Cleanup and add some comments to lighting registers.bunnei1-1/+1
2016-02-05gl_rasterizer: Minor naming refactor on Pica register naming.bunnei1-5/+5
2016-02-05renderer_opengl: Use textures for fragment shader LUTs instead of UBOs.bunnei1-4/+6
- Gets us LUT interpolation for free. - Some older Intel GPU drivers did not support the big UBOs needed to store the LUTs.
2016-02-05renderer_opengl: Initial implementation of basic specular lighting.bunnei1-0/+20
2016-02-05renderer_opengl: Implement HW fragment lighting distance attenuation.bunnei1-14/+22
2016-02-05renderer_opengl: Implement HW fragment lighting LUTs within our default UBO.bunnei1-2/+7
2016-02-05renderer_opengl: Implement diffuse component of HW fragment lighting.bunnei1-3/+58
2016-02-03hwrasterizer: Use proper cached fb addr/sizetfarley1-2/+2
2016-01-21hwrasterizer: Use depth offsettfarley1-1/+5
2015-12-08VideoCore: Unify interface to OpenGL and SW rasterizersYuri Kunde Schlesner1-17/+2
This removes explicit checks sprinkled all over the codebase to instead just have the SW rasterizer expose an implementation with no-ops for most operations.
2015-12-07VideoCore: Rename HWRasterizer methods to be less confusingYuri Kunde Schlesner1-3/+3
2015-11-25Use regular uniform locationPierre de La Morinerie1-7/+0
The support for GL_ARB_explicit_uniform_location is not that good (53% according to http://feedback.wildfiregames.com/report/opengl/feature/GL_ARB_explicit_uniform_location). This fix the shader compilation on Intel HD 4000 (#1222).
2015-11-19FragShader: Use an UBO instead of several individual uniformsSubv1-6/+21
2015-10-22gl_shader_gen: Various cleanups to shader generation.bunnei1-1/+1
2015-10-22gl_rasterizer: Use MMH3 hash for shader cache hey.bunnei1-76/+57
- Includes a check to confirm no hash collisions.
2015-10-22gl_shader_gen: Require explicit uniform locations.bunnei1-26/+14
- Fixes uniform issue on AMD.
2015-10-22gl_rasterizer: Add documentation to ShaderCacheKey.bunnei1-0/+16
2015-10-22renderer_opengl: Refactor shader generation/caching to be more organized + various cleanups.bunnei1-23/+18
2015-10-22gl_rasterizer: Move logic for creating ShaderCacheKey to a static function.bunnei1-1/+44
2015-10-22Initial implementation of fragment shader generation with caching.Subv1-31/+79
2015-09-11video_core: Reorganize headersLioncash1-3/+2
2015-09-03OpenGL: Use Sampler Objects to decouple sampler config from texturesYuri Kunde Schlesner1-0/+19
Fixes #978
2015-08-15Shader: Move shader code to its own subdirectory, "shader".bunnei1-1/+1
2015-08-15GPU: Refactor "VertexShader" namespace to "Shader".bunnei1-5/+5
- Also renames "vertex_shader.*" to "shader_interpreter.*"
2015-06-28Core: Cleanup hw includes.Emmanuel Gil Peyrot1-0/+1
2015-06-28Common: Cleanup key_map includes.Emmanuel Gil Peyrot1-0/+4
2015-05-31Pica: Implement LogicOp function.bunnei1-0/+3
2015-05-23OpenGL renderertfarley1-0/+207