Commit graph

108 commits

Author SHA1 Message Date
kd-11 e236ba4daf rsx: Improve lowered precision comparison emulation 2022-04-28 01:31:07 +03:00
kd-11 de0e660d28 rsx: Handle vertex shaders with no constant references
- If no vc[] refs exist, do not upload anything!
2022-03-26 16:10:18 +03:00
kd-11 d057ffe80f rsx: Fix program generation and compact referenced data blocks 2022-03-26 16:10:18 +03:00
kd-11 9a2d4fe46b rsx: Relocatable transform constants 2022-03-26 16:10:18 +03:00
kd-11 56dd09f4fe rsx: Handle floating point shenanigans
- If near and far clip are too close together, the API will not distinguish between them leading to out of bounds values
2021-12-22 22:08:53 +03:00
kd-11 de495952fd rsx: Enable fallback for devices without wide integer Z buffers 2021-12-22 22:08:53 +03:00
kd-11 c5a06dab0a rsx: Refactor program texture state handling to be persistent across shader swaps 2021-05-15 23:51:12 +03:00
Nekotekina 87af905018 Enable -Wunused-parameter 2021-03-06 18:07:08 +03:00
Nekotekina fb29933d3d Add usz alias for std::size_t 2020-12-18 12:23:53 +03:00
RipleyTom af8c661a64 Remove BOM markers 2020-12-06 15:30:12 +03:00
kd-11 7553429130 gl: Thread shader source compilation dispatch
- glCompileShader is in itself much slower than anticipated
2020-11-21 20:43:15 +03:00
kd-11 dc465df3bc rsx: Enable support for extended range in depth buffer
- Software clipping emulation is used here as OpenGL does not have explicit clip control.
- Hardware clip control for vulkan to be enabled after this.
2020-09-08 15:33:08 +03:00
AniLeo b0d3c4d75e gl: Refactor shader type usage
Use Common/GLSLTypes.h program_domain instead of duplicated own internal
type
2020-05-16 16:16:17 +01:00
AniLeo 3db2f23e02 gl: Refactor shader compilation 2020-05-16 16:16:17 +01:00
kd-11 0072df7f20 rsx/gl: Add basic interpreter support to OGL
- Adds basic interpreter functionality.
- Flow control and other instructions not yet implemented.
2020-04-30 15:02:59 +03:00
kd-11 2985a39d2e rsx: Rewrite async decompiler 2020-03-09 14:59:25 +03:00
Eladash 8762f2a588 Use more starts_with 2020-02-29 13:06:14 +03:00
Nekotekina 15391f45d0 Modernize RSX logging (rsx_log variable) 2020-02-01 11:52:22 +03:00
kd-11 bcf8799079 rsx: Fix missing point size export
- Sometimes program-point-size is enabled, but the vs does not actually
write to the point size register. In this case, pass the incoming point
size along instead of the default register init.
2019-09-30 01:40:04 +03:00
kd-11 28534e8833 gl: Remove a debug print 2019-09-28 13:24:14 +03:00
kd-11 eed32cf3a4 rsx: Decompiler fixups and improvements
- Fix 2D coordinate sampling of W coordinate.
  W is actually HPOS.w and not 1. Z is however always 0.
- Optimize register usage a bit
  Disassembling compiled SPV shows that global declaration results in less ops than using inout modifiers. Modifiers generate extra mov instructions.
2019-08-26 20:03:31 +03:00
kd-11 3e28e4b1e0 rsx/decompiler: Restructure program register behavior
- Fix reading of varying registers in FP
  Different registers have different behavior
- Always write to varying registers. If a register is not written to, it is initialized to (0, 0, 0, 1)
- Reimplements two-sided lighting correctly without hacks
- Also bumps shader cache version
2019-08-26 20:03:31 +03:00
kd-11 6be7c58fa4 glsl: Refactoring, cleanup and optimizations
- Avoid generating unused code
- Reduce GPR usage in emitted code
2019-06-25 20:50:54 +03:00
Lassi Hämäläinen c963c51a60 Remove unnecessary header includes
- Manually removed lot of unneeded #includes to clean code and reduce
  compilation time
- Reordered some of the #includes to be in more logical order
2019-06-25 17:11:10 +03:00
scribam 44265aa27d rsx: Apply Clang-Tidy fix "modernize-use-equals-default" 2019-06-12 15:11:52 +03:00
scribam 635695ac78 rsx: Apply Clang-Tidy fix "modernize-use-emplace" 2019-06-12 15:11:52 +03:00
scribam 8f2647555a rsx: Apply Clang-Tidy fix "readability-redundant-string-init" 2019-06-12 15:11:52 +03:00
scribam 331fe01762 rsx: Apply Clang-Tidy fix "performance-for-range-copy" 2019-06-12 15:11:52 +03:00
scribam c4667133c4 gl/vk: Add constexpr to varying_registers and sync functions between the two backends 2019-06-12 10:59:31 +01:00
msuih ef587d4cdc Limit shaderlog writing behind log_programs setting 2019-05-31 19:49:32 +03:00
kd-11 60f3059d22 rsx: Compensate for nvidia's low precision attribute interpolation
- The hw generates inaccurate values when doing perspective-correct
  interpolation of vertex output attributes and makes the comparison (a ==
  b) fail even when they are a fixed constant value.
