Lioncash
382717172e
shader_ir: Use std::array with pair instead of unordered_map
Given the overall size of the maps are very small, we can use arrays of
pairs here instead of always heap allocating a new map every time the
functions are called. Given the small size of the maps, the difference
in container lookups are negligible, especially given the entries are
already sorted.
6 years ago
Lioncash
1f5401c89c
video_core/shader: Resolve instances of variable shadowing
Silences a few -Wshadow warnings.
6 years ago
Fernando Sahmkow
1509d2ffbd
Shader_Ir: Fix TLD4S from using a component mask.
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.
6 years ago
ReinUsesLisp
1ea07954fb
shader_ir/memory: Ignore global memory when tracking fails
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.
6 years ago
Lioncash
074b38b7a9
video_core/shader/ast: Make ShowCurrentState() and SanityCheck() const member functions
These can also trivially be made const member functions, with the
addition of a few consts.
6 years ago
Lioncash
222f4b45eb
video_core/shader/ast: Make ASTManager::Print a const member function
Given all visiting functions never modify the nodes, we can trivially
make this a const member function.
6 years ago
Lioncash
7831e86c34
video_core/shader/ast: Make ExprPrinter members private
This member already has an accessor, so there's no need for it to be
public.
6 years ago
Lioncash
a2eccbf075
video_core/shader/ast: Make Indent() return a string_view
The returned string is simply a substring of our constexpr tabs
string_view, so we can just use a string_view here as well, since the
original string_view is guaranteed to always exist.
Now the function is fully non-allocating.
6 years ago
Lioncash
15d177a6ac
video_core/shader/ast: Make Indent() private
It's never used outside of this class, so we can narrow its scope down.
6 years ago
Lioncash
7f6a8a33d4
video_core/shader/ast: Rename Ident() to Indent()
This can be confusing, given "ident" is generally used as a shorthand
for "identifier".
6 years ago
Lioncash
081530686c
video_core/shader/ast: Make use of fmt where applicable
Makes a few strings nicer to read and also eliminates a bit of string
churn with operator+.
6 years ago
Lioncash
77b4916b33
control_flow: Silence truncation warnings
This can be trivially fixed by making the input size a size_t.
CFGRebuildState's constructor parameter is already a std::size_t, so
this just makes the size type fully conform with it.
6 years ago
Lioncash
67658dd6e8
shader/node: std::move Meta instance within OperationNode constructor
Allows usages of the constructor to avoid an unnecessary copy.
6 years ago
ReinUsesLisp
3d0f357307
shader/half_set_predicate: Fix HSETP2 for constant buffers
HSETP2 when used with a constant buffer parses the second operand type
as F32. This is not configurable.
6 years ago
ReinUsesLisp
632c9e4ee3
shader/half_set_predicate: Reduce DEBUG_ASSERT to LOG_DEBUG
6 years ago
Lioncash
f883cd4f0e
video_core/control_flow: Eliminate variable shadowing warnings
6 years ago
Lioncash
25702b6256
video_core/control_flow: Eliminate pessimizing moves
These can inhibit the ability of a compiler to perform RVO.
6 years ago
Lioncash
d82b181d44
video_core/ast: Unindent most of IsFullyDecompiled() by one level
6 years ago
Lioncash
6c41d1cd7e
video_core/ast: Make ShowCurrentState() take a string_view instead of std::string
Allows the function to be non-allocating in terms of the output string.
6 years ago
Lioncash
3c54edae24
video_core/ast: Eliminate variable shadowing warnings
6 years ago
Lioncash
5a0a9c7449
video_core/ast: Replace std::string with a constexpr std::string_view
Same behavior, but without the need to heap allocate
6 years ago
Lioncash
3a20d9734f
video_core/ast: Default the move constructor and assignment operator
This is behaviorally equivalent and also fixes a bug where some members
weren't being moved over.
6 years ago
Lioncash
43503a69bf
video_core/{ast, expr}: Organize forward declaration
Keeps them alphabetically sorted for readability.
6 years ago
Lioncash
50ad745585
video_core/expr: Supply operator!= along with operator==
Provides logical symmetry to the interface.
6 years ago
Lioncash
8eb1398f8d
video_core/{ast, expr}: Use std::move where applicable
Avoids unnecessary atomic reference count increments and decrements.
6 years ago
Lioncash
8e0c80f269
video_core/ast: Supply const accessors for data where applicable
Provides const equivalents of data accessors for use within const
contexts.
6 years ago
Fernando Sahmkow
e6eae4b815
Shader_ir: Address feedback
6 years ago
Fernando Sahmkow
3c09d9abe6
Shader_Ir: Address Feedback and clang format.
6 years ago
Fernando Sahmkow
7c756baa77
Shader_IR: clean up AST handling and add documentation.
6 years ago
Fernando Sahmkow
5ea740beb5
Shader_IR: Correct OutwardMoves for Ifs
6 years ago
Fernando Sahmkow
b3c46d6948
Shader_IR: corrections and clang-format
6 years ago
Fernando Sahmkow
2e9a810423
Shader_IR: allow else derivation to be optional.
6 years ago
Fernando Sahmkow
ca9901867e
vk_shader_compiler: Implement the decompiler in SPIR-V
6 years ago
Fernando Sahmkow
0366c18d87
Shader_IR: mark labels as unused for partial decompile.
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
7 years ago
Fernando Sahmkow
6fdd501113
shader_ir: Declare Manager and pass it to appropiate programs.
7 years ago
Fernando Sahmkow
8be6e1c522
shader_ir: Corrections to outward movements and misc stuffs
7 years ago
Fernando Sahmkow
4fde66e609
shader_ir: Add basic goto elimination
7 years ago
Fernando Sahmkow
c17953978b
shader_ir: Initial Decompile Setup
7 years ago
ReinUsesLisp
44000971e2
gl_shader_decompiler: Use uint for images and fix SUATOM
In the process remove implementation of SUATOM.MIN and SUATOM.MAX as
these require a distinction between U32 and S32. These have to be
implemented with imageCompSwap loop.
6 years ago
ReinUsesLisp
675f23aedc
shader/image: Implement SULD and remove irrelevant code
* Implement SULD as float.
* Remove conditional declaration of GL_ARB_shader_viewport_layer_array.
6 years ago
Fernando Sahmkow
527b841c15
Shader_IR: ICMP corrections and fixes
6 years ago
Fernando Sahmkow
4b81d19a1a
Shader_IR: Implement ICMP.
6 years ago
Fernando Sahmkow
7606da5611
VideoCore: Corrections to the MME Inliner and removal of hacky instance management.
6 years ago
ReinUsesLisp
0526bf1895
shader_ir/warp: Implement SHFL
6 years ago
ReinUsesLisp
36abf67e79
shader/image: Implement SUATOM and fix SUST
7 years ago
ReinUsesLisp
1f43e5296f
gl_shader_decompiler: Keep track of written images and mark them as modified
6 years ago
ReinUsesLisp
3a450c1395
kepler_compute: Implement texture queries
7 years ago
ReinUsesLisp
4de04eba39
shader_ir: Implement LD_S
Loads from shared memory.
7 years ago