Commit graph

458 commits

Author SHA1 Message Date
drfrag
338430995e Revert "- fixed a crash in the software renderer that caused wallsprites to crash"
This reverts commit 0dea6fcecc.
2019-10-05 19:18:00 +02:00
alexey.lysiuk
9332316c2a - set initial vsync state after creation of framebuffer
https://forum.zdoom.org/viewtopic.php?t=66020
2019-10-04 10:46:52 +03:00
Rachael Alexanderson
0dea6fcecc - fixed a crash in the software renderer that caused wallsprites to crash
(note: there is still a bug with grabbing the texture for these)
2019-10-03 23:32:14 -04:00
Christoph Oelckers
5179a69fdb - don't let Vulkan access the vid_vsync variable directly.
Since the FrameBuffers have a SetVsync method anything these last set must count, not the global variable directly.
2019-10-01 20:50:15 +02:00
Christoph Oelckers
86ab366958 - some reformatting on exit code, mainly to make searching for the content easier. 2019-10-01 19:06:28 +02:00
Christoph Oelckers
2a3205200f - reordered a few things in the startup procedure
Mainly done to isolate the calls that actually manipulate the global frame buffer.

V_Init alsoi initialized some palette data, which was moved to V_InitPalette and did something entirely different when running a restart as opposed to an initial start.
2019-10-01 00:21:51 +02:00
drfrag
634ef60c78 - Fixed player sprites not being affected by sector light level in the classic software renderer. 2019-09-28 10:31:27 +02:00
Christoph Oelckers
c3f26422df - changed MIDI sources so that they do not have to include i_musicinterns.h anymore.
They were already clean of unwanted external references, but including this file made it hard to keep it that way.
This also moves a few useful definitions around to less 'dirty' headers.
2019-09-25 21:47:33 +02:00
Marisa Kirisame
8dbddfc365 Fix crash on vulkan with a large number of texture shaders. 2019-09-25 17:46:33 +03:00
Rachael Alexanderson
7ba485f632
fixed the software resized texture warp problem. (#934)
* - almost nearly fixed the software resized texture warp problem.

* - proposed fix for mipmapping issue for previous commit

* - reduce texture allocation for mipmapped warped textures in the software renderer

* - add a check for the resize mode
2019-09-23 22:37:35 -04:00
drfrag
0cbb08ce84 - Fixed crash with mock2.wad in software. 2019-09-14 13:13:55 -04:00
Rachael Alexanderson
836f774b6c - use drfrag's suggested fix of checking for valid texture access, rather than checking whether it is null, when drawing fog boundaries in the software renderer 2019-09-13 09:18:26 -04:00
Magnus Norddahl
7d73616fda - release any references to command buffer when flushed 2019-08-25 12:12:29 +02:00
Magnus Norddahl
a410324084 Merge remote-tracking branch 'origin/master' into polybackend 2019-08-25 11:54:45 +02:00
Christoph Oelckers
38fec546a7 - moved the generic palette utilities and the matrix class to 'utility' 2019-08-20 23:05:20 +02:00
Christoph Oelckers
9210811b74 - patch the token 'texture2d' in GLSL sources.
This builtin function no longer exists outside of backwards compatible GLSL compilers so it needs to be remapped to 'texture' so that user shaders still using it can compile.
2019-08-18 14:50:37 +02:00
Patryk Obara
4c98b69b6b - use fallback implementation for C++ aligned_alloc
This function was introduced in C++17, then backported to older versions
of glibc++ library, but is not available in older releases (it's missing
from Ubuntu 12.04 derived SteamRT for example).
2019-08-16 20:44:29 +03:00
Christoph Oelckers
5e4de10f97 - fixed survey data retrieval for Vulkan. 2019-08-11 21:26:08 +02:00
Christoph Oelckers
1e4a32004b - fixed bad texture canvas checks when in truecolor software rendering. 2019-08-09 13:59:54 +02:00
Magnus Norddahl
d1026e4b5b - call vkDeviceWaitIdle before RAII tears down buffers 2019-08-08 20:56:11 +02:00
Magnus Norddahl
7746b2c6fd - add light array 2019-08-06 07:15:07 +02:00
Magnus Norddahl
b34658d4d8 - fix out of bounds crash 2019-08-06 06:21:37 +02:00
Magnus Norddahl
eb127d0dac - implement more shaders 2019-08-06 04:51:37 +02:00
Magnus Norddahl
4e24fdacf0 - implement more of the default shader 2019-08-05 23:31:56 +02:00
Magnus Norddahl
82a17572ef - implement getTexel part of main.fp 2019-08-05 19:32:54 +02:00
Magnus Norddahl
b17351cda4 - implement blend functions 2019-08-05 08:37:22 +02:00
Magnus Norddahl
f73470dcf4 - rewrite screen triangle drawer to be more modular and better support the hwrenderer shaders 2019-08-05 03:23:04 +02:00
Magnus Norddahl
ebe377e5de - remove TriDrawTriangleArgs::uniforms as it is redundant 2019-08-04 02:57:08 +02:00
Magnus Norddahl
7940d5fe01 Merge remote-tracking branch 'origin/master' into polybackend 2019-08-04 02:22:55 +02:00
alexey.lysiuk
ff4bc8bab9 - use EXT_metal_surface extension for Vulkan surface creation
Prefer EXT_metal_surface over deprecated MVK_macos_surface extension, and use it only when modern one is not available
2019-08-03 13:16:12 +03:00
alexey.lysiuk
cf81ab465e - updated Vulkan headers to version 1.1.114
This is the latest version released with Vulkan SDK
New headers are needed for EXT_metal_surface
2019-08-03 10:52:04 +03:00
alexey.lysiuk
5870cb7ea1 - recreate Vulkan swapchain in case of surface lost error
Do not abort with fatal error when VK_ERROR_SURFACE_LOST_KHR was returned from vkAcquireNextImageKHR() or vkQueuePresentKHR()
So far, only gfx-portability implementation is reporting this error from time to time, usually on startup, entering the game, or task switching
2019-08-02 10:21:06 +03:00
alexey.lysiuk
370f5ef234 - fixed writing of texture matrices in Vulkan render backend
https://forum.zdoom.org/viewtopic.php?t=65479
2019-07-30 11:46:14 +03:00
Christoph Oelckers
afbd7f7a24 - increased StreamBuffer size because I got it to crash with comatose.wad once due to an overflow here. 2019-07-28 19:05:39 +02:00
Magnus Norddahl
ad8c5bb96e - add VkRenderPassManager::GetVertexFormat so that all VkRenderState access is done through functions that can then be made thread safe 2019-07-28 17:20:49 +02:00
Magnus Norddahl
76675a4d61 - add VkMatrixBufferWriter so that both buffers are used same way in VkRenderState 2019-07-28 17:04:56 +02:00
Magnus Norddahl
4adac3fe59 - move streaming uniform buffers out of VkRenderState 2019-07-28 16:28:43 +02:00
Magnus Norddahl
97a4f25771 - hook up dynamic lights 2019-07-25 04:19:05 +02:00
Magnus Norddahl
a55412fcf6 - fix crash when rendering models 2019-07-24 23:25:48 +02:00
Magnus Norddahl
ec82f994f7 - hook up software renderer 2019-07-24 22:13:00 +02:00
Magnus Norddahl
e6f6f10e81 Merge remote-tracking branch 'origin/master' into polybackend 2019-07-24 21:39:07 +02:00
Christoph Oelckers
7346288bf5 - moved some more files. 2019-07-14 21:09:49 +02:00
Marisa Kirisame
bdb083f457 Shape2D drawing will gracefully abort the VM on any out of bounds access. 2019-07-12 17:44:54 +02:00
Christoph Oelckers
5df8919b90 Merge branch 'master' into userlights 2019-07-07 08:11:09 +02:00
Dzmitry Malyshau
3467e0edcf Switch command buffers to be one-time-submittable (#885) 2019-07-05 02:15:59 +02:00
Dzmitry Malyshau
e7e46f8c7c vk: Check for the time query support on the graphics queue (#884) 2019-07-03 16:49:06 +02:00
Christoph Oelckers
5ef43143f8 - removed unused CVAR_GUID type 2019-06-27 09:16:34 +02:00
Magnus Norddahl
557206131c - remove debug statement 2019-06-23 23:53:42 +02:00
Magnus Norddahl
e59c5cb947 - fix missing font glyphs 2019-06-23 21:24:37 +02:00
Magnus Norddahl
706bc0b7c6 Merge remote-tracking branch 'origin/master' into polybackend 2019-06-23 20:29:04 +02:00
Christoph Oelckers
3d3f364874 - consolidated postprocessing code a bit.
The code that determines the order of effects should not be duplicated between renderers.
2019-06-20 11:55:45 +02:00
Magnus Norddahl
774955dbc4 - write into stream buffers before opening the next render pass 2019-06-16 13:08:25 +02:00
Magnus Norddahl
d31dbf14e4 - wait for space if the stream buffers are exhausted 2019-06-16 13:05:12 +02:00
Magnus Norddahl
240a32f4c8 - also reset framebuffers when the image is reset 2019-06-16 10:31:12 +02:00
alexey.lysiuk
7e901055ea - fixed: light mode from mapinfo had no effect
https://forum.zdoom.org/viewtopic.php?t=64997
2019-06-12 09:49:40 +03:00
Magnus Norddahl
82ebcc4946 - fix compile errors 2019-06-10 23:00:15 +02:00
Magnus Norddahl
bb47230f79 Merge remote-tracking branch 'origin/master' into polybackend 2019-06-10 22:46:32 +02:00
Magnus Norddahl
5dd06de48c - fix compile error 2019-06-10 22:46:13 +02:00
Magnus Norddahl
a093f686a7 - store the vulkan framebuffer with the image (this ensures the framebuffer object is destroyed along with the image) 2019-06-10 22:14:02 +02:00
Christoph Oelckers
2766303cfc - consolidated the 3 atterm implementations.
Each platform had its own copy. Why?
2019-06-10 12:01:01 +02:00
Christoph Oelckers
9f2fbc1294 - renamed GLViewpointBuffer to HWViewpointBuffer. 2019-06-10 10:50:45 +02:00
Magnus Norddahl
13cab1c0b6 - delay postprocess texture destruction until the end of the frame 2019-06-10 09:13:56 +02:00
Magnus Norddahl
8853872bb4 - fix wipe screen when using -loadgame 2019-06-10 08:40:49 +02:00
Christoph Oelckers
037b69c8a7 - reworked buffer binding logic.
This shouldn't be in the hardware independent interface because the semantics on OpenGL and Vulkan are too different, so a common implementation is not possible.
Most bind calls were in the GL interface anyway, so these no longer pass through hardware independent code.

This also moves the bind calls in the shadowmap code into the GL interface - these never did anything useful in Vulkan and aren't needed there.

Last but not least, this moves the legacy buffer binding handling into FGLRenderState and performs the initial binding for the light buffer in a more suitable place so that this doesn't have to pollute the render state.
2019-06-09 20:37:11 +02:00
Gutawer
324a720d56 - added a linear transformation system to Shape2D so that things like rotations and scales can be changed without having to clear and push a large amount of data 2019-06-08 14:05:32 +02:00
Magnus Norddahl
c9ee880196 - fix loadgame crash 2019-06-06 18:56:34 +02:00
Magnus Norddahl
ae69abc049 - FXAA_DISCARD should never be enabled. It only works when the output framebuffer is the same as the original. 2019-06-05 19:06:33 +02:00
alexey.lysiuk
4d29b5b5e7 - limited disabling of FXAA discard to Vulkan on AMD hardware 2019-06-04 12:43:08 +03:00
alexey.lysiuk
dc8a944382 - implemented GPU vendor string assingment in Vulkan backend 2019-06-04 12:42:01 +03:00
alexey.lysiuk
addcad8ac0 - disabled discard in FXAA shader with Vulkan backend
Discard caused graphical corruptions on AMD hardware with Vulkan backend enabled

https://forum.zdoom.org/viewtopic.php?t=64230
2019-06-04 11:32:00 +03:00
Edoardo Prezioso
589f9b5c24 - Fixed uninitialized variable in case GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS does not exist.
Old graphics, like mine (Intel Sandybridge Mobile, GL 3.0 Mesa) do not support this, therefore most of the time RFL_SHADER_STORAGE_BUFFER wasn't unset (I found no consequence of this on my machine, but better safe than sorry).

Found out by Valgrind.
2019-06-02 21:20:53 +02:00
Magnus Norddahl
91ec1463b8 - add line drawer 2019-05-31 08:49:08 +02:00
Magnus Norddahl
80805656ed - implement alpha test 2019-05-31 06:43:24 +02:00
Magnus Norddahl
a5608c67b5 - upload using all threads 2019-05-31 05:42:04 +02:00
Magnus Norddahl
4a7824c380 - implement vsync and letterbox 2019-05-31 05:22:06 +02:00
Christoph Oelckers
6ace482266 - fixed fillSimplePoly for indexed data.
On OpenGL this merely caused some visual glitches on the cheat automap - but the bad data in the buffer can make Vulkan abort entirely.
2019-05-30 13:32:42 +02:00
Magnus Norddahl
b9230d4425 - fix negative uLightLevel being applied 2019-05-29 06:42:02 +02:00
Magnus Norddahl
a1229be5c6 - implement camera textures 2019-05-29 05:45:19 +02:00
Magnus Norddahl
be5ecce598 - fix fill color and translucency 2019-05-29 02:22:45 +02:00
Magnus Norddahl
eff38393af - fix stencil writing color 2019-05-29 01:14:42 +02:00
Magnus Norddahl
555beb58f0 - tell softpoly backend which hwrenderer shader is active and use that to decide which drawer to use 2019-05-28 08:13:19 +02:00
Magnus Norddahl
bd591c75fb - implement depth bias 2019-05-28 06:45:21 +02:00
Magnus Norddahl
b6e00cb208 - fix use after delete of some textures 2019-05-27 21:23:58 +02:00
Magnus Norddahl
c2535519e8 - fix blend mode for the fireballs 2019-05-27 20:20:20 +02:00
Magnus Norddahl
9f8cd68211 - fix use after delete 2019-05-27 20:03:11 +02:00
Magnus Norddahl
117617aad8 - minor blend and light adjustment 2019-05-27 19:18:27 +02:00
Magnus Norddahl
0d8d50c23e - fix viewport location
- add scissor support
2019-05-27 16:51:54 +02:00
Magnus Norddahl
8db5e72254 - add PolyTriangleDrawer functions for the operations needed by PolyRenderState 2019-05-27 07:57:27 +02:00
Magnus Norddahl
3a3de13abd - hook up main.vp and the data it uses for input 2019-05-26 01:00:36 +02:00
Magnus Norddahl
fbaeb11fba - convert main.vp to c++ so softpoly can use it 2019-05-25 01:27:20 +02:00
Magnus Norddahl
b453e15929 - adjust PolyTriangleDrawer to closer match what PolyRenderState receives as input 2019-05-24 22:30:14 +02:00
Magnus Norddahl
4fd4bfa092 Merge remote-tracking branch 'origin/master' into polybackend 2019-05-24 19:21:36 +02:00
alexey.lysiuk
da2d0e47e6 - removed array length() function from shadowmap shader
Array's length() function is not yet supported by SPIRV-cross and MoltenVK
Its usage was replaced by explicit nodes count value passed as uniform
2019-05-24 14:29:37 +03:00
Magnus Norddahl
756c593e96 - create a new error class for vulkan errors as they are only recoverable during initialization (unlike CRecoverableError which is recoverable during normal processing)
- improve vulkan errors by including the status code returned by vulkan if they fail
2019-05-23 14:09:05 +02:00
Magnus Norddahl
0cb3605c70 - fix null drawers
- slightly better renderstyle drawer selection
2019-05-22 21:23:10 +02:00
Magnus Norddahl
d724b623d1 - enable the depth buffer
- support vid_scalefactor
2019-05-22 17:56:29 +02:00
Magnus Norddahl
48d2d423f6 - remove softpoly scene drawer 2019-05-22 17:16:07 +02:00
Magnus Norddahl
0eda298db2 - create a renderer backend based on softpoly's drawers 2019-05-22 06:29:52 +02:00
Magnus Norddahl
e4dab707e4 - don't run the custom shaders twice on screenshots 2019-05-20 12:46:05 +02:00
Magnus Norddahl
2a15f65065 - apply present shader on screenshots 2019-05-20 12:36:45 +02:00