summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader/decode/texture.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Review 1Kelebek12021-02-151-1/+1
|
* Implement texture offset support for TexelFetch and TextureGather and add offsets for TldsKelebek12021-02-151-2/+9
| | | | Formatting
* video_core: Rewrite the texture cacheReinUsesLisp2020-12-301-27/+29
| | | | | | | | | | | | | | The current texture cache has several points that hurt maintainability and performance. It's easy to break unrelated parts of the cache when doing minor changes. The cache can easily forget valuable information about the cached textures by CPU writes or simply by its normal usage.The current texture cache has several points that hurt maintainability and performance. It's easy to break unrelated parts of the cache when doing minor changes. The cache can easily forget valuable information about the cached textures by CPU writes or simply by its normal usage. This commit aims to address those issues.
* video_core: Remove unnecessary enum class casting in logging messagesLioncash2020-12-071-5/+4
| | | | | | | 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.
* shader: Partially implement texture cube array shadowReinUsesLisp2020-10-281-1/+0
| | | | | | | | 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[].
* shader/texture: Implement CUBE texture type for TMML and fix arraysReinUsesLisp2020-10-081-19/+22
| | | | | | | | 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.
* decoder/texture: Eliminate narrowing conversion in GetTldCode()Lioncash2020-09-171-1/+1
| | | | The assignment was previously truncating a u64 value to a bool.
* shader/texture: Join separate image and sampler pairs offlineReinUsesLisp2020-06-051-18/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* shader/texture: Support multiple unknown sampler propertiesReinUsesLisp2020-04-231-51/+74
| | | | | | | | | 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.
* shader_ir: Turn classes into data structuresReinUsesLisp2020-04-231-49/+50
|
* decode/texture: Resolve unused variable warnings.Lioncash2020-04-171-5/+7
| | | | | | | | 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.
* decode/texture: Collapse loop down into std::generateLioncash2020-04-171-3/+1
| | | | Same behavior, less code.
* decode/texture: Eliminate trivial missing field initializer warningsLioncash2020-04-171-3/+4
| | | | We can just specify the initializers.
* shader/texture: Remove type mismatches management from shader decoderReinUsesLisp2020-04-101-14/+0
| | | | | | | 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.
* video_core: Rename "const buffer locker" to "registry"ReinUsesLisp2020-03-091-2/+3
|
* shader/texture: Fix illegal 3D texture assertReinUsesLisp2020-02-211-1/+1
| | | | | Fix typo in the illegal 3D texture assert logic. We care about catching arrayed 3D textures or 3D shadow textures, not regular 3D textures.
* shader/texture: Allow 2D shadow arrays and simplify codeReinUsesLisp2020-02-151-43/+28
| | | | | | | Shadow sampler 2D arrays are supported on OpenGL, so there's no reason to forbid these. Enable textureLod usage on these. Minor style changes.
* shader: Remove curly braces initializers on shared pointersReinUsesLisp2020-02-021-2/+2
|
* Shader_IR: Address feedback.Fernando Sahmkow2020-01-251-1/+2
|
* Shader_IR: Change name of TrackSampler function so it does not confuse with the type.Fernando Sahmkow2020-01-241-1/+1
|
* Shader_IR: Propagate bindless index into the GL compiler.Fernando Sahmkow2020-01-241-16/+24
|
* Shader_IR: deduce size of indexed samplersFernando Sahmkow2020-01-241-4/+5
|
* Shader_IR: Setup Indexed Samplers on the IRFernando Sahmkow2020-01-241-20/+46
|
* Merge pull request #3273 from FernandoS27/txd-arraybunnei2020-01-241-5/+12
|\ | | | | Shader_IR: Implement TXD Array.
| * Shader_IR: Implement TXD Array.Fernando Sahmkow2020-01-041-5/+12
| | | | | | | | | | This commit extends the compilation of TXD to support array samplers on TXD.
* | shader_ir/texture: Simplify AOFFI codeReinUsesLisp2020-01-091-10/+6
|/
* Merge pull request #3228 from ReinUsesLisp/ptpbunnei2019-12-271-33/+75
|\ | | | | shader/texture: Implement AOFFI and PTP for TLD4 and TLD4S
| * shader/texture: Implement TLD4.PTPReinUsesLisp2019-12-161-18/+56
| |
| * shader/texture: Enable arrayed TLD4ReinUsesLisp2019-12-161-1/+0
| |
| * shader/texture: Implement AOFFI for TLD4SReinUsesLisp2019-12-161-13/+18
| |
| * shader/texture: Remove unnecesary parenthesisReinUsesLisp2019-12-161-2/+2
| |
* | shader/texture: Properly shrink unused entries in size mismatchesReinUsesLisp2019-12-181-4/+9
|/ | | | | | | 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.
* Shader_IR: Correct TLD4S Depth Compare.Fernando Sahmkow2019-12-121-5/+12
|
* Shader_Ir: Correct TLD4S encoding and implement f16 flag.Fernando Sahmkow2019-12-121-9/+12
|
* Shader_Ir: default failed tracks on bindless samplers to null values.Fernando Sahmkow2019-12-121-22/+75
|
* Merge pull request #3109 from FernandoS27/new-instrbunnei2019-12-071-7/+46
|\ | | | | Implement FLO & TXD Instructions on GPU Shaders
| * Shader_IR: Address FeedbackFernando Sahmkow2019-11-181-5/+2
| |
| * Shader_IR: Implement TXD instruction.Fernando Sahmkow2019-11-141-7/+49
| |
* | shader/texture: Handle TLDS texture type mismatchesReinUsesLisp2019-11-231-1/+10
| | | | | | | | | | | | | | | | | | | | 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).
* | shader/texture: Deduce texture buffers from lockerReinUsesLisp2019-11-231-61/+41
|/ | | | | Instead of specializing shaders to separate texture buffers from 1D textures, use the locker to deduce them while they are being decoded.
* shader/texture: Remove NODEP warningsReinUsesLisp2019-11-071-35/+0
| | | | | These warnings don't offer meaningful information while decoding shaders. Remove them.
* Merge pull request #3039 from ReinUsesLisp/cleanup-samplersRodrigo Locatti2019-11-061-28/+31
|\ | | | | shader/node: Unpack bindless texture encoding
| * shader/node: Unpack bindless texture encodingReinUsesLisp2019-10-301-28/+31
| | | | | | | | | | | | | | | | | | 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.
* | Shader_IR: Fix regression on TLD4Fernando Sahmkow2019-10-311-4/+3
| | | | | | | | | | | | 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.
* | Shader_IR: Fix TLD4 and add Bindless Variant.Fernando Sahmkow2019-10-301-8/+24
|/ | | | | | 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.
* Merge pull request #2976 from FernandoS27/cache-fast-brx-rebasedRodrigo Locatti2019-10-261-20/+50
|\ | | | | Implement Fast BRX, fix TXQ and addapt the Shader Cache for it
| * Shader_IR: Address Feedback.Fernando Sahmkow2019-10-261-22/+16
| |
| * Shader_IR: allow lookup of texture samplers within the shader_ir for instructions that don't provide itFernando Sahmkow2019-10-251-18/+54
| |
* | Shader_Ir: Fix TLD4S from using a component mask.Fernando Sahmkow2019-10-221-4/+4
|/ | | | | | 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.
* shader_ir: Rename Get/SetTemporal to Get/SetTemporaryLioncash2019-07-171-13/+13
| | | | | | This is more accurate in terms of describing what the functions are actually doing. Temporal relates to time, not the setting of a temporary itself.
* shader: Allow tracking of indirect buffers without variable offsetReinUsesLisp2019-07-151-6/+2
| | | | | | While changing this code, simplify tracking code to allow returning the base address node, this way callers don't have to manually rebuild it on each invocation.
* shader/texture: Add F16 support for TLDSReinUsesLisp2019-07-071-1/+7
|
* decode/texture: Address feedbackReinUsesLisp2019-06-241-0/+1
|
* shader: Implement texture buffersReinUsesLisp2019-06-211-0/+44
|
* shader: Use shared_ptr to store nodes and move initialization to fileReinUsesLisp2019-06-061-4/+5
| | | | | | | | | Instead of having a vector of unique_ptr stored in a vector and returning star pointers to this, use shared_ptr. While changing initialization code, move it to a separate file when possible. This is a first step to allow code analysis and node generation beyond the ShaderIR class.
* video_core/shader/decode/texture: Remove unused variable from GetTld4Code()Lioncash2019-05-101-1/+0
|
* shader/decode/texture: Remove unused variableLioncash2019-05-041-1/+0
| | | | This isn't used anywhere, so we can get rid of it.
* shader_ir/texture: Fix sampler const buffer key shiftReinUsesLisp2019-04-261-1/+1
|
* Adapt Bindless to work with AOFFIFernando Sahmkow2019-04-081-7/+18
|
* Move ConstBufferAccessor to Maxwell3d, correct mistakes and clang format.Fernando Sahmkow2019-04-081-1/+2
|
* Fix TMMLFernando Sahmkow2019-04-081-5/+7
|
* Refactor GetTextureCode and GetTexCode to use an optional instead of optional parametersFernando Sahmkow2019-04-081-23/+24
|
* Implement TXQ_BFernando Sahmkow2019-04-081-2/+8
|
* Implement TMML_BFernando Sahmkow2019-04-081-5/+10
|
* Corrections to TEX_BFernando Sahmkow2019-04-081-4/+5
|
* Unify both sampler types.Fernando Sahmkow2019-04-081-10/+12
|
* Implement Bindless Samplers and TEX_B in the IR.Fernando Sahmkow2019-04-081-6/+52
|
* shader_ir/decode: Silent implicit sign conversion warningMat M2019-03-311-2/+2
| | | Co-Authored-By: ReinUsesLisp <reinuseslisp@airmail.cc>
* shader_ir/decode: Implement AOFFI for TEX and TLD4ReinUsesLisp2019-03-301-24/+88
|
* shader/decode: Remove extras from MetaTextureReinUsesLisp2019-02-261-14/+23
|
* shader/decode: Split memory and texture instructions decodingReinUsesLisp2019-02-261-0/+525