aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/shader/shader_ir.h
AgeCommit message (Collapse)Author
2021-07-22shader: Remove old shader managementReinUsesLisp
2021-02-13video_core: Reimplement the buffer cacheReinUsesLisp
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-01-25Revert "Start of Integer flags implementation"ReinUsesLisp
This reverts #4713. The implementation in that PR is not accurate. It does not reflect the behavior seen in hardware.
2021-01-10Merge remote-tracking branch 'upstream/master' into int-flagsLevi
2020-12-30video_core: Rewrite the texture cacheReinUsesLisp
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.3Lioncash
Cleans out the rest of the occurrences of variable shadowing and makes any further occurrences of shadowing compiler errors.
2020-09-24Address CommentsLevi Behunin
2020-09-24Start of Integer flags implementationLevi Behunin
2020-06-05shader/texture: Join separate image and sampler pairs offlineReinUsesLisp
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-04shader/track: Move bindless tracking to a separate functionReinUsesLisp
2020-05-02Merge pull request #3693 from ReinUsesLisp/clean-samplersbunnei
shader/texture: Support multiple unknown sampler properties
2020-04-26shader/memory_util: Deduplicate codeReinUsesLisp
Deduplicate code shared between vk_pipeline_cache and gl_shader_cache as well as shader decoder code. While we are at it, fix a bug in gl_shader_cache where compute shaders had an start offset of a stage shader.
2020-04-23shader/texture: Support multiple unknown sampler propertiesReinUsesLisp
This allows deducing some properties from the texture instruction before asking the runtime. By doing this we can handle type mismatches in some instructions from the renderer instead of the shader decoder. Fixes texelFetch issues with games using 2D texture instructions on a 1D sampler.
2020-04-23shader_ir: Turn classes into data structuresReinUsesLisp
2020-04-12Merge pull request #3578 from ReinUsesLisp/vmnmxFernando Sahmkow
shader/video: Partially implement VMNMX
2020-04-12shader/video: Partially implement VMNMXReinUsesLisp
Implements the common usages for VMNMX. Inputs with a different size than 32 bits are not supported and sign mismatches aren't supported either. VMNMX works as follows: It grabs Ra and Rb and applies a maximum/minimum on them (this is defined by .MX), having in mind the input sign. This result can then be saturated. After the intermediate result is calculated, it applies another operation on it using Rc. These operations are merges, accumulations or another min/max pass. This instruction allows to implement with a more flexible approach GCN's min3 and max3 instructions (for instance).
2020-04-06shader_decode: SULD.D using std::pair instead of out parameternamkazy
2020-04-06shader_decode: SULD.D implement bits64 and reverse shader ir init method to ↵namkazy
removed shader stage.
2020-04-05add shader stage when init shader irnamkazy
2020-03-15shader/shader_ir: Track usage in input attribute and of legacy varyingsReinUsesLisp
2020-03-09video_core: Rename "const buffer locker" to "registry"ReinUsesLisp
2020-01-25Shader_IR: Address feedback.Fernando Sahmkow
2020-01-24Shader_IR: Change name of TrackSampler function so it does not confuse with ↵Fernando Sahmkow
the type.
2020-01-24Shader_IR: Propagate bindless index into the GL compiler.Fernando Sahmkow
2020-01-24Shader_IR: Implement Injectable Custom Variables to the IR.Fernando Sahmkow
2020-01-24Shader_IR: deduce size of indexed samplersFernando Sahmkow
2020-01-24Shader_IR: Implement initial code for tracking indexed samplers.Fernando Sahmkow
2020-01-24GPU: Implement guest driver profile and deduce texture handler sizes.Fernando Sahmkow
2020-01-09shader_ir/memory: Implement u16 and u8 for STG and LDGReinUsesLisp
Using the same technique we used for u8 on LDG, implement u16. In the case of STG, load memory and insert the value we want to set into it with bitfieldInsert. Then set that value.
2020-01-04Shader_IR: Address FeedbackFernando Sahmkow
2019-12-30Shader_IR: add the ability to amend code in the shader ir.Fernando Sahmkow
This commit introduces a mechanism by which shader IR code can be amended and extended. This useful for track algorithms where certain information can derived from before the track such as indexes to array samplers.
2019-12-16shader/texture: Implement TLD4.PTPReinUsesLisp
2019-12-11Shader_Ir: Correct TLD4S encoding and implement f16 flag.Fernando Sahmkow
2019-12-11Shader_Ir: default failed tracks on bindless samplers to null values.Fernando Sahmkow
2019-12-09shader: Keep track of shaders using warp instructionsReinUsesLisp
2019-11-22shader/texture: Deduce texture buffers from lockerReinUsesLisp
Instead of specializing shaders to separate texture buffers from 1D textures, use the locker to deduce them while they are being decoded.
2019-11-08video_core: Silence implicit conversion warningsReinUsesLisp
2019-11-06Merge pull request #3039 from ReinUsesLisp/cleanup-samplersRodrigo Locatti
shader/node: Unpack bindless texture encoding
2019-10-30Shader_IR: Fix regression on TLD4Fernando Sahmkow
Originally on the last commit I thought TLD4 acted the same as TLD4S and didn't have a mask. It actually does have a component mask. This commit corrects that.
2019-10-30Shader_IR: Fix TLD4 and add Bindless Variant.Fernando Sahmkow
This commit fixes an issue where not all 4 results of tld4 were being written, the color component was defaulted to red, among other things. It also implements the bindless variant.
2019-10-29shader/node: Unpack bindless texture encodingReinUsesLisp
Bindless textures were using u64 to pack the buffer and offset from where they come from. Drop this in favor of separated entries in the struct. Remove the usage of std::set in favor of std::list (it's not std::vector to avoid reference invalidations) for samplers and images.
2019-10-26Merge pull request #2976 from FernandoS27/cache-fast-brx-rebasedRodrigo Locatti
Implement Fast BRX, fix TXQ and addapt the Shader Cache for it
2019-10-25Merge pull request #3013 from FernandoS27/tld4s-fixRodrigo Locatti
Shader_Ir: Fix TLD4S from using a component mask.
2019-10-25gl_shader_decompiler: Move entries to a separate functionReinUsesLisp
2019-10-25Shader_IR: allow lookup of texture samplers within the shader_ir for ↵Fernando Sahmkow
instructions that don't provide it
2019-10-25Shader_Cache: setup connection of ConstBufferLockerFernando Sahmkow
2019-10-25VideoCore: Unify const buffer accessing along engines and provide ↵Fernando Sahmkow
ConstBufferLocker class to shaders.
2019-10-22Shader_Ir: Fix TLD4S from using a component mask.Fernando Sahmkow
TLD4S always outputs 4 values, the previous code checked a component mask and omitted those values that weren't part of it. This commit corrects that and makes sure all 4 values are set.
2019-10-22shader_ir/memory: Ignore global memory when tracking failsReinUsesLisp
Ignore global memory operations instead of invoking undefined behaviour when constant buffer tracking fails and we are blasting through asserts, ignore the operation. In the case of LDG this means filling the destination registers with zeroes; for STG this means ignore the instruction as a whole. The default behaviour is still to abort execution on failure.
2019-10-04vk_shader_compiler: Implement the decompiler in SPIR-VFernando Sahmkow