summaryrefslogtreecommitdiffstats
path: root/src/video_core/engines/maxwell_3d.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2023-03-31video_core: Keep the definition of DimensionControl consistent with nvidia open docFeng Chen1-4/+4
2023-01-05video_core: Implement maxwell3d draw texture methodFeng Chen1-1/+15
2023-01-04Video_core: Address feedbackFernando Sahmkow1-18/+12
2023-01-03Vulkan: rework stencil tracking.Fernando Sahmkow1-4/+4
2023-01-01MacroHLE: Final cleanup and fixes.Fernando Sahmkow1-1/+1
2023-01-01DMAPusher: Improve collection of non executing methodsFernando Sahmkow1-0/+4
2023-01-01Revert Buffer cache changes and setup additional macros.Fernando Sahmkow1-5/+18
2023-01-01MacroHLE: Reduce massive calculations on sizing estimation.Fernando Sahmkow1-0/+2
2023-01-01MacroHLE: Add HLE replacement for base vertex and base instance.Fernando Sahmkow1-0/+17
2023-01-01MacroHLE: Add Index Buffer size estimation.Fernando Sahmkow1-0/+2
2023-01-01MacroHLE: Refactor MacroHLE system.Fernando Sahmkow1-3/+18
2023-01-01MacroHLE: Implement DrawIndexedIndirect & DrawArraysIndirect.Fernando Sahmkow1-3/+9
2022-12-08video_core: Implement maxwell3d draw manager and split draw logicFeng Chen1-20/+5
2022-12-01video_core: Fine tuning the index drawing judgment logicFeng Chen1-0/+1
2022-11-29maxwell_3d: Mark shifted value as unsignedLioncash1-3/+3
Otherwise this is technically creating a signed int result that gets converted. Just a consistency change. While we're in the area, we can mark Samples() as const.
2022-11-29engines: Remove unnecessary castsLioncash1-48/+25
In a few cases we have some casts that can be trivially removed.
2022-11-22video_core: Optimize maxwell drawing trigger mechanismFengChen1-2/+6
2022-11-17maxwell3d: full HLE for multi-layer clearsLiam1-4/+3
2022-11-17maxwell3d: HLE multi-layer clear macroLiam1-0/+1
2022-11-11Fix regs regression with OpenGL two-sided stencil, and re-add data invalidation regKelebek11-4/+12
2022-11-11ir/texture_pass: Use host_info instead of querying Settings::values (#9176)Morph1-2/+2
2022-10-27video_core: Fix drawing trigger mechanism regressionFengChen1-0/+2
2022-10-22video_core: Implement maxwell inline_index methodFengChen1-8/+5
2022-10-21video_coare: Reimplementing the maxwell drawing trigger mechanismFengChen1-29/+4
2022-10-13renderer_(opengl/vulkan): Fix tessellation clockwise parameterMorph1-2/+2
This should be assigned CW only on Triangles_CW rather than not Triangles_CCW, making CCW the default winding order rather than CW.
2022-10-10Fix stencil func registers, make clip control equivalent to how it was before, but surely wrong.Kelebek11-10/+12
2022-10-07Update 3D regsKelebek11-1014/+2825
2022-06-14common: Change semantics of UNREACHABLE to unconditionally crashLiam1-6/+6
2022-06-02Maxwell3D: Fix 3D semaphore counter type 0 handlingBilly Laws1-1/+1
Counter type 0 actually releases the semaphore payload rather than a constant zero as was previously thought. This is required by Skyrim.
2022-04-23general: Convert source file copyright comments over to SPDXMorph1-3/+2
This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
2022-04-14maxwell3d: add small_index_2 registerLiam1-1/+6
2022-03-19video_core: Reduce unused includesameerj1-1/+0
2022-03-15maxwell_3d: Implement a safer CB data uploadameerj1-14/+1
This makes constant buffer uploads safer and more accurate by updating the GPU memory as soon as the CB Data method is invoked. The previous implementation was deferring the updates until a different maxwell 3d method was detected, then writing all CB data at once.
2022-03-14Maxwell3D: Link to override constant definition in nouveaubyte[]1-0/+2
2022-03-14Maxwell3D: Use override constants from nouveauLiam1-1/+15
This fixes some incorrect rendering in Sunshine
2022-03-12Maxwell3D: Restrict topology override effect to after the register is setLiam1-0/+1
2022-03-11Maxwell3D: read small-index draw and primitive topology override registersLiam1-2/+16
This allows Galaxy and Sunshine to render for the first time.
2022-02-01Rasterizer: Refactor inlineToMemory.Fernando Sahmkow1-1/+1
2022-01-29Rasterizer: Implement Inline2Memory Acceleration.Fernando Sahmkow1-1/+2
2021-10-03gpu: Migrate implementation to the cpp fileameerj1-0/+1
2021-10-02common/logging: Move Log::Entry declaration to a separate headerameerj1-0/+1
This reduces the load of requiring to include std::chrono in all files which include log.h
2021-09-07Fix blend equation enum errorFeng Chen1-4/+4
2021-07-23vk_rasterizer: Workaround bug in VK_EXT_vertex_input_dynamic_stateReinUsesLisp1-4/+0
Workaround potential bug on Nvidia's driver where only updating high attributes leaves low attributes out dated.
2021-07-23shader: Rework varyings and implement passthrough geometry shadersReinUsesLisp1-1/+6
Put all varyings into a single std::bitset with helpers to access it. Implement passthrough geometry shaders using host's.
2021-07-23vk_graphics_pipeline: Implement conservative renderingReinUsesLisp1-1/+6
2021-07-23shader: Unify shader stage typesReinUsesLisp1-1/+0
2021-07-23vulkan: Use VK_EXT_provoking_vertex when availableReinUsesLisp1-1/+6
2021-07-23shader: Remove old shader managementReinUsesLisp1-19/+1
2021-06-23maxwell3d: Add missing return in default SizeInBytes() caseLioncash1-0/+1
We were returning '1' in ComponentCount()'s default case but were neglecting to do the same with SizeInBytes().
2021-02-13video_core: Reimplement the buffer cacheReinUsesLisp1-9/+3
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.
2021-02-13gpu: Report renderer errors with exceptionsReinUsesLisp1-1/+1
Instead of using a two step initialization to report errors, initialize the GPU renderer and rasterizer on the constructor and report errors through std::runtime_error.
2021-01-24maxwell_3d: Silence array bounds warningsReinUsesLisp1-1/+1
2021-01-15common/common_funcs: Rename INSERT_UNION_PADDING_{BYTES,WORDS} to _NOINITReinUsesLisp1-75/+75
INSERT_PADDING_BYTES_NOINIT is more descriptive of the underlying behavior.
2020-12-30video_core: Rewrite the texture cacheReinUsesLisp1-50/+77
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-07maxwell_3d: Move member variables to end of classLioncash1-31/+32
Follows our established coding style.
2020-12-07maxwell_3d: Resolve -Wdocumentation warningLioncash1-1/+1
Removes a documentation comment for a non-existent member.
2020-12-07maxwell_3d: Remove unused dirty_pointer arrayLioncash1-2/+0
This is unused and removing it shrinks the structure by 3584 bytes.
2020-11-26vk_shader_decompiler: Implement force early fragment testsReinUsesLisp1-1/+6
Force early fragment tests when the 3D method is enabled. The established pipeline cache takes care of recompiling if needed. This is implemented only on Vulkan to avoid invalidating the shader cache on OpenGL.
2020-11-11maxwell_3d: Move code to separate functionsReinUsesLisp1-0/+8
Deduplicate some code and put it in separate functions so it's easier to understand and profile.
2020-08-22video_core: Initialize renderer with a GPUReinUsesLisp1-10/+11
Add an extra step in GPU initialization to be able to initialize render backends with a valid GPU instance.
2020-08-14maxwell_3d: Resolve -Wextra-semi warningLioncash1-1/+1
Semicolons after a function definition aren't necessary.
2020-06-24Addressed issuesDavid Marcec1-0/+4
2020-06-24Macro HLE supportDavid Marcec1-0/+4
2020-06-08texture_cache: Implement rendering to 3D texturesReinUsesLisp1-0/+1
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.
2020-06-05shader/texture: Join separate image and sampler pairs offlineReinUsesLisp1-0/+2
Games using D3D idioms can join images and samplers when a shader executes, instead of baking them into a combined sampler image. This is also possible on Vulkan. One approach to this solution would be to use separate samplers on Vulkan and leave this unimplemented on OpenGL, but we can't do this because there's no consistent way of determining which constant buffer holds a sampler and which one an image. We could in theory find the first bit and if it's in the TIC area, it's an image; but this falls apart when an image or sampler handle use an index of zero. The used approach is to track for a LOP.OR operation (this is done at an IR level, not at an ISA level), track again the constant buffers used as source and store this pair. Then, outside of shader execution, join the sample and image pair with a bitwise or operation. This approach won't work on games that truly use separate samplers in a meaningful way. For example, pooling textures in a 2D array and determining at runtime what sampler to use. This invalidates OpenGL's disk shader cache :) - Used mostly by D3D ports to Switch
2020-06-03Mark parameters as constDavid Marcec1-2/+1
2020-06-02Pass by reference instead of copying parametersDavid Marcec1-1/+1
2020-05-30Implement macro JITDavid Marcec1-15/+4
2020-05-04vk_graphics_pipeline: Implement viewport swizzles with NV_viewport_swizzleReinUsesLisp1-0/+1
2020-05-04maxwell_3d: Add viewport swizzlesReinUsesLisp1-1/+18
2020-04-28Clang Format and Documentation.Fernando Sahmkow1-1/+2
2020-04-28{maxwell_3d,buffer_cache}: Implement memory barriers using 3D registersReinUsesLisp1-1/+4
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-28VideoCore/Engines: Refactor Engines CallMethod.Fernando Sahmkow1-4/+5
2020-04-28maxwell_3d: Fix depth clamping registerReinUsesLisp1-0/+1
Using deko3d as reference: https://github.com/devkitPro/deko3d/blob/4e47ba0013552e592a86ab7a2510d1e7dadf236a/source/maxwell/gpu_3d_state.cpp#L42 We were using bits 3 and 4 to determine depth clamping, but these are the same both enabled and disabled: state->depthClampEnable ? 0x101A : 0x181D The same happens on Nvidia's OpenGL driver, where they do something like this (default capabilities, GL 4.5 compatibility): (state & DEPTH_CLAMP) != 0 ? 0x201a : 0x281c There's always a difference between the first bits in this register, but bit 11 is consistently disabled on both deko3d/NVN and OpenGL. This commit changes yuzu's behaviour to use bit 11 to determine depth clamping. - Fixes depth issues on Super Mario Odyssey's intro.
2020-04-23DMAPusher: Propagate multimethod writes into the engines.Fernando Sahmkow1-0/+4
2020-04-22OpenGL: Implement Fencing backend.Fernando Sahmkow1-4/+0
2020-04-22GPU: Delay Fences.Fernando Sahmkow1-0/+4
2020-04-22gl_rasterizer: Fix buffers without sizeReinUsesLisp1-1/+2
On NVN buffers can be enabled but have no size. According to deko3d and the behavior we see in Animal Crossing: New Horizons these buffers get the special address of 0x1000 and limit themselves to 0xfff. Implement buffers without a size by binding a null buffer to OpenGL without a side. https://github.com/devkitPro/deko3d/blob/1d1930beea093b5a663419e93b0649719a3ca5da/source/maxwell/gpu_3d_vbo.cpp#L62-L63
2020-04-19fixed_pipeline_state: Pack attribute stateReinUsesLisp1-1/+1
Reduce FixedPipelineState's size from 1384 to 664 bytes
2020-04-14gl_rasterizer: Implement constant vertex attributesReinUsesLisp1-0/+4
Credits go to gdkchan from Ryujinx for finding constant attributes are used in retail games.
2020-04-13gl_rasterizer: Implement line widths and smooth linesReinUsesLisp1-2/+8
Implements "legacy" features from OpenGL present on hardware such as smooth lines and line width.
2020-04-12video_core: Add MSAA registers in 3D engine and TICReinUsesLisp1-6/+61
This adds the registers used for multisampling. It doesn't implement anything for now.
2020-03-22maxwell_3d: change declaration ordernamkazy1-1/+3
2020-03-22maxwell_3d: update comments for shadow ram usagenamkazy1-0/+4
2020-03-22maxwell_3d: implement MME shadow RAMNguyen Dac Nam1-1/+14
2020-03-13maxwell_3d: Add padding words to XFB entriesReinUsesLisp1-2/+4
Use INSERT_UNION_PADDING_WORDS instead of alignas to ensure a size requirement.
2020-03-13gl_rasterizer: Implement transform feedback bindingsReinUsesLisp1-0/+9
2020-03-10gl_rasterizer: Implement polygon modes and fill rectanglesReinUsesLisp1-2/+20
2020-03-09engines/maxwell_3d: Add TFB registers and store them in shader registryReinUsesLisp1-2/+32
2020-02-28state_tracker: Remove type traits with named structuresReinUsesLisp1-4/+8
2020-02-28maxwell_3d: Use two tables instead of three for dirty flagsReinUsesLisp1-1/+1
2020-02-28maxwell_3d: Change write dirty flags to a bitsetReinUsesLisp1-4/+2
2020-02-28maxwell_3d: Flatten cull and front face registersReinUsesLisp1-16/+14
2020-02-28video_core: Reintroduce dirty flags infrastructureReinUsesLisp1-0/+14
2020-02-28gl_state: Remove clip distances trackingReinUsesLisp1-10/+1
2020-02-28gl_state: Remove viewport and depth range trackingReinUsesLisp1-9/+9
2020-02-28gl_rasterizer: Remove dirty flagsReinUsesLisp1-75/+0
2020-02-16texture_cache: Implement layered framebuffer attachmentsReinUsesLisp1-2/+7
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.
2020-02-14gl_query_cache: Implement host queries using a deferred cacheReinUsesLisp1-0/+4
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-14maxwell_3d: Slow implementation of passed samples (query 21)ReinUsesLisp1-4/+34
Implements GL_SAMPLES_PASSED by waiting immediately for queries.
2020-02-10Maxwell3D: Correct query reporting.Fernando Sahmkow1-7/+9
2020-02-04gl_rasterizer: Implement GL_POINT_SPRITEReinUsesLisp1-1/+6
OpenGL core defaults to GL_POINT_SPRITE, meanwhile on OpenGL compatibility we have to explicitly enable it. This fixes gl_PointCoord's behaviour.
2020-02-02maxwell_3d: Fix stencil back maskReinUsesLisp1-3/+3
2020-01-24Shader_IR: Allow constant access of guest driver.Fernando Sahmkow1-0/+2
2020-01-24GPU: Implement guest driver profile and deduce texture handler sizes.Fernando Sahmkow1-0/+2
2020-01-16maxwell_3d: Make dirty_pointers privateLioncash1-2/+2
This isn't used outside of the class itself, so we can make it private for the time being.
2020-01-15gl_state: Implement PROGRAM_POINT_SIZEReinUsesLisp1-1/+9
For gl_PointSize to have effect we have to activate GL_PROGRAM_POINT_SIZE.
2019-12-23maxwell_3d: Add depth bounds registersReinUsesLisp1-6/+14
2019-12-18gl_rasterizer: Implement RASTERIZE_ENABLEReinUsesLisp1-1/+6
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-12-11Maxwell3D: Implement Depth Mode.Fernando Sahmkow1-6/+7
This commit finishes adding depth mode that was reverted before due to other unresolved issues.
2019-12-07maxwell_3d: Add tessellation tess level registersReinUsesLisp1-1/+6
2019-12-07maxwell_3d: Add tessellation mode registerReinUsesLisp1-1/+28
2019-12-07maxwell_3d: Add patch vertices registerReinUsesLisp1-1/+4
2019-11-23gl_shader_cache: Remove dynamic BaseBinding specializationReinUsesLisp1-1/+0
2019-11-23video_core: Unify ProgramType and ShaderStage into ShaderTypeReinUsesLisp1-10/+3
2019-11-13maxwell_3d: Fix stencil_back_func_mask offsetReinUsesLisp1-3/+3
stencil_back_func_mask and stencil_back_mask were misplaced. This commit addresses that issue.
2019-11-04common_func: Use std::array for INSERT_PADDING_* macros.bunnei1-58/+58
- Zero initialization here is useful for determinism.
2019-10-28maxwell_3d/kepler_compute: Remove unused arguments in GetTextureReinUsesLisp1-3/+2
2019-10-28maxwell_3d: Remove unused method GetStageTexturesReinUsesLisp1-3/+0
2019-10-27maxwell_3d: Silence implicit conversion warningsReinUsesLisp1-0/+2
While we are at it, unify types for dirty reg pointers.
2019-10-25Shader_IR: allow lookup of texture samplers within the shader_ir for instructions that don't provide itFernando Sahmkow1-1/+10
2019-10-25VideoCore: Unify const buffer accessing along engines and provide ConstBufferLocker class to shaders.Fernando Sahmkow1-2/+3
2019-10-05maxwell_3d: Add dirty flags for depth bounds valuesReinUsesLisp1-1/+5
This is useful in Vulkan where we want to update depth bounds without caring if it's enabled or disabled through vkCmdSetDepthBounds.
2019-09-22Maxwell3D: Corrections and refactors to MME instance refactorFernando Sahmkow1-2/+5
2019-09-19VideoCore: Corrections to the MME Inliner and removal of hacky instance management.Fernando Sahmkow1-2/+5
2019-09-19Video Core: initial Implementation of InstanceDraw PackagingFernando Sahmkow1-1/+22
2019-09-06gl_rasterizer: Implement image bindingsReinUsesLisp1-0/+1
2019-09-04Revert "Revert #2466" and stub FirmwareCall 4ReinUsesLisp1-1/+7
2019-09-04maxwell_3d: Avoid moving macro_paramsReinUsesLisp1-1/+2
2019-09-01maxwell_3d: Fix macro binding cursorReinUsesLisp1-1/+1
2019-07-20Maxwell3D: Reorganize and address feedbackFernando Sahmkow1-2/+2
2019-07-17GL_State: Feedback and fixesFernando Sahmkow1-1/+7
2019-07-17Maxwell3D: Address FeedbackFernando Sahmkow1-3/+3
2019-07-17Maxwell3D: Implement State Dirty Flags.Fernando Sahmkow1-6/+4
2019-07-17Maxwell3D: Rework CBData UploadFernando Sahmkow1-0/+11
2019-07-17Maxwell3D: Rework the dirty system to be more consistant and scaleableFernando Sahmkow1-11/+63
2019-07-17maxwell3d: Implement Conditional RenderingFernando Sahmkow1-1/+44
Conditional Rendering takes care of conditionaly clearing or drawing depending on a set of queries. This PR implements the query checks to stablish if things can be rendered or not.
2019-07-06gl_rasterizer: Minor style changesReinUsesLisp1-0/+1
2019-06-08video_core/engines: Move ConstBufferInfo out of Maxwell3DReinUsesLisp1-7/+1
2019-05-14video_core/engines/maxwell_3d: Add is_trivially_copyable_v check for RegsLioncash1-0/+2
std::memset is used to clear the entire register structure, which requires that the Regs struct be trivially copyable (otherwise undefined behavior is invoked). This prevents the case where a non-trivial type is potentially added to the struct.
2019-05-03gl_shader_decompiler: Declare all possible varyings on physical attribute usageReinUsesLisp1-0/+1
2019-05-01Refactors and name corrections.Fernando Sahmkow1-1/+1
2019-04-23Add Documentation Headers to all the GPU EnginesFernando Sahmkow1-0/+6
2019-04-23Implement Maxwell3D Data UploadFernando Sahmkow1-1/+18
2019-04-18video_core: Silent -Wswitch warningsReinUsesLisp1-2/+3
2019-04-08Move ConstBufferAccessor to Maxwell3d, correct mistakes and clang format.Fernando Sahmkow1-0/+2
2019-04-08Implement Bindless Handling on SetupTextureFernando Sahmkow1-0/+4
2019-04-06Implement SyncPoint Register in the GPU.Fernando Sahmkow1-1/+15
2019-04-06video_core/engines: Make memory manager members privateLioncash1-1/+2
These aren't used externally by anything, so they can be made private data members.
2019-04-06video_core/engines: Remove unnecessary inclusions where applicableLioncash1-1/+4
Replaces header inclusions with forward declarations where applicable and also removes unused headers within the cpp file. This reduces a few more dependencies on core/memory.h
2019-02-27common/math_util: Move contents into the Common namespaceLioncash1-1/+1
These types are within the common library, so they should be within the Common namespace.
2019-02-26maxwell_3d: Use std::bitset to manage dirty flagsReinUsesLisp1-7/+8
2019-02-16video_core: Remove usages of System::GetInstance() within the enginesLioncash1-1/+8
Avoids the use of the global accessor in favor of explicitly making the system a dependency within the interface.
2019-01-07gl_rasterizer_cache: Use dirty flags for the depth bufferReinUsesLisp1-0/+2
2019-01-07gl_rasterizer_cache: Use dirty flags for color buffersReinUsesLisp1-0/+3
2019-01-07gl_shader_cache: Use dirty flags for shadersReinUsesLisp1-0/+3
2018-12-19Fixed uninitialized memory due to missing returns in canaryDavid Marcec1-0/+2
Functions which are suppose to crash on non canary builds usually don't return anything which lead to uninitialized memory being used.
2018-11-29gl_rasterizer: Enable clip distances when set in register and in shaderReinUsesLisp1-0/+1
2018-11-27gpu: Rewrite GPU command list processing with DmaPusher class.bunnei1-1/+1
- More accurate impl., fixes Undertale (among other games).
2018-11-27Implement depth clampRodolfo Bogado1-1/+9
2018-11-27Add support for Clip Distance enabled registerRodolfo Bogado1-1/+15
2018-11-27GPU States: Implement Polygon Offset. This is used in SMO all the time. (#1784)Marcos1-4/+26
* GPU States: Implement Polygon Offset. This is used in SMO all the time. * Clang Format fixes. * Initialize polygon_offset in the constructor.
2018-11-25gl_shader_decompiler: Implement S2R's Y_DIRECTIONReinUsesLisp1-0/+1
2018-11-24Add support for viewport_transfom_enable registerRodolfo Bogado1-1/+9
2018-11-24Add support for clear_flags registerRodolfo Bogado1-1/+11
2018-11-22maxwell_3d: Implement alternate blend equations.bunnei1-0/+7
- Used by Undertale.
2018-11-17small fix for alphaToOne bit locationRodolfo Bogado1-2/+2
2018-11-17fix for gcc compilationRodolfo Bogado1-60/+61
2018-11-17add AlphaToCoverage and AlphaToOneRodolfo Bogado1-1/+7
2018-11-17add support for fragment_color_clampRodolfo Bogado1-1/+4
2018-11-17fix viewport and scissor behaviorRodolfo Bogado1-10/+16
2018-11-17gl_rasterizer: Skip VB upload if the state is clean.Markus Wick1-0/+5
2018-11-11Try to fix problems with stencil test in some games, relax translation to opengl enums to avoid crashing and only generate logs of the errors.Rodolfo Bogado1-0/+8
2018-11-06gl_rasterizer: Skip VAO binding if the state is clean.Markus Wick1-0/+6
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-3/+20
2018-11-05Implement multi-target viewports and blendingRodolfo Bogado1-2/+12
2018-11-01maxwell_3d: Restructure macro upload to use a single macro code memory.bunnei1-4/+21
- Fixes an issue where macros could be skipped. - Fixes rendering of distant objects in Super Mario Odyssey.
2018-10-28Implement sRGB Support, including workarounds for nvidia driver issues and QT sRGB supportRodolfo Bogado1-1/+6
2018-10-26gl_rasterizer: Implement primitive restart.bunnei1-1/+9
2018-10-26maxwell_3d: Add code for initializing register defaults.bunnei1-0/+2
2018-10-22Implemented Alpha TestingFernandoS271-1/+3
2018-10-18Implement 3D TexturesFernandoS271-1/+4
2018-10-10Add memory Layout to Render Targets and Depth BuffersFernandoS271-2/+14
2018-10-10Fixed block height settings for RenderTargets and Depth Buffers, and added block width and block depthFernandoS271-2/+10
2018-10-09Assert Scissor testsFernandoS271-1/+16
2018-10-04gl_rasterizer: Implement quads topologyReinUsesLisp1-0/+6
2018-09-28video_core: Implement point_size and add point state syncReinUsesLisp1-1/+6
2018-09-28gl_state: Pack sampler bindings into a single ARB_multi_bindReinUsesLisp1-0/+1
2018-09-26video_core: Add asserts for CS, TFB and alpha testingReinUsesLisp1-2/+10
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-14/+14
2018-09-10gl_rasterizer: Implement multiple color attachments.bunnei1-1/+21
2018-09-05gl_rasterizer: Implement a VAO cache.Markus Wick1-2/+7
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-08-23maxwell_3d: Update to include additional stencil registers.bunnei1-20/+50
2018-08-21GPU: Added registers for the logicop functionality.Subv1-1/+28
2018-08-18GLRasterizer: Implemented instanced vertex arrays.Subv1-1/+14
Before each draw call, for every enabled vertex array configured as instanced, we take the current instance id and divide it by its configured divisor, then we multiply that by the corresponding stride and increment the start address by the resulting amount. This way we can simulate the vertex array being incremented once per instance without actually using OpenGL's instancing functions.
2018-08-15Rasterizer: Implemented instanced rendering.Subv1-0/+3
We keep track of the current instance and update an uniform in the shaders to let them know which instance they are. Instanced vertex arrays are not yet implemented.
2018-08-12GPU/Maxwell3D: Implemented an alternative set of blend factors.Subv1-0/+21
These are used by nouveau and some games like SMO.
2018-08-12RasterizerGL: Ignore invalid/unset vertex attributes.Subv1-0/+5
This should make the es2gears example not crash anymore.
2018-08-08maxwell_3d: Use correct const buffer size and check bounds.bunnei1-1/+1
- Fixes mem corruption with Super Mario Odyssey and Pokkén Tournament DX.
2018-08-04video_core: Eliminate the g_renderer global variableLioncash1-1/+7
We move the initialization of the renderer to the core class, while keeping the creation of it and any other specifics in video_core. This way we can ensure that the renderer is initialized and doesn't give unfettered access to the renderer. This also makes dependencies on types more explicit. For example, the GPU class doesn't need to depend on the existence of a renderer, it only needs to care about whether or not it has a rasterizer, but since it was accessing the global variable, it was also making the renderer a part of its dependency chain. By adjusting the interface, we can get rid of this dependency.
2018-07-22maxwell_3d: Add depth buffer enable, width, and height registers.bunnei1-2/+14
2018-07-21video_core: Use nested namespaces where applicableLioncash1-4/+2
Compresses a few namespace specifiers to be more compact.
2018-07-17GPU: Added register definitions for the stencil parameters.Subv1-2/+25
2018-07-13gl_rasterizer: Fix check for if a shader stage is enabled.bunnei1-3/+8
2018-07-05GPU: Allow using the old NV04 values for the depth test function.Subv1-9/+21
These seem to be just a valid as the GL token values. Thanks @ReinUsesLisp This restores graphical output to Disgaea 5
2018-07-04GPU: Flip the triangle front face winding if the GPU is configured to not flip the triangles.Subv1-3/+19
OpenGL's default behavior is already correct when the GPU is configured to flip the triangles. This fixes 1-2 Switch's splash screen.
2018-07-03GPU: Added registers for the CLEAR_BUFFERS and CLEAR_COLOR methods.Subv1-2/+27
2018-07-03GPU: Use only the least significant 3 bits when reading the depth test func.Subv1-9/+9
Some games set the full GL define value here (including nouveau), but others just seem to set those last 3 bits.
2018-07-02GPU: Added registers for depth test and cull mode.Subv1-3/+51
2018-07-02GPU: Implemented the Z24S8 depth format and load the depth framebuffer.Subv1-1/+1
2018-07-02GPU: Added register definitions for the vertex buffer base element.Subv1-1/+6
2018-06-27maxwell_3d: Add a struct for RenderTargetConfig.bunnei1-17/+19
2018-06-09GPU: Added registers for normal and independent blending.Subv1-5/+26
2018-06-06GPU: Implement sampling multiple textures in the generated glsl shaders.Subv1-0/+3
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-06-04GPU: Calculate the correct viewport dimensions based on the scale and translate registers.Subv1-12/+28
This is how nouveau calculates the viewport width and height. For some reason some games set 0xFFFF in the VIEWPORT_HORIZ and VIEWPORT_VERT registers, maybe those are a misnomer and actually refer to something else?
2018-04-25GPU: Reduce the number of registers of Maxwell3D to 0xE00.Subv1-2/+2
The rest are just macro shim registers.
2018-04-25GPU: Move the Maxwell3D macro uploading code to the inside of the Maxwell3D processor.Subv1-4/+13
It doesn't belong in the PFIFO handler.
2018-04-24GPU: Added asserts to our code for handling the QUERY_GET GPU command.Subv1-1/+27
This is based on research from nouveau. Many things are currently unknown and will require hwtests in the future. This commit also stubs QueryMode::Write2 to do the same as Write. Nouveau code treats them interchangeably, it is currently unknown what the difference is.
2018-04-23GPU: Support multiple enabled vertex arrays.Subv1-0/+5
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-18gl_shader_gen: Support vertical/horizontal viewport flipping. (#347)bunnei1-1/+10
* gl_shader_gen: Support vertical/horizontal viewport flipping. * fixup! gl_shader_gen: Support vertical/horizontal viewport flipping.
2018-04-18renderer_opengl: Implement BlendEquation and BlendFunc.bunnei1-1/+47
2018-04-17gl_rasterizer: Implement indexed vertex mode.bunnei1-1/+43
2018-04-15GPU: Added a function to determine whether a shader stage is enabled or not.Subv1-0/+3
2018-04-14maxwell_3d: Make memory_manager public.bunnei1-2/+1
2018-04-14maxwell_3d: Fix shader_config decodings.bunnei1-6/+3
2018-04-01GPU: Use the MacroInterpreter class to execute the GPU macros instead of HLEing them.Subv1-21/+5
2018-04-01GPU: Implemented a gpu macro interpreter.Subv1-0/+3
The Ryujinx macro interpreter and envydis were used as reference. Macros are programs that are uploaded by the games during boot and can later be called by writing to their method id in a GPU command buffer.
2018-03-27gl_rasterizer: Add a SyncViewport method.bunnei1-0/+10
2018-03-27gl_rasterizer: Normalize vertex array data as appropriate.bunnei1-0/+4
2018-03-27maxwell_3d: Use names that match envytools for VertexType.bunnei1-8/+8
2018-03-27maxwell_3d: Add VertexAttribute struct and cleanup.bunnei1-121/+160
2018-03-27gl_rasterizer: Implement AnalyzeVertexArray.bunnei1-0/+35
2018-03-27maxwell: Add RenderTargetFormat enum.bunnei1-3/+4
2018-03-26GPU: Load the sampler info (TSC) when retrieving active textures.Subv1-1/+7
2018-03-24GPU: Added a function to retrieve the active textures for a shader stage.Subv1-6/+10
TODO: A shader may not use all of these textures at the same time, shader analysis should be performed to determine which textures are actually sampled.
2018-03-24GPU: Added viewport registers to Maxwell3D's reg structure.Subv1-1/+18
2018-03-23maxwell_3d: Add some format decodings and string helper functions.bunnei1-3/+107
2018-03-21GPU: Added vertex attribute format registers.Subv1-1/+14
2018-03-21GPU: Added registers for the number of vertices to render.Subv1-2/+13
2018-03-19GPU: Added Z buffer registers to Maxwell3D's reg structure.Subv1-1/+17
2018-03-19GPU: Added the render target (RT) registers to Maxwell3D's reg structure.Subv1-1/+32
2018-03-19GPU: Added the TSC registers to the Maxwell3D register structure.Subv1-1/+15
2018-03-19GPU: Added the TIC registers to the Maxwell3D register structure.Subv1-1/+16
2018-03-19GPU: Implement macro 0xE1A BindTextureInfoBuffer in HLE.Subv1-1/+11
This macro simply sets the current CB_ADDRESS to the texture buffer address for the input shader stage.
2018-03-18GPU: Implement the BindStorageBuffer macro method in HLE.Subv1-1/+15
This macro binds the SSBO Info Buffer as the current ConstBuffer. This buffer is usually bound to c0 during shader execution. Games seem to use this macro instead of directly writing the address for some reason.
2018-03-18GPU: Handle writes to the CB_DATA method.Subv1-0/+3
Writing to this method will cause the written value to be stored in the currently-set ConstBuffer plus CB_POS. This method is usually used to upload uniforms or other shader-visible data.
2018-03-18GPU: Store uploaded GPU macros and keep track of the number of method parameters.Subv1-4/+8
2018-03-18GPU: Macros are specific to the Maxwell3D engine, so handle them internally.Subv1-8/+19
2018-03-18GPU: Renamed ShaderType to ShaderStage as that is less confusing.Subv1-7/+7
2018-03-18GPU: Store shader constbuffer bindings in the GPU state.Subv1-3/+25
2018-03-18GPU: Corrected some register offsets and removed superfluous macro registers.Subv1-9/+3
2018-03-18GPU: Make the SetShader macro call do the same as the real macro's code.Subv1-2/+25
It'll now set the CB_SIZE, CB_ADDRESS and CB_BIND registers when it's called. Presumably this SetShader function is binding the constant shader uniforms to buffer 1 (c1[]).
2018-03-17GPU: Corrected the parameter documentation for the SetShader macro call.Subv1-6/+6
Register 0xE24 is actually a macro that sets some shader parameters in the register structure. Macros are uploaded to the GPU at startup and have their own ISA, we'll probably write an interpreter for this in the future.
2018-03-17GPU: Handle the SetShader method call (0xE24) and store the shader config.Subv1-2/+16
2018-03-17GPU: Added the vertex array registers.Subv1-2/+33
2018-03-17GPU: Process command mode 5 (IncreaseOnce) differently from other commands.Subv1-1/+21
Accumulate all arguments before calling the desired method. Note: Maybe we should do the same for the NonIncreasing mode?
2018-03-17GPU: Added Maxwell registers for Shader Program control.Subv1-2/+55
2018-03-05GPU: Intercept writes to the VERTEX_END_GL register.Subv1-1/+9
This is the register that gets written after a game calls DrawArrays(). We should collect all GPU state and draw using our graphics API here.
2018-02-14maxwell_3d: Make constructor explicitLioncash1-1/+1
2018-02-12GPU: Partially implemented the QUERY_* registers in the Maxwell3D engine.Subv1-1/+55
Only QueryMode::Write is supported at the moment.
2018-02-12Make a GPU class in VideoCore to contain the GPU state.Subv1-3/+7
Also moved the GPU MemoryManager class to video_core since it makes more sense for it to be there.
2018-02-12GPU: Added a command processor to decode the GPU pushbuffers and forward the commands to their respective engines.Subv1-0/+18