1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

DirectX: Make it easier to enable debug logging output

This commit is contained in:
reuk 2024-11-27 16:54:41 +00:00
parent 3c75e7eeeb
commit 4b9253dc76
No known key found for this signature in database

View file

@ -35,6 +35,8 @@
namespace juce
{
constexpr auto enableDirectXDebugLayer = false;
struct DxgiAdapter : public ReferenceCountedObject
{
using Ptr = ReferenceCountedObjectPtr<DxgiAdapter>;
@ -60,7 +62,8 @@ struct DxgiAdapter : public ReferenceCountedObject
// This flag adds support for surfaces with a different color channel ordering
// than the API default. It is required for compatibility with Direct2D.
const auto creationFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;
const auto creationFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT
| (enableDirectXDebugLayer ? D3D11_CREATE_DEVICE_DEBUG : 0);
if (const auto hr = D3D11CreateDevice (result->dxgiAdapter,
D3D_DRIVER_TYPE_UNKNOWN,
@ -266,7 +269,7 @@ private:
ComSmartPtr<ID2D1Factory2> d2dSharedFactory = [&]
{
D2D1_FACTORY_OPTIONS options;
options.debugLevel = D2D1_DEBUG_LEVEL_NONE;
options.debugLevel = enableDirectXDebugLayer ? D2D1_DEBUG_LEVEL_INFORMATION : D2D1_DEBUG_LEVEL_NONE;
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wlanguage-extension-token")
ComSmartPtr<ID2D1Factory2> result;
auto hr = D2D1CreateFactory (D2D1_FACTORY_TYPE_MULTI_THREADED,