/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#ifdef GL_KHR_blend_equation_advanced
mBlendBarrierKHR(nullptr),
#endif
+#ifdef GL_EXT_multisampled_render_to_texture
+ mGlRenderbufferStorageMultisampleEXT(nullptr),
+ mGlFramebufferTexture2DMultisampleEXT(nullptr),
+#endif
mInitialized(false)
{
}
{
// initialize extension on first use as on some hw platforms a context
// has to be bound for the extensions to return correct pointer
- if(!mInitialized)
+ if(DALI_UNLIKELY(!mInitialized))
{
Initialize();
}
{
// initialize extension on first use as on some hw platforms a context
// has to be bound for the extensions to return correct pointer
- if(!mInitialized)
+ if(DALI_UNLIKELY(!mInitialized))
{
Initialize();
}
{
// initialize extension on first use as on some hw platforms a context
// has to be bound for the extensions to return correct pointer
- if(!mInitialized)
+ if(DALI_UNLIKELY(!mInitialized))
{
Initialize();
}
{
// initialize extension on first use as on some hw platforms a context
// has to be bound for the extensions to return correct pointer
- if(!mInitialized)
+ if(DALI_UNLIKELY(!mInitialized))
{
Initialize();
}
return false;
}
+void GlExtensions::RenderbufferStorageMultisampleEXT(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+{
+ // initialize extension on first use as on some hw platforms a context
+ // has to be bound for the extensions to return correct pointer
+ if(DALI_UNLIKELY(!mInitialized))
+ {
+ Initialize();
+ }
+
+#ifdef GL_EXT_multisampled_render_to_texture
+ if(mGlRenderbufferStorageMultisampleEXT)
+ {
+ mGlRenderbufferStorageMultisampleEXT(target, samples, internalformat, width, height);
+ }
+ else
+ {
+ DALI_LOG_ERROR("Error: glRenderbufferStorageMultisampleEXT extension is not available\n");
+ DALI_ASSERT_DEBUG(0);
+ }
+#endif
+}
+
+void GlExtensions::FramebufferTexture2DMultisampleEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)
+{
+ // initialize extension on first use as on some hw platforms a context
+ // has to be bound for the extensions to return correct pointer
+ if(DALI_UNLIKELY(!mInitialized))
+ {
+ Initialize();
+ }
+
+#ifdef GL_EXT_multisampled_render_to_texture
+ if(mGlFramebufferTexture2DMultisampleEXT)
+ {
+ mGlFramebufferTexture2DMultisampleEXT(target, attachment, textarget, texture, level, samples);
+ }
+ else
+ {
+ DALI_LOG_ERROR("Error: glFramebufferTexture2DMultisampleEXT extension is not available\n");
+ DALI_ASSERT_DEBUG(0);
+ }
+#endif
+}
+
void GlExtensions::Initialize()
{
mInitialized = true;
#ifdef GL_KHR_blend_equation_advanced
mBlendBarrierKHR = reinterpret_cast<PFNGLBLENDBARRIERKHRPROC>(eglGetProcAddress("glBlendBarrierKHR"));
#endif
+
+#ifdef GL_EXT_multisampled_render_to_texture
+ mGlRenderbufferStorageMultisampleEXT = reinterpret_cast<PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC>(eglGetProcAddress("glRenderbufferStorageMultisampleEXT"));
+ mGlFramebufferTexture2DMultisampleEXT = reinterpret_cast<PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC>(eglGetProcAddress("glFramebufferTexture2DMultisampleEXT"));
+#endif
}
} // namespace Adaptor