Commit graph

2916 commits

Author SHA1 Message Date
kd-11 2086e7f2e8 rsx: Account for subpixel precision when converting DST coordinates to
SRC coordinates

- When extracting a 1x1 texture from another texture of a different
  format, width conversion can result in a dimension of 0 if the
extracted texel is not a full texel in SRC
2020-06-17 22:18:47 +03:00
kd-11 c764925b4d rsx: Properly handle conversion of G8B8 and related formats
- These formats are 16-bit packed, not separate 8-bit channels. Conversion requires byteswap for them.
2020-06-16 22:36:38 +03:00
kd-11 83d818d96f rsx: Improve mipmap gathering
- Account for source offsets when grabbing subregions
- Scale input accordingly when sourcing from fbo in all paths
2020-06-16 19:12:03 +03:00
sampletext32 0ad4e91001 Avoid string reallocation in swizzle CgBinaryProgram 2020-06-15 22:26:49 +03:00
kd-11 8d8fb4a2e4 rsx: Remove ARGB->D24S8 conversion shader which has been deprecated for years since compute capabilities were added to the emulator 2020-06-15 14:18:12 +03:00
kd-11 2e737ad483 rsx: Fix surface option invalidation
- Depth buffers can be in special "read" state when writes are disabled. Account for this.
2020-06-14 23:30:03 +03:00
Eladash e2248332ae rsx: Make "Disable ZCull Occlusion" setting dynamic 2020-06-14 18:45:46 +01:00
kd-11 3663a8ab4d rsx: Improve surface options invalidation 2020-06-14 20:13:12 +03:00
Eladash bd6fdf3f2d rsx: Optimize rsx::rsx_iomap_table construction 2020-06-12 22:40:58 +03:00
kd-11 e1183f6919 gl: Fix depth buffer byteswap hint
- uint24_8 is not actually swapped, it is decoded in a special way
2020-06-12 20:49:47 +03:00
kd-11 f4ec28d932 rsx: Merge instruction expand flag with the other sign expand flags
- Avoids double expansion when both the exp_tex flag is set AND the texture also is sampled as signed
- Should fix missing eyeballs in Mass Effect 1 with the previous sign expansion fix
2020-06-12 20:19:20 +03:00
kd-11 ce587f43a0 rsx: Implement signed normalized texture formats
- Already partially supported via EXP option in the shader opcode, but format decoding was disabled.
- Noticed in some UE3 games which use _SNORM variants on PC but _UNORM on rpcs3
2020-06-12 20:19:20 +03:00
kd-11 ebbf329b6a gl: Improve async compiler synchronization with initialization
- On multithreaded mesa, the program initialization routine was not
  being flushed correctly. Set up synchronization fence after initialization
is complete.
2020-06-07 12:54:34 +03:00
kd-11 87cc937d4e rsx/fp: Separate SRC precision modifiers
- SRC0, SRC1 and SRC2 have different bits for precision modifiers all stored inside SRC1
- This explains the strange observed behavior of the MAD instruction which has 3 inputs
2020-06-07 12:07:27 +03:00
kd-11 d47d597b34 vk: Make the depth-convert pass multisample aware 2020-06-05 17:19:24 +03:00
kd-11 69c2150fbd vk: Fix query reset when renderpass is active
- Performs delayed query reset on-demand
2020-06-05 17:19:24 +03:00
kd-11 650152e05f rsx: Fix fragment state updates
- Fix copypasta for POLYGON_STIPPLE_PATTERN vs SET_POLYGON_STIPPLE method binding
- Use proper enums for ROP_control bits to avoid confusion
2020-06-03 22:05:33 +03:00
kd-11 73fe9b51de rsx/fp: Ignore self-referencing register writes.
- Sometimes, usually with shaders that do pack/unpack operations, there is a write-to-self operation.
  For example r0.xy = r0.xy
  Obviously no new data was introduced into "r0" by this, so we should not mark the register as having new data.

