mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-02-16 17:21:10 +00:00
- removed the SSBO block for desktop OS’s when gl_pipeline_depth is enabled
This commit is contained in:
parent
19c8eb1e33
commit
b0382599f6
5 changed files with 19 additions and 3 deletions
|
@ -382,7 +382,7 @@ bool FShader::Load(const char * name, const char * vert_prog_lump, const char *
|
||||||
vp_comb = "#version 430 core\n#define SHADER_STORAGE_LIGHTS\n";
|
vp_comb = "#version 430 core\n#define SHADER_STORAGE_LIGHTS\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((gl.flags & RFL_SHADER_STORAGE_BUFFER) && screen->mPipelineType == 0)
|
if ((gl.flags & RFL_SHADER_STORAGE_BUFFER) && screen->allowSSBO())
|
||||||
{
|
{
|
||||||
vp_comb << "#define SUPPORTS_SHADOWMAPS\n";
|
vp_comb << "#define SUPPORTS_SHADOWMAPS\n";
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,13 @@
|
||||||
|
|
||||||
class FRenderState;
|
class FRenderState;
|
||||||
|
|
||||||
|
#ifdef __ANDROID__
|
||||||
#define HW_MAX_PIPELINE_BUFFERS 8
|
#define HW_MAX_PIPELINE_BUFFERS 8
|
||||||
|
#define HW_BLOCK_SSBO 1
|
||||||
|
#else
|
||||||
|
// On desktop this is only useful fpr letting the GPU run in parallel with the playsim and for that 2 buffers are enough.
|
||||||
|
#define HW_MAX_PIPELINE_BUFFERS 2
|
||||||
|
#endif
|
||||||
|
|
||||||
// The low level code needs to know which attributes exist.
|
// The low level code needs to know which attributes exist.
|
||||||
// OpenGL needs to change the state of all of them per buffer binding.
|
// OpenGL needs to change the state of all of them per buffer binding.
|
||||||
|
|
|
@ -44,7 +44,7 @@ FLightBuffer::FLightBuffer(int pipelineNbr):
|
||||||
// Hack alert: On Intel's GL driver SSBO's perform quite worse than UBOs.
|
// Hack alert: On Intel's GL driver SSBO's perform quite worse than UBOs.
|
||||||
// We only want to disable using SSBOs for lights but not disable the feature entirely.
|
// We only want to disable using SSBOs for lights but not disable the feature entirely.
|
||||||
// Note that using an uniform buffer here will limit the number of lights per surface so it isn't done for NVidia and AMD.
|
// Note that using an uniform buffer here will limit the number of lights per surface so it isn't done for NVidia and AMD.
|
||||||
if (screen->IsVulkan() || screen->IsPoly() || ((screen->hwcaps & RFL_SHADER_STORAGE_BUFFER) && screen->mPipelineType == 0 && !strstr(screen->vendorstring, "Intel")))
|
if (screen->IsVulkan() || screen->IsPoly() || ((screen->hwcaps & RFL_SHADER_STORAGE_BUFFER) && screen->allowSSBO() && !strstr(screen->vendorstring, "Intel")))
|
||||||
{
|
{
|
||||||
mBufferType = true;
|
mBufferType = true;
|
||||||
mBlockAlign = 0;
|
mBlockAlign = 0;
|
||||||
|
|
|
@ -43,6 +43,7 @@
|
||||||
#include "v_2ddrawer.h"
|
#include "v_2ddrawer.h"
|
||||||
#include "intrect.h"
|
#include "intrect.h"
|
||||||
#include "hw_shadowmap.h"
|
#include "hw_shadowmap.h"
|
||||||
|
#include "buffers.h"
|
||||||
|
|
||||||
|
|
||||||
struct FPortalSceneState;
|
struct FPortalSceneState;
|
||||||
|
@ -150,6 +151,7 @@ public:
|
||||||
|
|
||||||
int mPipelineNbr = 1; // Number of HW buffers to pipeline
|
int mPipelineNbr = 1; // Number of HW buffers to pipeline
|
||||||
int mPipelineType = 0;
|
int mPipelineType = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DFrameBuffer (int width=1, int height=1);
|
DFrameBuffer (int width=1, int height=1);
|
||||||
virtual ~DFrameBuffer();
|
virtual ~DFrameBuffer();
|
||||||
|
@ -160,6 +162,14 @@ public:
|
||||||
{
|
{
|
||||||
mShadowMap.SetAABBTree(tree);
|
mShadowMap.SetAABBTree(tree);
|
||||||
}
|
}
|
||||||
|
bool allowSSBO()
|
||||||
|
{
|
||||||
|
#ifndef HW_BLOCK_SSBO
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
return mPipelineType == 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
virtual DCanvas* GetCanvas() { return nullptr; }
|
virtual DCanvas* GetCanvas() { return nullptr; }
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,7 @@ sector_t* RenderViewpoint(FRenderViewpoint& mainvp, AActor* camera, IntRect* bou
|
||||||
|
|
||||||
R_SetupFrame(mainvp, r_viewwindow, camera);
|
R_SetupFrame(mainvp, r_viewwindow, camera);
|
||||||
|
|
||||||
if (mainview && toscreen && !(camera->Level->flags3 & LEVEL3_NOSHADOWMAP) && camera->Level->HasDynamicLights && gl_light_shadowmap && screen->mPipelineType == 0 && (screen->hwcaps & RFL_SHADER_STORAGE_BUFFER))
|
if (mainview && toscreen && !(camera->Level->flags3 & LEVEL3_NOSHADOWMAP) && camera->Level->HasDynamicLights && gl_light_shadowmap && screen->allowSSBO() && (screen->hwcaps & RFL_SHADER_STORAGE_BUFFER))
|
||||||
{
|
{
|
||||||
screen->SetAABBTree(camera->Level->aabbTree);
|
screen->SetAABBTree(camera->Level->aabbTree);
|
||||||
screen->mShadowMap.SetCollectLights([=] {
|
screen->mShadowMap.SetCollectLights([=] {
|
||||||
|
|
Loading…
Reference in a new issue