OpenGL3: Support min/max blend modes

This commit is contained in:
numzero 2023-04-20 17:44:14 +03:00 committed by sfan5
parent 81ad195aa3
commit 1f15fd0805
4 changed files with 15 additions and 0 deletions

View File

@ -1405,6 +1405,18 @@ COpenGL3DriverBase::~COpenGL3DriverBase()
case EBO_REVSUBTRACT:
CacheHandler->setBlendEquation(GL_FUNC_REVERSE_SUBTRACT);
break;
case EBO_MIN:
if (BlendMinMaxSupported)
CacheHandler->setBlendEquation(GL_MIN);
else
os::Printer::log("Attempt to use EBO_MIN without driver support", ELL_WARNING);
break;
case EBO_MAX:
if (BlendMinMaxSupported)
CacheHandler->setBlendEquation(GL_MAX);
else
os::Printer::log("Attempt to use EBO_MAX without driver support", ELL_WARNING);
break;
default:
break;
}

View File

@ -166,6 +166,7 @@ namespace video
}
bool AnisotropicFilterSupported = false;
bool BlendMinMaxSupported = false;
private:
void addExtension(std::string name);

View File

@ -34,6 +34,7 @@ namespace video {
initExtensionsNew();
AnisotropicFilterSupported = isVersionAtLeast(4, 6) || queryExtension("GL_ARB_texture_filter_anisotropic") || queryExtension("GL_EXT_texture_filter_anisotropic");
BlendMinMaxSupported = true;
// COGLESCoreExtensionHandler::Feature
static_assert(MATERIAL_MAX_TEXTURES <= 16, "Only up to 16 textures are guaranteed");

View File

@ -32,6 +32,7 @@ namespace video {
const bool MRTSupported = Version.Major >= 3 || queryExtension("GL_EXT_draw_buffers");
AnisotropicFilterSupported = queryExtension("GL_EXT_texture_filter_anisotropic");
BlendMinMaxSupported = (Version.Major >= 3) || FeatureAvailable[IRR_GL_EXT_blend_minmax];
const bool TextureLODBiasSupported = queryExtension("GL_EXT_texture_lod_bias");
// COGLESCoreExtensionHandler::Feature