$(adaptor_trace_ubuntu_src_files)
endif
+if VULKAN_ENABLED
+LIBDALI_ADAPTOR_LA_SOURCES += \
+ $(adaptor_graphics_vulkan_x11_src_files)
+endif
+
endif
$(HARFBUZZ_LIBS) \
$(TPKP_CURL_LIBS) \
$(UTILX_LIBS) \
+ $(VULKAN_LIBS) \
-lgif \
-lpthread \
-lturbojpeg \
[DALI_USE_ECORE_WAYLAND=0])
else
-PKG_CHECK_MODULES(ECORE_X, [ecore-x],
+PKG_CHECK_MODULES(ECORE_X, [ecore-x x11-xcb],
[DALI_USE_ECORE_X11=1],
[DALI_USE_ECORE_X11=0])
-PKG_CHECK_MODULES(X11, [x11],
+PKG_CHECK_MODULES(X11, [x11 x11-xcb],
[DALI_USE_X11=1],
[DALI_USE_X11=0])
+#PKG_CHECK_MODULES(X11_XCB, [x11-xcb],
+# [DALI_HAS_X11_XCB=1],
+# [DALI_HAS_X11_XCB=0])
fi
# remove this when we update common repos
[ AC_MSG_ERROR([Vulkan not available as a package]) ]
)
- DALI_ADAPTOR_CFLAGS+=" ${VULKAN_CFLAGS} -DVK_USE_PLATFORM_XLIB_KHR -DVULKAN_HPP_NO_EXCEPTIONS"
- DALI_ADAPTOR_LDFLAGS+=" ${VULKAN_LIBS}"
+ DALI_ADAPTOR_CFLAGS+=" ${VULKAN_CFLAGS} -DVULKAN_HPP_NO_EXCEPTIONS"
+
+ # due to a bug in nvidia driver x11-xcb library is required
+ DALI_ADAPTOR_LDFLAGS+=${VULKAN_LIBS}
+
+ if test "x$DALI_HAS_X11_XCB" == "x1"; then
+ echo "X11 libs: ${X11_XCB_LIBS}"
+ DALI_ADAPTOR_LDFLAGS+=${X11_XCB_LIBS}
+ fi
fi
-AM_CONDITIONAL([VULKAN_ENABLED], [test x$enable_vulkan = xyes])
+AM_CONDITIONAL([VULKAN_ENABLED], [test x$enable_vulkan != xno])
AC_SUBST(dataReadWriteDir)
AC_SUBST(dataReadOnlyDir)
#include <dali/integration-api/profiling.h>
#include <dali/integration-api/input-options.h>
#include <dali/integration-api/events/touch-event-integ.h>
+#include <dali/integration-api/graphics/graphics.h>
// INTERNAL INCLUDES
#include <dali/public-api/dali-adaptor-common.h>
#include <dali/internal/window-system/common/display-connection.h>
#include <dali/internal/window-system/common/window-impl.h>
#include <dali/internal/window-system/common/window-render-surface.h>
+#include <dali/internal/graphics/vulkan/x11/vk-surface-xlib2xcb.h>
#include <dali/internal/system/common/logging.h>
#include <dali/devel-api/adaptor-framework/image-loading.h>
EglSyncImplementation* eglSyncImpl = mEglFactory->GetSyncImplementation();
- mCore = Integration::Core::New( *this,
- *mPlatformAbstraction,
- *mGLES,
- *eglSyncImpl,
- *mGestureManager,
- dataRetentionPolicy ,
+ // todo: add somewhere MakeUnique to make it cleaner
+ mGraphics = std::unique_ptr<Dali::Integration::Graphics::Graphics>(
+ new Dali::Integration::Graphics::Graphics()
+ );
+
+ // todo: surface shouldn't really be create here :((((
+ auto xlibSurface = std::unique_ptr<Dali::Graphics::Vulkan::VkSurfaceXlib2Xcb>(
+ new Dali::Graphics::Vulkan::VkSurfaceXlib2Xcb( *mSurface )
+ );
+
+ mGraphics->Create( std::move(xlibSurface) );
+
+ mCore = Integration::Core::New( *this, *mPlatformAbstraction, *mGraphics, *mGLES, *eglSyncImpl, *mGestureManager, dataRetentionPolicy,
( 0u != mEnvironmentOptions->GetRenderToFboInterval() ) ? Integration::RenderToFrameBuffer::TRUE : Integration::RenderToFrameBuffer::FALSE,
depthBufferAvailable,
stencilBufferAvailable );
return *mGLES;
}
+Dali::Integration::Graphics::Graphics& Adaptor::GetGraphics() const
+{
+ return *mGraphics;
+}
+
Dali::Integration::PlatformAbstraction& Adaptor::GetPlatformAbstractionInterface()
{
return *mPlatformAbstraction;
#include <dali/integration-api/trigger-event-factory.h>
#include <dali/internal/network/common/socket-factory.h>
+#include <memory>
+
namespace Dali
{
{
class Core;
class GlAbstraction;
+namespace Graphics
+{
+class Graphics;
+}
}
namespace Internal
Integration::GlAbstraction& GetGlAbstraction() const;
/**
+ *
+ * @return the Graphics
+ */
+ Dali::Integration::Graphics::Graphics& GetGraphics() const;
+
+ /**
* Return the PlatformAbstraction.
* @return The PlatformAbstraction.
*/
SocketFactory mSocketFactory; ///< Socket factory
const bool mEnvironmentOptionsOwned:1; ///< Whether we own the EnvironmentOptions (and thus, need to delete it)
bool mUseRemoteSurface; ///< whether the remoteSurface is used or not
+
+ std::unique_ptr<Dali::Integration::Graphics::Graphics> mGraphics;
+
public:
inline static Adaptor& GetImplementation(Dali::Adaptor& adaptor) {return *adaptor.mImpl;}
};
namespace Dali
{
+namespace Integration
+{
+namespace Graphics
+{
+class Graphics;
+} // graphics
+} // integration
+
namespace Internal
{
virtual EglFactoryInterface& GetEGLFactoryInterface() const = 0;
/**
+ * @return Graphics
+ */
+ virtual Dali::Integration::Graphics::Graphics& GetGraphics() const = 0;
+
+ /**
* Used by update-thread to notify core (main-thread) it has messages to process
* @return trigger event ProcessCoreEvents
*/
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
+#include <dali/integration-api/graphics/graphics.h>
// INTERNAL INCLUDES
#include <dali/internal/adaptor/common/adaptor-internal-services.h>
: mGLES( adaptorInterfaces.GetGlesInterface() ),
mEglFactory( &adaptorInterfaces.GetEGLFactoryInterface()),
mEGL( NULL ),
+ mGraphics( adaptorInterfaces.GetGraphics() ),
mSurfaceReplaced( false ),
mSurfaceResized( false )
{
delete mDisplayConnection;
mDisplayConnection = NULL;
}
-
+#if 0
mEglFactory->Destroy();
+#endif
}
void RenderHelper::Start()
{
+#if 0
if( mSurface )
{
mSurface->StartRender();
}
+#endif
}
void RenderHelper::Stop()
{
+#if 0
if( mSurface )
{
// Tell surface we have stopped rendering
mSurface->StopRender();
}
+#endif
}
void RenderHelper::ConsumeEvents()
void RenderHelper::InitializeEgl()
{
+#if 0
mEGL = mEglFactory->Create();
DALI_ASSERT_ALWAYS( mSurface && "NULL surface" );
// Make it current
mEGL->MakeContextCurrent();
+#endif
}
void RenderHelper::ReplaceSurface( RenderSurface* newSurface )
{
+#if 0
mSurface->DestroyEglSurface(*mEGL);
// This is designed for replacing pixmap surfaces, but should work for window as well
// use the new surface from now on
mSurface = newSurface;
mSurfaceReplaced = true;
+#endif
}
void RenderHelper::ResizeSurface()
void RenderHelper::ShutdownEgl()
{
+#if 0
if( mSurface )
{
// give a chance to destroy the OpenGL surface that created externally
// delete the GL context / egl surface
mEGL->TerminateGles();
+#endif
}
bool RenderHelper::PreRender()
{
+ mGraphics.PreRender( 1 );
+#if 0
if( mSurface )
{
mSurface->PreRender( *mEGL, mGLES, mSurfaceResized );
}
mGLES.PreRender();
+#endif
return true;
}
void RenderHelper::PostRender( bool renderToFbo )
{
+ mGraphics.PostRender( 1 );
+#if 0
// Inform the gl implementation that rendering has finished before informing the surface
mGLES.PostRender();
}
mSurfaceReplaced = false;
mSurfaceResized = false;
+#endif
}
} // namespace Adaptor
namespace Integration
{
class GlAbstraction;
+namespace Graphics
+{
+class Graphics;
+}
}
namespace Internal
private: // Data
- Integration::GlAbstraction& mGLES; ///< GL abstraction reference
- EglFactoryInterface* mEglFactory; ///< Factory class to create EGL implementation
- EglInterface* mEGL; ///< Interface to EGL implementation
- RenderSurface* mSurface; ///< Current surface
- Dali::DisplayConnection* mDisplayConnection; ///< Display connection
- bool mSurfaceReplaced; ///< True when new surface has been initialized.
- bool mSurfaceResized; ///< True when the surface is resized.
+ Integration::GlAbstraction& mGLES; ///< GL abstraction reference
+ EglFactoryInterface* mEglFactory; ///< Factory class to create EGL implementation
+ EglInterface* mEGL; ///< Interface to EGL implementation
+ RenderSurface* mSurface; ///< Current surface
+ Dali::DisplayConnection* mDisplayConnection; ///< Display connection
+ Integration::Graphics::Graphics& mGraphics;
+ bool mSurfaceReplaced; ///< True when new surface has been initialized.
+ bool mSurfaceResized; ///< True when the surface is resized.
};
} // namespace Adaptor
# module: graphics, backend: ubuntu
adaptor_graphics_ubuntu_src_files=\
- ${adaptor_graphics_dir}/ubuntu/vsync-monitor-ubuntu.cpp
\ No newline at end of file
+ ${adaptor_graphics_dir}/ubuntu/vsync-monitor-ubuntu.cpp
+
+adaptor_vulkan_ubuntu_src_files = \
+ $(adaptor_graphics_dir)/vulkan/x11/vk-surface-xcb.cpp \
+ $(adaptor_graphics_dir)/vulkan/x11/vk-surface-xlib.cpp \
+ $(adaptor_graphics_dir)/vulkan/x11/vk-surface-xlib2xcb.cpp
--- /dev/null
+---
+Language: Cpp
+BasedOnStyle: Google
+AccessModifierOffset: -2
+AlignAfterOpenBracket: Align
+AlignConsecutiveAssignments: true
+AlignConsecutiveDeclarations: true
+
+AlignEscapedNewlinesLeft: true
+AlignOperands: true
+AlignTrailingComments: true
+AllowAllParametersOfDeclarationOnNextLine: true
+
+AllowShortBlocksOnASingleLine: false
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: None
+AllowShortIfStatementsOnASingleLine: false
+AllowShortLoopsOnASingleLine: false
+
+AlwaysBreakAfterDefinitionReturnType: None
+AlwaysBreakAfterReturnType: None
+AlwaysBreakBeforeMultilineStrings: true
+AlwaysBreakTemplateDeclarations: true
+
+BinPackArguments: true
+BinPackParameters: true
+
+BraceWrapping:
+ AfterClass: false
+ AfterControlStatement: false
+ AfterEnum: false
+ AfterFunction: false
+ AfterNamespace: false
+ AfterObjCDeclaration: false
+ AfterStruct: false
+ AfterUnion: false
+ BeforeCatch: false
+ BeforeElse: false
+ IndentBraces: false
+
+BreakBeforeBinaryOperators: None
+BreakBeforeBraces: Allman
+BreakBeforeTernaryOperators: true
+BreakConstructorInitializersBeforeComma: false
+BreakAfterJavaFieldAnnotations: false
+BreakStringLiterals: false
+ColumnLimit: 100
+CommentPragmas: '^ IWYU pragma:'
+ConstructorInitializerAllOnOneLineOrOnePerLine: true
+ConstructorInitializerIndentWidth: 0
+ContinuationIndentWidth: 4
+Cpp11BracedListStyle: true
+DerivePointerAlignment: true
+DisableFormat: false
+ExperimentalAutoDetectBinPacking: true
+ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
+IncludeCategories:
+ - Regex: '^<.*\.h>'
+ Priority: 1
+ - Regex: '^<.*'
+ Priority: 2
+ - Regex: '.*'
+ Priority: 3
+IncludeIsMainRegex: '([-_](test|unittest))?$'
+IndentCaseLabels: false
+IndentWidth: 2
+IndentWrappedFunctionNames: false
+JavaScriptQuotes: Leave
+JavaScriptWrapImports: true
+KeepEmptyLinesAtTheStartOfBlocks: true
+MacroBlockBegin: ''
+MacroBlockEnd: ''
+MaxEmptyLinesToKeep: 1
+NamespaceIndentation: None
+ObjCBlockIndentWidth: 2
+ObjCSpaceAfterProperty: false
+ObjCSpaceBeforeProtocolList: false
+PenaltyBreakBeforeFirstCallParameter: 50
+PenaltyBreakComment: 300000000
+PenaltyBreakFirstLessLess: 120
+PenaltyBreakString: 1000
+PenaltyExcessCharacter: 1
+PenaltyReturnTypeOnItsOwnLine: 200
+PointerAlignment: Left
+ReflowComments: false
+SortIncludes: true
+SpaceAfterCStyleCast: false
+SpaceAfterTemplateKeyword: false
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeParens: Never
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 1
+SpacesInAngles: true
+SpacesInContainerLiterals: true
+SpacesInCStyleCastParentheses: true
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+Standard: Auto
+TabWidth: 2
+UseTab: Never
+...
+
+
--- /dev/null
+/*
+ * Copyright (c) 2017 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali/internal/graphics/vulkan/x11/vk-surface-xcb.h>
+
+namespace Dali
+{
+namespace Graphics
+{
+namespace Vulkan
+{
+
+VkSurfaceXcb::VkSurfaceXcb(xcb_connection_t* connection, xcb_window_t window)
+: VkSurfaceFactory{}, mConnection(connection), mWindow(window)
+{
+}
+
+vk::SurfaceKHR VkSurfaceXcb::Create(vk::Instance instance, vk::AllocationCallbacks* allocCallbacks,
+ vk::PhysicalDevice physicalDevice) const
+{
+ vk::XcbSurfaceCreateInfoKHR info;
+ info.setConnection(mConnection).setWindow(mWindow);
+ auto retval = instance.createXcbSurfaceKHR(info, allocCallbacks).value;
+ return retval;
+}
+}
+}
+}
--- /dev/null
+#ifndef DALI_GRAPHICS_VULKAN_VKSURFACEXCB_H
+#define DALI_GRAPHICS_VULKAN_VKSURFACEXCB_H
+
+/*
+ * Copyright (c) 2017 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#ifndef VK_USE_PLATFORM_XCB_KHR
+#define VK_USE_PLATFORM_XCB_KHR
+#endif
+
+// INTERNAL INCLUDES
+#include <dali/integration-api/graphics/vulkan/vk-surface-factory.h>
+
+// EXTERNAL INCLUDES
+#include <vulkan/vulkan.hpp>
+
+namespace Dali
+{
+namespace Graphics
+{
+namespace Vulkan
+{
+
+class VkSurfaceXcb final : public Dali::Integration::Graphics::Vulkan::VkSurfaceFactory
+{
+public:
+ /**
+ * Instantiates surface factory ( should
+ * @param display
+ * @param window
+ */
+ VkSurfaceXcb(xcb_connection_t* connection, xcb_window_t window);
+
+ virtual vk::SurfaceKHR Create(vk::Instance instance, vk::AllocationCallbacks* allocCallbacks,
+ vk::PhysicalDevice physicalDevice) const override;
+
+private:
+ xcb_connection_t* mConnection;
+ xcb_window_t mWindow;
+ vk::SurfaceKHR mSurface;
+};
+
+} // Namespace Vulkan
+} // Namespace Graphics
+} // Namespace Dali
+
+#endif // DALI_GRAPHICS_VULKAN_VKSURFACEXCB_H
--- /dev/null
+/*
+ * Copyright (c) 2017 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <adaptors/devel-api/adaptor-framework/render-surface.h>
+#include <dali/internal/graphics/vulkan/x11/vk-surface-xlib.h>
+#include <dali/internal/window-system/common/window-render-surface.h>
+
+namespace Dali
+{
+namespace Graphics
+{
+namespace Vulkan
+{
+
+VkSurfaceXlib::VkSurfaceXlib(Dali::RenderSurface& renderSurface)
+: VkSurfaceFactory()
+{
+ auto ecoreSurface = dynamic_cast<Dali::ECore::WindowRenderSurface*>(&renderSurface);
+ assert( ecoreSurface != nullptr && "This is not ecore surface!");
+ mWindow = ecoreSurface->GetXWindow();
+ mDisplay = XOpenDisplay(nullptr);
+}
+
+VkSurfaceXlib::VkSurfaceXlib(Display* display, Window window)
+: VkSurfaceFactory(), mDisplay(display), mWindow(window)
+{
+}
+
+vk::SurfaceKHR VkSurfaceXlib::Create(vk::Instance instance, vk::AllocationCallbacks* allocCallbacks,
+ vk::PhysicalDevice physicalDevice) const
+{
+ vk::XlibSurfaceCreateInfoKHR info;
+ info.setDpy(mDisplay).setWindow(mWindow);
+ auto retval = instance.createXlibSurfaceKHR(info, allocCallbacks).value;
+ return retval;
+}
+}
+}
+}
--- /dev/null
+#ifndef DALI_GRAPHICS_VULKAN_VKSURFACEXLIB_H
+#define DALI_GRAPHICS_VULKAN_VKSURFACEXLIB_H
+
+/*
+ * Copyright (c) 2017 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef VK_USE_PLATFORM_XLIB_KHR
+#define VK_USE_PLATFORM_XLIB_KHR
+#endif
+
+// INTERNAL INCLUDES
+#include <dali/integration-api/graphics/vulkan/vk-surface-factory.h>
+
+// EXTERNAL INCLUDES
+#include <vulkan/vulkan.hpp>
+
+namespace Dali
+{
+class RenderSurface;
+
+namespace Graphics
+{
+namespace Vulkan
+{
+
+class VkSurfaceXlib final : public Dali::Integration::Graphics::Vulkan::VkSurfaceFactory
+{
+public:
+ VkSurfaceXlib(Dali::RenderSurface& renderSurface);
+
+ VkSurfaceXlib(Display* display, Window window);
+
+ virtual vk::SurfaceKHR Create(vk::Instance instance, vk::AllocationCallbacks* allocCallbacks,
+ vk::PhysicalDevice physicalDevice) const override;
+
+private:
+ Display* mDisplay;
+ ::Window mWindow;
+ vk::SurfaceKHR mSurface;
+};
+
+} // Namespace Vulkan
+} // Namespace Graphics
+} // Namespace Dali
+
+#endif // DALI_GRAPHICS_VULKAN_VKSURFACEXLIB_H
--- /dev/null
+/*
+ * Copyright (c) 2017 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <adaptors/devel-api/adaptor-framework/render-surface.h>
+#include <dali/internal/graphics/vulkan/x11/vk-surface-xlib2xcb.h>
+#include <dali/internal/window-system/common/window-render-surface.h>
+
+#include <X11/Xlib-xcb.h>
+
+namespace Dali
+{
+namespace Graphics
+{
+namespace Vulkan
+{
+
+VkSurfaceXlib2Xcb::VkSurfaceXlib2Xcb(Dali::RenderSurface& renderSurface)
+: VkSurfaceFactory()
+{
+ auto ecoreSurface = dynamic_cast<Dali::ECore::WindowRenderSurface*>(&renderSurface);
+ assert( ecoreSurface != nullptr && "This is not ecore surface!");
+ mConnection = XGetXCBConnection(XOpenDisplay(nullptr));
+ mWindow = static_cast<decltype(mWindow)>(ecoreSurface->GetXWindow());
+}
+
+VkSurfaceXlib2Xcb::VkSurfaceXlib2Xcb(Display* display, Window window)
+: VkSurfaceFactory()
+{
+ mConnection = XGetXCBConnection(display);
+ mWindow = static_cast<decltype(mWindow)>(window);
+}
+
+vk::SurfaceKHR VkSurfaceXlib2Xcb::Create(vk::Instance instance, vk::AllocationCallbacks* allocCallbacks,
+ vk::PhysicalDevice physicalDevice) const
+{
+ vk::XcbSurfaceCreateInfoKHR info;
+ info.setConnection(mConnection).setWindow(mWindow);
+ auto retval = instance.createXcbSurfaceKHR(info, allocCallbacks).value;
+ return retval;
+}
+}
+}
+}
--- /dev/null
+#ifndef DALI_GRAPHICS_VULKAN_VKSURFACEXLIB2XCB_H
+#define DALI_GRAPHICS_VULKAN_VKSURFACEXLIB2XCB_H
+
+/*
+ * Copyright (c) 2017 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef VK_USE_PLATFORM_XLIB_KHR
+#define VK_USE_PLATFORM_XLIB_KHR
+#endif
+#ifndef VK_USE_PLATFORM_XCB_KHR
+#define VK_USE_PLATFORM_XCB_KHR
+#endif
+
+// INTERNAL INCLUDES
+#include <dali/integration-api/graphics/vulkan/vk-surface-factory.h>
+
+// EXTERNAL INCLUDES
+#include <vulkan/vulkan.hpp>
+
+namespace Dali
+{
+class RenderSurface;
+
+namespace Graphics
+{
+namespace Vulkan
+{
+/**
+ * This surface exists only because of ( probably ) Nvidia driver bug.
+ * Presenting swapchain that uses Xlib surface crashes. Class VkSurfaceXlib2Xcb
+ * takes Xlib window arguments but creates Xcb surface. It's a workaround.
+ */
+class VkSurfaceXlib2Xcb final : public Dali::Integration::Graphics::Vulkan::VkSurfaceFactory
+{
+public:
+ VkSurfaceXlib2Xcb(Dali::RenderSurface& renderSurface);
+
+ VkSurfaceXlib2Xcb(Display* display, Window window);
+
+ virtual vk::SurfaceKHR Create(vk::Instance instance, vk::AllocationCallbacks* allocCallbacks,
+ vk::PhysicalDevice physicalDevice) const override;
+
+private:
+ xcb_connection_t* mConnection;
+ xcb_window_t mWindow;
+ vk::SurfaceKHR mSurface;
+};
+
+} // Namespace Vulkan
+} // Namespace Graphics
+} // Namespace Dali
+
+#endif // DALI_GRAPHICS_VULKAN_VKSURFACEXLIB2XCB_H
if(mNeedToApproveDeiconify)
{
// SwapBuffer is desychronized. So make sure to sychronize when window is deiconified.
- glAbstraction.Finish();
+ //glAbstraction.Finish();
XDisplay* display = AnyCast<XDisplay *>(displayConnection->GetDisplay());