From 86765854b01cf19a25fb4371daeb0b5f87cb02f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Mon, 5 Jan 2015 20:59:58 -0800 Subject: [PATCH] Fixed missing DX11 defines when building with MinGW on Linux. --- scripts/genie.lua | 3 +++ src/renderer_d3d11.cpp | 10 +++++----- src/renderer_d3d11.h | 21 +++++++++++++++++++++ 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/scripts/genie.lua b/scripts/genie.lua index ee67ca92..8b26a7a9 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -148,6 +148,9 @@ function exampleProject(_name) "/DELAYLOAD:\"libGLESv2.dll\"", } + configuration { "mingw*" } + targetextension ".exe" + configuration { "vs20* or mingw*" } links { "gdi32", diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index 0bb5c54e..4fbee8b6 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -653,13 +653,13 @@ namespace bgfx D3D11_INFO_QUEUE_FILTER filter; memset(&filter, 0, sizeof(filter) ); - D3D11_MESSAGE_CATEGORY categies[] = + D3D11_MESSAGE_CATEGORY catlist[] = { D3D11_MESSAGE_CATEGORY_STATE_SETTING, D3D11_MESSAGE_CATEGORY_EXECUTION, }; - filter.DenyList.NumCategories = BX_COUNTOF(categies); - filter.DenyList.pCategoryList = categies; + filter.DenyList.NumCategories = BX_COUNTOF(catlist); + filter.DenyList.pCategoryList = catlist; infoQueue->PushStorageFilter(&filter); DX_RELEASE(infoQueue, 3); @@ -2311,8 +2311,8 @@ namespace bgfx { desc.Usage = D3D11_USAGE_DEFAULT; desc.CPUAccessFlags = 0; - desc.StructureByteStride = isValid(_declHandle) - ? s_renderD3D11->m_vertexDecls[_declHandle.idx].m_stride + desc.StructureByteStride = isValid(_declHandle) + ? s_renderD3D11->m_vertexDecls[_declHandle.idx].m_stride : 0 ; diff --git a/src/renderer_d3d11.h b/src/renderer_d3d11.h index dc54e1a2..eb74566d 100644 --- a/src/renderer_d3d11.h +++ b/src/renderer_d3d11.h @@ -49,6 +49,27 @@ BX_PRAGMA_DIAGNOSTIC_POP() # define D3D_FEATURE_LEVEL_11_1 D3D_FEATURE_LEVEL(0xb100) #endif // D3D_FEATURE_LEVEL_11_1 +// MinGW Linux/Wine missing defines... +#ifndef D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT +# define D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT 8 +#endif // D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT + +#ifndef D3D11_PS_CS_UAV_REGISTER_COUNT +# define D3D11_PS_CS_UAV_REGISTER_COUNT 8 +#endif // D3D11_PS_CS_UAV_REGISTER_COUNT + +#ifndef D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT +# define D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT 8 +#endif + +#ifndef D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT +# define D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT 8 +#endif // D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT + +#ifndef D3D11_APPEND_ALIGNED_ELEMENT +# define D3D11_APPEND_ALIGNED_ELEMENT UINT32_MAX +#endif // D3D11_APPEND_ALIGNED_ELEMENT + namespace bgfx { struct IndexBufferD3D11