diff --git a/CMakePresets.json b/CMakePresets.json index f3cc020..343d9c1 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -116,7 +116,14 @@ { "name": "x86-Debug-Clang" , "description": "Clang/LLVM for x86 (Debug)", "inherits": [ "base", "x86", "Debug", "Clang" ], "environment": { "CXXFLAGS": "-m32" } }, { "name": "x86-Release-Clang" , "description": "Clang/LLVM for x86 (Release)", "inherits": [ "base", "x86", "Release", "Clang" ], "environment": { "CXXFLAGS": "-m32" } }, { "name": "arm64-Debug-Clang" , "description": "Clang/LLVM for AArch64 (Debug)", "inherits": [ "base", "ARM64", "Debug", "Clang" ], "environment": { "CXXFLAGS": "--target=arm64-pc-windows-msvc" } }, - { "name": "arm64-Release-Clang", "description": "Clang/LLVM for AArch64 (Release)", "inherits": [ "base", "ARM64", "Release", "Clang" ], "environment": { "CXXFLAGS": "--target=arm64-pc-windows-msvc" } } + { "name": "arm64-Release-Clang", "description": "Clang/LLVM for AArch64 (Release)", "inherits": [ "base", "ARM64", "Release", "Clang" ], "environment": { "CXXFLAGS": "--target=arm64-pc-windows-msvc" } }, + + { "name": "x64-Debug-UWP-Clang" , "description": "Clang/LLVM for x64 (Debug) for UWP", "inherits": [ "base", "x64", "Debug", "Clang", "UWP" ] }, + { "name": "x64-Release-UWP-Clang" , "description": "Clang/LLVM for x64 (Release) for UWP", "inherits": [ "base", "x64", "Release", "Clang", "UWP" ] }, + { "name": "x86-Debug-UWP-Clang" , "description": "Clang/LLVM for x86 (Debug) for UWP", "inherits": [ "base", "x86", "Debug", "Clang", "UWP" ], "environment": { "CXXFLAGS": "-m32" } }, + { "name": "x86-Release-UWP-Clang" , "description": "Clang/LLVM for x86 (Release) for UWP", "inherits": [ "base", "x86", "Release", "Clang", "UWP" ], "environment": { "CXXFLAGS": "-m32" } }, + { "name": "arm64-Debug-UWP-Clang" , "description": "Clang/LLVM for AArch64 (Debug) for UWP", "inherits": [ "base", "ARM64", "Debug", "Clang", "UWP" ], "environment": { "CXXFLAGS": "--target=arm64-pc-windows-msvc" } }, + { "name": "arm64-Release-UWP-Clang", "description": "Clang/LLVM for AArch64 (Release) for UWP", "inherits": [ "base", "ARM64", "Release", "Clang", "UWP" ], "environment": { "CXXFLAGS": "--target=arm64-pc-windows-msvc" } } ] } \ No newline at end of file diff --git a/Effect.h b/Effect.h index c350f02..003ef2b 100644 --- a/Effect.h +++ b/Effect.h @@ -14,13 +14,6 @@ #include "EffectBinaryFormat.h" #include "IUnknownImp.h" -#ifdef _DEBUG -extern void __cdecl D3DXDebugPrintf(UINT lvl, _In_z_ _Printf_format_string_ LPCSTR szFormat, ...); -#define DPF D3DXDebugPrintf -#else -#define DPF -#endif - #pragma warning(push) #pragma warning(disable : 4481) // VS 2010 considers 'override' to be a extension, but it's part of C++11 as of VS 2012 diff --git a/EffectVariable.inl b/EffectVariable.inl index d287e85..7d6a962 100644 --- a/EffectVariable.inl +++ b/EffectVariable.inl @@ -127,7 +127,7 @@ struct SEffectInvalidScalarVariable : public TEffectInvalidVariable *pTopLevelEntity2 = GetTopLevelEntity(); + auto pTopLevelEntity2 = GetTopLevelEntity(); if (((ID3DX11Effect*)pTopLevelEntity2->pEffect)->IsOptimized()) { @@ -854,7 +854,7 @@ struct TVariable : public IBaseInterface SVariable *pMember; UDataPointer dataPtr; uint32_t index; - TTopLevelVariable *pTopLevelEntity2 = GetTopLevelEntity(); + auto pTopLevelEntity2 = GetTopLevelEntity(); if (pTopLevelEntity2->pEffect->IsOptimized()) { @@ -883,7 +883,7 @@ struct TVariable : public IBaseInterface SVariable *pMember; UDataPointer dataPtr; uint32_t index; - TTopLevelVariable *pTopLevelEntity2 = GetTopLevelEntity(); + auto pTopLevelEntity2 = GetTopLevelEntity(); if (pTopLevelEntity2->pEffect->IsOptimized()) { @@ -910,7 +910,7 @@ struct TVariable : public IBaseInterface STDMETHOD_(ID3DX11EffectVariable*, GetElement)(_In_ uint32_t Index) { static LPCSTR pFuncName = "ID3DX11EffectVariable::GetElement"; - TTopLevelVariable *pTopLevelEntity2 = GetTopLevelEntity(); + auto pTopLevelEntity2 = GetTopLevelEntity(); UDataPointer dataPtr; if (pTopLevelEntity2->pEffect->IsOptimized()) @@ -1557,19 +1557,19 @@ lExit: template struct TFloatScalarVariable : public TNumericVariable { - STDMETHOD(SetFloat)(_In_ const float Value) override; + STDMETHOD(SetFloat)(_In_ float Value) override; STDMETHOD(GetFloat)(_Out_ float *pValue) override; STDMETHOD(SetFloatArray)(_In_reads_(Count) const float *pData, _In_ uint32_t Offset, _In_ uint32_t Count) override; STDMETHOD(GetFloatArray)(_Out_writes_(Count) float *pData, _In_ uint32_t Offset, _In_ uint32_t Count) override; - STDMETHOD(SetInt)(_In_ const int Value) override; + STDMETHOD(SetInt)(_In_ int Value) override; STDMETHOD(GetInt)(_Out_ int *pValue) override; STDMETHOD(SetIntArray)(_In_reads_(Count) const int *pData, _In_ uint32_t Offset, _In_ uint32_t Count) override; STDMETHOD(GetIntArray)(_Out_writes_(Count) int *pData, _In_ uint32_t Offset, _In_ uint32_t Count) override; - STDMETHOD(SetBool)(_In_ const bool Value) override; + STDMETHOD(SetBool)(_In_ bool Value) override; STDMETHOD(GetBool)(_Out_ bool *pValue) override; STDMETHOD(SetBoolArray)(_In_reads_(Count) const bool *pData, _In_ uint32_t Offset, _In_ uint32_t Count) override; @@ -1614,7 +1614,7 @@ HRESULT TFloatScalarVariable::GetFloatArray(float template _Use_decl_annotations_ -HRESULT TFloatScalarVariable::SetInt(const int Value) +HRESULT TFloatScalarVariable::SetInt(int Value) { static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetInt"; if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName); @@ -1650,7 +1650,7 @@ HRESULT TFloatScalarVariable::GetIntArray(int *pDa template _Use_decl_annotations_ -HRESULT TFloatScalarVariable::SetBool(const bool Value) +HRESULT TFloatScalarVariable::SetBool(bool Value) { static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetBool"; if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName); @@ -1691,19 +1691,19 @@ HRESULT TFloatScalarVariable::GetBoolArray(bool *p template struct TIntScalarVariable : public TNumericVariable { - STDMETHOD(SetFloat)(_In_ const float Value) override; + STDMETHOD(SetFloat)(_In_ float Value) override; STDMETHOD(GetFloat)(_Out_ float *pValue) override; STDMETHOD(SetFloatArray)(_In_reads_(Count) const float *pData, _In_ uint32_t Offset, _In_ uint32_t Count) override; STDMETHOD(GetFloatArray)(_Out_writes_(Count) float *pData, _In_ uint32_t Offset, _In_ uint32_t Count) override; - STDMETHOD(SetInt)(_In_ const int Value) override; + STDMETHOD(SetInt)(_In_ int Value) override; STDMETHOD(GetInt)(_Out_ int *pValue) override; STDMETHOD(SetIntArray)(_In_reads_(Count) const int *pData, _In_ uint32_t Offset, _In_ uint32_t Count) override; STDMETHOD(GetIntArray)(_Out_writes_(Count) int *pData, _In_ uint32_t Offset, _In_ uint32_t Count) override; - STDMETHOD(SetBool)(_In_ const bool Value) override; + STDMETHOD(SetBool)(_In_ bool Value) override; STDMETHOD(GetBool)(_Out_ bool *pValue) override; STDMETHOD(SetBoolArray)(_In_reads_(Count) const bool *pData, _In_ uint32_t Offset, _In_ uint32_t Count) override; @@ -1748,7 +1748,7 @@ HRESULT TIntScalarVariable::GetFloatArray(float *p template _Use_decl_annotations_ -HRESULT TIntScalarVariable::SetInt(const int Value) +HRESULT TIntScalarVariable::SetInt(int Value) { static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetInt"; if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName); @@ -1784,7 +1784,7 @@ HRESULT TIntScalarVariable::GetIntArray(int *pData template _Use_decl_annotations_ -HRESULT TIntScalarVariable::SetBool(const bool Value) +HRESULT TIntScalarVariable::SetBool(bool Value) { static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetBool"; if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName); @@ -1825,19 +1825,19 @@ HRESULT TIntScalarVariable::GetBoolArray(bool *pDa template struct TBoolScalarVariable : public TNumericVariable { - STDMETHOD(SetFloat)(_In_ const float Value) override; + STDMETHOD(SetFloat)(_In_ float Value) override; STDMETHOD(GetFloat)(_Out_ float *pValue) override; STDMETHOD(SetFloatArray)(_In_reads_(Count) const float *pData, _In_ uint32_t Offset, _In_ uint32_t Count) override; STDMETHOD(GetFloatArray)(_Out_writes_(Count) float *pData, _In_ uint32_t Offset, _In_ uint32_t Count) override; - STDMETHOD(SetInt)(_In_ const int Value) override; + STDMETHOD(SetInt)(_In_ int Value) override; STDMETHOD(GetInt)(_Out_ int *pValue) override; STDMETHOD(SetIntArray)(_In_reads_(Count) const int *pData, _In_ uint32_t Offset, _In_ uint32_t Count) override; STDMETHOD(GetIntArray)(_Out_writes_(Count) int *pData, _In_ uint32_t Offset, _In_ uint32_t Count) override; - STDMETHOD(SetBool)(_In_ const bool Value) override; + STDMETHOD(SetBool)(_In_ bool Value) override; STDMETHOD(GetBool)(_Out_ bool *pValue) override; STDMETHOD(SetBoolArray)(_In_reads_(Count) const bool *pData, uint32_t Offset, _In_ uint32_t Count) override; @@ -1882,7 +1882,7 @@ HRESULT TBoolScalarVariable::GetFloatArray(float * template _Use_decl_annotations_ -HRESULT TBoolScalarVariable::SetInt(const int Value) +HRESULT TBoolScalarVariable::SetInt(int Value) { static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetInt"; if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName); @@ -1918,7 +1918,7 @@ HRESULT TBoolScalarVariable::GetIntArray(int *pDat template _Use_decl_annotations_ -HRESULT TBoolScalarVariable::SetBool(const bool Value) +HRESULT TBoolScalarVariable::SetBool(bool Value) { static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetBool"; if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName); diff --git a/inc/d3dx11effect.h b/inc/d3dx11effect.h index bfdc865..4edbcf6 100644 --- a/inc/d3dx11effect.h +++ b/inc/d3dx11effect.h @@ -343,19 +343,19 @@ DECLARE_INTERFACE_(ID3DX11EffectScalarVariable, ID3DX11EffectVariable) // ID3DX11EffectVariable // ID3DX11EffectScalarVariable - STDMETHOD(SetFloat)(THIS_ _In_ const float Value) PURE; + STDMETHOD(SetFloat)(THIS_ _In_ float Value) PURE; STDMETHOD(GetFloat)(THIS_ _Out_ float *pValue) PURE; STDMETHOD(SetFloatArray)(THIS_ _In_reads_(Count) const float *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; STDMETHOD(GetFloatArray)(THIS_ _Out_writes_(Count) float *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; - STDMETHOD(SetInt)(THIS_ _In_ const int Value) PURE; + STDMETHOD(SetInt)(THIS_ _In_ int Value) PURE; STDMETHOD(GetInt)(THIS_ _Out_ int *pValue) PURE; STDMETHOD(SetIntArray)(THIS_ _In_reads_(Count) const int *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; STDMETHOD(GetIntArray)(THIS_ _Out_writes_(Count) int *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; - STDMETHOD(SetBool)(THIS_ _In_ const bool Value) PURE; + STDMETHOD(SetBool)(THIS_ _In_ bool Value) PURE; STDMETHOD(GetBool)(THIS_ _Out_ bool *pValue) PURE; STDMETHOD(SetBoolArray)(THIS_ _In_reads_(Count) const bool *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE; diff --git a/pchfx.h b/pchfx.h index b637975..002050c 100644 --- a/pchfx.h +++ b/pchfx.h @@ -22,7 +22,7 @@ // C6326 Potential comparison of a constant with another constant #ifndef NOMINMAX -#define NOMINMAX +#define NOMINMAX 1 #endif #include @@ -52,6 +52,13 @@ #define offsetof_fx( a, b ) (uint32_t)offsetof( a, b ) +#ifdef _DEBUG +extern void __cdecl D3DXDebugPrintf(UINT lvl, _In_z_ _Printf_format_string_ LPCSTR szFormat, ...); +#define DPF D3DXDebugPrintf +#else +#define DPF +#endif + #include "d3dxGlobal.h" #include