Commit graph

88 commits

Author SHA1 Message Date
kd-11 4b79ef1ad9 rsx: Implement stencil mirror views
- Implements a mirror view of D24S8 data that accesses the stencil components.
  Finishes the implementation of TEX2D_DEPTH_RGBA as the stencil component was previously missing from the reconstructed data
- Add a few missing destructors
  Image classes are inherited a lot and I forgot to make the dtors virtual
2018-12-24 09:05:19 +03:00
kd-11 1ad76ad331 rsx: Restructure programs
- Also re-enable pipeline optimizations
2018-11-30 23:51:25 +03:00
scribam d7bb59cd99 c++17: use std::size 2018-09-06 13:15:59 +03:00
eladash f349695a75 Rsx: rewrite address translation 2018-08-13 16:16:34 +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 321c360dcb rsx: Overhaul rendertarget sampling/shuffles
- Reimplements render target views used for sampling
- Optimizes access using an encoded control token
- Adds proper encoding for 24-bit textures (DRGB8 -> ORGB/OBGR)
- Adds proper encoding for ABGR textures (ABGR8 -> ARGB8)
- Silence some compiler warnings as well
- TODO: Real texture views for OGL current method is a hack
2018-03-25 13:31:06 +03:00
kd-11 9fc1740608 rsx/fp: Fragment program overhaul
- Separate TXB from TXL: They are completely different!
- Properly perform TMU emulation in the fragment shader. Implemens SRGB conversion and alphakill at the moment
- Properly perform ROP emulation in the fragment shader. Implements FRAMEBUFFER_SRGB. While support on the chip looks to be incomplete (and wierd), it does work
- Document some more bits in SHADER_CONTROL register
2018-03-25 13:31:06 +03:00
kd-11 4804efc17d rsx: Clear up confusion on depth writes.
According to the NV_fragment_program spec, its not feasible to have 16-bit depth wries
 NOTE: NV_fragement_program precedes NV_fragment_program2 which is very
 close to what RSX consumes. It is hardware from that era afterall