- TODO: Investigate on realhw if self-reference is needed to "cast" the overlapping half registers to their full register counterparts.
2020-06-03 09:45:02 +03:00
kd-11 26b2e4253d rsx: Properly account for memory sizes of reused surfaces 2020-06-02 21:37:57 +03:00
kd-11 b353bf6c56 rsx: Improve surface cache resource management
- Do not allocate too many objects. This is a problem in games using dynamic memory allocators that can make it rare for a surface to fall on the same address twice, keeping zombie RTVs and DSVs alive much longer than needed.
- Current limit used is 256M of virtual VRAM which is impossible on retail PS3
2020-06-01 22:24:27 +03:00
kd-11 c9a978a03e Typo fix
Co-authored-by: Megamouse <studienricky89@googlemail.com>
2020-05-30 14:47:10 +03:00
kd-11 59d44cd1cc gl: Fix shader logging 2020-05-30 14:47:10 +03:00
kd-11 542a6aed51 rsx: Add stippled rendering support to interpreters 2020-05-30 14:47:10 +03:00
kd-11 1677618c75 rsx: Implement stippled rendering 2020-05-30 14:47:10 +03:00
Eladash 3d20ce70f5 rsx: Fix possible case NULL zcull_ctrl in on_exit() 2020-05-28 11:56:02 +02:00
xddxd f56b362769
rsx: Copypasta fix (#8289) 2020-05-25 20:07:11 +01:00
kd-11 224a0e4b1a rsx: Fix data format remapping
- Includes missing 0xEE and 0x44 variants of the 2-component data format remapper
2020-05-24 13:51:19 +03:00
kd-11 bd41a108d8 nv3089: Account for subpixel addressing
- Those strange offsets noted in some games seem to match to subpixel addressing.
  For example, when scaling down by a factor of 4, a pixel offset of 2 will end up inside pixel 0 of the output
2020-05-24 11:31:37 +03:00
kd-11 7080305d82 vk: Implement masked stencil buffer clears
- Partial stencil buffer clears were not implemented. This is for example where a game can choose to clear only some bits from the stencil buffer.
- Vulkan does not support masked stencil clears natively, it has to be implemented as a graphics operation.
- Also refactors vulkan overlay passes to use global resource system instead of forcing the render backend to own all of them and manage lifetimes.
2020-05-21 19:27:23 +03:00
Nekotekina 72fedccaba rsx_utils.h: fix signed/unsigned comparison 2020-05-18 00:51:57 +03:00
Ani 581176fb1a gl: Restrict insert_vertex_input_fetch workaround to Intel proprietary
It works fine on Mesa iris
Fixes detection of Mesa as recent Mesa does not have "x.org" on vendor string, allowing vendor_MESA to become true instead of vendor_INTEL on Mesa Intel
2020-05-17 17:49:14 +03:00
Eladash 377e2ce3e8
rsx: Write 4-byte long data to all semaphores (#8246)
* rsx: Write 4-byte long data to all semaphores
2020-05-17 17:48:35 +03:00
kd-11 37df3c6f96 rsx/fp: Fix precision clamping on MAD instruction 2020-05-17 09:11:26 +03:00
AniLeo a8bca8b2ed gl: Only log shaders if g_cfg.video.log_programs is enabled 2020-05-16 16:16:17 +01: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
Ani 661636efef gl: Check for EXT_depth_bounds_test
Avoid glEnable/glDisable GL_DEPTH_BOUNDS_TEST_EXT flood that returns 
GL_INVALID_ENUM if the feature isn't supported
2020-05-16 14:50:05 +01:00
AniLeo 99f5145aab glsl: Avoid implicit int->uint conversions
Silences debug output regarding implicit int -> uint conversions
2020-05-16 11:45:59 +01:00
Eladash 8a0425570c
rsx: Fix data written to RSX semaphores and the initial data of them (#8235) 2020-05-16 09:55:56 +01:00
AniLeo eecb22e749 gl: Remove older debug code
KHR_DEBUG path makes this obsolete, usage of this older path has been 
removed a long time ago
2020-05-16 08:29:00 +01:00
AniLeo 3ad12cf5f8 gl: Avoid issuing glDelete calls with m_id == GL_NONE
Applies GL_NONE macro usage where it makes sense
2020-05-16 08:29:00 +01:00
AniLeo 308cdfac35 gl: Rewrite Debug Output
Remove Windows restriction, enable Debug Output for every supported OS
Filter our severity by Khronos severity
Handle and log source and type enums
2020-05-16 08:29:00 +01:00
Nekotekina 7824419bbf Remove std::rotr usage for now
It seems to be missing on some std implementations.
2020-05-14 21:42:44 +03:00
Mrlinkwii c22d778143
Spelling fix in texture_cache.h (#8219)
heurestic_end -> heuristic_end
2020-05-14 21:42:21 +03:00
kd-11 310f367fb1
rsx: Improve blit engine memory validation (#8215)
- In blit engine logic there is a tendancy to over-allocate so as to avoid having to sticth together textures later
- Sometimes this can lead to out of bounds access and crash applications, so memory must be validated
2020-05-14 12:57:58 +01:00
kd-11 cc723ed45c vk: Properly fix dynamic state descriptors 2020-05-13 22:20:43 +03:00
kd-11 ed82288c1b rsx/fp: Support more types of texture access
- Allows more instructions to correctly decode depth textures
2020-05-13 22:20:43 +03:00
kd-11 118bfbbe98 rsx: Rewrite data texture remap expansion
- 16-bit channel formats have special 0x4|0xE encoding for only 2 channels, not 4
- float textures do not take any remapping and crash if you try it.
  Depth float textures work fine though.
2020-05-13 14:33:22 +03:00
JohnHolmesII 69ea573b0d
vk: Remove more deprecated VK_DYNAMIC_STATE_RANGE_SIZE usage (#8206) 2020-05-13 02:52:01 +01:00
kd-11 dd9397473a
vk: Remove deprecated enum VK_DYNAMIC_STATE_RANGE_SIZE (#8202) 2020-05-12 22:36:55 +01:00