aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/shader/decode/texture.cpp
AgeCommit message (Collapse)Author
2021-07-22shader: Remove old shader managementReinUsesLisp
2021-02-15Review 1Kelebek1
2021-02-15Implement texture offset support for TexelFetch and TextureGather and add ↵Kelebek1
offsets for Tlds Formatting
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-07video_core: Remove unnecessary enum class casting in logging messagesLioncash
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.
2020-10-28shader: Partially implement texture cube array shadowReinUsesLisp
This implements texture cube arrays with shadow comparisons but doesn't fix the asserts related to it. Fixes out of bounds reads on swizzle constructors and makes them use bounds checked ::at instead of the unsafe operator[].
2020-10-07shader/texture: Implement CUBE texture type for TMML and fix arraysReinUsesLisp
TMML takes an array argument that has no known meaning, this one appears as the first component in gpr8 followed by s, t and r. Skip this component when arrays are being used. Also implement CUBE texture types. - Used by Pikmin 3: Deluxe Demo.
2020-09-17decoder/texture: Eliminate narrowing conversion in GetTldCode()Lioncash
The assignment was previously truncating a u64 value to a bool.
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-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-16decode/texture: Resolve unused variable warnings.Lioncash
Some variables aren't used, so we can remove these. Unfortunately, diagnostics are still reported on structured bindings even when annotated with [[maybe_unused]], so we need to unpack the elements that we want to use manually.
2020-04-16decode/texture: Collapse loop down into std::generateLioncash
Same behavior, less code.
2020-04-16decode/texture: Eliminate trivial missing field initializer warningsLioncash
We can just specify the initializers.
2020-04-10shader/texture: Remove type mismatches management from shader decoderReinUsesLisp
Since commit e22816a5bb we handle type mismatches from the CPU. We don't need to hack our shader decoder due to game bugs anymore. Removed in this commit.
2020-03-09video_core: Rename "const buffer locker" to "registry"ReinUsesLisp
2020-02-21shader/texture: Fix illegal 3D texture assertReinUsesLisp
Fix typo in the illegal 3D texture assert logic. We care about catching arrayed 3D textures or 3D shadow textures, not regular 3D textures.
2020-02-15shader/texture: Allow 2D shadow arrays and simplify codeReinUsesLisp
Shadow sampler 2D arrays are supported on OpenGL, so there's no reason to forbid these. Enable textureLod usage on these. Minor style changes.
2020-02-01shader: Remove curly braces initializers on shared pointersReinUsesLisp
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: deduce size of indexed samplersFernando Sahmkow
2020-01-24Shader_IR: Setup Indexed Samplers on the IRFernando Sahmkow
2020-01-24Merge pull request #3273 from FernandoS27/txd-arraybunnei
Shader_IR: Implement TXD Array.
2020-01-09shader_ir/texture: Simplify AOFFI codeReinUsesLisp
2020-01-04Shader_IR: Implement TXD Array.Fernando Sahmkow
This commit extends the compilation of TXD to support array samplers on TXD.
2019-12-26Merge pull request #3228 from ReinUsesLisp/ptpbunnei
shader/texture: Implement AOFFI and PTP for TLD4 and TLD4S
2019-12-17shader/texture: Properly shrink unused entries in size mismatchesReinUsesLisp
When a image format mismatches we were inserting zeroes to the texture itself. This was not handling cases were the mismatch uses less coordinates than the guest shader code. Address that by resizing the vector.
2019-12-16shader/texture: Implement TLD4.PTPReinUsesLisp
2019-12-16shader/texture: Enable arrayed TLD4ReinUsesLisp
2019-12-16shader/texture: Implement AOFFI for TLD4SReinUsesLisp
2019-12-16shader/texture: Remove unnecesary parenthesisReinUsesLisp
2019-12-11Shader_IR: Correct TLD4S Depth Compare.Fernando Sahmkow
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-06Merge pull request #3109 from FernandoS27/new-instrbunnei
Implement FLO & TXD Instructions on GPU Shaders
2019-11-22shader/texture: Handle TLDS texture type mismatchesReinUsesLisp
Some games like "Fire Emblem: Three Houses" bind 2D textures to offsets used by instructions of 1D textures. To handle the discrepancy this commit uses the the texture type from the binding and modifies the emitted code IR to build a valid backend expression. E.g.: Bound texture is 2D and instruction is 1D, the emitted IR samples a 2D texture in the coordinate ivec2(X, 0).
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-18Shader_IR: Address FeedbackFernando Sahmkow
2019-11-14Shader_IR: Implement TXD instruction.Fernando Sahmkow
2019-11-07shader/texture: Remove NODEP warningsReinUsesLisp
These warnings don't offer meaningful information while decoding shaders. Remove them.
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-26Shader_IR: Address Feedback.Fernando Sahmkow
2019-10-25Shader_IR: allow lookup of texture samplers within the shader_ir for ↵Fernando Sahmkow
instructions that don't provide it
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.