2018-03-13 18:55:03 +03:00
Jake 3a9428a88e rsx: Fix alpha test on VK/GL
Moving alpha test outside of fp_main. This enforces alpha test is still done even if shader asm has early return
2018-03-09 18:06:20 +03: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 320fb5f94c rsx/fp: Fix alphakill 2017-12-22 20:08:14 +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 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 1fa18757fc rsx: Implement render-to-cubemap; Also simplify unnormalized samplers [WIP, DELETE SHADER CACHE, VERY SLOW]
- Enables real-time cubemap reflections
- TODO: Vulkan is broke; rsx is very slow with this feature
2017-11-08 13:15:34 +03:00
kd-11 fbb7186e66 rsx/gl: Addendum - Fix fragment shader to consume texture scale parameters 2017-11-08 13:15:34 +03:00
kd-11 12ab03b0b5 rsx/gl: Implement resolution scaling
rsx: Revise wpos calculation to take resolution scale into account
2017-10-09 20:25:41 +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 73312fc363 rsx: Several fixes and improvements
- Do not ignore non-centered pixel blitting
- Register method ac00+16
- Bump texture memory heap to account for GPU texture scaling requirements (vulkan)
- Explicit MRT location index output to better convey intent (openGL)
2017-09-21 16:17:06 +03:00
kd-11 f71f67c4ff rsx: Make fragment state dynamic to reduce shader permutations 2017-08-26 21:53:54 +03:00
kd-11 6a707f515e vk/gl: Factorize shared GLSL code
- prep vulkan for shared glsl backend
2017-08-16 23:58:30 +03:00
kd-11 a69f19a9ab rsx/decompilers: Avoid std::endl like the plague. It adds extra processing overhead 2017-06-29 13:13:19 +03:00
kd-11 b2e906f4cc rsx: Code cleanup. Fixes several dozen warnings
- Wrap unused parameters as comments to prevent C1400
- Fix sized variable conversions with explicit casts
2017-06-22 23:36:15 +03:00
kd-11 110974af0b vk/gl: Fix sampling of shadow2D textures 2017-06-22 23:36:15 +03:00
kd-11 6a9eef0382 rsx/gl/vk: Enable use of native PCF shadows 2017-06-22 23:36:15 +03:00
shameful e93c4c42b6 fix for shader fog mode exponential2_abs (#2781)
* Update VKFragmentProgram.cpp

added missing exponent parameter

* fixed misplaced exponent in VKFragmentProgram.cpp

parameter that belonged to pow() was being passed to exp() instead, causing the shader compilation to fail

* fix for opengl fog_mode exponential2

same fix as the vulkan version

* directx fog_mode exponential2 fix

misplaced parameter

* directx fog_mode exponential2_abs fix

* vulkan fog_mode exponential2_abs fix

* opengl fog_mode exponential2 fix
2017-05-14 12:56:24 +08:00
kd-11 8fa3f0721e fix false alphakill flags when texture fetch is optimized away 2017-03-24 09:30:23 +03:00
kd-11 be4bb48476 rsx/fp: Fix some decompiler bugs 2017-03-13 23:40:34 +03:00
kd-11 d6159a35aa gl/vk/dx12: Fix texture scaling on unnormalized rtt access 2017-02-11 15:45:59 +03:00
kd-11 38562155d4 gl/vk: Flip wpos if origin != top 2016-09-28 07:22:45 +08:00
raven02 528b2d6c7b GL/Vulkan: not discard fragment when hits NEVER comparsion (#2156)
GL/Vulkan: return no operation when comparison is never
2016-09-26 21:59:38 +08:00
kd-11 7884356e90 gl/vk: Bug fixes and improvements (#2155)
* gl: Fix broken buffer reserve computation

* gl: Texture format fixes

* gl: Two sided lighting

* gl: Always update glsl output registers

* gl: Simplify vertex input declaration

* vk: Always write output registers

* vk/gl: swizzle component read on depth textures

* gl/vk: Use proper MVP matrix

gl: fix broken mvp when window_origin=top

* vk/gl: Move fragment operations block into the proxy function
2016-09-26 20:21:17 +08:00
kd-11 0d207a6c0d GL/Vulkan: Bug fixes and improvements; alphakill for vulkan (#2146)
* vk: Zero-initialize some more structs

* gl: Clean up fragment program generation code

* vk: Enable alpha kill

* vk: Fix surface clear; redirect output for surface_type:b

* vk: Tie renderpass to program object to avoid incompatible passes
2016-09-21 21:41:29 +08:00
kd-11 867e9210d7 gl/vk: Enable vertex texture fetch (#2127)
* gl: Enable vertex textures

* rsx: use textureLod instead of generic texture sample

* rsx: handle uploading of W32_X32_Y32_Z32

* gl: Re-enable proper shader logging

remove old logging method that overwrites single file

* gl: Declare texture_coord_scale for vertex samplers

* gl: texture remap fixes; enable remap for vertex textures

* gl: offset texture indices to base layer 16

* rsx: Fix W32_Z32_Y32_X32_FLOAT subresource layout

* vk: Enable vertex textures

* rsx: define special calls for vertex texture fetch

* gl: improved vertex texture fetch setup

* vk: Fix texture formats and component mapping

* vk: Implement vertex texture fetch functions properly

* vk/gl: proper fix for primitive restart index

revert inadvertent decompiler update

* gl: Disable filtering for vertex textures
2016-09-20 22:23:56 +08:00
Oil 153a2d2b40 Fixed fog and alphakill implementation in glsl (based on DH's old commits) (#2137)
* Fixed NV4097_SET_COLOR_CLEAR_VALUE

* Fixed fog and alphakill implementation in glsl (based on DH's old commits)
2016-09-14 22:47:53 +08:00
raven02 bb66b97251 GL: minor fixes (#2105)
* Minor fixes

* temporary disable 2-sided lighting

* Disable user clip planes until they are properly handled
2016-08-27 14:12:44 +08:00
raven02 6e07e07cd0 GL: enable 2-sided lighting (#2103) 2016-08-27 00:26:23 +08:00
Nekotekina cc46f2d7e6 LOG macro improved 2016-08-15 00:04:42 +03:00
Nekotekina ceb4cb59ac Typo fix: comparaison->comparison 2016-07-19 14:17:25 +03:00
kd-11 c4102f3b18 vk/gl: Enable alpha test in shaders (#1743) 2016-06-05 20:31:23 +03:00
Ivan 75fe95eeb1 GSL moved from stdafx.h (#1676)
Added GSL.h helper for correct including
2016-04-20 02:32:27 +03:00
Vincent Lejeune 17c4b2387e gl: Fix unnormalized coord sampling. 2016-03-31 00:12:41 +02:00
Vincent Lejeune 1dcc6858b4 d3d12/gl: Separate fog distance and fog frag in fogc input. 2016-03-05 18:25:31 +01:00
kd-11 8d3235cd7c Properly set up fog parameters for openGL 2016-03-03 01:07:53 +03:00
Vincent Lejeune 32434dd848 rsx/common/d3d12/gl: Support for fog mode.
Fix hitman 2
2016-02-29 16:31:18 +01:00
Vincent Lejeune 62246f75c8 d3d12/gl: Supports SSA in Fragment Shader. 2016-02-27 00:21:10 +01:00
Vincent Lejeune 1f7a1e4078 rsx/common/d3d12/gl: Fix lit and rsq behavior near 0 in vertex shaders. 2016-02-08 17:35:49 +01:00
kd-11 ddf5b52360 Implement rectangle textures natively on OpenGL 2016-02-07 08:57:04 +03:00
Vincent Lejeune 6aac972bda d3d12/gl: Use r1 as depth output.
The "Output_from_h0" flag seems to concern color output.
There might be another flag for depth from half float value.
2016-01-19 00:45:26 +01:00