Commit graph

78 commits

Author SHA1 Message Date
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
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 d54c2dd39a gl: Move vertex processing to the GPU
- Significant gains from greatly reduced CPU work
- Also reorders command submission in end() to improve throughput

- Refactors most of the vertex buffer handling
- All vertex processing is moved GPU side
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 6e578c4fde rsx: Initialize declared but unset varying variables to all ones 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 30f276a49b gl: Properly emulate signed normalized wide integers
Another fix for signed normalized formats; single component vectors are swizzled
2017-06-22 23:36:15 +03:00
kd-11 98cf72e0fb rsx: Fix clip space computations 2017-06-22 23:36:15 +03:00
kd-11 c26607de08 gl: Strict export of diff_color and spec_color for mesa compatibility (#2779)
* gl: Strict export of diff_color and spec_color for mesa compatibility

* gl: Relax the front_diff/spec rules a little
2017-05-14 11:50:24 +03:00
kd-11 7460bdfb1b gl: Use strict vertex output declaration for better compatibility with mesa 2017-05-12 20:10:03 +03:00
kd-11 c5975d5f66 rsx: Vertex program output fixes 2017-05-12 20:10:03 +03:00
Jake 60ce85f840 [Render] Userclip for d12/vk/ogl (#2719) 2017-04-25 18:32:39 +08:00
kd-11 9263999ad1 [rsx/vp] Improve BRB opcode implementation
fix merge issues
2017-02-26 10:17:34 +03:00
kd-11 d6159a35aa gl/vk/dx12: Fix texture scaling on unnormalized rtt access 2017-02-11 15:45:59 +03:00
O1L 6b48a72d42 GL: fixed user clip implementation 2017-01-23 23:49:17 +03:00
kd-11 2c803dbe66 gl/vk: Bug fixes and improvements (#2206)
* gl: Only bind attrib textures on thread startup

* gl: Persistent mapped buffers

* gl: Fix emulated primitives in an inlined array

* gl: Do not re-update program information every draw call

* gl/vk: s1 type is signed normalized not unsigned normalized

* gl/rsx: Allow disabling of persistent buffers for debugging

gl: Large heap size is more practical

gl: Fix a bug with legacy opengl buffers

* gl/rsx: Allow emulation of unsupported attribute formats

* gl: Fix typos and remove dprints

gl: cleanup debug prints

* ui: Move the GL legacy buffer toggle to the left pane

* vk/gl: Fix cmp type, its range is [-1,1] not [0,1] SNORM_INT
2016-10-18 15:57:28 +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
Oil b72f6da853 Porting of DH's user clip implementation in gl (#2139)
* Porting of DH's user clip implementation in gl

* Tweak clang-format

* rsx: Move inline array to draw_clause structure.

* rsx: Use variant based draw commands.

* rsx: Dump DRAW_ARRAYS and DRAW_INDEX_ARRAYS.

* GL: old recompiler clean up (#2142)

* RSX texture refactor (#2144)

* 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

* Hopefully fix appveyor build (#2148)

* 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

* vk: Properly compute descriptor pool size (#2150)

* rsx: Set default attribute format to float.

* rsx: vertex attribute size is 1 again for CMP, let backend handles this formats properties.

* rsx: Move printing function in a separate header/cpp

* Porting of DH's user clip implementation in gl
2016-09-24 18:21:41 +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
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
kd-11 3956b21cb7 vk/gl/dx12: Dynamic cb flush for vulkan; fix glsl/hlsl vertex shader generation for some games; dx12: ignore fbo textures during flip if no surface target is set (#1766)
* gl/vk/dx12: Fix vertex shader code generation for buggy games

dx12: revert vsh attribute changes

* vk: dynamically flush command buffers if we exceed available resources

* dx12: do not prepare flip texture if it has not been initialized
2016-06-11 16:24:27 +03:00
kd-11 4260f68f85 gl/vk: Fix ub256 and s32k vertex attributes; silence some unnecessary debug errors (#1757)
* gl/vk: Sample integer attribs with integer samplers

* gl: silence useless DPRINTs where behaviour has already proven correct
2016-06-08 12:39:08 +03:00
kd-11 c4102f3b18 vk/gl: Enable alpha test in shaders (#1743) 2016-06-05 20:31:23 +03:00
Nekotekina 266db1336d The rest 2016-05-23 16:22:25 +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
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 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 7b889a10cc Add vertex texture buffers for VS input
Support vertex instancing in vertex shader using VertexID

Relax OpenGL requirements by removing 4.5 features

Use EXT version of TexBufferRange; Implement buffer copy using TexBuffer

Apply travis workaround by danilaml

Fix vertex upload in in case of inlined array
2016-02-03 13:38:23 +03:00
Vincent Lejeune 69272edba6 gl: Fix warnings and enable trat warning as error. 2016-01-13 23:53:11 +01:00
Vincent Lejeune bab52c132d rsx/common/d3d12/gl: Clean ProgramStateCache
Use a_b_c format.
Use using =
Use tuple as output
Use RAII to delete program safely
Ensure const correctness.
2016-01-11 19:21:57 +01:00