Commit Graph

46 Commits (e6b4311178b4f87b67eb2383f2a64520c2a8dd25)

Author SHA1 Message Date
bunnei e6b4311178
Merge pull request #3693 from ReinUsesLisp/clean-samplers
shader/texture: Support multiple unknown sampler properties
5 years ago
ReinUsesLisp ddd82ef42b shader/memory_util: Deduplicate code
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.
5 years ago
ReinUsesLisp 72deb773fd shader_ir: Turn classes into data structures 5 years ago
ReinUsesLisp e8efd5a901 video_core: Rename "const buffer locker" to "registry" 5 years ago
ReinUsesLisp bd8b9bbcee gl_shader_cache: Rework shader cache and remove post-specializations
Instead of pre-specializing shaders and then post-specializing them,
drop the later and only "specialize" the shader while decoding it.
5 years ago
Fernando Sahmkow bb8eb15d39 Shader_IR: Address feedback. 5 years ago
Fernando Sahmkow 3919b7b8a9 Shader_IR: Corrections, styling and extras. 5 years ago
Fernando Sahmkow 037ea431ce Shader_IR: deduce size of indexed samplers 5 years ago
Fernando Sahmkow 64496f2456 Shader_IR: Address Feedback 5 years ago
Fernando Sahmkow dc5cfa8d28 Shader_IR: Address Feedback 5 years ago
Fernando Sahmkow c921e496eb GPU: Implement guest driver profile and deduce texture handler sizes. 5 years ago
ReinUsesLisp 096f339a2a video_core: Silence implicit conversion warnings 5 years ago
Fernando Sahmkow be856a38d6 Shader_IR: Address Feedback. 6 years ago
ReinUsesLisp 7b81ba4d8a gl_shader_decompiler: Move entries to a separate function 6 years ago
Fernando Sahmkow 8909f52166 Shader_IR: Implement Fast BRX and allow multi-branches in the CFG. 6 years ago
Fernando Sahmkow acd6441134 Shader_Cache: setup connection of ConstBufferLocker 6 years ago
Fernando Sahmkow e6eae4b815 Shader_ir: Address feedback 6 years ago
Fernando Sahmkow 47e4f6a52c Shader_Ir: Refactor Decompilation process and allow multiple decompilation modes. 6 years ago
Fernando Sahmkow 38fc995f6c gl_shader_decompiler: Implement AST decompiling 6 years ago
Fernando Sahmkow 6fdd501113 shader_ir: Declare Manager and pass it to appropiate programs. 6 years ago
ReinUsesLisp 4e35177e23 shader_ir: Implement VOTE
Implement VOTE using Nvidia's intrinsics. Documentation about these can
be found here
https://developer.nvidia.com/reading-between-threads-shader-intrinsics

Instead of using portable ARB instructions I opted to use Nvidia
intrinsics because these are the closest we have to how Tegra X1
hardware renders.

To stub VOTE on non-Nvidia drivers (including nouveau) this commit
simulates a GPU with a warp size of one, returning what is meaningful
for the instruction being emulated:

* anyThreadNV(value) -> value
* allThreadsNV(value) -> value
* allThreadsEqualNV(value) -> true

ballotARB, also known as "uint64_t(activeThreadsNV())", emits

VOTE.ANY Rd, PT, PT;

on nouveau's compiler. This doesn't match exactly to Nvidia's code

VOTE.ALL Rd, PT, PT;

Which is emulated with activeThreadsNV() by this commit. In theory this
shouldn't really matter since .ANY, .ALL and .EQ affect the predicates
(set to PT on those cases) and not the registers.
6 years ago
Lioncash 1109db86b7 video_core/shader/decode: Prevent sign-conversion warnings
Makes it explicit that the conversions here are intentional.
6 years ago
Lioncash bebbdc2067 shader_ir: std::move Node instance where applicable
These are std::shared_ptr instances underneath the hood, which means
copying them isn't as cheap as a regular pointer. Particularly so on
weakly-ordered systems.

This avoids atomic reference count increments and decrements where they
aren't necessary for the core set of operations.
6 years ago
Fernando Sahmkow f2549739d1 shader_ir: Add comments on missing instruction.
Also shows Nvidia's address space on comments.
6 years ago
Fernando Sahmkow 2de7649311 shader_ir: limit explorastion to best known program size. 6 years ago
Fernando Sahmkow 34357b110c shader_ir: Correct parsing of scheduling instructions and correct sizing 6 years ago
Fernando Sahmkow cfb3db1a32 shader_ir: Correct max sizing 6 years ago
Fernando Sahmkow d45fed3030 shader_ir: Remove unnecessary constructors and use optional for ScanFlow result 6 years ago
Fernando Sahmkow 01b21ee1e8 shader_ir: Corrections, documenting and asserting control_flow 6 years ago
Fernando Sahmkow d5533b440c shader_ir: Unify blocks in decompiled shaders. 6 years ago
Fernando Sahmkow 926b80102f shader_ir: Decompile Flow Stack 6 years ago
Fernando Sahmkow 459fce3a8f shader_ir: propagate shader size to the IR 6 years ago
Fernando Sahmkow c218ae4b02 shader_ir: Remove the old scanner. 6 years ago
Fernando Sahmkow 8af6e6a052 shader_ir: Implement a new shader scanner 6 years ago
ReinUsesLisp 06c4ce8645 shader: Decode SUST and implement backing image functionality 6 years ago
ReinUsesLisp bf4dfb3ad4 shader: Use shared_ptr to store nodes and move initialization to file
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.
6 years ago
ReinUsesLisp fbe8d1ceaa video_core: Silent -Wswitch warnings 6 years ago
ReinUsesLisp 48e6f77c03 shader/decode: Split memory and texture instructions decoding 6 years ago
ReinUsesLisp 42b75e8be8 shader_ir: Rename BasicBlock to NodeBlock
It's not always used as a basic block. Rename it for consistency.
6 years ago
ReinUsesLisp 6a6fabea58 shader_ir: Pass decoded nodes as a whole instead of per basic blocks
Some games call LDG at the top of a basic block, making the tracking
heuristic to fail. This commit lets the heuristic the decoded nodes as a
whole instead of per basic blocks.

This may lead to some false positives but allows it the heuristic to
track cases it previously couldn't.
6 years ago
Lioncash 3e1a9a45a6 shader/decode: Avoid a pessimizing std::move within DecodeRange()
std::moveing a local variable in a return statement has the potential to
prevent copy elision from occurring, so this can just be converted into
a regular return.
6 years ago
ReinUsesLisp 170c8212bb shader_ir: Pass to decoder functions basic block's code 6 years ago
ReinUsesLisp a1b845b651 shader_decode: Implement VMAD and VSETP 6 years ago
ReinUsesLisp 21aff36459 video_core: Address feedback 6 years ago
ReinUsesLisp 59b34b1d76 shader_ir: Fixup file inclusions and clang-format 6 years ago
ReinUsesLisp 15a0e1481d shader_ir: Initial implementation 6 years ago