- merged gzdoom-gles2 and fixed some issues with pipeline size validation.

This commit is contained in:
Christoph Oelckers 2021-08-03 18:46:45 +02:00
commit 441cd0796f
116 changed files with 12502 additions and 80 deletions

View file

@ -29,6 +29,10 @@
#include "c_cvars.h"
#include "v_video.h"
CVAR(Bool, gl_customshader, true, 0);
static IHardwareTexture* (*layercallback)(int layer, int translation);
TArray<UserShaderDesc> usershaders;
@ -124,17 +128,20 @@ FMaterial::FMaterial(FGameTexture * tx, int scaleflags)
}
auto index = tx->GetShaderIndex();
if (index >= FIRST_USER_SHADER)
if (gl_customshader)
{
const UserShaderDesc &usershader = usershaders[index - FIRST_USER_SHADER];
if (usershader.shaderType == mShaderIndex) // Only apply user shader if it matches the expected material
if (index >= FIRST_USER_SHADER)
{
for (auto &texture : tx->CustomShaderTextures)
const UserShaderDesc& usershader = usershaders[index - FIRST_USER_SHADER];
if (usershader.shaderType == mShaderIndex) // Only apply user shader if it matches the expected material
{
if (texture == nullptr) continue;
mTextureLayers.Push({ texture.get(), 0 }); // scalability should be user-definable.
for (auto& texture : tx->CustomShaderTextures)
{
if (texture == nullptr) continue;
mTextureLayers.Push({ texture.get(), 0 }); // scalability should be user-definable.
}
mShaderIndex = index;
}
mShaderIndex = index;
}
}
}