зеркало из https://github.com/microsoft/FX11.git
Minor code review (#29)
This commit is contained in:
Родитель
9437385820
Коммит
f4c33640ae
|
@ -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" } }
|
||||
|
||||
]
|
||||
}
|
7
Effect.h
7
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
|
||||
|
|
|
@ -127,7 +127,7 @@ struct SEffectInvalidScalarVariable : public TEffectInvalidVariable<ID3DX11Effec
|
|||
{
|
||||
public:
|
||||
|
||||
STDMETHOD(SetFloat)(_In_ const float Value) override { UNREFERENCED_PARAMETER(Value); return E_FAIL; }
|
||||
STDMETHOD(SetFloat)(_In_ float Value) override { UNREFERENCED_PARAMETER(Value); return E_FAIL; }
|
||||
STDMETHOD(GetFloat)(_Out_ float *pValue) override { UNREFERENCED_PARAMETER(pValue); return E_FAIL; }
|
||||
|
||||
STDMETHOD(SetFloatArray)(_In_reads_(Count) const float *pData, _In_ uint32_t Offset, _In_ uint32_t Count) override
|
||||
|
@ -135,7 +135,7 @@ public:
|
|||
STDMETHOD(GetFloatArray)(_Out_writes_(Count) float *pData, _In_ uint32_t Offset, _In_ uint32_t Count) override
|
||||
{ UNREFERENCED_PARAMETER(pData); UNREFERENCED_PARAMETER(Offset); UNREFERENCED_PARAMETER(Count); return E_FAIL; }
|
||||
|
||||
STDMETHOD(SetInt)(_In_ const int Value) override { UNREFERENCED_PARAMETER(Value); return E_FAIL; }
|
||||
STDMETHOD(SetInt)(_In_ int Value) override { UNREFERENCED_PARAMETER(Value); return E_FAIL; }
|
||||
STDMETHOD(GetInt)(_Out_ int *pValue) override { UNREFERENCED_PARAMETER(pValue); return E_FAIL; }
|
||||
|
||||
STDMETHOD(SetIntArray)(_In_reads_(Count) const int *pData, _In_ uint32_t Offset, _In_ uint32_t Count) override
|
||||
|
@ -143,7 +143,7 @@ public:
|
|||
STDMETHOD(GetIntArray)(_Out_writes_(Count) int *pData, _In_ uint32_t Offset, _In_ uint32_t Count) override
|
||||
{ UNREFERENCED_PARAMETER(pData); UNREFERENCED_PARAMETER(Offset); UNREFERENCED_PARAMETER(Count); return E_FAIL; }
|
||||
|
||||
STDMETHOD(SetBool)(_In_ const bool Value) override { UNREFERENCED_PARAMETER(Value); return E_FAIL; }
|
||||
STDMETHOD(SetBool)(_In_ bool Value) override { UNREFERENCED_PARAMETER(Value); return E_FAIL; }
|
||||
STDMETHOD(GetBool)(_Out_ bool *pValue) override { UNREFERENCED_PARAMETER(pValue); return E_FAIL; }
|
||||
|
||||
STDMETHOD(SetBoolArray)(_In_reads_(Count) const bool *pData, _In_ uint32_t Offset, _In_ uint32_t Count) override
|
||||
|
@ -826,7 +826,7 @@ struct TVariable : public IBaseInterface
|
|||
{
|
||||
SVariable *pMember;
|
||||
UDataPointer dataPtr;
|
||||
TTopLevelVariable<ID3DX11EffectVariable> *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<ID3DX11EffectVariable> *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<ID3DX11EffectVariable> *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<ID3DX11EffectVariable> *pTopLevelEntity2 = GetTopLevelEntity();
|
||||
auto pTopLevelEntity2 = GetTopLevelEntity();
|
||||
UDataPointer dataPtr;
|
||||
|
||||
if (pTopLevelEntity2->pEffect->IsOptimized())
|
||||
|
@ -1557,19 +1557,19 @@ lExit:
|
|||
template<typename IBaseInterface, bool IsAnnotation>
|
||||
struct TFloatScalarVariable : public TNumericVariable<IBaseInterface, IsAnnotation>
|
||||
{
|
||||
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<IBaseInterface, IsAnnotation>::GetFloatArray(float
|
|||
|
||||
template<typename IBaseInterface, bool IsAnnotation>
|
||||
_Use_decl_annotations_
|
||||
HRESULT TFloatScalarVariable<IBaseInterface, IsAnnotation>::SetInt(const int Value)
|
||||
HRESULT TFloatScalarVariable<IBaseInterface, IsAnnotation>::SetInt(int Value)
|
||||
{
|
||||
static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetInt";
|
||||
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
|
||||
|
@ -1650,7 +1650,7 @@ HRESULT TFloatScalarVariable<IBaseInterface, IsAnnotation>::GetIntArray(int *pDa
|
|||
|
||||
template<typename IBaseInterface, bool IsAnnotation>
|
||||
_Use_decl_annotations_
|
||||
HRESULT TFloatScalarVariable<IBaseInterface, IsAnnotation>::SetBool(const bool Value)
|
||||
HRESULT TFloatScalarVariable<IBaseInterface, IsAnnotation>::SetBool(bool Value)
|
||||
{
|
||||
static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetBool";
|
||||
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
|
||||
|
@ -1691,19 +1691,19 @@ HRESULT TFloatScalarVariable<IBaseInterface, IsAnnotation>::GetBoolArray(bool *p
|
|||
template<typename IBaseInterface, bool IsAnnotation>
|
||||
struct TIntScalarVariable : public TNumericVariable<IBaseInterface, IsAnnotation>
|
||||
{
|
||||
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<IBaseInterface, IsAnnotation>::GetFloatArray(float *p
|
|||
|
||||
template<typename IBaseInterface, bool IsAnnotation>
|
||||
_Use_decl_annotations_
|
||||
HRESULT TIntScalarVariable<IBaseInterface, IsAnnotation>::SetInt(const int Value)
|
||||
HRESULT TIntScalarVariable<IBaseInterface, IsAnnotation>::SetInt(int Value)
|
||||
{
|
||||
static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetInt";
|
||||
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
|
||||
|
@ -1784,7 +1784,7 @@ HRESULT TIntScalarVariable<IBaseInterface, IsAnnotation>::GetIntArray(int *pData
|
|||
|
||||
template<typename IBaseInterface, bool IsAnnotation>
|
||||
_Use_decl_annotations_
|
||||
HRESULT TIntScalarVariable<IBaseInterface, IsAnnotation>::SetBool(const bool Value)
|
||||
HRESULT TIntScalarVariable<IBaseInterface, IsAnnotation>::SetBool(bool Value)
|
||||
{
|
||||
static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetBool";
|
||||
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
|
||||
|
@ -1825,19 +1825,19 @@ HRESULT TIntScalarVariable<IBaseInterface, IsAnnotation>::GetBoolArray(bool *pDa
|
|||
template<typename IBaseInterface, bool IsAnnotation>
|
||||
struct TBoolScalarVariable : public TNumericVariable<IBaseInterface, IsAnnotation>
|
||||
{
|
||||
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<IBaseInterface, IsAnnotation>::GetFloatArray(float *
|
|||
|
||||
template<typename IBaseInterface, bool IsAnnotation>
|
||||
_Use_decl_annotations_
|
||||
HRESULT TBoolScalarVariable<IBaseInterface, IsAnnotation>::SetInt(const int Value)
|
||||
HRESULT TBoolScalarVariable<IBaseInterface, IsAnnotation>::SetInt(int Value)
|
||||
{
|
||||
static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetInt";
|
||||
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
|
||||
|
@ -1918,7 +1918,7 @@ HRESULT TBoolScalarVariable<IBaseInterface, IsAnnotation>::GetIntArray(int *pDat
|
|||
|
||||
template<typename IBaseInterface, bool IsAnnotation>
|
||||
_Use_decl_annotations_
|
||||
HRESULT TBoolScalarVariable<IBaseInterface, IsAnnotation>::SetBool(const bool Value)
|
||||
HRESULT TBoolScalarVariable<IBaseInterface, IsAnnotation>::SetBool(bool Value)
|
||||
{
|
||||
static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetBool";
|
||||
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
|
||||
|
|
|
@ -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;
|
||||
|
|
9
pchfx.h
9
pchfx.h
|
@ -22,7 +22,7 @@
|
|||
// C6326 Potential comparison of a constant with another constant
|
||||
|
||||
#ifndef NOMINMAX
|
||||
#define NOMINMAX
|
||||
#define NOMINMAX 1
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
|
@ -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 <cstddef>
|
||||
|
|
Загрузка…
Ссылка в новой задаче