rhi: gl: Enable seamless cubemap filtering

...when available. This is mandatory in order to match results with
other APIs where this is always on.

Change-Id: I3b8ef2cb806a7297c83e60a3eb1fa71b50780dbe
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
bb10
Laszlo Agocs 2020-09-23 14:48:21 +02:00
parent 7c483a251b
commit d3c985631d
1 changed files with 10 additions and 0 deletions

View File

@ -313,6 +313,10 @@ QT_BEGIN_NAMESPACE
#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF
#endif
#ifndef GL_TEXTURE_CUBE_MAP_SEAMLESS
#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F
#endif
/*!
Constructs a new QRhiGles2InitParams.
@ -568,6 +572,12 @@ bool QRhiGles2::create(QRhi::Flags flags)
f->glEnable(GL_POINT_SPRITE);
} // else (with gles) these are always on
// Match D3D and others when it comes to seamless cubemap filtering.
// ES 3.0+ has this always enabled. (hopefully)
// ES 2.0 and GL < 3.2 will not have it.
if (!caps.gles && (caps.ctxMajor > 3 || (caps.ctxMajor == 3 && caps.ctxMinor >= 2)))
f->glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS);
nativeHandlesStruct.context = ctx;
contextLost = false;