Commit graph

300 commits

Author SHA1 Message Date
kd-11 6828fbf658 rsx/texture_cache: Remove hacks; it has been proven that in offsets are in x16 fixed point 2018-01-19 12:03:57 +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
lewmpk d64e79bd9f fix clang warning: logical-op-parentheses 2017-12-31 22:08:17 +03:00
kd-11 1ea5e7404a rsx: Workaround for nvidia linux
- For some reason, using 1.E-x notation does not work on nvidia linux. Could be a bug in spir-v generator or the driver itself
2017-12-31 12:43:40 +03:00
kd-11 d6bc6ec2c1 rsx: fix initial swizzle ordering for render target data 2017-12-22 20:08:14 +03:00
kd-11 4a0c4259f0 c++ is hard
- Remove unnecessary const definitions
2017-12-22 20:08:14 +03:00
Nekotekina 61de20a633 RSX: remove SSSE3 dependency 2017-12-20 00:04:08 +03:00
kd-11 47060cdc5f rsx/fp: Fix typo 2017-12-18 10:45:37 +03:00
kd-11 7dd349ae8e Update FragmentProgramDecompiler.cpp 2017-12-18 10:45:37 +03:00
kd-11 4e80858bed rsx/fp: Hotfix for TEXBEM/TXPBEM 2017-12-18 10:45:37 +03:00
kd-11 e89a035e8b rsx/fp: Implement TXPBEM 2017-12-18 10:45:37 +03:00
kd-11 f7c52d3bb7 rsx/fp: Implement TEXBEM (untested) 2017-12-18 10:45:37 +03:00
kd-11 6f8dd20f03 rsx/fp: Stuff
- Implement BEM
- Add LG2 to special instructions
2017-12-18 10:45:37 +03:00
kd-11 6891323c18 rsx: framebuffer textures do not have mipmaps!
- Force mipmap count to 1 if sampling from an RTV/DSV
- TODO: Better wcb flush detection, it should be better to re-upload the texture after it has been dwnloaded if expected mipmaps are > 1
2017-12-18 10:45:37 +03:00
kd-11 7c7cd4153e rsx: Framebuffer setup fixes
- Sometimes square renders are done to surfaces with pitch=64 and re-uploaded with swizzle scanning
-- This setup avoids discarding targets if they are square and pitch == 64
2017-12-18 10:45:37 +03:00
kd-11 ff0f1510e5 rsx: Minor fixes
- Abort nv406e semaphore acquire if the rsx thread stalls/crashes
- Fix texture size approximation to take mipmaps into account. Fixes some games hanging with WCB
2017-12-18 10:45:37 +03:00
kd-11 3338fdb936 rsx: Fix RGB565 blits. Data is byteswapped on input
- Fixes messed up BG on retroarch glyphs
2017-12-18 10:45:37 +03:00
kd-11 6dfe32c6d2 fix linux builds 2017-12-18 10:45:37 +03:00
kd-11 95966a467e rsx: Texture cache fixes
- Handle blit resources in a more consistent way
- TODO: Handle some corner cases (piyotama)
2017-12-18 10:45:37 +03:00
kd-11 ac0022483a rsx: Implement delayed swizzle remap for blit engine resources
- Fixes remap vectors for memory copied via blit engine as it has no context
2017-12-18 10:45:37 +03:00
kd-11 0b3fbf1d4c rsx: Narrow the race condition window further
- Needs aliased paging to be implemented to fix properly or a re-entrant global IO lock
2017-12-06 12:55:49 +03:00
kd-11 a2b4cf22b5 rsx: Reimplement invalidate_range_base_impl
- Avoid unprotecting memory until just before we have to write the data
- Avoids race conditions where the caller thread takes too long to enter the second phase and another thread accesses the "bad" memory
2017-12-06 12:55:49 +03:00
kd-11 9853027f72 rsx/vp: Decide default return values in case of undefined attributes based on location ID
- Different default values should be returned for different attributes
2017-12-04 18:22:18 +03:00
kd-11 90c2324e47 rsx: Program cache fixes
- Reorganize storage hash vs ucode hash
- Scan for actual fragment program start in case leading NOPed code precedes the actual instructions
-- e.g FEAR2 Demo has over 32k of padding before actual program code that messes up hashes
2017-12-04 18:22:18 +03:00
kd-11 cdd4fd9867 rsx/fp: Explicitly insert global functions.
- Functions such as pack/unpack ops must exist before the shared gather functions are declared
2017-12-04 18:22:18 +03:00
kd-11 896c8991de rsx/fp: Properly implement PK/UP instructions based on NV_fragment_program documentation 2017-12-01 21:00:50 +03:00
kd-11 fe9090bd39 rsx/fp: Implement register gather (only for UP(X) instructions)
- Workaround for temp register aliasing between H and R variants
- TODO: Implement temp regs as 128 bit-blocks with r/w as pack/unpack
2017-12-01 21:00:50 +03:00
kd-11 a18ae0f6ac rsx/fp: Reimplement PK(X) and UP(X) opcodes. The read back values are obviously in normalized range
- Confirmed with a GOW shader which writes result of UP8 to BGRA8 output
2017-12-01 21:00:50 +03:00
kd-11 6c9c300fe0 rsx: Fix texture cache memory usage statistics 2017-12-01 21:00:50 +03:00
kd-11 ddebc334bf rsx: Fixes
- Discard intentionally invalidated framebuffer resources. These are created after a flush has happened, forcing reupload since contents cannot be guaranteed (strict mode only)
- Fix for blits using vulkan; dont use the copy method if formats do not match, use generic blit instead
2017-12-01 21:00:50 +03:00
kd-11 145ecb00fc rsx: Texture cache hotfixes 2017-12-01 21:00:50 +03:00
kd-11 4d75e98647 rsx/fp: Do not apply input mods to all types of inputs
- Temp registers are confirmed to be affected
- Const registers are confirmed to be unaffected
- Varying inputs are not confirmed yet
2017-12-01 21:00:50 +03:00
kd-11 de5a4fe083 rsx: Reimplement depth <-> RGBA reinterpretation code
- Implements proper channel order for fp24-ARGB8 conversion
- Takes swizzle remap into account when reconstructing source bytes
2017-12-01 21:00:50 +03:00
kd-11 33f3a3e014 rsx: Major fixes
- Handle aliased depth + color target by disabling depth writes. This looks to be the correct way
- Add support for generic passes that cannot be done using general imaging operations. Lays the framework for tons of features and effects
- Implement RGBA->D24D8 casting. Sometimes games will split depth texture into RGBA8 then use the new RGBA8 as a depth texture directly
-- This happens alot in ps3 games and I'm not sure why. Its likely the ps3 did not sample fp values with linear filtering so this is a workaround
-- Only implemented for openGL at the moment
-- Requires a workaround for an AMD driver bug
2017-12-01 21:00:50 +03:00
kd-11 0aaae000b3 rsx: Minor improvements 2017-12-01 21:00:50 +03:00
kd-11 db58cd7513 rsx: Invalidate both depth and color surfaces when binding a new surface 2017-12-01 21:00:50 +03:00
Zion Nimchuk 3a9ae2df9e silence warnings in RSX stuff 2017-11-30 18:07:19 +03:00
kd-11 df7d52b177 rsx/fp: Give abs higher prio as it invalidates any precision checks 2017-11-20 15:18:57 +03:00
kd-11 f5addbf751 rsx/fp: improve SRC modifier order
- Neg modifier is applied after clamping. Abs has not been tested/proven so precision clamp goes first now, not last
2017-11-20 15:18:57 +03:00
kd-11 a8c0dd649e rsx/fp: RE work on precision modifier bits
- Testing DS2 has revealed clamping bits in SRC1 that were not respected and left negative values reaching the framebuffer
2017-11-20 15:18:57 +03:00
kd-11 6d2dcbd164 rsx: Enable hw blit engine for local->main memory blit operations as well 2017-11-20 15:18:57 +03:00
kd-11 be6b5922dd rsx: research native texel byte order on cpu readback (WCB) [WIP] 2017-11-20 15:18:57 +03:00
kd-11 3c9126d91f rsx: Ignore FENCE instruction as it seems like its ignored on realhw
- This is likely a compiler hint for performance reasons and not a mandate
2017-11-09 14:39:50 +03:00
kd-11 ed21bb309f rsx: Minor fixups
- Fix texture cache blit behaviour when src has AA enabled and dst is a blit dst texture with or without AA
-- This requires handling AA resolve by removing a half downscale on multisampled axes

- Return all ones when a vertex attribute is disabled.
-- Some games forget to enable vertex attributes actually needed by the fs
2017-11-08 13:15:34 +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
kd-11 8733505d0a rsx: Minor fixes
- texture_cache: Fix internal size calculation for subresources
- vk: Delay dynamic state updates until just about to draw to ensure no flush has discarded the cb state
2017-11-08 13:15:34 +03:00
kd-11 baa5a261a5 rsx: Rewrite invalidate_range_impl_base in a way that makes sense. Fixes wcb hanging 2017-11-08 13:15:34 +03:00
kd-11 3730b9d1da rsx: More fixes
- Support for raster offsets in surface descriptors (looks to be unused)
- Do not tag disabled render targets when using MRT (pitch = 64)
- Add missing notify_surface_changed() call for openGL
2017-11-08 13:15:34 +03:00
kd-11 4ca98e53a6 rsx: Fix for unnormalized texture access 2017-11-08 13:15:34 +03:00
kd-11 300a36d3d6 rsx: Fixes for cubemap reconstruction
- Do not abort generation if sides are missing, replace with blank surfaces instead
- Make cubemaps scale with res scaling
2017-11-08 13:15:34 +03:00