mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 00:32:57 -04:00
glgsg: a few version check tweaks
This commit is contained in:
parent
8348f16665
commit
2556d006f7
@ -2286,8 +2286,10 @@ reset() {
|
||||
if (is_at_least_gl_version(4, 5) || has_extension("GL_ARB_direct_state_access")) {
|
||||
_glGenerateTextureMipmap = (PFNGLGENERATETEXTUREMIPMAPPROC)
|
||||
get_extension_func("glGenerateTextureMipmap");
|
||||
|
||||
_supports_dsa = true;
|
||||
} else {
|
||||
_glGenerateTextureMipmap = nullptr;
|
||||
_supports_dsa = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -2830,7 +2832,9 @@ reset() {
|
||||
// Check availability of anisotropic texture filtering.
|
||||
_supports_anisotropy = false;
|
||||
_max_anisotropy = 1.0;
|
||||
if (has_extension("GL_EXT_texture_filter_anisotropic")) {
|
||||
if (is_at_least_gl_version(4, 6) ||
|
||||
has_extension("GL_EXT_texture_filter_anisotropic") ||
|
||||
has_extension("GL_ARB_texture_filter_anisotropic")) {
|
||||
GLfloat max_anisotropy;
|
||||
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &max_anisotropy);
|
||||
_max_anisotropy = (PN_stdfloat)max_anisotropy;
|
||||
@ -3237,7 +3241,7 @@ reset() {
|
||||
if (GLCAT.is_debug()) {
|
||||
if (_supports_get_program_binary) {
|
||||
GLCAT.debug()
|
||||
<< "Supported shader binary formats:\n";
|
||||
<< "Supported program binary formats:\n";
|
||||
GLCAT.debug() << " ";
|
||||
|
||||
pset<GLenum>::const_iterator it;
|
||||
@ -3249,7 +3253,7 @@ reset() {
|
||||
}
|
||||
GLCAT.debug(false) << "\n";
|
||||
} else {
|
||||
GLCAT.debug() << "No shader binary formats supported.\n";
|
||||
GLCAT.debug() << "No program binary formats supported.\n";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -13193,7 +13197,7 @@ upload_texture_image(CLP(TextureContext) *gtc, bool needs_reload,
|
||||
void CLP(GraphicsStateGuardian)::
|
||||
generate_mipmaps(CLP(TextureContext) *gtc) {
|
||||
#ifndef OPENGLES
|
||||
if (_glGenerateTextureMipmap != nullptr) {
|
||||
if (_supports_dsa) {
|
||||
// OpenGL 4.5 offers an easy way to do this without binding.
|
||||
_glGenerateTextureMipmap(gtc->_index);
|
||||
return;
|
||||
|
@ -909,6 +909,7 @@ public:
|
||||
PFNGLBINDPROGRAMARBPROC _glBindProgram;
|
||||
|
||||
#ifndef OPENGLES
|
||||
bool _supports_dsa;
|
||||
PFNGLGENERATETEXTUREMIPMAPPROC _glGenerateTextureMipmap;
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user