CMake support added for building with MinGW (#275)

This commit is contained in:
Chuck Walbourn
2022-05-05 14:50:13 -07:00
committed by GitHub
parent 24c1415c9a
commit 9c72f2c6cd
26 changed files with 229 additions and 151 deletions

View File

@@ -64,16 +64,18 @@ using Microsoft::WRL::ComPtr;
namespace
{
//--------------------------------------------------------------------------------------
#if !defined(NO_D3D11_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
template<UINT TNameLength>
inline void SetDebugObjectName(_In_ ID3D11DeviceChild* resource, _In_ const char(&name)[TNameLength]) noexcept
{
#if !defined(NO_D3D11_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
resource->SetPrivateData(WKPDID_D3DDebugObjectName, TNameLength - 1, name);
#else
UNREFERENCED_PARAMETER(resource);
UNREFERENCED_PARAMETER(name);
#endif
}
#else
template<UINT TNameLength>
inline void SetDebugObjectName(_In_ ID3D11DeviceChild*, _In_ const char(&)[TNameLength]) noexcept
{
}
#endif
//-------------------------------------------------------------------------------------
// WIC Pixel Format Translation Data

View File

@@ -57,7 +57,11 @@
#define D3DX12_NO_STATE_OBJECT_HELPERS
#define D3DX12_NO_CHECK_FEATURE_SUPPORT_CLASS
#ifdef USING_DIRECTX_HEADERS
#include "directx/d3dx12.h"
#else
#include "d3dx12.h"
#endif
using namespace DirectX;
using Microsoft::WRL::ComPtr;
@@ -197,16 +201,18 @@ namespace
}
//---------------------------------------------------------------------------------
#if !defined(NO_D3D12_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
template<UINT TNameLength>
inline void SetDebugObjectName(_In_ ID3D12DeviceChild* resource, _In_z_ const wchar_t(&name)[TNameLength]) noexcept
{
#if !defined(NO_D3D12_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
resource->SetName(name);
#else
UNREFERENCED_PARAMETER(resource);
UNREFERENCED_PARAMETER(name);
#endif
}
#else
template<UINT TNameLength>
inline void SetDebugObjectName(_In_ ID3D12DeviceChild*, _In_z_ const wchar_t(&)[TNameLength]) noexcept
{
}
#endif
inline uint32_t CountMips(uint32_t width, uint32_t height) noexcept
{

View File

@@ -20,9 +20,22 @@
#pragma once
#include <d3d12.h>
#ifndef _WIN32
#error This module only supports Windows
#endif
#ifdef __MINGW32__
#include <unknwn.h>
#endif
#ifdef USING_DIRECTX_HEADERS
#include <directx/d3d12.h>
#include <dxguids/dxguids.h>
#else
#include <d3d12.h>
#pragma comment(lib,"dxguid.lib")
#endif
#pragma comment(lib,"windowscodecs.lib")
#include <cstddef>