- Increase equality tolerance when doing comparisons in fragment
  shaders for NV cards only to work around this issue.
- Teepo fix
2019-04-25 16:23:05 +03:00
kd-11 417a2e6731 rsx: Refactor index buffers
- Index offset is ignored anyway and only used to calculate vertex attribute divisor index
- Specialized optimization for untouched xfer without primitive restart
2019-01-25 14:34:22 +03:00
Nekotekina bd9131ae1c Implement fs::get_cache_dir
Win32: equal to config dir for now
Linux: respect XDG_CACHE_HOME if specified
OSX: possibly incomplete
2019-01-13 14:45:36 +03:00
kd-11 7b065d7781 rsx: Fixup; input attributes blob decoding
- Use an unstructured blob and index into the vec4 structures to extract the real data
2018-11-30 23:51:25 +03:00
kd-11 1ad76ad331 rsx: Restructure programs
- Also re-enable pipeline optimizations
2018-11-30 23:51:25 +03:00
kd-11 fa55a8072c rsx: Improve vertex textures support
- Adds proper support for vertex textures, including dimensions other than 2D textures
- Minor analyser fixup, removes spurious 'analyser failed' errors
- Minor optimizations for program state tracking
2018-07-12 18:02:28 +03:00
kd-11 d78957d1cf rsx/vp: CodeGen improvements
- Fix double destination writes on conditional write masking
- Fix codegen to simplify simple scalar comparisons vs vector functions
2018-07-07 16:20:33 +03:00
kd-11 2c34195954 rsx/vp: Discard broken vertex programs with no writes to POS register 2018-07-07 16:20:33 +03:00
eladash 3e433ef05c create the shaderlog dir in Emu.Init() 2018-06-21 22:54:08 +04:00
scribam 04ad49de4d typos 2018-05-14 21:14:39 +04:00
kd-11 33bcdd476c glsl/fp/vp: Avoid shader clutter
- Do not add unused subroutines in shaders unless necessary
-- makes shaders easier to read and disassembled spir-v has less clutter
- glsl: Replace switch block with lookup table
2018-01-30 21:16:43 +03:00
kd-11 0a2992839b rsx/gl/vk: Simulate z clipping with selective depth clamp
- The scale offset matrix is fine but on real hardware the z results seem to be independent of near/far clipping distances
-- If depth falls within near/far, clamp depth value to [0,1]
2018-01-19 12:03:57 +03:00
kd-11 b1a1c0251f rsx: Implement variable point size 2017-12-18 10:45:37 +03:00
kd-11 5cf2d774f3 fp32 precision on GPUs is embarassing
- Division seems to suffer from drift easily on GPUs due to limited precision
2017-12-01 21:00:50 +03:00
kd-11 4e9160104a rsx/vk/gl: Cleanup and refector glsl::getFunctionImpl
- Both backends now generate very similar code
2017-11-08 13:15:34 +03:00
yzwduck 2e5f8c0786 Rename outputs correctly when writing default values to them (#3574)
- Fix for undeclared variable errors
2017-10-11 01:50:43 +03:00
kd-11 571dbfb7b1 rsx: Texture cache improvements
- Limits buffer size to min 720 in the Y axis (1024 section causes conflicts in some cases - TODO)
rsx: Fixups to allow large textures for blit operation
- Also includes checks for both leaking sections and blit regions for vulkan
hotfix for hanging when using WCB
addendum - unlock both ro and no blocks before attempting to copy memory blocks
gl: Fixups for ARB_explicit_uniform_location
- Forces glsl v 430 to make use of the extension
rsx/vk: Rework texture cache to minimize recursive access violations
- Also modifies the vulkan commandbuffer begin/end/submit mechanism
gl: Fix cached_texture_section::is_flushable to take memory protection into account
rsx: Fix blit dst offset calculation
2017-09-21 16:17:06 +03:00
kd-11 07c83f6e44 gl: cleanup; fix program linkage on mesa using GL_ARB_explicit_uniform_location, also make use of ARB_multidraw 2017-09-21 16:17:06 +03:00
kd-11 650c1c64f1 gl: Workarounds for intel GPUs which dont seem to be truly GL4 compliant 2017-08-16 23:58:30 +03:00
kd-11 00b0311c86 rsx/gl/vulkan: Refactoring and partial vulkan rewrite
- Updates vulkan to use GPU vertex processing
- Rewrites vulkan to buffer entire frames and present when first available to avoid stalls
- Move more state into dynamic descriptors to reduce progam cache misses; Fix render pass conflicts before texture access
- Discards incomplete cb at destruction to avoid refs to destroyed objects
- Move set_viewport to the uninterruptible block before drawing in case cb is switched before we're ready
- Manage frame contexts separately for easier async frame management
- Avoid wasteful create-destroy cycles when sampling rtts
2017-08-16 23:58:30 +03:00