aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthexai <58434170+thexai@users.noreply.github.com>2022-11-12 11:01:14 +0100
committerthexai <58434170+thexai@users.noreply.github.com>2022-11-12 11:01:14 +0100
commit9dfd20a8ee9d294855a25927d7abbc0bad1ba913 (patch)
tree34a1775c6dd4a471fff46b9db20dd68abde95fba
parent04f1417532fd43a2c8f87f7fd001f6a23421961c (diff)
[Windows] Sync Effects11 with upstream - Fix build with Visual Studio 2022 v17.4.0
https://github.com/microsoft/FX11
-rw-r--r--lib/win32/Effects11/Binary/EffectBinaryFormat.h5
-rw-r--r--lib/win32/Effects11/Binary/EffectStateBase11.h2
-rw-r--r--lib/win32/Effects11/Binary/EffectStates11.h2
-rw-r--r--lib/win32/Effects11/Binary/SOParser.h10
-rw-r--r--lib/win32/Effects11/CMakeLists.txt4
-rw-r--r--lib/win32/Effects11/Effect.h15
-rw-r--r--lib/win32/Effects11/EffectAPI.cpp21
-rw-r--r--lib/win32/Effects11/EffectLoad.cpp23
-rw-r--r--lib/win32/Effects11/EffectLoad.h2
-rw-r--r--lib/win32/Effects11/EffectNonRuntime.cpp50
-rw-r--r--lib/win32/Effects11/EffectReflection.cpp15
-rw-r--r--lib/win32/Effects11/EffectRuntime.cpp4
-rw-r--r--lib/win32/Effects11/EffectVariable.inl758
-rw-r--r--lib/win32/Effects11/HISTORY.md131
-rw-r--r--lib/win32/Effects11/IUnknownImp.h2
-rw-r--r--lib/win32/Effects11/LICENSE2
-rw-r--r--lib/win32/Effects11/README.md66
-rw-r--r--lib/win32/Effects11/ReadMe.txt178
-rw-r--r--lib/win32/Effects11/SECURITY.md41
-rw-r--r--lib/win32/Effects11/d3dxGlobal.cpp6
-rw-r--r--lib/win32/Effects11/inc/d3dx11effect.h4
-rw-r--r--lib/win32/Effects11/inc/d3dxGlobal.h69
-rw-r--r--lib/win32/Effects11/pchfx.h11
23 files changed, 722 insertions, 699 deletions
diff --git a/lib/win32/Effects11/Binary/EffectBinaryFormat.h b/lib/win32/Effects11/Binary/EffectBinaryFormat.h
index f6dc192b3e..55ccf60d00 100644
--- a/lib/win32/Effects11/Binary/EffectBinaryFormat.h
+++ b/lib/win32/Effects11/Binary/EffectBinaryFormat.h
@@ -5,7 +5,7 @@
// This is the binary file interface shared between the Effects
// compiler and runtime.
//
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//
// http://go.microsoft.com/fwlink/p/?LinkId=271568
@@ -44,7 +44,7 @@ static const EVersionTag g_EffectVersions[] =
// Enumeration of the possible left-hand side values of an assignment,
// divided up categorically by the type of block they may appear in
-enum ELhsType
+enum ELhsType : int
{
ELHS_Invalid,
@@ -148,6 +148,7 @@ enum EVarType
EVT_Object,
EVT_Struct,
EVT_Interface,
+ EVT_Count,
};
enum EScalarType
diff --git a/lib/win32/Effects11/Binary/EffectStateBase11.h b/lib/win32/Effects11/Binary/EffectStateBase11.h
index 7363781b99..fcd117a50b 100644
--- a/lib/win32/Effects11/Binary/EffectStateBase11.h
+++ b/lib/win32/Effects11/Binary/EffectStateBase11.h
@@ -3,7 +3,7 @@
//
// Direct3D 11 Effects States Header
//
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//
// http://go.microsoft.com/fwlink/p/?LinkId=271568
diff --git a/lib/win32/Effects11/Binary/EffectStates11.h b/lib/win32/Effects11/Binary/EffectStates11.h
index f488050420..a5fd1e7612 100644
--- a/lib/win32/Effects11/Binary/EffectStates11.h
+++ b/lib/win32/Effects11/Binary/EffectStates11.h
@@ -5,7 +5,7 @@
// This file defines properties of states which can appear in
// state blocks and pass blocks.
//
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//
// http://go.microsoft.com/fwlink/p/?LinkId=271568
diff --git a/lib/win32/Effects11/Binary/SOParser.h b/lib/win32/Effects11/Binary/SOParser.h
index 6ae5d5424f..412ea15e91 100644
--- a/lib/win32/Effects11/Binary/SOParser.h
+++ b/lib/win32/Effects11/Binary/SOParser.h
@@ -3,7 +3,7 @@
//
// Direct3D 11 Effects Stream Out Decl Parser
//
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//
// http://go.microsoft.com/fwlink/p/?LinkId=271568
@@ -108,7 +108,6 @@ protected:
HRESULT Parse( _In_ uint32_t Stream, _In_z_ LPCSTR pString )
{
HRESULT hr = S_OK;
- LPSTR pSemantic = nullptr;
m_pError[0] = 0;
@@ -123,7 +122,7 @@ protected:
VN( m_SemanticString[Stream] = new char[len + 1] );
strcpy_s( m_SemanticString[Stream], len + 1, pString );
- pSemantic = m_SemanticString[Stream];
+ LPSTR pSemantic = m_SemanticString[Stream];
while( true )
{
@@ -246,8 +245,7 @@ lExit:
_Analysis_assume_( ppSemantic && *ppSemantic );
HRESULT hr = S_OK;
- LPSTR pColon = strchr( *ppSemantic, ':' );
- int outputSlot = 0;
+ LPSTR pColon = strchr( *ppSemantic, ':' );
if( pColon == nullptr )
return S_OK;
@@ -260,7 +258,7 @@ lExit:
}
*pColon = '\0';
- outputSlot = atoi(*ppSemantic);
+ int outputSlot = atoi( *ppSemantic );
if( outputSlot < 0 || outputSlot > 255 )
{
strcpy_s( m_pError, MAX_ERROR_SIZE,
diff --git a/lib/win32/Effects11/CMakeLists.txt b/lib/win32/Effects11/CMakeLists.txt
index a71fa221c5..b886171278 100644
--- a/lib/win32/Effects11/CMakeLists.txt
+++ b/lib/win32/Effects11/CMakeLists.txt
@@ -11,6 +11,8 @@ target_include_directories(effects11
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Binary
)
+target_compile_options(effects11 PRIVATE "/permissive")
+
if(CORE_SYSTEM_NAME STREQUAL windowsstore)
target_compile_definitions(effects11 PRIVATE
_WIN7_PLATFORM_UPDATE
@@ -28,7 +30,7 @@ target_compile_definitions(effects11 PRIVATE
_WINDOWS
_LIB
D3DXFX_LARGEADDRESS_HANDLE
- _WIN32_WINNT=0x0600
+ _WIN32_WINNT=0x0601
_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS
)
endif()
diff --git a/lib/win32/Effects11/Effect.h b/lib/win32/Effects11/Effect.h
index 59d9d4128c..c350f02deb 100644
--- a/lib/win32/Effects11/Effect.h
+++ b/lib/win32/Effects11/Effect.h
@@ -3,7 +3,7 @@
//
// Direct3D 11 Effects Header for ID3DX11Effect Implementation
//
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//
// http://go.microsoft.com/fwlink/p/?LinkId=271568
@@ -13,9 +13,6 @@
#include "EffectBinaryFormat.h"
#include "IUnknownImp.h"
-#include "d3dxGlobal.h"
-
-#include <cassert>
#ifdef _DEBUG
extern void __cdecl D3DXDebugPrintf(UINT lvl, _In_z_ _Printf_format_string_ LPCSTR szFormat, ...);
@@ -724,10 +721,14 @@ struct SVariable
char *pSemantic;
uint32_t ExplicitBindPoint;
- SVariable() noexcept
+ SVariable() noexcept :
+ Data{},
+ pMemberData(nullptr),
+ pType(nullptr),
+ pName(nullptr),
+ pSemantic(nullptr),
+ ExplicitBindPoint(uint32_t(-1))
{
- ZeroMemory(this, sizeof(*this));
- ExplicitBindPoint = uint32_t(-1);
}
};
diff --git a/lib/win32/Effects11/EffectAPI.cpp b/lib/win32/Effects11/EffectAPI.cpp
index 5a2f1de0cf..7b8e222ac5 100644
--- a/lib/win32/Effects11/EffectAPI.cpp
+++ b/lib/win32/Effects11/EffectAPI.cpp
@@ -3,7 +3,7 @@
//
// Effect API entry point
//
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//
// http://go.microsoft.com/fwlink/p/?LinkId=271568
@@ -128,8 +128,6 @@ HRESULT WINAPI D3DX11CreateEffectFromFile( LPCWSTR pFileName, UINT FXFlags, ID3D
std::unique_ptr<uint8_t[]> fileData;
uint32_t size;
- int result = 0;
- CHAR* pstrName = nullptr;
HRESULT hr = LoadBinaryFromFile( pFileName, fileData, size );
if ( FAILED(hr) )
return hr;
@@ -142,8 +140,7 @@ HRESULT WINAPI D3DX11CreateEffectFromFile( LPCWSTR pFileName, UINT FXFlags, ID3D
// Create debug object name from input filename
CHAR strFileA[MAX_PATH];
- result = WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, pFileName, -1, strFileA, MAX_PATH,
- nullptr, FALSE);
+ int result = WideCharToMultiByte( CP_ACP, WC_NO_BEST_FIT_CHARS, pFileName, -1, strFileA, MAX_PATH, nullptr, FALSE );
if ( !result )
{
DPF(0, "Failed to load effect file due to WC to MB conversion failure: %ls", pFileName);
@@ -151,7 +148,7 @@ HRESULT WINAPI D3DX11CreateEffectFromFile( LPCWSTR pFileName, UINT FXFlags, ID3D
goto lExit;
}
- pstrName = strrchr(strFileA, '\\');
+ const CHAR* pstrName = strrchr( strFileA, '\\' );
if (!pstrName)
{
pstrName = strFileA;
@@ -229,8 +226,6 @@ HRESULT D3DX11CompileEffectFromFile( LPCWSTR pFileName,
}
ID3DBlob *blob = nullptr;
- CHAR* pstrName = nullptr;
- int result = 0;
#if (D3D_COMPILER_VERSION >= 46) && ( !defined(WINAPI_FAMILY) || ( (WINAPI_FAMILY != WINAPI_FAMILY_APP) && (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) ) )
@@ -254,15 +249,14 @@ HRESULT D3DX11CompileEffectFromFile( LPCWSTR pFileName,
// Create debug object name from input filename
CHAR strFileA[MAX_PATH];
- result = WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, pFileName, -1, strFileA, MAX_PATH,
- nullptr, FALSE);
+ int result = WideCharToMultiByte( CP_ACP, WC_NO_BEST_FIT_CHARS, pFileName, -1, strFileA, MAX_PATH, nullptr, FALSE );
if ( !result )
{
DPF(0, "Failed to load effect file due to WC to MB conversion failure: %ls", pFileName);
return E_FAIL;
}
- pstrName = strrchr(strFileA, '\\');
+ const CHAR* pstrName = strrchr( strFileA, '\\' );
if (!pstrName)
{
pstrName = strFileA;
@@ -296,8 +290,7 @@ HRESULT D3DX11CompileEffectFromFile( LPCWSTR pFileName,
#if (D3D_COMPILER_VERSION >= 46) && ( !defined(WINAPI_FAMILY) || ( (WINAPI_FAMILY != WINAPI_FAMILY_APP) && (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) ) )
// Create debug object name from input filename
CHAR strFileA[MAX_PATH];
- result = WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, pFileName, -1, strFileA, MAX_PATH,
- nullptr, FALSE);
+ int result = WideCharToMultiByte( CP_ACP, WC_NO_BEST_FIT_CHARS, pFileName, -1, strFileA, MAX_PATH, nullptr, FALSE );
if ( !result )
{
DPF(0, "Failed to load effect file due to WC to MB conversion failure: %ls", pFileName);
@@ -305,7 +298,7 @@ HRESULT D3DX11CompileEffectFromFile( LPCWSTR pFileName,
goto lExit;
}
- pstrName = strrchr(strFileA, '\\');
+ const CHAR* pstrName = strrchr( strFileA, '\\' );
if (!pstrName)
{
pstrName = strFileA;
diff --git a/lib/win32/Effects11/EffectLoad.cpp b/lib/win32/Effects11/EffectLoad.cpp
index 1ee342ad4d..40dfe0c019 100644
--- a/lib/win32/Effects11/EffectLoad.cpp
+++ b/lib/win32/Effects11/EffectLoad.cpp
@@ -3,7 +3,7 @@
//
// Direct3D Effects file loading code
//
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//
// http://go.microsoft.com/fwlink/p/?LinkId=271568
@@ -184,8 +184,8 @@ inline HRESULT VerifyPointer(uint32_t oBase, uint32_t dwSize, uint32_t dwMaxSize
CEffectHeap::CEffectHeap() noexcept :
m_pData(nullptr),
- m_dwSize(0),
- m_dwBufferSize(0)
+ m_dwBufferSize(0),
+ m_dwSize(0)
{
}
@@ -788,7 +788,6 @@ HRESULT CEffectLoader::LoadEffect(CEffect *pEffect, const void *pEffectBuffer, u
HRESULT hr = S_OK;
uint32_t i, varSize, cMemberDataBlocks;
CCheckedDword chkVariables = 0;
- uint32_t oStructured = 0;
// Used for cloning
m_pvOldMemberInterfaces = nullptr;
@@ -876,7 +875,7 @@ HRESULT CEffectLoader::LoadEffect(CEffect *pEffect, const void *pEffectBuffer, u
VN( m_pEffect->m_pRenderTargetViews = PRIVATENEW SRenderTargetView[m_pHeader->cRenderTargetViews] );
VN( m_pEffect->m_pDepthStencilViews = PRIVATENEW SDepthStencilView[m_pHeader->cDepthStencilViews] );
- oStructured = m_pHeader->cbUnstructured + sizeof(SBinaryHeader5);
+ uint32_t oStructured = m_pHeader->cbUnstructured + sizeof(SBinaryHeader5);
VHD( m_msStructured.Seek(oStructured), "Invalid pEffectBuffer: Missing structured data block." );
VH( m_msUnstructured.SetData(m_pData + sizeof(SBinaryHeader5), oStructured - sizeof(SBinaryHeader5)) );
@@ -995,8 +994,7 @@ HRESULT CEffectLoader::LoadTypeAndAddToPool(SType **ppType, uint32_t dwOffset)
uint8_t *pHashBuffer;
uint32_t hash;
SVariable *pTempMembers = nullptr;
- uint32_t cElements = 0;
-
+
m_HashBuffer.Empty();
VHD( m_msUnstructured.ReadAtOffset(dwOffset, sizeof(SBinaryType), (void**) &psType), "Invalid pEffectBuffer: cannot read type." );
@@ -1008,7 +1006,7 @@ HRESULT CEffectLoader::LoadTypeAndAddToPool(SType **ppType, uint32_t dwOffset)
temporaryType.PackedSize = psType->PackedSize;
// sanity check elements, size, stride, etc.
- cElements = std::max<uint32_t>(1, temporaryType.Elements);
+ uint32_t cElements = std::max<uint32_t>(1, temporaryType.Elements);
VBD( cElements * temporaryType.Stride == AlignToPowerOf2(temporaryType.TotalSize, SType::c_RegisterSize), "Invalid pEffectBuffer: invalid type size." );
VBD( temporaryType.Stride % SType::c_RegisterSize == 0, "Invalid pEffectBuffer: invalid type stride." );
VBD( temporaryType.PackedSize <= temporaryType.TotalSize && temporaryType.PackedSize % cElements == 0, "Invalid pEffectBuffer: invalid type packed size." );
@@ -1018,7 +1016,7 @@ HRESULT CEffectLoader::LoadTypeAndAddToPool(SType **ppType, uint32_t dwOffset)
case EVT_Object:
VHD( m_msUnstructured.Read((void**) &pObjectType, sizeof(uint32_t)), "Invalid pEffectBuffer: cannot read object type." );
temporaryType.ObjectType = *pObjectType;
- VBD( temporaryType.VarType > EOT_Invalid && temporaryType.VarType < EOT_Count, "Invalid pEffectBuffer: invalid object type." );
+ VBD( temporaryType.VarType > EVT_Invalid && temporaryType.VarType < EVT_Count, "Invalid pEffectBuffer: invalid object type." );
VN( pHashBuffer = m_HashBuffer.AddRange(sizeof(temporaryType.VarType) + sizeof(temporaryType.Elements) +
sizeof(temporaryType.pTypeName) + sizeof(temporaryType.ObjectType)) );
@@ -2556,9 +2554,7 @@ HRESULT CEffectLoader::GrabShaderData(SShaderBlock *pShaderBlock)
SRange *pRange = nullptr;
CEffectVector<SConstantBuffer*> vTBuffers;
- uint32_t NumInterfaces = 0;
- uint32_t CurInterfaceParameter = 0;
-
+
//////////////////////////////////////////////////////////////////////////
// Step 1: iterate through the resource binding structures and build
// an "optimized" list of all of the dependencies
@@ -2797,7 +2793,8 @@ HRESULT CEffectLoader::GrabShaderData(SShaderBlock *pShaderBlock)
// Step 2: iterate through the interfaces and build
// an "optimized" list of all of the dependencies
- NumInterfaces = pShaderBlock->pReflectionData->pReflection->GetNumInterfaceSlots();
+ uint32_t NumInterfaces = pShaderBlock->pReflectionData->pReflection->GetNumInterfaceSlots();
+ uint32_t CurInterfaceParameter = 0;
if( NumInterfaces > 0 )
{
assert( ShaderDesc.ConstantBuffers > 0 );
diff --git a/lib/win32/Effects11/EffectLoad.h b/lib/win32/Effects11/EffectLoad.h
index 6bdb8a2fc9..c125f8cff8 100644
--- a/lib/win32/Effects11/EffectLoad.h
+++ b/lib/win32/Effects11/EffectLoad.h
@@ -4,7 +4,7 @@
// Direct3D 11 Effects header for the FX file loader
// A CEffectLoader is created at load time to facilitate loading
//
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//
// http://go.microsoft.com/fwlink/p/?LinkId=271568
diff --git a/lib/win32/Effects11/EffectNonRuntime.cpp b/lib/win32/Effects11/EffectNonRuntime.cpp
index 887b881e1a..e6908c2d49 100644
--- a/lib/win32/Effects11/EffectNonRuntime.cpp
+++ b/lib/win32/Effects11/EffectNonRuntime.cpp
@@ -6,7 +6,7 @@
// are typically called when creating, cloning, or optimizing an
// Effect, or reflecting a variable.
//
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//
// http://go.microsoft.com/fwlink/p/?LinkId=271568
@@ -376,7 +376,7 @@ HRESULT SShaderBlock::GetShaderDesc(_Out_ D3DX11_EFFECT_SHADER_DESC *pDesc, _In_
pDesc->NumPatchConstantSignatureEntries = ShaderDesc.PatchConstantParameters;
}
}
-lExit:
+
return hr;
}
@@ -1100,20 +1100,6 @@ _Use_decl_annotations_
HRESULT CEffect::BindToDevice(ID3D11Device *pDevice, LPCSTR srcName)
{
HRESULT hr = S_OK;
- uint32_t CurMemberData = 0;
- SConstantBuffer* pCB = nullptr;
- SConstantBuffer* pCBLast = nullptr;
- SRasterizerBlock* pRB = nullptr;
- SRasterizerBlock* pRBLast = nullptr;
- SSamplerBlock* pSampler = nullptr;
- SSamplerBlock* pSamplerLast = nullptr;
- ID3D11ClassLinkage* neededClassLinkage = nullptr;
- SShaderBlock* pShader = nullptr;
- SShaderBlock* pShaderLast = nullptr;
- SDepthStencilBlock* pDS = nullptr;
- SDepthStencilBlock* pDSLast = nullptr;
- SBlendBlock* pBlend = nullptr;
- SBlendBlock* pBlendLast = nullptr;
// Set new device
if (pDevice == nullptr)
@@ -1137,8 +1123,8 @@ HRESULT CEffect::BindToDevice(ID3D11Device *pDevice, LPCSTR srcName)
SetDebugObjectName(m_pClassLinkage,srcName);
// Create all constant buffers
- pCB = m_pCBs;
- pCBLast = m_pCBs + m_CBCount;
+ SConstantBuffer *pCB = m_pCBs;
+ SConstantBuffer *pCBLast = m_pCBs + m_CBCount;
for(; pCB != pCBLast; pCB++)
{
SAFE_RELEASE(pCB->pD3DObject);
@@ -1193,8 +1179,8 @@ HRESULT CEffect::BindToDevice(ID3D11Device *pDevice, LPCSTR srcName)
}
// Create all RasterizerStates
- pRB = m_pRasterizerBlocks;
- pRBLast = m_pRasterizerBlocks + m_RasterizerBlockCount;
+ SRasterizerBlock *pRB = m_pRasterizerBlocks;
+ SRasterizerBlock *pRBLast = m_pRasterizerBlocks + m_RasterizerBlockCount;
for(; pRB != pRBLast; pRB++)
{
SAFE_RELEASE(pRB->pRasterizerObject);
@@ -1208,8 +1194,8 @@ HRESULT CEffect::BindToDevice(ID3D11Device *pDevice, LPCSTR srcName)
}
// Create all DepthStencils
- pDS = m_pDepthStencilBlocks;
- pDSLast = m_pDepthStencilBlocks + m_DepthStencilBlockCount;
+ SDepthStencilBlock *pDS = m_pDepthStencilBlocks;
+ SDepthStencilBlock *pDSLast = m_pDepthStencilBlocks + m_DepthStencilBlockCount;
for(; pDS != pDSLast; pDS++)
{
SAFE_RELEASE(pDS->pDSObject);
@@ -1223,8 +1209,8 @@ HRESULT CEffect::BindToDevice(ID3D11Device *pDevice, LPCSTR srcName)
}
// Create all BlendStates
- pBlend = m_pBlendBlocks;
- pBlendLast = m_pBlendBlocks + m_BlendBlockCount;
+ SBlendBlock *pBlend = m_pBlendBlocks;
+ SBlendBlock *pBlendLast = m_pBlendBlocks + m_BlendBlockCount;
for(; pBlend != pBlendLast; pBlend++)
{
SAFE_RELEASE(pBlend->pBlendObject);
@@ -1238,8 +1224,8 @@ HRESULT CEffect::BindToDevice(ID3D11Device *pDevice, LPCSTR srcName)
}
// Create all Samplers
- pSampler = m_pSamplerBlocks;
- pSamplerLast = m_pSamplerBlocks + m_SamplerBlockCount;
+ SSamplerBlock *pSampler = m_pSamplerBlocks;
+ SSamplerBlock *pSamplerLast = m_pSamplerBlocks + m_SamplerBlockCount;
for(; pSampler != pSamplerLast; pSampler++)
{
SAFE_RELEASE(pSampler->pD3DObject);
@@ -1249,9 +1235,9 @@ HRESULT CEffect::BindToDevice(ID3D11Device *pDevice, LPCSTR srcName)
}
// Create all shaders
- neededClassLinkage = featureLevelGE11 ? m_pClassLinkage : nullptr;
- pShader = m_pShaderBlocks;
- pShaderLast = m_pShaderBlocks + m_ShaderBlockCount;
+ ID3D11ClassLinkage* neededClassLinkage = featureLevelGE11 ? m_pClassLinkage : nullptr;
+ SShaderBlock *pShader = m_pShaderBlocks;
+ SShaderBlock *pShaderLast = m_pShaderBlocks + m_ShaderBlockCount;
for(; pShader != pShaderLast; pShader++)
{
SAFE_RELEASE(pShader->pD3DObject);
@@ -1317,6 +1303,7 @@ HRESULT CEffect::BindToDevice(ID3D11Device *pDevice, LPCSTR srcName)
}
// Initialize the member data pointers for all variables
+ uint32_t CurMemberData = 0;
for (uint32_t i = 0; i < m_VariableCount; ++ i)
{
if( m_pVariables[i].pMemberData )
@@ -1900,7 +1887,6 @@ HRESULT CEffect::CopyOptimizedTypePool( CEffect* pEffectSource, CPointerMappingT
{
HRESULT hr = S_OK;
CEffectHeap* pOptimizedTypeHeap = nullptr;
- uint8_t* pReadTypes = nullptr;
assert( pEffectSource->m_pOptimizedTypeHeap != 0 );
_Analysis_assume_( pEffectSource->m_pOptimizedTypeHeap != 0 );
@@ -1913,7 +1899,7 @@ HRESULT CEffect::CopyOptimizedTypePool( CEffect* pEffectSource, CPointerMappingT
CPointerMappingTable::CIterator mapIter;
// first pass: move types over, build mapping table
- pReadTypes = pEffectSource->m_pOptimizedTypeHeap->GetDataStart();
+ uint8_t* pReadTypes = pEffectSource->m_pOptimizedTypeHeap->GetDataStart();
while( pEffectSource->m_pOptimizedTypeHeap->IsInHeap( pReadTypes ) )
{
SPointerMapping ptrMapping;
@@ -2200,7 +2186,6 @@ lExit:
HRESULT CEffect::OptimizeTypes(_Inout_ CPointerMappingTable *pMappingTable, _In_ bool Cloning)
{
HRESULT hr = S_OK;
- uint32_t Members = m_pMemberInterfaces.GetSize();
// find all child types, point them to the new location
for (size_t i = 0; i < m_VariableCount; ++ i)
@@ -2208,6 +2193,7 @@ HRESULT CEffect::OptimizeTypes(_Inout_ CPointerMappingTable *pMappingTable, _In_
VH( RemapType((SType**)&m_pVariables[i].pType, pMappingTable) );
}
+ uint32_t Members = m_pMemberInterfaces.GetSize();
for( size_t i=0; i < Members; i++ )
{
if( m_pMemberInterfaces[i] != nullptr )
diff --git a/lib/win32/Effects11/EffectReflection.cpp b/lib/win32/Effects11/EffectReflection.cpp
index b4207e0a82..48e7b67de4 100644
--- a/lib/win32/Effects11/EffectReflection.cpp
+++ b/lib/win32/Effects11/EffectReflection.cpp
@@ -3,7 +3,7 @@
//
// Direct3D 11 Effects public reflection APIs
//
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//
// http://go.microsoft.com/fwlink/p/?LinkId=271568
@@ -934,7 +934,7 @@ HRESULT SConstantBuffer::GetDesc(_Out_ D3DX11_EFFECT_VARIABLE_DESC *pDesc)
pDesc->Semantic = nullptr;
pDesc->BufferOffset = 0;
- if (ExplicitBindPoint != -1)
+ if (ExplicitBindPoint != static_cast<uint32_t>(- 1))
{
pDesc->ExplicitBindPoint = ExplicitBindPoint;
pDesc->Flags |= D3DX11_EFFECT_VARIABLE_EXPLICIT_BIND_POINT;
@@ -1438,6 +1438,10 @@ HRESULT SPassBlock::GetShaderDescHelper(D3DX11_PASS_SHADER_DESC *pDesc)
ApplyPassAssignments();
+#ifdef _PREFAST_
+#pragma prefast(push)
+#pragma prefast(disable:__WARNING_UNUSED_POINTER_ASSIGNMENT, "pFuncName used in DPF")
+#endif
switch (EShaderType)
{
case EOT_VertexShader:
@@ -1456,20 +1460,20 @@ HRESULT SPassBlock::GetShaderDescHelper(D3DX11_PASS_SHADER_DESC *pDesc)
pShaderBlock = BackingStore.pGeometryShaderBlock;
break;
case EOT_HullShader5:
-#pragma prefast(suppress:__WARNING_UNUSED_POINTER_ASSIGNMENT, "pFuncName used in DPF")
pFuncName = "ID3DX11EffectPass::GetHullShaderDesc";
pShaderBlock = BackingStore.pHullShaderBlock;
break;
case EOT_DomainShader5:
-#pragma prefast(suppress:__WARNING_UNUSED_POINTER_ASSIGNMENT, "pFuncName used in DPF")
pFuncName = "ID3DX11EffectPass::GetDomainShaderDesc";
pShaderBlock = BackingStore.pDomainShaderBlock;
break;
case EOT_ComputeShader5:
-#pragma prefast(suppress:__WARNING_UNUSED_POINTER_ASSIGNMENT, "pFuncName used in DPF")
pFuncName = "ID3DX11EffectPass::GetComputeShaderDesc";
pShaderBlock = BackingStore.pComputeShaderBlock;
break;
+#ifdef _PREFAST_
+#pragma prefast(pop)
+#endif
default:
assert(0);
}
@@ -1627,7 +1631,6 @@ HRESULT SPassBlock::Apply(_In_ uint32_t Flags, _In_ ID3D11DeviceContext* pContex
pEffect->ApplyPassBlock(this);
pEffect->m_pContext = nullptr;
-lExit:
return hr;
}
diff --git a/lib/win32/Effects11/EffectRuntime.cpp b/lib/win32/Effects11/EffectRuntime.cpp
index 4ef83e5455..90a4194794 100644
--- a/lib/win32/Effects11/EffectRuntime.cpp
+++ b/lib/win32/Effects11/EffectRuntime.cpp
@@ -5,7 +5,7 @@
// These functions are expected to be called at high frequency
// (when applying a pass).
//
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//
// http://go.microsoft.com/fwlink/p/?LinkId=271568
@@ -640,7 +640,7 @@ void CEffect::IncrementTimer()
m_LocalTimer++;
#if !defined(_M_X64) && !defined(_M_ARM64)
-#if _DEBUG
+#ifdef _DEBUG
if (m_LocalTimer > g_TimerRolloverCount)
{
DPF(0, "Rolling over timer (current time: %zu, rollover cap: %u).", m_LocalTimer, g_TimerRolloverCount);
diff --git a/lib/win32/Effects11/EffectVariable.inl b/lib/win32/Effects11/EffectVariable.inl
index c65c8d69cd..d287e85f56 100644
--- a/lib/win32/Effects11/EffectVariable.inl
+++ b/lib/win32/Effects11/EffectVariable.inl
@@ -4,7 +4,7 @@
// Direct3D 11 Effects Variable reflection template
// These templates define the many Effect variable types.
//
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//
// http://go.microsoft.com/fwlink/p/?LinkId=271568
@@ -749,7 +749,6 @@ inline HRESULT SetScalarArray(_In_reads_(Count) const SRC_TYPE *pSrcValues, _Out
_In_ const SType *pType, _In_ uint32_t TotalUnpackedSize, _In_z_ const char *pFuncName)
{
HRESULT hr = S_OK;
- uint32_t delta = pType->NumericType.IsPackedArray ? 1 : SType::c_ScalarsPerRegister;
#ifdef _DEBUG
VERIFYPARAMETER(pSrcValues);
@@ -765,8 +764,9 @@ inline HRESULT SetScalarArray(_In_reads_(Count) const SRC_TYPE *pSrcValues, _Out
UNREFERENCED_PARAMETER(pFuncName);
#endif
+ uint32_t i, j, delta = pType->NumericType.IsPackedArray ? 1 : SType::c_ScalarsPerRegister;
pDestValues += Offset * delta;
- for (uint32_t i = 0, j = 0; j < Count; i += delta, ++ j)
+ for (i = 0, j = 0; j < Count; i += delta, ++ j)
{
// pDestValues[i] = (DEST_TYPE)pSrcValues[j];
CopyScalarValue<SourceType, DestType, SRC_TYPE, false>(pSrcValues[j], &pDestValues[i], "SetScalarArray");
@@ -784,7 +784,6 @@ inline HRESULT GetScalarArray(_In_reads_(Count) SRC_TYPE *pSrcValues, _Out_write
_In_ const SType *pType, _In_ uint32_t TotalUnpackedSize, _In_z_ const char *pFuncName)
{
HRESULT hr = S_OK;
- uint32_t delta = pType->NumericType.IsPackedArray ? 1 : SType::c_ScalarsPerRegister;
#ifdef _DEBUG
VERIFYPARAMETER(pDestValues);
@@ -800,8 +799,9 @@ inline HRESULT GetScalarArray(_In_reads_(Count) SRC_TYPE *pSrcValues, _Out_write
UNREFERENCED_PARAMETER(pFuncName);
#endif
+ uint32_t i, j, delta = pType->NumericType.IsPackedArray ? 1 : SType::c_ScalarsPerRegister;
pSrcValues += Offset * delta;
- for (uint32_t i = 0, j = 0; j < Count; i += delta, ++ j)
+ for (i = 0, j = 0; j < Count; i += delta, ++ j)
{
// pDestValues[j] = (DEST_TYPE)pSrcValues[i];
CopyScalarValue<SourceType, DestType, SRC_TYPE, false>(pSrcValues[i], &pDestValues[j], "GetScalarArray");
@@ -810,8 +810,7 @@ inline HRESULT GetScalarArray(_In_reads_(Count) SRC_TYPE *pSrcValues, _Out_write
lExit:
return hr;
}
-template<class IBaseInterface>
-struct TTopLevelVariable;
+
//////////////////////////////////////////////////////////////////////////
// TVariable - implements type casting and member/element retrieval
@@ -827,7 +826,7 @@ struct TVariable : public IBaseInterface
{
SVariable *pMember;
UDataPointer dataPtr;
- TTopLevelVariable<ID3DX11EffectVariable> *pTopLevelEntity2 = this->GetTopLevelEntity();
+ TTopLevelVariable<ID3DX11EffectVariable> *pTopLevelEntity2 = GetTopLevelEntity();
if (((ID3DX11Effect*)pTopLevelEntity2->pEffect)->IsOptimized())
{
@@ -835,14 +834,14 @@ struct TVariable : public IBaseInterface
return &g_InvalidScalarVariable;
}
- if (this->pType->VarType != EVT_Struct)
+ if (pType->VarType != EVT_Struct)
{
DPF(0, "ID3DX11EffectVariable::GetMemberByIndex: Variable is not a structure");
return &g_InvalidScalarVariable;
}
- if (!GetVariableByIndexHelper<SVariable>(Index, this->pType->StructType.Members, this->pType->StructType.pMembers,
- this->Data.pNumeric, &pMember, &dataPtr.pGeneric))
+ if (!GetVariableByIndexHelper<SVariable>(Index, pType->StructType.Members, pType->StructType.pMembers,
+ Data.pNumeric, &pMember, &dataPtr.pGeneric))
{
return &g_InvalidScalarVariable;
}
@@ -855,7 +854,7 @@ struct TVariable : public IBaseInterface
SVariable *pMember;
UDataPointer dataPtr;
uint32_t index;
- TTopLevelVariable<ID3DX11EffectVariable> *pTopLevelEntity2 = this->GetTopLevelEntity();
+ TTopLevelVariable<ID3DX11EffectVariable> *pTopLevelEntity2 = GetTopLevelEntity();
if (pTopLevelEntity2->pEffect->IsOptimized())
{
@@ -863,14 +862,14 @@ struct TVariable : public IBaseInterface
return &g_InvalidScalarVariable;
}
- if (this->pType->VarType != EVT_Struct)
+ if (pType->VarType != EVT_Struct)
{
DPF(0, "ID3DX11EffectVariable::GetMemberByName: Variable is not a structure");
return &g_InvalidScalarVariable;
}
- if (!GetVariableByNameHelper<SVariable>(Name, this->pType->StructType.Members, this->pType->StructType.pMembers,
- this->Data.pNumeric, &pMember, &dataPtr.pGeneric, &index))
+ if (!GetVariableByNameHelper<SVariable>(Name, pType->StructType.Members, pType->StructType.pMembers,
+ Data.pNumeric, &pMember, &dataPtr.pGeneric, &index))
{
return &g_InvalidScalarVariable;
@@ -884,7 +883,7 @@ struct TVariable : public IBaseInterface
SVariable *pMember;
UDataPointer dataPtr;
uint32_t index;
- TTopLevelVariable<ID3DX11EffectVariable> *pTopLevelEntity2 = this->GetTopLevelEntity();
+ TTopLevelVariable<ID3DX11EffectVariable> *pTopLevelEntity2 = GetTopLevelEntity();
if (pTopLevelEntity2->pEffect->IsOptimized())
{
@@ -892,14 +891,14 @@ struct TVariable : public IBaseInterface
return &g_InvalidScalarVariable;
}
- if (this->pType->VarType != EVT_Struct)
+ if (pType->VarType != EVT_Struct)
{
DPF(0, "ID3DX11EffectVariable::GetMemberBySemantic: Variable is not a structure");
return &g_InvalidScalarVariable;
}
- if (!GetVariableBySemanticHelper<SVariable>(Semantic, this->pType->StructType.Members, this->pType->StructType.pMembers,
- this->Data.pNumeric, &pMember, &dataPtr.pGeneric, &index))
+ if (!GetVariableBySemanticHelper<SVariable>(Semantic, pType->StructType.Members, pType->StructType.pMembers,
+ Data.pNumeric, &pMember, &dataPtr.pGeneric, &index))
{
return &g_InvalidScalarVariable;
@@ -911,7 +910,7 @@ struct TVariable : public IBaseInterface
STDMETHOD_(ID3DX11EffectVariable*, GetElement)(_In_ uint32_t Index)
{
static LPCSTR pFuncName = "ID3DX11EffectVariable::GetElement";
- TTopLevelVariable<ID3DX11EffectVariable> *pTopLevelEntity2 = this->GetTopLevelEntity();
+ TTopLevelVariable<ID3DX11EffectVariable> *pTopLevelEntity2 = GetTopLevelEntity();
UDataPointer dataPtr;
if (pTopLevelEntity2->pEffect->IsOptimized())
@@ -920,25 +919,25 @@ struct TVariable : public IBaseInterface
return &g_InvalidScalarVariable;
}
- if (!this->IsArray())
+ if (!IsArray())
{
DPF(0, "%s: This interface does not refer to an array", pFuncName);
return &g_InvalidScalarVariable;
}
- if (Index >= this->pType->Elements)
+ if (Index >= pType->Elements)
{
- DPF(0, "%s: Invalid element index (%u, total: %u)", pFuncName, Index, this->pType->Elements);
+ DPF(0, "%s: Invalid element index (%u, total: %u)", pFuncName, Index, pType->Elements);
return &g_InvalidScalarVariable;
}
- if (this->pType->BelongsInConstantBuffer())
+ if (pType->BelongsInConstantBuffer())
{
- dataPtr.pGeneric = this->Data.pNumeric + this->pType->Stride * Index;
+ dataPtr.pGeneric = Data.pNumeric + pType->Stride * Index;
}
else
{
- dataPtr.pGeneric = GetBlockByIndex(this->pType->VarType, this->pType->ObjectType, this->Data.pGeneric, Index);
+ dataPtr.pGeneric = GetBlockByIndex(pType->VarType, pType->ObjectType, Data.pGeneric, Index);
if (nullptr == dataPtr.pGeneric)
{
DPF(0, "%s: Internal error", pFuncName);
@@ -953,8 +952,8 @@ struct TVariable : public IBaseInterface
{
static LPCSTR pFuncName = "ID3DX11EffectVariable::AsScalar";
- if (this->pType->VarType != EVT_Numeric ||
- this->pType->NumericType.NumericLayout != ENL_Scalar)
+ if (pType->VarType != EVT_Numeric ||
+ pType->NumericType.NumericLayout != ENL_Scalar)
{
DPF(0, "%s: Invalid typecast", pFuncName);
return &g_InvalidScalarVariable;
@@ -967,8 +966,8 @@ struct TVariable : public IBaseInterface
{
static LPCSTR pFuncName = "ID3DX11EffectVariable::AsVector";
- if (this->pType->VarType != EVT_Numeric ||
- this->pType->NumericType.NumericLayout != ENL_Vector)
+ if (pType->VarType != EVT_Numeric ||
+ pType->NumericType.NumericLayout != ENL_Vector)
{
DPF(0, "%s: Invalid typecast", pFuncName);
return &g_InvalidVectorVariable;
@@ -981,8 +980,8 @@ struct TVariable : public IBaseInterface
{
static LPCSTR pFuncName = "ID3DX11EffectVariable::AsMatrix";
- if (this->pType->VarType != EVT_Numeric ||
- this->pType->NumericType.NumericLayout != ENL_Matrix)
+ if (pType->VarType != EVT_Numeric ||
+ pType->NumericType.NumericLayout != ENL_Matrix)
{
DPF(0, "%s: Invalid typecast", pFuncName);
return &g_InvalidMatrixVariable;
@@ -995,7 +994,7 @@ struct TVariable : public IBaseInterface
{
static LPCSTR pFuncName = "ID3DX11EffectVariable::AsString";
- if (!this->pType->IsObjectType(EOT_String))
+ if (!pType->IsObjectType(EOT_String))
{
DPF(0, "%s: Invalid typecast", pFuncName);
return &g_InvalidStringVariable;
@@ -1008,12 +1007,12 @@ struct TVariable : public IBaseInterface
{
static LPCSTR pFuncName = "ID3DX11EffectVariable::AsClassInstance";
- if (!this->pType->IsClassInstance() )
+ if (!pType->IsClassInstance() )
{
DPF(0, "%s: Invalid typecast", pFuncName);
return &g_InvalidClassInstanceVariable;
}
- else if( this->pMemberData == nullptr )
+ else if( pMemberData == nullptr )
{
DPF(0, "%s: Non-global class instance variables (members of structs or classes) and class instances "
"inside tbuffers are not supported.", pFuncName );
@@ -1027,7 +1026,7 @@ struct TVariable : public IBaseInterface
{
static LPCSTR pFuncName = "ID3DX11EffectVariable::AsInterface";
- if (!this->pType->IsInterface())
+ if (!pType->IsInterface())
{
DPF(0, "%s: Invalid typecast", pFuncName);
return &g_InvalidInterfaceVariable;
@@ -1040,7 +1039,7 @@ struct TVariable : public IBaseInterface
{
static LPCSTR pFuncName = "ID3DX11EffectVariable::AsShaderResource";
- if (!this->pType->IsShaderResource())
+ if (!pType->IsShaderResource())
{
DPF(0, "%s: Invalid typecast", pFuncName);
return &g_InvalidShaderResourceVariable;
@@ -1053,7 +1052,7 @@ struct TVariable : public IBaseInterface
{
static LPCSTR pFuncName = "ID3DX11EffectVariable::AsUnorderedAccessView";
- if (!this->pType->IsUnorderedAccessView())
+ if (!pType->IsUnorderedAccessView())
{
DPF(0, "%s: Invalid typecast", pFuncName);
return &g_InvalidUnorderedAccessViewVariable;
@@ -1066,7 +1065,7 @@ struct TVariable : public IBaseInterface
{
static LPCSTR pFuncName = "ID3DX11EffectVariable::AsRenderTargetView";
- if (!this->pType->IsRenderTargetView())
+ if (!pType->IsRenderTargetView())
{
DPF(0, "%s: Invalid typecast", pFuncName);
return &g_InvalidRenderTargetViewVariable;
@@ -1079,7 +1078,7 @@ struct TVariable : public IBaseInterface
{
static LPCSTR pFuncName = "ID3DX11EffectVariable::AsDepthStencilView";
- if (!this->pType->IsDepthStencilView())
+ if (!pType->IsDepthStencilView())
{
DPF(0, "%s: Invalid typecast", pFuncName);
return &g_InvalidDepthStencilViewVariable;
@@ -1099,7 +1098,7 @@ struct TVariable : public IBaseInterface
{
static LPCSTR pFuncName = "ID3DX11EffectVariable::AsShader";
- if (!this->pType->IsShader())
+ if (!pType->IsShader())
{
DPF(0, "%s: Invalid typecast", pFuncName);
return &g_InvalidShaderVariable;
@@ -1112,7 +1111,7 @@ struct TVariable : public IBaseInterface
{
static LPCSTR pFuncName = "ID3DX11EffectVariable::AsBlend";
- if (!this->pType->IsObjectType(EOT_Blend))
+ if (!pType->IsObjectType(EOT_Blend))
{
DPF(0, "%s: Invalid typecast", pFuncName);
return &g_InvalidBlendVariable;
@@ -1125,7 +1124,7 @@ struct TVariable : public IBaseInterface
{
static LPCSTR pFuncName = "ID3DX11EffectVariable::AsDepthStencil";
- if (!this->pType->IsObjectType(EOT_DepthStencil))
+ if (!pType->IsObjectType(EOT_DepthStencil))
{
DPF(0, "%s: Invalid typecast", pFuncName);
return &g_InvalidDepthStencilVariable;
@@ -1138,7 +1137,7 @@ struct TVariable : public IBaseInterface
{
static LPCSTR pFuncName = "ID3DX11EffectVariable::AsRasterizer";
- if (!this->pType->IsObjectType(EOT_Rasterizer))
+ if (!pType->IsObjectType(EOT_Rasterizer))
{
DPF(0, "%s: Invalid typecast", pFuncName);
return &g_InvalidRasterizerVariable;
@@ -1151,7 +1150,7 @@ struct TVariable : public IBaseInterface
{
static LPCSTR pFuncName = "ID3DX11EffectVariable::AsSampler";
- if (!this->pType->IsSampler())
+ if (!pType->IsSampler())
{
DPF(0, "%s: Invalid typecast", pFuncName);
return &g_InvalidSamplerVariable;
@@ -1171,8 +1170,8 @@ struct TVariable : public IBaseInterface
// TTopLevelVariable - functionality for annotations and global variables
//////////////////////////////////////////////////////////////////////////
-template<class IBaseInterface>
-struct TTopLevelVariable : public D3DX11Effects::SVariable, public IBaseInterface
+template<typename IBaseInterface>
+struct TTopLevelVariable : public SVariable, public IBaseInterface
{
// Required to create member/element variable interfaces
CEffect *pEffect;
@@ -1209,9 +1208,6 @@ struct TTopLevelVariable : public D3DX11Effects::SVariable, public IBaseInterfac
};
-template<typename IBaseInterface>
-struct TGlobalVariable;
-
//////////////////////////////////////////////////////////////////////////
// TMember - functionality for structure/array members of other variables
//////////////////////////////////////////////////////////////////////////
@@ -1267,7 +1263,7 @@ struct TMember : public SVariable, public IBaseInterface
if (pTopLevelEntity->pEffect->IsReflectionData(pTopLevelEntity))
{
// Is part of an annotation
- assert(pTopLevelEntity->pEffect->IsReflectionData(this->Data.pGeneric));
+ assert(pTopLevelEntity->pEffect->IsReflectionData(Data.pGeneric));
pDesc->Annotations = 0;
pDesc->BufferOffset = 0;
pDesc->Flags |= D3DX11_EFFECT_VARIABLE_ANNOTATION;
@@ -1279,7 +1275,7 @@ struct TMember : public SVariable, public IBaseInterface
if (!pTopLevelEntity->pType->IsObjectType(EOT_String))
{
// strings are funny; their data is reflection data, so ignore those
- assert(pTopLevelEntity->pEffect->IsRuntimeData(this->Data.pGeneric));
+ assert(pTopLevelEntity->pEffect->IsRuntimeData(Data.pGeneric));
}
pDesc->Annotations = ((TGlobalVariable<ID3DX11Effect>*)pTopLevelEntity)->AnnotationCount;
@@ -1290,10 +1286,10 @@ struct TMember : public SVariable, public IBaseInterface
{
assert(pCB != 0);
_Analysis_assume_(pCB != 0);
- UINT_PTR offset = this->Data.pNumeric - pCB->pBackingStore;
+ UINT_PTR offset = Data.pNumeric - pCB->pBackingStore;
assert(offset == (uint32_t)offset);
pDesc->BufferOffset = (uint32_t)offset;
- assert(pDesc->BufferOffset >= 0 && pDesc->BufferOffset + this->GetTotalUnpackedSize() <= pCB->Size);
+ assert(pDesc->BufferOffset >= 0 && pDesc->BufferOffset + GetTotalUnpackedSize() <= pCB->Size);
}
else
{
@@ -1346,8 +1342,8 @@ struct TAnnotation : public TVariable<TTopLevelVariable<IBaseInterface> >
VERIFYPARAMETER(pDesc != nullptr);
- pDesc->Name = this->pName;
- pDesc->Semantic = this->pSemantic;
+ pDesc->Name = pName;
+ pDesc->Semantic = pSemantic;
pDesc->Flags = D3DX11_EFFECT_VARIABLE_ANNOTATION;
pDesc->Annotations = 0;
pDesc->BufferOffset = 0;
@@ -1413,19 +1409,19 @@ struct TGlobalVariable : public TVariable<TTopLevelVariable<IBaseInterface> >
VERIFYPARAMETER(pDesc != nullptr);
- pDesc->Name = this->pName;
- pDesc->Semantic = this->pSemantic;
+ pDesc->Name = pName;
+ pDesc->Semantic = pSemantic;
pDesc->Flags = 0;
pDesc->Annotations = AnnotationCount;
- if (this->pType->BelongsInConstantBuffer())
+ if (pType->BelongsInConstantBuffer())
{
assert(pCB != 0);
_Analysis_assume_(pCB != 0);
- UINT_PTR offset = this->Data.pNumeric - pCB->pBackingStore;
+ UINT_PTR offset = Data.pNumeric - pCB->pBackingStore;
assert(offset == (uint32_t)offset);
pDesc->BufferOffset = (uint32_t)offset;
- assert(pDesc->BufferOffset >= 0 && pDesc->BufferOffset + this->GetTotalUnpackedSize() <= pCB->Size );
+ assert(pDesc->BufferOffset >= 0 && pDesc->BufferOffset + GetTotalUnpackedSize() <= pCB->Size );
}
else
{
@@ -1433,9 +1429,9 @@ struct TGlobalVariable : public TVariable<TTopLevelVariable<IBaseInterface> >
pDesc->BufferOffset = 0;
}
- if (this->ExplicitBindPoint != -1)
+ if (ExplicitBindPoint != -1)
{
- pDesc->ExplicitBindPoint = this->ExplicitBindPoint;
+ pDesc->ExplicitBindPoint = ExplicitBindPoint;
pDesc->Flags |= D3DX11_EFFECT_VARIABLE_EXPLICIT_BIND_POINT;
}
else
@@ -1462,12 +1458,12 @@ lExit:
{
if (nullptr != pCB)
{
- assert(this->pType->BelongsInConstantBuffer());
+ assert(pType->BelongsInConstantBuffer());
return (ID3DX11EffectConstantBuffer*)pCB;
}
else
{
- assert(!this->pType->BelongsInConstantBuffer());
+ assert(!pType->BelongsInConstantBuffer());
return &g_InvalidConstantBuffer;
}
}
@@ -1477,7 +1473,7 @@ lExit:
assert(pCB != 0);
_Analysis_assume_(pCB != 0);
pCB->IsDirty = true;
- LastModifiedTime = this->pEffect->GetCurrentTime();
+ LastModifiedTime = pEffect->GetCurrentTime();
}
};
@@ -1512,7 +1508,7 @@ struct TNumericVariable : public IBaseInterface
if ((ByteOffset + ByteCount < ByteOffset) ||
(ByteCount + (uint8_t*)pData < (uint8_t*)pData) ||
- ((ByteOffset + ByteCount) > this->GetTotalUnpackedSize()))
+ ((ByteOffset + ByteCount) > GetTotalUnpackedSize()))
{
// overflow of some kind
DPF(0, "%s: Invalid range specified", pFuncName);
@@ -1520,8 +1516,8 @@ struct TNumericVariable : public IBaseInterface
}
#endif
- this->DirtyVariable();
- memcpy(this->Data.pNumeric + ByteOffset, pData, ByteCount);
+ DirtyVariable();
+ memcpy(Data.pNumeric + ByteOffset, pData, ByteCount);
lExit:
return hr;
@@ -1539,7 +1535,7 @@ lExit:
if ((ByteOffset + ByteCount < ByteOffset) ||
(ByteCount + (uint8_t*)pData < (uint8_t*)pData) ||
- ((ByteOffset + ByteCount) > this->GetTotalUnpackedSize()))
+ ((ByteOffset + ByteCount) > GetTotalUnpackedSize()))
{
// overflow of some kind
DPF(0, "%s: Invalid range specified", pFuncName);
@@ -1547,7 +1543,7 @@ lExit:
}
#endif
- memcpy(pData, this->Data.pNumeric + ByteOffset, ByteCount);
+ memcpy(pData, Data.pNumeric + ByteOffset, ByteCount);
lExit:
return hr;
@@ -1586,15 +1582,15 @@ HRESULT TFloatScalarVariable<IBaseInterface, IsAnnotation>::SetFloat(float Value
{
static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetFloat";
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- return CopyScalarValue<ETVT_Float, ETVT_Float, float, false>(Value, this->Data.pNumericFloat, pFuncName);
+ DirtyVariable();
+ return CopyScalarValue<ETVT_Float, ETVT_Float, float, false>(Value, Data.pNumericFloat, pFuncName);
}
template<typename IBaseInterface, bool IsAnnotation>
_Use_decl_annotations_
HRESULT TFloatScalarVariable<IBaseInterface, IsAnnotation>::GetFloat(float *pValue)
{
- return CopyScalarValue<ETVT_Float, ETVT_Float, float, true>(*this->Data.pNumericFloat, pValue, "ID3DX11EffectScalarVariable::GetFloat");
+ return CopyScalarValue<ETVT_Float, ETVT_Float, float, true>(*Data.pNumericFloat, pValue, "ID3DX11EffectScalarVariable::GetFloat");
}
template<typename IBaseInterface, bool IsAnnotation>
@@ -1603,17 +1599,17 @@ HRESULT TFloatScalarVariable<IBaseInterface, IsAnnotation>::SetFloatArray(const
{
static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetFloatArray";
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- return SetScalarArray<ETVT_Float, ETVT_Float, float, float>(pData, this->Data.pNumericFloat, Offset, Count,
- this->pType, this->GetTotalUnpackedSize(), pFuncName);
+ DirtyVariable();
+ return SetScalarArray<ETVT_Float, ETVT_Float, float, float>(pData, Data.pNumericFloat, Offset, Count,
+ pType, GetTotalUnpackedSize(), pFuncName);
}
template<typename IBaseInterface, bool IsAnnotation>
_Use_decl_annotations_
HRESULT TFloatScalarVariable<IBaseInterface, IsAnnotation>::GetFloatArray(float *pData, uint32_t Offset, uint32_t Count)
{
- return GetScalarArray<ETVT_Float, ETVT_Float, float, float>(this->Data.pNumericFloat, pData, Offset, Count,
- this->pType, this->GetTotalUnpackedSize(), "ID3DX11EffectScalarVariable::GetFloatArray");
+ return GetScalarArray<ETVT_Float, ETVT_Float, float, float>(Data.pNumericFloat, pData, Offset, Count,
+ pType, GetTotalUnpackedSize(), "ID3DX11EffectScalarVariable::GetFloatArray");
}
template<typename IBaseInterface, bool IsAnnotation>
@@ -1622,15 +1618,15 @@ HRESULT TFloatScalarVariable<IBaseInterface, IsAnnotation>::SetInt(const int Val
{
static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetInt";
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- return CopyScalarValue<ETVT_Int, ETVT_Float, int, false>(Value, this->Data.pNumericFloat, pFuncName);
+ DirtyVariable();
+ return CopyScalarValue<ETVT_Int, ETVT_Float, int, false>(Value, Data.pNumericFloat, pFuncName);
}
template<typename IBaseInterface, bool IsAnnotation>
_Use_decl_annotations_
HRESULT TFloatScalarVariable<IBaseInterface, IsAnnotation>::GetInt(int *pValue)
{
- return CopyScalarValue<ETVT_Float, ETVT_Int, float, true>(*this->Data.pNumericFloat, pValue, "ID3DX11EffectScalarVariable::GetInt");
+ return CopyScalarValue<ETVT_Float, ETVT_Int, float, true>(*Data.pNumericFloat, pValue, "ID3DX11EffectScalarVariable::GetInt");
}
template<typename IBaseInterface, bool IsAnnotation>
@@ -1639,17 +1635,17 @@ HRESULT TFloatScalarVariable<IBaseInterface, IsAnnotation>::SetIntArray(const in
{
static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetIntArray";
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- return SetScalarArray<ETVT_Int, ETVT_Float, int, float>(pData, this->Data.pNumericFloat, Offset, Count,
- this->pType, this->GetTotalUnpackedSize(), pFuncName);
+ DirtyVariable();
+ return SetScalarArray<ETVT_Int, ETVT_Float, int, float>(pData, Data.pNumericFloat, Offset, Count,
+ pType, GetTotalUnpackedSize(), pFuncName);
}
template<typename IBaseInterface, bool IsAnnotation>
_Use_decl_annotations_
HRESULT TFloatScalarVariable<IBaseInterface, IsAnnotation>::GetIntArray(int *pData, uint32_t Offset, uint32_t Count)
{
- return GetScalarArray<ETVT_Float, ETVT_Int, float, int>(this->Data.pNumericFloat, pData, Offset, Count,
- this->pType, this->GetTotalUnpackedSize(), "ID3DX11EffectScalarVariable::GetIntArray");
+ return GetScalarArray<ETVT_Float, ETVT_Int, float, int>(Data.pNumericFloat, pData, Offset, Count,
+ pType, GetTotalUnpackedSize(), "ID3DX11EffectScalarVariable::GetIntArray");
}
template<typename IBaseInterface, bool IsAnnotation>
@@ -1658,15 +1654,15 @@ HRESULT TFloatScalarVariable<IBaseInterface, IsAnnotation>::SetBool(const bool V
{
static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetBool";
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- return CopyScalarValue<ETVT_bool, ETVT_Float, bool, false>(Value, this->Data.pNumericFloat, pFuncName);
+ DirtyVariable();
+ return CopyScalarValue<ETVT_bool, ETVT_Float, bool, false>(Value, Data.pNumericFloat, pFuncName);
}
template<typename IBaseInterface, bool IsAnnotation>
_Use_decl_annotations_
HRESULT TFloatScalarVariable<IBaseInterface, IsAnnotation>::GetBool(bool *pValue)
{
- return CopyScalarValue<ETVT_Float, ETVT_bool, float, true>(*this->Data.pNumericFloat, pValue, "ID3DX11EffectScalarVariable::GetBool");
+ return CopyScalarValue<ETVT_Float, ETVT_bool, float, true>(*Data.pNumericFloat, pValue, "ID3DX11EffectScalarVariable::GetBool");
}
template<typename IBaseInterface, bool IsAnnotation>
@@ -1675,17 +1671,17 @@ HRESULT TFloatScalarVariable<IBaseInterface, IsAnnotation>::SetBoolArray(const b
{
static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetBoolArray";
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- return SetScalarArray<ETVT_bool, ETVT_Float, bool, float>(pData, this->Data.pNumericFloat, Offset, Count,
- this->pType, this->GetTotalUnpackedSize(), pFuncName);
+ DirtyVariable();
+ return SetScalarArray<ETVT_bool, ETVT_Float, bool, float>(pData, Data.pNumericFloat, Offset, Count,
+ pType, GetTotalUnpackedSize(), pFuncName);
}
template<typename IBaseInterface, bool IsAnnotation>
_Use_decl_annotations_
HRESULT TFloatScalarVariable<IBaseInterface, IsAnnotation>::GetBoolArray(bool *pData, uint32_t Offset, uint32_t Count)
{
- return GetScalarArray<ETVT_Float, ETVT_bool, float, bool>(this->Data.pNumericFloat, pData, Offset, Count,
- this->pType, this->GetTotalUnpackedSize(), "ID3DX11EffectScalarVariable::GetBoolArray");
+ return GetScalarArray<ETVT_Float, ETVT_bool, float, bool>(Data.pNumericFloat, pData, Offset, Count,
+ pType, GetTotalUnpackedSize(), "ID3DX11EffectScalarVariable::GetBoolArray");
}
//////////////////////////////////////////////////////////////////////////
@@ -1720,15 +1716,15 @@ HRESULT TIntScalarVariable<IBaseInterface, IsAnnotation>::SetFloat(float Value)
{
static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetFloat";
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- return CopyScalarValue<ETVT_Float, ETVT_Int, float, false>(Value, this->Data.pNumericInt, pFuncName);
+ DirtyVariable();
+ return CopyScalarValue<ETVT_Float, ETVT_Int, float, false>(Value, Data.pNumericInt, pFuncName);
}
template<typename IBaseInterface, bool IsAnnotation>
_Use_decl_annotations_
HRESULT TIntScalarVariable<IBaseInterface, IsAnnotation>::GetFloat(float *pValue)
{
- return CopyScalarValue<ETVT_Int, ETVT_Float, int, true>(*this->Data.pNumericInt, pValue, "ID3DX11EffectScalarVariable::GetFloat");
+ return CopyScalarValue<ETVT_Int, ETVT_Float, int, true>(*Data.pNumericInt, pValue, "ID3DX11EffectScalarVariable::GetFloat");
}
template<typename IBaseInterface, bool IsAnnotation>
@@ -1737,17 +1733,17 @@ HRESULT TIntScalarVariable<IBaseInterface, IsAnnotation>::SetFloatArray(const fl
{
static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetFloatArray";
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- return SetScalarArray<ETVT_Float, ETVT_Int, float, int>(pData, this->Data.pNumericInt, Offset, Count,
- this->pType, this->GetTotalUnpackedSize(), pFuncName);
+ DirtyVariable();
+ return SetScalarArray<ETVT_Float, ETVT_Int, float, int>(pData, Data.pNumericInt, Offset, Count,
+ pType, GetTotalUnpackedSize(), pFuncName);
}
template<typename IBaseInterface, bool IsAnnotation>
_Use_decl_annotations_
HRESULT TIntScalarVariable<IBaseInterface, IsAnnotation>::GetFloatArray(float *pData, uint32_t Offset, uint32_t Count)
{
- return GetScalarArray<ETVT_Int, ETVT_Float, int, float>(this->Data.pNumericInt, pData, Offset, Count,
- this->pType, this->GetTotalUnpackedSize(), "ID3DX11EffectScalarVariable::GetFloatArray");
+ return GetScalarArray<ETVT_Int, ETVT_Float, int, float>(Data.pNumericInt, pData, Offset, Count,
+ pType, GetTotalUnpackedSize(), "ID3DX11EffectScalarVariable::GetFloatArray");
}
template<typename IBaseInterface, bool IsAnnotation>
@@ -1756,15 +1752,15 @@ HRESULT TIntScalarVariable<IBaseInterface, IsAnnotation>::SetInt(const int Value
{
static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetInt";
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- return CopyScalarValue<ETVT_Int, ETVT_Int, int, false>(Value, this->Data.pNumericInt, pFuncName);
+ DirtyVariable();
+ return CopyScalarValue<ETVT_Int, ETVT_Int, int, false>(Value, Data.pNumericInt, pFuncName);
}
template<typename IBaseInterface, bool IsAnnotation>
_Use_decl_annotations_
HRESULT TIntScalarVariable<IBaseInterface, IsAnnotation>::GetInt(int *pValue)
{
- return CopyScalarValue<ETVT_Int, ETVT_Int, int, true>(*this->Data.pNumericInt, pValue, "ID3DX11EffectScalarVariable::GetInt");
+ return CopyScalarValue<ETVT_Int, ETVT_Int, int, true>(*Data.pNumericInt, pValue, "ID3DX11EffectScalarVariable::GetInt");
}
template<typename IBaseInterface, bool IsAnnotation>
@@ -1773,17 +1769,17 @@ HRESULT TIntScalarVariable<IBaseInterface, IsAnnotation>::SetIntArray(const int
{
static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetIntArray";
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- return SetScalarArray<ETVT_Int, ETVT_Int, int, int>(pData, this->Data.pNumericInt, Offset, Count,
- this->pType, this->GetTotalUnpackedSize(), pFuncName);
+ DirtyVariable();
+ return SetScalarArray<ETVT_Int, ETVT_Int, int, int>(pData, Data.pNumericInt, Offset, Count,
+ pType, GetTotalUnpackedSize(), pFuncName);
}
template<typename IBaseInterface, bool IsAnnotation>
_Use_decl_annotations_
HRESULT TIntScalarVariable<IBaseInterface, IsAnnotation>::GetIntArray(int *pData, uint32_t Offset, uint32_t Count)
{
- return GetScalarArray<ETVT_Int, ETVT_Int, int, int>(this->Data.pNumericInt, pData, Offset, Count,
- this->pType, this->GetTotalUnpackedSize(), "ID3DX11EffectScalarVariable::GetIntArray");
+ return GetScalarArray<ETVT_Int, ETVT_Int, int, int>(Data.pNumericInt, pData, Offset, Count,
+ pType, GetTotalUnpackedSize(), "ID3DX11EffectScalarVariable::GetIntArray");
}
template<typename IBaseInterface, bool IsAnnotation>
@@ -1792,15 +1788,15 @@ HRESULT TIntScalarVariable<IBaseInterface, IsAnnotation>::SetBool(const bool Val
{
static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetBool";
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- return CopyScalarValue<ETVT_bool, ETVT_Int, bool, false>(Value, this->Data.pNumericInt, pFuncName);
+ DirtyVariable();
+ return CopyScalarValue<ETVT_bool, ETVT_Int, bool, false>(Value, Data.pNumericInt, pFuncName);
}
template<typename IBaseInterface, bool IsAnnotation>
_Use_decl_annotations_
HRESULT TIntScalarVariable<IBaseInterface, IsAnnotation>::GetBool(bool *pValue)
{
- return CopyScalarValue<ETVT_Int, ETVT_bool, int, true>(*this->Data.pNumericInt, pValue, "ID3DX11EffectScalarVariable::GetBool");
+ return CopyScalarValue<ETVT_Int, ETVT_bool, int, true>(*Data.pNumericInt, pValue, "ID3DX11EffectScalarVariable::GetBool");
}
template<typename IBaseInterface, bool IsAnnotation>
@@ -1809,17 +1805,17 @@ HRESULT TIntScalarVariable<IBaseInterface, IsAnnotation>::SetBoolArray(const boo
{
static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetBoolArray";
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- return SetScalarArray<ETVT_bool, ETVT_Int, bool, int>(pData, this->Data.pNumericInt, Offset, Count,
- this->pType, this->GetTotalUnpackedSize(), pFuncName);
+ DirtyVariable();
+ return SetScalarArray<ETVT_bool, ETVT_Int, bool, int>(pData, Data.pNumericInt, Offset, Count,
+ pType, GetTotalUnpackedSize(), pFuncName);
}
template<typename IBaseInterface, bool IsAnnotation>
_Use_decl_annotations_
HRESULT TIntScalarVariable<IBaseInterface, IsAnnotation>::GetBoolArray(bool *pData, uint32_t Offset, uint32_t Count)
{
- return GetScalarArray<ETVT_Int, ETVT_bool, int, bool>(this->Data.pNumericInt, pData, Offset, Count,
- this->pType, this->GetTotalUnpackedSize(), "ID3DX11EffectScalarVariable::GetBoolArray");
+ return GetScalarArray<ETVT_Int, ETVT_bool, int, bool>(Data.pNumericInt, pData, Offset, Count,
+ pType, GetTotalUnpackedSize(), "ID3DX11EffectScalarVariable::GetBoolArray");
}
//////////////////////////////////////////////////////////////////////////
@@ -1854,15 +1850,15 @@ HRESULT TBoolScalarVariable<IBaseInterface, IsAnnotation>::SetFloat(float Value)
{
static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetFloat";
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- return CopyScalarValue<ETVT_Float, ETVT_Bool, float, false>(Value, this->Data.pNumericBool, pFuncName);
+ DirtyVariable();
+ return CopyScalarValue<ETVT_Float, ETVT_Bool, float, false>(Value, Data.pNumericBool, pFuncName);
}
template<typename IBaseInterface, bool IsAnnotation>
_Use_decl_annotations_
HRESULT TBoolScalarVariable<IBaseInterface, IsAnnotation>::GetFloat(float *pValue)
{
- return CopyScalarValue<ETVT_Bool, ETVT_Float, BOOL, true>(*this->Data.pNumericBool, pValue, "ID3DX11EffectScalarVariable::GetFloat");
+ return CopyScalarValue<ETVT_Bool, ETVT_Float, BOOL, true>(*Data.pNumericBool, pValue, "ID3DX11EffectScalarVariable::GetFloat");
}
template<typename IBaseInterface, bool IsAnnotation>
@@ -1871,17 +1867,17 @@ HRESULT TBoolScalarVariable<IBaseInterface, IsAnnotation>::SetFloatArray(const f
{
static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetFloatArray";
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- return SetScalarArray<ETVT_Float, ETVT_Bool, float, BOOL>(pData, this->Data.pNumericBool, Offset, Count,
- this->pType, this->GetTotalUnpackedSize(), pFuncName);
+ DirtyVariable();
+ return SetScalarArray<ETVT_Float, ETVT_Bool, float, BOOL>(pData, Data.pNumericBool, Offset, Count,
+ pType, GetTotalUnpackedSize(), pFuncName);
}
template<typename IBaseInterface, bool IsAnnotation>
_Use_decl_annotations_
HRESULT TBoolScalarVariable<IBaseInterface, IsAnnotation>::GetFloatArray(float *pData, uint32_t Offset, uint32_t Count)
{
- return GetScalarArray<ETVT_Bool, ETVT_Float, BOOL, float>(this->Data.pNumericBool, pData, Offset, Count,
- this->pType, this->GetTotalUnpackedSize(), "ID3DX11EffectScalarVariable::GetFloatArray");
+ return GetScalarArray<ETVT_Bool, ETVT_Float, BOOL, float>(Data.pNumericBool, pData, Offset, Count,
+ pType, GetTotalUnpackedSize(), "ID3DX11EffectScalarVariable::GetFloatArray");
}
template<typename IBaseInterface, bool IsAnnotation>
@@ -1890,15 +1886,15 @@ HRESULT TBoolScalarVariable<IBaseInterface, IsAnnotation>::SetInt(const int Valu
{
static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetInt";
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- return CopyScalarValue<ETVT_Int, ETVT_Bool, int, false>(Value, this->Data.pNumericBool, pFuncName);
+ DirtyVariable();
+ return CopyScalarValue<ETVT_Int, ETVT_Bool, int, false>(Value, Data.pNumericBool, pFuncName);
}
template<typename IBaseInterface, bool IsAnnotation>
_Use_decl_annotations_
HRESULT TBoolScalarVariable<IBaseInterface, IsAnnotation>::GetInt(int *pValue)
{
- return CopyScalarValue<ETVT_Bool, ETVT_Int, BOOL, true>(*this->Data.pNumericBool, pValue, "ID3DX11EffectScalarVariable::GetInt");
+ return CopyScalarValue<ETVT_Bool, ETVT_Int, BOOL, true>(*Data.pNumericBool, pValue, "ID3DX11EffectScalarVariable::GetInt");
}
template<typename IBaseInterface, bool IsAnnotation>
@@ -1907,17 +1903,17 @@ HRESULT TBoolScalarVariable<IBaseInterface, IsAnnotation>::SetIntArray(const int
{
static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetIntArray";
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- return SetScalarArray<ETVT_Int, ETVT_Bool, int, BOOL>(pData, this->Data.pNumericBool, Offset, Count,
- this->pType, this->GetTotalUnpackedSize(), pFuncName);
+ DirtyVariable();
+ return SetScalarArray<ETVT_Int, ETVT_Bool, int, BOOL>(pData, Data.pNumericBool, Offset, Count,
+ pType, GetTotalUnpackedSize(), pFuncName);
}
template<typename IBaseInterface, bool IsAnnotation>
_Use_decl_annotations_
HRESULT TBoolScalarVariable<IBaseInterface, IsAnnotation>::GetIntArray(int *pData, uint32_t Offset, uint32_t Count)
{
- return GetScalarArray<ETVT_Bool, ETVT_Int, BOOL, int>(this->Data.pNumericBool, pData, Offset, Count,
- this->pType, this->GetTotalUnpackedSize(), "ID3DX11EffectScalarVariable::GetIntArray");
+ return GetScalarArray<ETVT_Bool, ETVT_Int, BOOL, int>(Data.pNumericBool, pData, Offset, Count,
+ pType, GetTotalUnpackedSize(), "ID3DX11EffectScalarVariable::GetIntArray");
}
template<typename IBaseInterface, bool IsAnnotation>
@@ -1926,15 +1922,15 @@ HRESULT TBoolScalarVariable<IBaseInterface, IsAnnotation>::SetBool(const bool Va
{
static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetBool";
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- return CopyScalarValue<ETVT_bool, ETVT_Bool, bool, false>(Value, this->Data.pNumericBool, pFuncName);
+ DirtyVariable();
+ return CopyScalarValue<ETVT_bool, ETVT_Bool, bool, false>(Value, Data.pNumericBool, pFuncName);
}
template<typename IBaseInterface, bool IsAnnotation>
_Use_decl_annotations_
HRESULT TBoolScalarVariable<IBaseInterface, IsAnnotation>::GetBool(bool *pValue)
{
- return CopyScalarValue<ETVT_Bool, ETVT_bool, BOOL, true>(*this->Data.pNumericBool, pValue, "ID3DX11EffectScalarVariable::GetBool");
+ return CopyScalarValue<ETVT_Bool, ETVT_bool, BOOL, true>(*Data.pNumericBool, pValue, "ID3DX11EffectScalarVariable::GetBool");
}
template<typename IBaseInterface, bool IsAnnotation>
@@ -1943,17 +1939,17 @@ HRESULT TBoolScalarVariable<IBaseInterface, IsAnnotation>::SetBoolArray(const bo
{
static LPCSTR pFuncName = "ID3DX11EffectScalarVariable::SetBoolArray";
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- return SetScalarArray<ETVT_bool, ETVT_Bool, bool, BOOL>(pData, this->Data.pNumericBool, Offset, Count,
- this->pType, this->GetTotalUnpackedSize(), pFuncName);
+ DirtyVariable();
+ return SetScalarArray<ETVT_bool, ETVT_Bool, bool, BOOL>(pData, Data.pNumericBool, Offset, Count,
+ pType, GetTotalUnpackedSize(), pFuncName);
}
template<typename IBaseInterface, bool IsAnnotation>
_Use_decl_annotations_
HRESULT TBoolScalarVariable<IBaseInterface, IsAnnotation>::GetBoolArray(bool *pData, uint32_t Offset, uint32_t Count)
{
- return GetScalarArray<ETVT_Bool, ETVT_bool, BOOL, bool>(this->Data.pNumericBool, pData, Offset, Count,
- this->pType, this->GetTotalUnpackedSize(), "ID3DX11EffectScalarVariable::GetBoolArray");
+ return GetScalarArray<ETVT_Bool, ETVT_bool, BOOL, bool>(Data.pNumericBool, pData, Offset, Count,
+ pType, GetTotalUnpackedSize(), "ID3DX11EffectScalarVariable::GetBoolArray");
}
//////////////////////////////////////////////////////////////////////////
@@ -2216,8 +2212,8 @@ HRESULT TVectorVariable<IBaseInterface, IsAnnotation, BaseType >::SetFloatVector
#endif
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- CopyDataWithTypeConversion<BaseType, ETVT_Float>(this->Data.pVector, pData, 4, this->pType->NumericType.Columns, this->pType->NumericType.Columns, 1);
+ DirtyVariable();
+ CopyDataWithTypeConversion<BaseType, ETVT_Float>(Data.pVector, pData, 4, pType->NumericType.Columns, pType->NumericType.Columns, 1);
lExit:
return hr;
@@ -2234,7 +2230,7 @@ HRESULT TVectorVariable<IBaseInterface, IsAnnotation, BaseType>::GetFloatVector(
VERIFYPARAMETER(pData);
#endif
- CopyDataWithTypeConversion<ETVT_Float, BaseType>(pData, this->Data.pVector, this->pType->NumericType.Columns, 4, this->pType->NumericType.Columns, 1);
+ CopyDataWithTypeConversion<ETVT_Float, BaseType>(pData, Data.pVector, pType->NumericType.Columns, 4, pType->NumericType.Columns, 1);
lExit:
return hr;
@@ -2254,8 +2250,8 @@ HRESULT TVectorVariable<IBaseInterface, IsAnnotation, BaseType >::SetIntVector(c
#endif
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- CopyDataWithTypeConversion<BaseType, ETVT_Int>(this->Data.pVector, pData, 4, this->pType->NumericType.Columns, this->pType->NumericType.Columns, 1);
+ DirtyVariable();
+ CopyDataWithTypeConversion<BaseType, ETVT_Int>(Data.pVector, pData, 4, pType->NumericType.Columns, pType->NumericType.Columns, 1);
lExit:
return hr;
@@ -2272,7 +2268,7 @@ HRESULT TVectorVariable<IBaseInterface, IsAnnotation, BaseType>::GetIntVector(in
VERIFYPARAMETER(pData);
#endif
- CopyDataWithTypeConversion<ETVT_Int, BaseType>(pData, this->Data.pVector, this->pType->NumericType.Columns, 4, this->pType->NumericType.Columns, 1);
+ CopyDataWithTypeConversion<ETVT_Int, BaseType>(pData, Data.pVector, pType->NumericType.Columns, 4, pType->NumericType.Columns, 1);
lExit:
return hr;
@@ -2293,8 +2289,8 @@ HRESULT TVectorVariable<IBaseInterface, IsAnnotation, BaseType >::SetBoolVector(
#endif
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- CopyDataWithTypeConversion<BaseType, ETVT_bool>(this->Data.pVector, pData, 4, this->pType->NumericType.Columns, this->pType->NumericType.Columns, 1);
+ DirtyVariable();
+ CopyDataWithTypeConversion<BaseType, ETVT_bool>(Data.pVector, pData, 4, pType->NumericType.Columns, pType->NumericType.Columns, 1);
lExit:
return hr;
@@ -2311,7 +2307,7 @@ HRESULT TVectorVariable<IBaseInterface, IsAnnotation, BaseType>::GetBoolVector(b
VERIFYPARAMETER(pData);
#endif
- CopyDataWithTypeConversion<ETVT_bool, BaseType>(pData, this->Data.pVector, this->pType->NumericType.Columns, 4, this->pType->NumericType.Columns, 1);
+ CopyDataWithTypeConversion<ETVT_bool, BaseType>(pData, Data.pVector, pType->NumericType.Columns, 4, pType->NumericType.Columns, 1);
lExit:
return hr;
@@ -2328,7 +2324,7 @@ HRESULT TVectorVariable<IBaseInterface, IsAnnotation, BaseType>::SetFloatVectorA
#ifdef _DEBUG
#pragma warning( suppress : 6001 )
- if (!AreBoundsValid(Offset, Count, pData, this->pType, this->GetTotalUnpackedSize()))
+ if (!AreBoundsValid(Offset, Count, pData, pType, GetTotalUnpackedSize()))
{
DPF(0, "%s: Invalid range specified", pFuncName);
VH(E_INVALIDARG);
@@ -2336,9 +2332,9 @@ HRESULT TVectorVariable<IBaseInterface, IsAnnotation, BaseType>::SetFloatVectorA
#endif
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
+ DirtyVariable();
// ensure we don't write over the padding at the end of the vector array
- CopyDataWithTypeConversion<BaseType, ETVT_Float>(this->Data.pVector + Offset, pData, 4, this->pType->NumericType.Columns, this->pType->NumericType.Columns, std::max(std::min((int)Count, (int)this->pType->Elements - (int)Offset), 0));
+ CopyDataWithTypeConversion<BaseType, ETVT_Float>(Data.pVector + Offset, pData, 4, pType->NumericType.Columns, pType->NumericType.Columns, std::max(std::min((int)Count, (int)pType->Elements - (int)Offset), 0));
lExit:
return hr;
@@ -2353,7 +2349,7 @@ HRESULT TVectorVariable<IBaseInterface, IsAnnotation, BaseType>::GetFloatVectorA
#ifdef _DEBUG
static LPCSTR pFuncName = "ID3DX11EffectVectorVariable::GetFloatVectorArray";
#pragma warning( suppress : 6001 )
- if (!AreBoundsValid(Offset, Count, pData, this->pType, this->GetTotalUnpackedSize()))
+ if (!AreBoundsValid(Offset, Count, pData, pType, GetTotalUnpackedSize()))
{
DPF(0, "%s: Invalid range specified", pFuncName);
VH(E_INVALIDARG);
@@ -2361,7 +2357,7 @@ HRESULT TVectorVariable<IBaseInterface, IsAnnotation, BaseType>::GetFloatVectorA
#endif
// ensure we don't read past the end of the vector array
- CopyDataWithTypeConversion<ETVT_Float, BaseType>(pData, this->Data.pVector + Offset, this->pType->NumericType.Columns, 4, this->pType->NumericType.Columns, std::max(std::min((int)Count, (int)this->pType->Elements - (int)Offset), 0));
+ CopyDataWithTypeConversion<ETVT_Float, BaseType>(pData, Data.pVector + Offset, pType->NumericType.Columns, 4, pType->NumericType.Columns, std::max(std::min((int)Count, (int)pType->Elements - (int)Offset), 0));
lExit:
return hr;
@@ -2378,7 +2374,7 @@ HRESULT TVectorVariable<IBaseInterface, IsAnnotation, BaseType>::SetIntVectorArr
#ifdef _DEBUG
#pragma warning( suppress : 6001 )
- if (!AreBoundsValid(Offset, Count, pData, this->pType, this->GetTotalUnpackedSize()))
+ if (!AreBoundsValid(Offset, Count, pData, pType, GetTotalUnpackedSize()))
{
DPF(0, "%s: Invalid range specified", pFuncName);
VH(E_INVALIDARG);
@@ -2386,9 +2382,9 @@ HRESULT TVectorVariable<IBaseInterface, IsAnnotation, BaseType>::SetIntVectorArr
#endif
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
+ DirtyVariable();
// ensure we don't write over the padding at the end of the vector array
- CopyDataWithTypeConversion<BaseType, ETVT_Int>(this->Data.pVector + Offset, pData, 4, this->pType->NumericType.Columns, this->pType->NumericType.Columns, std::max(std::min((int)Count, (int)this->pType->Elements - (int)Offset), 0));
+ CopyDataWithTypeConversion<BaseType, ETVT_Int>(Data.pVector + Offset, pData, 4, pType->NumericType.Columns, pType->NumericType.Columns, std::max(std::min((int)Count, (int)pType->Elements - (int)Offset), 0));
lExit:
return hr;
@@ -2403,7 +2399,7 @@ HRESULT TVectorVariable<IBaseInterface, IsAnnotation, BaseType>::GetIntVectorArr
#ifdef _DEBUG
#pragma warning( suppress : 6001 )
- if (!AreBoundsValid(Offset, Count, pData, this->pType, this->GetTotalUnpackedSize()))
+ if (!AreBoundsValid(Offset, Count, pData, pType, GetTotalUnpackedSize()))
{
DPF(0, "%s: Invalid range specified", pFuncName);
VH(E_INVALIDARG);
@@ -2411,7 +2407,7 @@ HRESULT TVectorVariable<IBaseInterface, IsAnnotation, BaseType>::GetIntVectorArr
#endif
// ensure we don't read past the end of the vector array
- CopyDataWithTypeConversion<ETVT_Int, BaseType>(pData, this->Data.pVector + Offset, this->pType->NumericType.Columns, 4, this->pType->NumericType.Columns, std::max(std::min((int)Count, (int)this->pType->Elements - (int)Offset), 0));
+ CopyDataWithTypeConversion<ETVT_Int, BaseType>(pData, Data.pVector + Offset, pType->NumericType.Columns, 4, pType->NumericType.Columns, std::max(std::min((int)Count, (int)pType->Elements - (int)Offset), 0));
lExit:
return hr;
@@ -2428,7 +2424,7 @@ HRESULT TVectorVariable<IBaseInterface, IsAnnotation, BaseType>::SetBoolVectorAr
#ifdef _DEBUG
#pragma warning( suppress : 6001 )
- if (!AreBoundsValid(Offset, Count, pData, this->pType, this->GetTotalUnpackedSize()))
+ if (!AreBoundsValid(Offset, Count, pData, pType, GetTotalUnpackedSize()))
{
DPF(0, "%s: Invalid range specified", pFuncName);
VH(E_INVALIDARG);
@@ -2436,9 +2432,9 @@ HRESULT TVectorVariable<IBaseInterface, IsAnnotation, BaseType>::SetBoolVectorAr
#endif
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
+ DirtyVariable();
// ensure we don't write over the padding at the end of the vector array
- CopyDataWithTypeConversion<BaseType, ETVT_bool>(this->Data.pVector + Offset, pData, 4, this->pType->NumericType.Columns, this->pType->NumericType.Columns, std::max(std::min((int)Count, (int)this->pType->Elements - (int)Offset), 0));
+ CopyDataWithTypeConversion<BaseType, ETVT_bool>(Data.pVector + Offset, pData, 4, pType->NumericType.Columns, pType->NumericType.Columns, std::max(std::min((int)Count, (int)pType->Elements - (int)Offset), 0));
lExit:
return hr;
@@ -2453,7 +2449,7 @@ HRESULT TVectorVariable<IBaseInterface, IsAnnotation, BaseType>::GetBoolVectorAr
#ifdef _DEBUG
#pragma warning( suppress : 6001 )
- if (!AreBoundsValid(Offset, Count, pData, this->pType, this->GetTotalUnpackedSize()))
+ if (!AreBoundsValid(Offset, Count, pData, pType, GetTotalUnpackedSize()))
{
DPF(0, "%s: Invalid range specified", pFuncName);
VH(E_INVALIDARG);
@@ -2461,7 +2457,7 @@ HRESULT TVectorVariable<IBaseInterface, IsAnnotation, BaseType>::GetBoolVectorAr
#endif
// ensure we don't read past the end of the vector array
- CopyDataWithTypeConversion<ETVT_bool, BaseType>(pData, this->Data.pVector + Offset, this->pType->NumericType.Columns, 4, this->pType->NumericType.Columns, std::max(std::min((int)Count, (int)this->pType->Elements - (int)Offset), 0));
+ CopyDataWithTypeConversion<ETVT_bool, BaseType>(pData, Data.pVector + Offset, pType->NumericType.Columns, 4, pType->NumericType.Columns, std::max(std::min((int)Count, (int)pType->Elements - (int)Offset), 0));
lExit:
return hr;
@@ -2492,8 +2488,8 @@ HRESULT TVector4Variable<IBaseInterface>::SetFloatVector(const float *pData)
VERIFYPARAMETER(pData);
#endif
- this->DirtyVariable();
- this->Data.pVector[0] = ((CEffectVector4*) pData)[0];
+ DirtyVariable();
+ Data.pVector[0] = ((CEffectVector4*) pData)[0];
lExit:
return hr;
@@ -2510,7 +2506,7 @@ HRESULT TVector4Variable<IBaseInterface>::GetFloatVector(float *pData)
VERIFYPARAMETER(pData);
#endif
- memcpy(pData, this->Data.pVector, this->pType->NumericType.Columns * SType::c_ScalarSize);
+ memcpy(pData, Data.pVector, pType->NumericType.Columns * SType::c_ScalarSize);
lExit:
return hr;
@@ -2525,17 +2521,17 @@ HRESULT TVector4Variable<IBaseInterface>::SetFloatVectorArray(const float *pData
#ifdef _DEBUG
#pragma warning( suppress : 6001 )
- if (!AreBoundsValid(Offset, Count, pData, this->pType, this->GetTotalUnpackedSize()))
+ if (!AreBoundsValid(Offset, Count, pData, pType, GetTotalUnpackedSize()))
{
DPF(0, "%s: Invalid range specified", pFuncName);
VH(E_INVALIDARG);
}
#endif
- this->DirtyVariable();
+ DirtyVariable();
// ensure we don't write over the padding at the end of the vector array
- memcpy(this->Data.pVector + Offset, pData,
- std::min<size_t>(Count * sizeof(CEffectVector4), this->pType->TotalSize - (Offset * sizeof(CEffectVector4))));
+ memcpy(Data.pVector + Offset, pData,
+ std::min<size_t>(Count * sizeof(CEffectVector4), pType->TotalSize - (Offset * sizeof(CEffectVector4))));
lExit:
return hr;
@@ -2550,7 +2546,7 @@ HRESULT TVector4Variable<IBaseInterface>::GetFloatVectorArray(float *pData, uint
#ifdef _DEBUG
#pragma warning( suppress : 6001 )
- if (!AreBoundsValid(Offset, Count, pData, this->pType, this->GetTotalUnpackedSize()))
+ if (!AreBoundsValid(Offset, Count, pData, pType, GetTotalUnpackedSize()))
{
DPF(0, "%s: Invalid range specified", pFuncName);
VH(E_INVALIDARG);
@@ -2558,8 +2554,8 @@ HRESULT TVector4Variable<IBaseInterface>::GetFloatVectorArray(float *pData, uint
#endif
// ensure we don't read past the end of the vector array
- memcpy(pData, this->Data.pVector + Offset,
- std::min<size_t>(Count * sizeof(CEffectVector4), this->pType->TotalSize - (Offset * sizeof(CEffectVector4))));
+ memcpy(pData, Data.pVector + Offset,
+ std::min<size_t>(Count * sizeof(CEffectVector4), pType->TotalSize - (Offset * sizeof(CEffectVector4))));
lExit:
return hr;
@@ -2755,17 +2751,17 @@ HRESULT TMatrixVariable<IBaseInterface, IsAnnotation>::SetMatrix(const float *pD
{
static LPCSTR pFuncName = "ID3DX11EffectMatrixVariable::SetMatrix";
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- return DoMatrixArrayInternal<false, true, false>(this->pType, this->GetTotalUnpackedSize(),
- this->Data.pNumeric, const_cast<float*>(pData), 0, 1, pFuncName);
+ DirtyVariable();
+ return DoMatrixArrayInternal<false, true, false>(pType, GetTotalUnpackedSize(),
+ Data.pNumeric, const_cast<float*>(pData), 0, 1, pFuncName);
}
template<typename IBaseInterface, bool IsAnnotation>
_Use_decl_annotations_
HRESULT TMatrixVariable<IBaseInterface, IsAnnotation>::GetMatrix(float *pData)
{
- return DoMatrixArrayInternal<false, false, false>(this->pType, this->GetTotalUnpackedSize(),
- this->Data.pNumeric, pData, 0, 1, "ID3DX11EffectMatrixVariable::GetMatrix");
+ return DoMatrixArrayInternal<false, false, false>(pType, GetTotalUnpackedSize(),
+ Data.pNumeric, pData, 0, 1, "ID3DX11EffectMatrixVariable::GetMatrix");
}
template<typename IBaseInterface, bool IsAnnotation>
@@ -2774,17 +2770,17 @@ HRESULT TMatrixVariable<IBaseInterface, IsAnnotation>::SetMatrixArray(const floa
{
static LPCSTR pFuncName = "ID3DX11EffectMatrixVariable::SetMatrixArray";
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- return DoMatrixArrayInternal<false, true, false>(this->pType, this->GetTotalUnpackedSize(),
- this->Data.pNumeric, const_cast<float*>(pData), Offset, Count, "ID3DX11EffectMatrixVariable::SetMatrixArray");
+ DirtyVariable();
+ return DoMatrixArrayInternal<false, true, false>(pType, GetTotalUnpackedSize(),
+ Data.pNumeric, const_cast<float*>(pData), Offset, Count, "ID3DX11EffectMatrixVariable::SetMatrixArray");
}
template<typename IBaseInterface, bool IsAnnotation>
_Use_decl_annotations_
HRESULT TMatrixVariable<IBaseInterface, IsAnnotation>::GetMatrixArray(float *pData, uint32_t Offset, uint32_t Count)
{
- return DoMatrixArrayInternal<false, false, false>(this->pType, this->GetTotalUnpackedSize(),
- this->Data.pNumeric, pData, Offset, Count, "ID3DX11EffectMatrixVariable::GetMatrixArray");
+ return DoMatrixArrayInternal<false, false, false>(pType, GetTotalUnpackedSize(),
+ Data.pNumeric, pData, Offset, Count, "ID3DX11EffectMatrixVariable::GetMatrixArray");
}
template<typename IBaseInterface, bool IsAnnotation>
@@ -2793,17 +2789,17 @@ HRESULT TMatrixVariable<IBaseInterface, IsAnnotation>::SetMatrixPointerArray(con
{
static LPCSTR pFuncName = "ID3DX11EffectMatrixVariable::SetMatrixPointerArray";
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- return DoMatrixArrayInternal<false, true, true>(this->pType, this->GetTotalUnpackedSize(),
- this->Data.pNumeric, const_cast<float**>(ppData), Offset, Count, "ID3DX11EffectMatrixVariable::SetMatrixPointerArray");
+ DirtyVariable();
+ return DoMatrixArrayInternal<false, true, true>(pType, GetTotalUnpackedSize(),
+ Data.pNumeric, const_cast<float**>(ppData), Offset, Count, "ID3DX11EffectMatrixVariable::SetMatrixPointerArray");
}
template<typename IBaseInterface, bool IsAnnotation>
_Use_decl_annotations_
HRESULT TMatrixVariable<IBaseInterface, IsAnnotation>::GetMatrixPointerArray(float **ppData, uint32_t Offset, uint32_t Count)
{
- return DoMatrixArrayInternal<false, false, true>(this->pType, this->GetTotalUnpackedSize(),
- this->Data.pNumeric, ppData, Offset, Count, "ID3DX11EffectMatrixVariable::GetMatrixPointerArray");
+ return DoMatrixArrayInternal<false, false, true>(pType, GetTotalUnpackedSize(),
+ Data.pNumeric, ppData, Offset, Count, "ID3DX11EffectMatrixVariable::GetMatrixPointerArray");
}
template<typename IBaseInterface, bool IsAnnotation>
@@ -2812,17 +2808,17 @@ HRESULT TMatrixVariable<IBaseInterface, IsAnnotation>::SetMatrixTranspose(const
{
static LPCSTR pFuncName = "ID3DX11EffectMatrixVariable::SetMatrixTranspose";
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- return DoMatrixArrayInternal<true, true, false>(this->pType, this->GetTotalUnpackedSize(),
- this->Data.pNumeric, const_cast<float*>(pData), 0, 1, "ID3DX11EffectMatrixVariable::SetMatrixTranspose");
+ DirtyVariable();
+ return DoMatrixArrayInternal<true, true, false>(pType, GetTotalUnpackedSize(),
+ Data.pNumeric, const_cast<float*>(pData), 0, 1, "ID3DX11EffectMatrixVariable::SetMatrixTranspose");
}
template<typename IBaseInterface, bool IsAnnotation>
_Use_decl_annotations_
HRESULT TMatrixVariable<IBaseInterface, IsAnnotation>::GetMatrixTranspose(float *pData)
{
- return DoMatrixArrayInternal<true, false, false>(this->pType, this->GetTotalUnpackedSize(),
- this->Data.pNumeric, pData, 0, 1, "ID3DX11EffectMatrixVariable::GetMatrixTranspose");
+ return DoMatrixArrayInternal<true, false, false>(pType, GetTotalUnpackedSize(),
+ Data.pNumeric, pData, 0, 1, "ID3DX11EffectMatrixVariable::GetMatrixTranspose");
}
template<typename IBaseInterface, bool IsAnnotation>
@@ -2831,17 +2827,17 @@ HRESULT TMatrixVariable<IBaseInterface, IsAnnotation>::SetMatrixTransposeArray(c
{
static LPCSTR pFuncName = "ID3DX11EffectMatrixVariable::SetMatrixTransposeArray";
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- return DoMatrixArrayInternal<true, true, false>(this->pType, this->GetTotalUnpackedSize(),
- this->Data.pNumeric, const_cast<float*>(pData), Offset, Count, "ID3DX11EffectMatrixVariable::SetMatrixTransposeArray");
+ DirtyVariable();
+ return DoMatrixArrayInternal<true, true, false>(pType, GetTotalUnpackedSize(),
+ Data.pNumeric, const_cast<float*>(pData), Offset, Count, "ID3DX11EffectMatrixVariable::SetMatrixTransposeArray");
}
template<typename IBaseInterface, bool IsAnnotation>
_Use_decl_annotations_
HRESULT TMatrixVariable<IBaseInterface, IsAnnotation>::GetMatrixTransposeArray(float *pData, uint32_t Offset, uint32_t Count)
{
- return DoMatrixArrayInternal<true, false, false>(this->pType, this->GetTotalUnpackedSize(),
- this->Data.pNumeric, pData, Offset, Count, "ID3DX11EffectMatrixVariable::GetMatrixTransposeArray");
+ return DoMatrixArrayInternal<true, false, false>(pType, GetTotalUnpackedSize(),
+ Data.pNumeric, pData, Offset, Count, "ID3DX11EffectMatrixVariable::GetMatrixTransposeArray");
}
template<typename IBaseInterface, bool IsAnnotation>
@@ -2850,17 +2846,17 @@ HRESULT TMatrixVariable<IBaseInterface, IsAnnotation>::SetMatrixTransposePointer
{
static LPCSTR pFuncName = "ID3DX11EffectMatrixVariable::SetMatrixTransposePointerArray";
if (IsAnnotation) return AnnotationInvalidSetCall(pFuncName);
- this->DirtyVariable();
- return DoMatrixArrayInternal<true, true, true>(this->pType, this->GetTotalUnpackedSize(),
- this->Data.pNumeric, const_cast<float**>(ppData), Offset, Count, "ID3DX11EffectMatrixVariable::SetMatrixTransposePointerArray");
+ DirtyVariable();
+ return DoMatrixArrayInternal<true, true, true>(pType, GetTotalUnpackedSize(),
+ Data.pNumeric, const_cast<float**>(ppData), Offset, Count, "ID3DX11EffectMatrixVariable::SetMatrixTransposePointerArray");
}
template<typename IBaseInterface, bool IsAnnotation>
_Use_decl_annotations_
HRESULT TMatrixVariable<IBaseInterface, IsAnnotation>::GetMatrixTransposePointerArray(float **ppData, uint32_t Offset, uint32_t Count)
{
- return DoMatrixArrayInternal<true, false, true>(this->pType, this->GetTotalUnpackedSize(),
- this->Data.pNumeric, ppData, Offset, Count, "ID3DX11EffectMatrixVariable::GetMatrixTransposePointerArray");
+ return DoMatrixArrayInternal<true, false, true>(pType, GetTotalUnpackedSize(),
+ Data.pNumeric, ppData, Offset, Count, "ID3DX11EffectMatrixVariable::GetMatrixTransposePointerArray");
}
// Optimize commonly used fast paths
@@ -3027,10 +3023,10 @@ template<typename IBaseInterface, bool IsColumnMajor>
_Use_decl_annotations_
HRESULT TMatrix4x4Variable<IBaseInterface, IsColumnMajor>::SetMatrix(const float *pData)
{
- this->DirtyVariable();
- return DoMatrix4x4ArrayInternal<IsColumnMajor, false, true>(this->Data.pNumeric, const_cast<float*>(pData), 0, 1
+ DirtyVariable();
+ return DoMatrix4x4ArrayInternal<IsColumnMajor, false, true>(Data.pNumeric, const_cast<float*>(pData), 0, 1
#ifdef _DEBUG
- , this->pType, this->GetTotalUnpackedSize(), "ID3DX11EffectMatrixVariable::SetMatrix");
+ , pType, GetTotalUnpackedSize(), "ID3DX11EffectMatrixVariable::SetMatrix");
#else
);
#endif
@@ -3040,9 +3036,9 @@ template<typename IBaseInterface, bool IsColumnMajor>
_Use_decl_annotations_
HRESULT TMatrix4x4Variable<IBaseInterface, IsColumnMajor>::GetMatrix(float *pData)
{
- return DoMatrix4x4ArrayInternal<IsColumnMajor, false, false>(this->Data.pNumeric, pData, 0, 1
+ return DoMatrix4x4ArrayInternal<IsColumnMajor, false, false>(Data.pNumeric, pData, 0, 1
#ifdef _DEBUG
- , this->pType, this->GetTotalUnpackedSize(), "ID3DX11EffectMatrixVariable::GetMatrix");
+ , pType, GetTotalUnpackedSize(), "ID3DX11EffectMatrixVariable::GetMatrix");
#else
);
#endif
@@ -3052,10 +3048,10 @@ template<typename IBaseInterface, bool IsColumnMajor>
_Use_decl_annotations_
HRESULT TMatrix4x4Variable<IBaseInterface, IsColumnMajor>::SetMatrixArray(const float *pData, uint32_t Offset, uint32_t Count)
{
- this->DirtyVariable();
- return DoMatrix4x4ArrayInternal<IsColumnMajor, false, true>(this->Data.pNumeric, const_cast<float*>(pData), Offset, Count
+ DirtyVariable();
+ return DoMatrix4x4ArrayInternal<IsColumnMajor, false, true>(Data.pNumeric, const_cast<float*>(pData), Offset, Count
#ifdef _DEBUG
- , this->pType, this->GetTotalUnpackedSize(), "ID3DX11EffectMatrixVariable::SetMatrixArray");
+ , pType, GetTotalUnpackedSize(), "ID3DX11EffectMatrixVariable::SetMatrixArray");
#else
);
#endif
@@ -3065,9 +3061,9 @@ template<typename IBaseInterface, bool IsColumnMajor>
_Use_decl_annotations_
HRESULT TMatrix4x4Variable<IBaseInterface, IsColumnMajor>::GetMatrixArray(float *pData, uint32_t Offset, uint32_t Count)
{
- return DoMatrix4x4ArrayInternal<IsColumnMajor, false, false>(this->Data.pNumeric, pData, Offset, Count
+ return DoMatrix4x4ArrayInternal<IsColumnMajor, false, false>(Data.pNumeric, pData, Offset, Count
#ifdef _DEBUG
- , this->pType, this->GetTotalUnpackedSize(), "ID3DX11EffectMatrixVariable::GetMatrixArray");
+ , pType, GetTotalUnpackedSize(), "ID3DX11EffectMatrixVariable::GetMatrixArray");
#else
);
#endif
@@ -3077,10 +3073,10 @@ template<typename IBaseInterface, bool IsColumnMajor>
_Use_decl_annotations_
HRESULT TMatrix4x4Variable<IBaseInterface, IsColumnMajor>::SetMatrixTranspose(const float *pData)
{
- this->DirtyVariable();
- return DoMatrix4x4ArrayInternal<IsColumnMajor, true, true>(this->Data.pNumeric, const_cast<float*>(pData), 0, 1
+ DirtyVariable();
+ return DoMatrix4x4ArrayInternal<IsColumnMajor, true, true>(Data.pNumeric, const_cast<float*>(pData), 0, 1
#ifdef _DEBUG
- , this->pType, this->GetTotalUnpackedSize(), "ID3DX11EffectMatrixVariable::SetMatrixTranspose");
+ , pType, GetTotalUnpackedSize(), "ID3DX11EffectMatrixVariable::SetMatrixTranspose");
#else
);
#endif
@@ -3090,9 +3086,9 @@ template<typename IBaseInterface, bool IsColumnMajor>
_Use_decl_annotations_
HRESULT TMatrix4x4Variable<IBaseInterface, IsColumnMajor>::GetMatrixTranspose(float *pData)
{
- return DoMatrix4x4ArrayInternal<IsColumnMajor, true, false>(this->Data.pNumeric, pData, 0, 1
+ return DoMatrix4x4ArrayInternal<IsColumnMajor, true, false>(Data.pNumeric, pData, 0, 1
#ifdef _DEBUG
- , this->pType, this->GetTotalUnpackedSize(), "ID3DX11EffectMatrixVariable::GetMatrixTranspose");
+ , pType, GetTotalUnpackedSize(), "ID3DX11EffectMatrixVariable::GetMatrixTranspose");
#else
);
#endif
@@ -3102,10 +3098,10 @@ template<typename IBaseInterface, bool IsColumnMajor>
_Use_decl_annotations_
HRESULT TMatrix4x4Variable<IBaseInterface, IsColumnMajor>::SetMatrixTransposeArray(const float *pData, uint32_t Offset, uint32_t Count)
{
- this->DirtyVariable();
- return DoMatrix4x4ArrayInternal<IsColumnMajor, true, true>(this->Data.pNumeric, const_cast<float*>(pData), Offset, Count
+ DirtyVariable();
+ return DoMatrix4x4ArrayInternal<IsColumnMajor, true, true>(Data.pNumeric, const_cast<float*>(pData), Offset, Count
#ifdef _DEBUG
- , this->pType, this->GetTotalUnpackedSize(), "ID3DX11EffectMatrixVariable::SetMatrixTransposeArray");
+ , pType, GetTotalUnpackedSize(), "ID3DX11EffectMatrixVariable::SetMatrixTransposeArray");
#else
);
#endif
@@ -3115,9 +3111,9 @@ template<typename IBaseInterface, bool IsColumnMajor>
_Use_decl_annotations_
HRESULT TMatrix4x4Variable<IBaseInterface, IsColumnMajor>::GetMatrixTransposeArray(float *pData, uint32_t Offset, uint32_t Count)
{
- return DoMatrix4x4ArrayInternal<IsColumnMajor, true, false>(this->Data.pNumeric, pData, Offset, Count
+ return DoMatrix4x4ArrayInternal<IsColumnMajor, true, false>(Data.pNumeric, pData, Offset, Count
#ifdef _DEBUG
- , this->pType, this->GetTotalUnpackedSize(), "ID3DX11EffectMatrixVariable::GetMatrixTransposeArray");
+ , pType, GetTotalUnpackedSize(), "ID3DX11EffectMatrixVariable::GetMatrixTransposeArray");
#else
);
#endif
@@ -3128,8 +3124,8 @@ HRESULT TMatrix4x4Variable<IBaseInterface, IsColumnMajor>::GetMatrixTransposeArr
// Useful object macro to check bounds and parameters
#define CHECK_OBJECT_ARRAY_BOUNDS(Offset, Count, Pointer) \
HRESULT hr = S_OK; \
- const uint32_t elements = this->IsArray() ? this->pType->Elements : 1; \
VERIFYPARAMETER(Pointer) \
+ uint32_t elements = IsArray() ? pType->Elements : 1; \
\
if ((Offset + Count < Offset) || (elements < Offset + Count)) \
{ \
@@ -3139,8 +3135,8 @@ HRESULT TMatrix4x4Variable<IBaseInterface, IsColumnMajor>::GetMatrixTransposeArr
#define CHECK_OBJECT_SCALAR_BOUNDS(Index, Pointer) \
HRESULT hr = S_OK; \
- const uint32_t elements = this->IsArray() ? this->pType->Elements : 1; \
VERIFYPARAMETER(Pointer) \
+ uint32_t elements = IsArray() ? pType->Elements : 1; \
\
if (Index >= elements) \
{ \
@@ -3150,7 +3146,7 @@ HRESULT TMatrix4x4Variable<IBaseInterface, IsColumnMajor>::GetMatrixTransposeArr
#define CHECK_SCALAR_BOUNDS(Index) \
HRESULT hr = S_OK; \
- uint32_t elements = this->IsArray() ? this->pType->Elements : 1; \
+ uint32_t elements = IsArray() ? pType->Elements : 1; \
\
if (Index >= elements) \
{ \
@@ -3191,16 +3187,16 @@ HRESULT TStringVariable<IBaseInterface, IsAnnotation>::GetString(LPCSTR *ppStrin
VERIFYPARAMETER(ppString);
- if (this->GetTopLevelEntity()->pEffect->IsOptimized())
+ if (GetTopLevelEntity()->pEffect->IsOptimized())
{
DPF(0, "%s: Effect has been Optimize()'ed; all string/reflection data has been deleted", pFuncName);
return D3DERR_INVALIDCALL;
}
- assert(this->Data.pString != 0);
- _Analysis_assume_(this->Data.pString != 0);
+ assert(Data.pString != 0);
+ _Analysis_assume_(Data.pString != 0);
- *ppString = this->Data.pString->pString;
+ *ppString = Data.pString->pString;
lExit:
return hr;
@@ -3215,18 +3211,18 @@ HRESULT TStringVariable<IBaseInterface, IsAnnotation>::GetStringArray( LPCSTR *p
CHECK_OBJECT_ARRAY_BOUNDS(Offset, Count, ppStrings);
- if (this->GetTopLevelEntity()->pEffect->IsOptimized())
+ if (GetTopLevelEntity()->pEffect->IsOptimized())
{
DPF(0, "%s: Effect has been Optimize()'ed; all string/reflection data has been deleted", pFuncName);
return D3DERR_INVALIDCALL;
}
- assert(this->Data.pString != 0);
- _Analysis_assume_(this->Data.pString != 0);
+ assert(Data.pString != 0);
+ _Analysis_assume_(Data.pString != 0);
for (size_t i = 0; i < Count; ++ i)
{
- ppStrings[i] = (this->Data.pString + Offset + i)->pString;
+ ppStrings[i] = (Data.pString + Offset + i)->pString;
}
lExit:
@@ -3249,9 +3245,9 @@ HRESULT TClassInstanceVariable<IBaseClassInstance>::GetClassInstance(_Outptr_ ID
HRESULT hr = S_OK;
static LPCSTR pFuncName = "ID3DX11EffectClassInstanceVariable::GetClassInstance";
- assert( this->pMemberData != 0 && this->pMemberData->Data.pD3DClassInstance != 0);
- _Analysis_assume_( this->pMemberData != 0 && this->pMemberData->Data.pD3DClassInstance != 0);
- *ppClassInstance = this->pMemberData->Data.pD3DClassInstance;
+ assert( pMemberData != 0 && pMemberData->Data.pD3DClassInstance != 0);
+ _Analysis_assume_( pMemberData != 0 && pMemberData->Data.pD3DClassInstance != 0);
+ *ppClassInstance = pMemberData->Data.pD3DClassInstance;
SAFE_ADDREF(*ppClassInstance);
lExit:
@@ -3278,7 +3274,7 @@ HRESULT TInterfaceVariable<IBaseInterface>::SetClassInstance(_In_ ID3DX11EffectC
// Note that we don't check if the types are compatible. The debug layer will complain if it is.
// IsValid() will not catch type mismatches.
SClassInstanceGlobalVariable* pCI = (SClassInstanceGlobalVariable*)pEffectClassInstance;
- this->Data.pInterface->pClassInstance = pCI;
+ Data.pInterface->pClassInstance = pCI;
lExit:
return hr;
@@ -3294,7 +3290,7 @@ HRESULT TInterfaceVariable<IBaseInterface>::GetClassInstance(_Outptr_ ID3DX11Eff
VERIFYPARAMETER(ppEffectClassInstance);
#endif
- *ppEffectClassInstance = this->Data.pInterface->pClassInstance;
+ *ppEffectClassInstance = Data.pInterface->pClassInstance;
lExit:
return hr;
@@ -3586,13 +3582,13 @@ HRESULT TShaderResourceVariable<IBaseInterface>::SetResource(ID3D11ShaderResourc
#ifdef _DEBUG
static LPCSTR pFuncName = "ID3DX11EffectShaderResourceVariable::SetResource";
- VH(ValidateTextureType(pResource, this->pType->ObjectType, pFuncName));
+ VH(ValidateTextureType(pResource, pType->ObjectType, pFuncName));
#endif
// Texture variables don't need to be dirtied.
SAFE_ADDREF(pResource);
- SAFE_RELEASE(this->Data.pShaderResource->pShaderResource);
- this->Data.pShaderResource->pShaderResource = pResource;
+ SAFE_RELEASE(Data.pShaderResource->pShaderResource);
+ Data.pShaderResource->pShaderResource = pResource;
lExit:
return hr;
@@ -3610,9 +3606,9 @@ HRESULT TShaderResourceVariable<IBaseInterface>::GetResource(ID3D11ShaderResourc
VERIFYPARAMETER(ppResource);
#endif
- assert(this->Data.pShaderResource != 0 && this->Data.pShaderResource->pShaderResource != 0);
- _Analysis_assume_(this->Data.pShaderResource != 0 && this->Data.pShaderResource->pShaderResource != 0);
- *ppResource = this->Data.pShaderResource->pShaderResource;
+ assert(Data.pShaderResource != 0 && Data.pShaderResource->pShaderResource != 0);
+ _Analysis_assume_(Data.pShaderResource != 0 && Data.pShaderResource->pShaderResource != 0);
+ *ppResource = Data.pShaderResource->pShaderResource;
SAFE_ADDREF(*ppResource);
lExit:
@@ -3630,14 +3626,14 @@ HRESULT TShaderResourceVariable<IBaseInterface>::SetResourceArray(ID3D11ShaderRe
#ifdef _DEBUG
for (size_t i = 0; i < Count; ++ i)
{
- VH(ValidateTextureType(ppResources[i], this->pType->ObjectType, pFuncName));
+ VH(ValidateTextureType(ppResources[i], pType->ObjectType, pFuncName));
}
#endif
// Texture variables don't need to be dirtied.
for (size_t i = 0; i < Count; ++ i)
{
- SShaderResource *pResourceBlock = this->Data.pShaderResource + Offset + i;
+ SShaderResource *pResourceBlock = Data.pShaderResource + Offset + i;
SAFE_ADDREF(ppResources[i]);
SAFE_RELEASE(pResourceBlock->pShaderResource);
pResourceBlock->pShaderResource = ppResources[i];
@@ -3657,7 +3653,7 @@ HRESULT TShaderResourceVariable<IBaseInterface>::GetResourceArray(ID3D11ShaderRe
for (size_t i = 0; i < Count; ++ i)
{
- ppResources[i] = (this->Data.pShaderResource + Offset + i)->pShaderResource;
+ ppResources[i] = (Data.pShaderResource + Offset + i)->pShaderResource;
SAFE_ADDREF(ppResources[i]);
}
@@ -3803,13 +3799,13 @@ HRESULT TUnorderedAccessViewVariable<IBaseInterface>::SetUnorderedAccessView(ID3
#ifdef _DEBUG
static LPCSTR pFuncName = "ID3DX11EffectUnorderedAccessViewVariable::SetUnorderedAccessView";
- VH(ValidateTextureType(pResource, this->pType->ObjectType, pFuncName));
+ VH(ValidateTextureType(pResource, pType->ObjectType, pFuncName));
#endif
// UAV variables don't need to be dirtied.
SAFE_ADDREF(pResource);
- SAFE_RELEASE(this->Data.pUnorderedAccessView->pUnorderedAccessView);
- this->Data.pUnorderedAccessView->pUnorderedAccessView = pResource;
+ SAFE_RELEASE(Data.pUnorderedAccessView->pUnorderedAccessView);
+ Data.pUnorderedAccessView->pUnorderedAccessView = pResource;
lExit:
return hr;
@@ -3827,9 +3823,9 @@ HRESULT TUnorderedAccessViewVariable<IBaseInterface>::GetUnorderedAccessView(ID3
VERIFYPARAMETER(ppResource);
#endif
- assert(this->Data.pUnorderedAccessView != 0 && this->Data.pUnorderedAccessView->pUnorderedAccessView != 0);
- _Analysis_assume_(this->Data.pUnorderedAccessView != 0 && this->Data.pUnorderedAccessView->pUnorderedAccessView != 0);
- *ppResource = this->Data.pUnorderedAccessView->pUnorderedAccessView;
+ assert(Data.pUnorderedAccessView != 0 && Data.pUnorderedAccessView->pUnorderedAccessView != 0);
+ _Analysis_assume_(Data.pUnorderedAccessView != 0 && Data.pUnorderedAccessView->pUnorderedAccessView != 0);
+ *ppResource = Data.pUnorderedAccessView->pUnorderedAccessView;
SAFE_ADDREF(*ppResource);
lExit:
@@ -3847,14 +3843,14 @@ HRESULT TUnorderedAccessViewVariable<IBaseInterface>::SetUnorderedAccessViewArra
#ifdef _DEBUG
for (size_t i = 0; i < Count; ++ i)
{
- VH(ValidateTextureType(ppResources[i], this->pType->ObjectType, pFuncName));
+ VH(ValidateTextureType(ppResources[i], pType->ObjectType, pFuncName));
}
#endif
// Texture variables don't need to be dirtied.
for (size_t i = 0; i < Count; ++ i)
{
- SUnorderedAccessView *pResourceBlock = this->Data.pUnorderedAccessView + Offset + i;
+ SUnorderedAccessView *pResourceBlock = Data.pUnorderedAccessView + Offset + i;
SAFE_ADDREF(ppResources[i]);
SAFE_RELEASE(pResourceBlock->pUnorderedAccessView);
pResourceBlock->pUnorderedAccessView = ppResources[i];
@@ -3874,7 +3870,7 @@ HRESULT TUnorderedAccessViewVariable<IBaseInterface>::GetUnorderedAccessViewArra
for (size_t i = 0; i < Count; ++ i)
{
- ppResources[i] = (this->Data.pUnorderedAccessView + Offset + i)->pUnorderedAccessView;
+ ppResources[i] = (Data.pUnorderedAccessView + Offset + i)->pUnorderedAccessView;
SAFE_ADDREF(ppResources[i]);
}
@@ -3909,8 +3905,8 @@ HRESULT TRenderTargetViewVariable<IBaseInterface>::SetRenderTarget(ID3D11RenderT
// Texture variables don't need to be dirtied.
SAFE_ADDREF(pResource);
- SAFE_RELEASE(this->Data.pRenderTargetView->pRenderTargetView);
- this->Data.pRenderTargetView->pRenderTargetView = pResource;
+ SAFE_RELEASE(Data.pRenderTargetView->pRenderTargetView);
+ Data.pRenderTargetView->pRenderTargetView = pResource;
lExit:
return hr;
@@ -3922,9 +3918,9 @@ HRESULT TRenderTargetViewVariable<IBaseInterface>::GetRenderTarget(ID3D11RenderT
{
HRESULT hr = S_OK;
- assert(this->Data.pRenderTargetView->pRenderTargetView != 0);
- _Analysis_assume_(this->Data.pRenderTargetView->pRenderTargetView != 0);
- *ppResource = this->Data.pRenderTargetView->pRenderTargetView;
+ assert(Data.pRenderTargetView->pRenderTargetView != 0);
+ _Analysis_assume_(Data.pRenderTargetView->pRenderTargetView != 0);
+ *ppResource = Data.pRenderTargetView->pRenderTargetView;
SAFE_ADDREF(*ppResource);
lExit:
@@ -3942,7 +3938,7 @@ HRESULT TRenderTargetViewVariable<IBaseInterface>::SetRenderTargetArray(ID3D11Re
// Texture variables don't need to be dirtied.
for (size_t i = 0; i < Count; ++ i)
{
- SRenderTargetView *pResourceBlock = this->Data.pRenderTargetView + Offset + i;
+ SRenderTargetView *pResourceBlock = Data.pRenderTargetView + Offset + i;
SAFE_ADDREF(ppResources[i]);
SAFE_RELEASE(pResourceBlock->pRenderTargetView);
pResourceBlock->pRenderTargetView = ppResources[i];
@@ -3962,7 +3958,7 @@ HRESULT TRenderTargetViewVariable<IBaseInterface>::GetRenderTargetArray(ID3D11Re
for (size_t i = 0; i < Count; ++ i)
{
- ppResources[i] = (this->Data.pRenderTargetView + Offset + i)->pRenderTargetView;
+ ppResources[i] = (Data.pRenderTargetView + Offset + i)->pRenderTargetView;
SAFE_ADDREF(ppResources[i]);
}
@@ -3998,8 +3994,8 @@ HRESULT TDepthStencilViewVariable<IBaseInterface>::SetDepthStencil(ID3D11DepthSt
// Texture variables don't need to be dirtied.
SAFE_ADDREF(pResource);
- SAFE_RELEASE(this->Data.pDepthStencilView->pDepthStencilView);
- this->Data.pDepthStencilView->pDepthStencilView = pResource;
+ SAFE_RELEASE(Data.pDepthStencilView->pDepthStencilView);
+ Data.pDepthStencilView->pDepthStencilView = pResource;
lExit:
return hr;
@@ -4017,9 +4013,9 @@ HRESULT TDepthStencilViewVariable<IBaseInterface>::GetDepthStencil(ID3D11DepthSt
VERIFYPARAMETER(ppResource);
#endif
- assert(this->Data.pDepthStencilView->pDepthStencilView != 0);
- _Analysis_assume_(this->Data.pDepthStencilView->pDepthStencilView != 0);
- *ppResource = this->Data.pDepthStencilView->pDepthStencilView;
+ assert(Data.pDepthStencilView->pDepthStencilView != 0);
+ _Analysis_assume_(Data.pDepthStencilView->pDepthStencilView != 0);
+ *ppResource = Data.pDepthStencilView->pDepthStencilView;
SAFE_ADDREF(*ppResource);
lExit:
@@ -4037,7 +4033,7 @@ HRESULT TDepthStencilViewVariable<IBaseInterface>::SetDepthStencilArray(ID3D11De
// Texture variables don't need to be dirtied.
for (size_t i = 0; i < Count; ++ i)
{
- SDepthStencilView *pResourceBlock = this->Data.pDepthStencilView + Offset + i;
+ SDepthStencilView *pResourceBlock = Data.pDepthStencilView + Offset + i;
SAFE_ADDREF(ppResources[i]);
SAFE_RELEASE(pResourceBlock->pDepthStencilView);
pResourceBlock->pDepthStencilView = ppResources[i];
@@ -4057,7 +4053,7 @@ HRESULT TDepthStencilViewVariable<IBaseInterface>::GetDepthStencilArray(ID3D11De
for (size_t i = 0; i < Count; ++ i)
{
- ppResources[i] = (this->Data.pDepthStencilView + Offset + i)->pDepthStencilView;
+ ppResources[i] = (Data.pDepthStencilView + Offset + i)->pDepthStencilView;
SAFE_ADDREF(ppResources[i]);
}
@@ -4096,7 +4092,7 @@ HRESULT TShaderVariable<IBaseInterface>::GetShaderDesc(uint32_t ShaderIndex, D3D
CHECK_OBJECT_SCALAR_BOUNDS(ShaderIndex, pDesc);
- hr = this->Data.pShader[ShaderIndex].GetShaderDesc(pDesc, false);
+ hr = Data.pShader[ShaderIndex].GetShaderDesc(pDesc, false);
lExit:
return hr;
@@ -4110,7 +4106,7 @@ HRESULT TShaderVariable<IBaseInterface>::GetVertexShader(uint32_t ShaderIndex, I
CHECK_OBJECT_SCALAR_BOUNDS(ShaderIndex, ppVS);
- VH( this->Data.pShader[ShaderIndex].GetVertexShader(ppVS) );
+ VH( Data.pShader[ShaderIndex].GetVertexShader(ppVS) );
lExit:
return hr;
@@ -4124,7 +4120,7 @@ HRESULT TShaderVariable<IBaseInterface>::GetGeometryShader(uint32_t ShaderIndex,
CHECK_OBJECT_SCALAR_BOUNDS(ShaderIndex, ppGS);
- VH( this->Data.pShader[ShaderIndex].GetGeometryShader(ppGS) );
+ VH( Data.pShader[ShaderIndex].GetGeometryShader(ppGS) );
lExit:
return hr;
@@ -4138,7 +4134,7 @@ HRESULT TShaderVariable<IBaseInterface>::GetPixelShader(uint32_t ShaderIndex, ID
CHECK_OBJECT_SCALAR_BOUNDS(ShaderIndex, ppPS);
- VH( this->Data.pShader[ShaderIndex].GetPixelShader(ppPS) );
+ VH( Data.pShader[ShaderIndex].GetPixelShader(ppPS) );
lExit:
return hr;
@@ -4152,7 +4148,7 @@ HRESULT TShaderVariable<IBaseInterface>::GetHullShader(uint32_t ShaderIndex, ID3
CHECK_OBJECT_SCALAR_BOUNDS(ShaderIndex, ppHS);
- VH( this->Data.pShader[ShaderIndex].GetHullShader(ppHS) );
+ VH( Data.pShader[ShaderIndex].GetHullShader(ppHS) );
lExit:
return hr;
@@ -4166,7 +4162,7 @@ HRESULT TShaderVariable<IBaseInterface>::GetDomainShader(uint32_t ShaderIndex, I
CHECK_OBJECT_SCALAR_BOUNDS(ShaderIndex, ppDS);
- VH( this->Data.pShader[ShaderIndex].GetDomainShader(ppDS) );
+ VH( Data.pShader[ShaderIndex].GetDomainShader(ppDS) );
lExit:
return hr;
@@ -4180,7 +4176,7 @@ HRESULT TShaderVariable<IBaseInterface>::GetComputeShader(uint32_t ShaderIndex,
CHECK_OBJECT_SCALAR_BOUNDS(ShaderIndex, ppCS);
- VH( this->Data.pShader[ShaderIndex].GetComputeShader(ppCS) );
+ VH( Data.pShader[ShaderIndex].GetComputeShader(ppCS) );
lExit:
return hr;
@@ -4194,7 +4190,7 @@ HRESULT TShaderVariable<IBaseInterface>::GetInputSignatureElementDesc(uint32_t S
CHECK_OBJECT_SCALAR_BOUNDS(ShaderIndex, pDesc);
- VH( this->Data.pShader[ShaderIndex].GetSignatureElementDesc(SShaderBlock::ST_Input, Element, pDesc) );
+ VH( Data.pShader[ShaderIndex].GetSignatureElementDesc(SShaderBlock::ST_Input, Element, pDesc) );
lExit:
return hr;
@@ -4208,7 +4204,7 @@ HRESULT TShaderVariable<IBaseInterface>::GetOutputSignatureElementDesc(uint32_t
CHECK_OBJECT_SCALAR_BOUNDS(ShaderIndex, pDesc);
- VH( this->Data.pShader[ShaderIndex].GetSignatureElementDesc(SShaderBlock::ST_Output, Element, pDesc) );
+ VH( Data.pShader[ShaderIndex].GetSignatureElementDesc(SShaderBlock::ST_Output, Element, pDesc) );
lExit:
return hr;
@@ -4222,7 +4218,7 @@ HRESULT TShaderVariable<IBaseInterface>::GetPatchConstantSignatureElementDesc(ui
CHECK_OBJECT_SCALAR_BOUNDS(ShaderIndex, pDesc);
- VH( this->Data.pShader[ShaderIndex].GetSignatureElementDesc(SShaderBlock::ST_PatchConstant, Element, pDesc) );
+ VH( Data.pShader[ShaderIndex].GetSignatureElementDesc(SShaderBlock::ST_PatchConstant, Element, pDesc) );
lExit:
return hr;
@@ -4231,9 +4227,9 @@ lExit:
template<typename IBaseInterface>
bool TShaderVariable<IBaseInterface>::IsValid()
{
- uint32_t numElements = this->IsArray()? this->pType->Elements : 1;
+ uint32_t numElements = IsArray()? pType->Elements : 1;
bool valid = true;
- while( numElements > 0 && ( valid = this->Data.pShader[ numElements-1 ].IsValid ) )
+ while( numElements > 0 && ( valid = Data.pShader[ numElements-1 ].IsValid ) )
numElements--;
return valid;
}
@@ -4261,9 +4257,9 @@ HRESULT TBlendVariable<IBaseInterface>::GetBlendState(uint32_t Index, ID3D11Blen
CHECK_OBJECT_SCALAR_BOUNDS(Index, ppState);
- assert(this->Data.pBlend[Index].pBlendObject != 0);
- _Analysis_assume_(this->Data.pBlend[Index].pBlendObject != 0);
- *ppState = this->Data.pBlend[Index].pBlendObject;
+ assert(Data.pBlend[Index].pBlendObject != 0);
+ _Analysis_assume_(Data.pBlend[Index].pBlendObject != 0);
+ *ppState = Data.pBlend[Index].pBlendObject;
SAFE_ADDREF(*ppState);
lExit:
@@ -4278,20 +4274,20 @@ HRESULT TBlendVariable<IBaseInterface>::SetBlendState(uint32_t Index, ID3D11Blen
CHECK_SCALAR_BOUNDS(Index);
- if( !this->Data.pBlend[Index].IsUserManaged )
+ if( !Data.pBlend[Index].IsUserManaged )
{
// Save original state object in case we UndoSet
- assert( this->pMemberData[Index].Type == MDT_BlendState );
- VB( this->pMemberData[Index].Data.pD3DEffectsManagedBlendState == nullptr );
- this->pMemberData[Index].Data.pD3DEffectsManagedBlendState = this->Data.pBlend[Index].pBlendObject;
- this->Data.pBlend[Index].pBlendObject = nullptr;
- this->Data.pBlend[Index].IsUserManaged = true;
+ assert( pMemberData[Index].Type == MDT_BlendState );
+ VB( pMemberData[Index].Data.pD3DEffectsManagedBlendState == nullptr );
+ pMemberData[Index].Data.pD3DEffectsManagedBlendState = Data.pBlend[Index].pBlendObject;
+ Data.pBlend[Index].pBlendObject = nullptr;
+ Data.pBlend[Index].IsUserManaged = true;
}
SAFE_ADDREF( pState );
- SAFE_RELEASE( this->Data.pBlend[Index].pBlendObject );
- this->Data.pBlend[Index].pBlendObject = pState;
- this->Data.pBlend[Index].IsValid = true;
+ SAFE_RELEASE( Data.pBlend[Index].pBlendObject );
+ Data.pBlend[Index].pBlendObject = pState;
+ Data.pBlend[Index].IsValid = true;
lExit:
return hr;
}
@@ -4304,16 +4300,16 @@ HRESULT TBlendVariable<IBaseInterface>::UndoSetBlendState(uint32_t Index)
CHECK_SCALAR_BOUNDS(Index);
- if( !this->Data.pBlend[Index].IsUserManaged )
+ if( !Data.pBlend[Index].IsUserManaged )
{
return S_FALSE;
}
// Revert to original state object
- SAFE_RELEASE( this->Data.pBlend[Index].pBlendObject );
- this->Data.pBlend[Index].pBlendObject = this->pMemberData[Index].Data.pD3DEffectsManagedBlendState;
- this->pMemberData[Index].Data.pD3DEffectsManagedBlendState = nullptr;
- this->Data.pBlend[Index].IsUserManaged = false;
+ SAFE_RELEASE( Data.pBlend[Index].pBlendObject );
+ Data.pBlend[Index].pBlendObject = pMemberData[Index].Data.pD3DEffectsManagedBlendState;
+ pMemberData[Index].Data.pD3DEffectsManagedBlendState = nullptr;
+ Data.pBlend[Index].IsUserManaged = false;
lExit:
return hr;
@@ -4327,11 +4323,11 @@ HRESULT TBlendVariable<IBaseInterface>::GetBackingStore(uint32_t Index, D3D11_BL
CHECK_OBJECT_SCALAR_BOUNDS(Index, pBlendDesc);
- if( this->Data.pBlend[Index].IsUserManaged )
+ if( Data.pBlend[Index].IsUserManaged )
{
- if( this->Data.pBlend[Index].pBlendObject )
+ if( Data.pBlend[Index].pBlendObject )
{
- this->Data.pBlend[Index].pBlendObject->GetDesc( pBlendDesc );
+ Data.pBlend[Index].pBlendObject->GetDesc( pBlendDesc );
}
else
{
@@ -4340,8 +4336,8 @@ HRESULT TBlendVariable<IBaseInterface>::GetBackingStore(uint32_t Index, D3D11_BL
}
else
{
- SBlendBlock *pBlock = this->Data.pBlend + Index;
- if (pBlock->ApplyAssignments(this->GetTopLevelEntity()->pEffect))
+ SBlendBlock *pBlock = Data.pBlend + Index;
+ if (pBlock->ApplyAssignments(GetTopLevelEntity()->pEffect))
{
pBlock->pAssignments[0].LastRecomputedTime = 0; // Force a recreate of this block the next time ApplyRenderStateBlock is called
}
@@ -4356,9 +4352,9 @@ lExit:
template<typename IBaseInterface>
bool TBlendVariable<IBaseInterface>::IsValid()
{
- uint32_t numElements = this->IsArray()? this->pType->Elements : 1;
+ uint32_t numElements = IsArray()? pType->Elements : 1;
bool valid = true;
- while( numElements > 0 && ( valid = this->Data.pBlend[ numElements-1 ].IsValid ) )
+ while( numElements > 0 && ( valid = Data.pBlend[ numElements-1 ].IsValid ) )
numElements--;
return valid;
}
@@ -4387,9 +4383,9 @@ HRESULT TDepthStencilVariable<IBaseInterface>::GetDepthStencilState(uint32_t Ind
CHECK_OBJECT_SCALAR_BOUNDS(Index, ppState);
- assert(this->Data.pDepthStencil[Index].pDSObject != 0);
- _Analysis_assume_(this->Data.pDepthStencil[Index].pDSObject != 0);
- *ppState = this->Data.pDepthStencil[Index].pDSObject;
+ assert(Data.pDepthStencil[Index].pDSObject != 0);
+ _Analysis_assume_(Data.pDepthStencil[Index].pDSObject != 0);
+ *ppState = Data.pDepthStencil[Index].pDSObject;
SAFE_ADDREF(*ppState);
lExit:
@@ -4404,20 +4400,20 @@ HRESULT TDepthStencilVariable<IBaseInterface>::SetDepthStencilState(uint32_t Ind
CHECK_SCALAR_BOUNDS(Index);
- if( !this->Data.pDepthStencil[Index].IsUserManaged )
+ if( !Data.pDepthStencil[Index].IsUserManaged )
{
// Save original state object in case we UndoSet
- assert( this->pMemberData[Index].Type == MDT_DepthStencilState );
- VB( this->pMemberData[Index].Data.pD3DEffectsManagedDepthStencilState == nullptr );
- this->pMemberData[Index].Data.pD3DEffectsManagedDepthStencilState = this->Data.pDepthStencil[Index].pDSObject;
- this->Data.pDepthStencil[Index].pDSObject = nullptr;
- this->Data.pDepthStencil[Index].IsUserManaged = true;
+ assert( pMemberData[Index].Type == MDT_DepthStencilState );
+ VB( pMemberData[Index].Data.pD3DEffectsManagedDepthStencilState == nullptr );
+ pMemberData[Index].Data.pD3DEffectsManagedDepthStencilState = Data.pDepthStencil[Index].pDSObject;
+ Data.pDepthStencil[Index].pDSObject = nullptr;
+ Data.pDepthStencil[Index].IsUserManaged = true;
}
SAFE_ADDREF( pState );
- SAFE_RELEASE( this->Data.pDepthStencil[Index].pDSObject );
- this->Data.pDepthStencil[Index].pDSObject = pState;
- this->Data.pDepthStencil[Index].IsValid = true;
+ SAFE_RELEASE( Data.pDepthStencil[Index].pDSObject );
+ Data.pDepthStencil[Index].pDSObject = pState;
+ Data.pDepthStencil[Index].IsValid = true;
lExit:
return hr;
}
@@ -4429,16 +4425,16 @@ HRESULT TDepthStencilVariable<IBaseInterface>::UndoSetDepthStencilState(_In_ uin
CHECK_SCALAR_BOUNDS(Index);
- if( !this->Data.pDepthStencil[Index].IsUserManaged )
+ if( !Data.pDepthStencil[Index].IsUserManaged )
{
return S_FALSE;
}
// Revert to original state object
- SAFE_RELEASE( this->Data.pDepthStencil[Index].pDSObject );
- this->Data.pDepthStencil[Index].pDSObject = this->pMemberData[Index].Data.pD3DEffectsManagedDepthStencilState;
- this->pMemberData[Index].Data.pD3DEffectsManagedDepthStencilState = nullptr;
- this->Data.pDepthStencil[Index].IsUserManaged = false;
+ SAFE_RELEASE( Data.pDepthStencil[Index].pDSObject );
+ Data.pDepthStencil[Index].pDSObject = pMemberData[Index].Data.pD3DEffectsManagedDepthStencilState;
+ pMemberData[Index].Data.pD3DEffectsManagedDepthStencilState = nullptr;
+ Data.pDepthStencil[Index].IsUserManaged = false;
lExit:
return hr;
@@ -4452,11 +4448,11 @@ HRESULT TDepthStencilVariable<IBaseInterface>::GetBackingStore(uint32_t Index, D
CHECK_OBJECT_SCALAR_BOUNDS(Index, pDepthStencilDesc);
- if( this->Data.pDepthStencil[Index].IsUserManaged )
+ if( Data.pDepthStencil[Index].IsUserManaged )
{
- if( this->Data.pDepthStencil[Index].pDSObject )
+ if( Data.pDepthStencil[Index].pDSObject )
{
- this->Data.pDepthStencil[Index].pDSObject->GetDesc( pDepthStencilDesc );
+ Data.pDepthStencil[Index].pDSObject->GetDesc( pDepthStencilDesc );
}
else
{
@@ -4465,8 +4461,8 @@ HRESULT TDepthStencilVariable<IBaseInterface>::GetBackingStore(uint32_t Index, D
}
else
{
- SDepthStencilBlock *pBlock = this->Data.pDepthStencil + Index;
- if (pBlock->ApplyAssignments(this->GetTopLevelEntity()->pEffect))
+ SDepthStencilBlock *pBlock = Data.pDepthStencil + Index;
+ if (pBlock->ApplyAssignments(GetTopLevelEntity()->pEffect))
{
pBlock->pAssignments[0].LastRecomputedTime = 0; // Force a recreate of this block the next time ApplyRenderStateBlock is called
}
@@ -4481,9 +4477,9 @@ lExit:
template<typename IBaseInterface>
bool TDepthStencilVariable<IBaseInterface>::IsValid()
{
- uint32_t numElements = this->IsArray()? this->pType->Elements : 1;
+ uint32_t numElements = IsArray()? pType->Elements : 1;
bool valid = true;
- while( numElements > 0 && ( valid = this->Data.pDepthStencil[ numElements-1 ].IsValid ) )
+ while( numElements > 0 && ( valid = Data.pDepthStencil[ numElements-1 ].IsValid ) )
numElements--;
return valid;
}
@@ -4512,9 +4508,9 @@ HRESULT TRasterizerVariable<IBaseInterface>::GetRasterizerState(uint32_t Index,
CHECK_OBJECT_SCALAR_BOUNDS(Index, ppState);
- assert(this->Data.pRasterizer[Index].pRasterizerObject != 0);
- _Analysis_assume_(this->Data.pRasterizer[Index].pRasterizerObject != 0);
- *ppState = this->Data.pRasterizer[Index].pRasterizerObject;
+ assert(Data.pRasterizer[Index].pRasterizerObject != 0);
+ _Analysis_assume_(Data.pRasterizer[Index].pRasterizerObject != 0);
+ *ppState = Data.pRasterizer[Index].pRasterizerObject;
SAFE_ADDREF(*ppState);
lExit:
@@ -4529,20 +4525,20 @@ HRESULT TRasterizerVariable<IBaseInterface>::SetRasterizerState(uint32_t Index,
CHECK_SCALAR_BOUNDS(Index);
- if( !this->Data.pRasterizer[Index].IsUserManaged )
+ if( !Data.pRasterizer[Index].IsUserManaged )
{
// Save original state object in case we UndoSet
- assert( this->pMemberData[Index].Type == MDT_RasterizerState );
- VB( this->pMemberData[Index].Data.pD3DEffectsManagedRasterizerState == nullptr );
- this->pMemberData[Index].Data.pD3DEffectsManagedRasterizerState = this->Data.pRasterizer[Index].pRasterizerObject;
- this->Data.pRasterizer[Index].pRasterizerObject = nullptr;
- this->Data.pRasterizer[Index].IsUserManaged = true;
+ assert( pMemberData[Index].Type == MDT_RasterizerState );
+ VB( pMemberData[Index].Data.pD3DEffectsManagedRasterizerState == nullptr );
+ pMemberData[Index].Data.pD3DEffectsManagedRasterizerState = Data.pRasterizer[Index].pRasterizerObject;
+ Data.pRasterizer[Index].pRasterizerObject = nullptr;
+ Data.pRasterizer[Index].IsUserManaged = true;
}
SAFE_ADDREF( pState );
- SAFE_RELEASE( this->Data.pRasterizer[Index].pRasterizerObject );
- this->Data.pRasterizer[Index].pRasterizerObject = pState;
- this->Data.pRasterizer[Index].IsValid = true;
+ SAFE_RELEASE( Data.pRasterizer[Index].pRasterizerObject );
+ Data.pRasterizer[Index].pRasterizerObject = pState;
+ Data.pRasterizer[Index].IsValid = true;
lExit:
return hr;
}
@@ -4555,16 +4551,16 @@ HRESULT TRasterizerVariable<IBaseInterface>::UndoSetRasterizerState(uint32_t Ind
CHECK_SCALAR_BOUNDS(Index);
- if( !this->Data.pRasterizer[Index].IsUserManaged )
+ if( !Data.pRasterizer[Index].IsUserManaged )
{
return S_FALSE;
}
// Revert to original state object
- SAFE_RELEASE( this->Data.pRasterizer[Index].pRasterizerObject );
- this->Data.pRasterizer[Index].pRasterizerObject = this->pMemberData[Index].Data.pD3DEffectsManagedRasterizerState;
- this->pMemberData[Index].Data.pD3DEffectsManagedRasterizerState = nullptr;
- this->Data.pRasterizer[Index].IsUserManaged = false;
+ SAFE_RELEASE( Data.pRasterizer[Index].pRasterizerObject );
+ Data.pRasterizer[Index].pRasterizerObject = pMemberData[Index].Data.pD3DEffectsManagedRasterizerState;
+ pMemberData[Index].Data.pD3DEffectsManagedRasterizerState = nullptr;
+ Data.pRasterizer[Index].IsUserManaged = false;
lExit:
return hr;
@@ -4578,11 +4574,11 @@ HRESULT TRasterizerVariable<IBaseInterface>::GetBackingStore(uint32_t Index, D3D
CHECK_OBJECT_SCALAR_BOUNDS(Index, pRasterizerDesc);
- if( this->Data.pRasterizer[Index].IsUserManaged )
+ if( Data.pRasterizer[Index].IsUserManaged )
{
- if( this->Data.pRasterizer[Index].pRasterizerObject )
+ if( Data.pRasterizer[Index].pRasterizerObject )
{
- this->Data.pRasterizer[Index].pRasterizerObject->GetDesc( pRasterizerDesc );
+ Data.pRasterizer[Index].pRasterizerObject->GetDesc( pRasterizerDesc );
}
else
{
@@ -4591,8 +4587,8 @@ HRESULT TRasterizerVariable<IBaseInterface>::GetBackingStore(uint32_t Index, D3D
}
else
{
- SRasterizerBlock *pBlock = this->Data.pRasterizer + Index;
- if (pBlock->ApplyAssignments(this->GetTopLevelEntity()->pEffect))
+ SRasterizerBlock *pBlock = Data.pRasterizer + Index;
+ if (pBlock->ApplyAssignments(GetTopLevelEntity()->pEffect))
{
pBlock->pAssignments[0].LastRecomputedTime = 0; // Force a recreate of this block the next time ApplyRenderStateBlock is called
}
@@ -4607,9 +4603,9 @@ lExit:
template<typename IBaseInterface>
bool TRasterizerVariable<IBaseInterface>::IsValid()
{
- uint32_t numElements = this->IsArray()? this->pType->Elements : 1;
+ uint32_t numElements = IsArray()? pType->Elements : 1;
bool valid = true;
- while( numElements > 0 && ( valid = this->Data.pRasterizer[ numElements-1 ].IsValid ) )
+ while( numElements > 0 && ( valid = Data.pRasterizer[ numElements-1 ].IsValid ) )
numElements--;
return valid;
}
@@ -4637,8 +4633,8 @@ HRESULT TSamplerVariable<IBaseInterface>::GetSampler(uint32_t Index, ID3D11Sampl
CHECK_OBJECT_SCALAR_BOUNDS(Index, ppSampler);
- _Analysis_assume_( this->Data.pSampler[Index].pD3DObject != 0 );
- *ppSampler = this->Data.pSampler[Index].pD3DObject;
+ _Analysis_assume_( Data.pSampler[Index].pD3DObject != 0 );
+ *ppSampler = Data.pSampler[Index].pD3DObject;
SAFE_ADDREF(*ppSampler);
lExit:
@@ -4654,21 +4650,21 @@ HRESULT TSamplerVariable<IBaseInterface>::SetSampler(uint32_t Index, ID3D11Sampl
CHECK_SCALAR_BOUNDS(Index);
// Replace all references to the old shader block with this one
- this->GetEffect()->ReplaceSamplerReference(&this->Data.pSampler[Index], pSampler);
+ GetEffect()->ReplaceSamplerReference(&Data.pSampler[Index], pSampler);
- if( !this->Data.pSampler[Index].IsUserManaged )
+ if( !Data.pSampler[Index].IsUserManaged )
{
// Save original state object in case we UndoSet
- assert( this->pMemberData[Index].Type == MDT_SamplerState );
- VB( this->pMemberData[Index].Data.pD3DEffectsManagedSamplerState == nullptr );
- this->pMemberData[Index].Data.pD3DEffectsManagedSamplerState = this->Data.pSampler[Index].pD3DObject;
- this->Data.pSampler[Index].pD3DObject = nullptr;
- this->Data.pSampler[Index].IsUserManaged = true;
+ assert( pMemberData[Index].Type == MDT_SamplerState );
+ VB( pMemberData[Index].Data.pD3DEffectsManagedSamplerState == nullptr );
+ pMemberData[Index].Data.pD3DEffectsManagedSamplerState = Data.pSampler[Index].pD3DObject;
+ Data.pSampler[Index].pD3DObject = nullptr;
+ Data.pSampler[Index].IsUserManaged = true;
}
SAFE_ADDREF( pSampler );
- SAFE_RELEASE( this->Data.pSampler[Index].pD3DObject );
- this->Data.pSampler[Index].pD3DObject = pSampler;
+ SAFE_RELEASE( Data.pSampler[Index].pD3DObject );
+ Data.pSampler[Index].pD3DObject = pSampler;
lExit:
return hr;
}
@@ -4680,19 +4676,19 @@ HRESULT TSamplerVariable<IBaseInterface>::UndoSetSampler(_In_ uint32_t Index)
CHECK_SCALAR_BOUNDS(Index);
- if( !this->Data.pSampler[Index].IsUserManaged )
+ if( !Data.pSampler[Index].IsUserManaged )
{
return S_FALSE;
}
// Replace all references to the old shader block with this one
- this->GetEffect()->ReplaceSamplerReference(&this->Data.pSampler[Index], this->pMemberData[Index].Data.pD3DEffectsManagedSamplerState);
+ GetEffect()->ReplaceSamplerReference(&Data.pSampler[Index], pMemberData[Index].Data.pD3DEffectsManagedSamplerState);
// Revert to original state object
- SAFE_RELEASE( this->Data.pSampler[Index].pD3DObject );
- this->Data.pSampler[Index].pD3DObject = this->pMemberData[Index].Data.pD3DEffectsManagedSamplerState;
- this->pMemberData[Index].Data.pD3DEffectsManagedSamplerState = nullptr;
- this->Data.pSampler[Index].IsUserManaged = false;
+ SAFE_RELEASE( Data.pSampler[Index].pD3DObject );
+ Data.pSampler[Index].pD3DObject = pMemberData[Index].Data.pD3DEffectsManagedSamplerState;
+ pMemberData[Index].Data.pD3DEffectsManagedSamplerState = nullptr;
+ Data.pSampler[Index].IsUserManaged = false;
lExit:
return hr;
@@ -4706,11 +4702,11 @@ HRESULT TSamplerVariable<IBaseInterface>::GetBackingStore(uint32_t Index, D3D11_
CHECK_OBJECT_SCALAR_BOUNDS(Index, pDesc);
- if( this->Data.pSampler[Index].IsUserManaged )
+ if( Data.pSampler[Index].IsUserManaged )
{
- if( this->Data.pSampler[Index].pD3DObject )
+ if( Data.pSampler[Index].pD3DObject )
{
- this->Data.pSampler[Index].pD3DObject->GetDesc( pDesc );
+ Data.pSampler[Index].pD3DObject->GetDesc( pDesc );
}
else
{
@@ -4719,8 +4715,8 @@ HRESULT TSamplerVariable<IBaseInterface>::GetBackingStore(uint32_t Index, D3D11_
}
else
{
- SSamplerBlock *pBlock = this->Data.pSampler + Index;
- if (pBlock->ApplyAssignments(this->GetTopLevelEntity()->pEffect))
+ SSamplerBlock *pBlock = Data.pSampler + Index;
+ if (pBlock->ApplyAssignments(GetTopLevelEntity()->pEffect))
{
pBlock->pAssignments[0].LastRecomputedTime = 0; // Force a recreate of this block the next time ApplyRenderStateBlock is called
}
diff --git a/lib/win32/Effects11/HISTORY.md b/lib/win32/Effects11/HISTORY.md
new file mode 100644
index 0000000000..a637df49d0
--- /dev/null
+++ b/lib/win32/Effects11/HISTORY.md
@@ -0,0 +1,131 @@
+# Effects for Direct3D 11 (FX11)
+
+http://go.microsoft.com/fwlink/?LinkId=271568
+
+## Release History
+
+## August 17, 2022 (11.28)
+* CMake and MSBuild project updates
+
+## May 23, 2022 (11.27)
+* Add VS 2022 projects, retired VS 2017 projects
+* Update build switches for SDL recommendations
+* CMake project cleanup, added CMakePresets.json
+
+## December 2, 2021
+* Minor project cleanup
+
+## February 7, 2021
+* Added CMake project
+* Removed Windows Vista support
+* No code changes
+
+## June 1, 2020
+* Minor update to VS 2019 project
+* Retired VS 2015 projects
+* No code changes
+
+### April 26, 2019 (11.26)
+* Added VS 2019 desktop projects
+* VS 2017 updated for Windows 10 October 2018 Update SDK (17763)
+* Minor code cleanup
+
+### July 12, 2018 (11.25)
+* Added ``D3DX11DebugMute`` function
+* Minor project and code cleanup
+
+### May 31, 2018 (11.24)
+* VS 2017 updated for Windows 10 April 2018 Update SDK (17134)
+
+### May 11, 2018 (11.23)
+* Retired VS 2013 projects
+* Code cleanup
+
+### February 27, 2018 (11.22)
+* Minor code update
+
+### November 2, 2017 (11.21)
+* VS 2017 updated for Windows 10 Fall Creators Update SDK (16299)
+
+### October 13, 2017 (11.20)
+* Updated for VS 2017 update 15.1 - 15.3 and Windows 10 SDK (15063)
+
+### March 10, 2017 (11.19)
+* Add VS 2017 projects
+* Minor code cleanup
+
+### September 15, 2016 (11.18)
+* Minor code cleanup
+
+### August 2, 2016 (11.17)
+* Updated for VS 2015 Update 3 and Windows 10 SDK (14393)
+* Added 'D' suffix to debug libraries per request
+
+### April 26, 2016 (11.16)
+* Retired VS 2012 projects
+* Minor code and project file cleanup
+
+### November 30, 2015 (11.15)
+* Updated for VS 2015 Update 1 and Windows 10 SDK (10586)
+
+### July 29, 2015 (11.14)
+* Updated for VS 2015 and Windows 10 SDK RTM
+* Retired VS 2010 projects
+
+### June 17, 2015 (11.13)
+* Fix for Get/SetFloatVectorArray with an offset
+
+### April 14, 2015 (11.12)
+* More updates for VS 2015
+
+### November 24, 2014 (11.11)
+* Updates for Visual Studio 2015 Technical Preview
+
+### July 15, 2014 (11.10)
+* Minor code review fixes
+
+### January 24, 2014 (11.09)
+* VS 2010 projects now require Windows 8.1 SDK
+* Added pragma for needed libs to public header
+* Minor code cleanup
+
+### October 21, 2013 (11.08)
+* Updated for Visual Studio 2013 and Windows 8.1 SDK RTM
+
+### July 16, 2013 (11.07)
+* Added VS 2013 Preview project files
+* Cleaned up project files
+* Fixed a number of /analyze issues
+
+### June 13, 2013 (11.06)
+* Added ``GetMatrixPointerArray``, ``GetMatrixTransposePointerArray``, ``SetMatrixPointerArray``, ``SetMatrixTransposePointerArray`` methods
+* Reverted back to ``BOOL`` in some cases because sizeof(bool)==1, sizeof(BOOL)==4
+* Some code-cleanup: minor SAL fix, removed bad assert, and added use of override keyword
+
+### February 22, 2013 (11.05)
+* Cleaned up some warning level 4 warnings
+
+### November 6, 2012 (11.04)
+* Added ``IUnknown`` as a base class for all Effects 11 interfaces to simplify use in managed interop sceanrios, although the lifetime for these objects is still based on the lifetime of the parent ID3DX11Effect object. Therefore reference counting is ignored for these interfaces.
+ + ID3DX11EffectType, ID3DX11EffectVariable and derived classes, ID3DX11EffectPass, ID3DX11EffectTechnique, and ID3DX11EffectGroup
+
+### October 24, 2012 (11.03)
+* Removed the dependency on the D3DX11 headers, so FX11 no longer requires the legacy DirectX SDK to build.
+* It does require the d3dcompiler.h header from either the Windows 8.0 SDK or from the legacy DirectX SDK
+* Removed references to D3D10 constants and interfaces
+* Deleted the d3dx11dbg.cpp and d3dx11dbg.h files
+* Deleted the ``D3DX11_EFFECT_PASS`` flags which were never implemented
+* General C++ code cleanups (nullptr, C++ style casting, stdint.h types, Safer CRT, etc.) which are compatible with Visual C++ 2010 and 2012
+* SAL2 annotation and /analyze cleanup
+* Added population of Direct3D debug names for object naming support in PIX and the SDK debug layer
+* Added additional optional parameter to D3DX11CreateEffectFromMemory to provide a debug name
+* Added ``D3DX11CreateEffectFromFile``,``D3DX11CompileEffectFromMemory``, and ``D3DX11CompileEffectFromFile``
+
+### June 2010 (11.02)
+The DirectX SDK (June 2010) included an update with some minor additional bug fixes. This also included the Effects 11-based sample DynamicShaderLinkageFX11. This is the last version to support Visual Studio 2008. The source code is located in ``Samples\C++\Effects11``.
+
+### February 2010 (11.01)
+An update was shipped with the DirectX SDK (February 2010). This fixed a problem with the library which prevented it from working correctly on 9.x and 10.x feature levels. This is the last version to support Visual Studio 2005. The source code is located in ``Samples\C++\Effects11``.
+
+### August 2009 (11.00)
+The initial release of Effects 11 (FX11) was in the DirectX SDK (August 2009). The source code is located in ``Utilities\Source\Effects11``. This is essentially the Effects 10 (FX10) system ported to Direct3D 11.0 with support for effects pools removed and support for groups added.
diff --git a/lib/win32/Effects11/IUnknownImp.h b/lib/win32/Effects11/IUnknownImp.h
index a08b7b6de2..ed3be4111f 100644
--- a/lib/win32/Effects11/IUnknownImp.h
+++ b/lib/win32/Effects11/IUnknownImp.h
@@ -6,7 +6,7 @@
// Lifetime for most Effects objects is based on the the lifetime of the master
// effect, so the reference count is not used.
//
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//
// http://go.microsoft.com/fwlink/p/?LinkId=271568
diff --git a/lib/win32/Effects11/LICENSE b/lib/win32/Effects11/LICENSE
index 61784d451a..38e78017b8 100644
--- a/lib/win32/Effects11/LICENSE
+++ b/lib/win32/Effects11/LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2009-2019 Microsoft Corp
+Copyright (c) 2009-2022 Microsoft Corp
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
diff --git a/lib/win32/Effects11/README.md b/lib/win32/Effects11/README.md
new file mode 100644
index 0000000000..84e3621923
--- /dev/null
+++ b/lib/win32/Effects11/README.md
@@ -0,0 +1,66 @@
+![DirectX Logo](https://raw.githubusercontent.com/wiki/Microsoft/FX11/Dx_logo.GIF)
+
+# Effects for Direct3D 11 (FX11)
+
+http://go.microsoft.com/fwlink/?LinkId=271568
+
+Copyright (c) Microsoft Corporation. All rights reserved.
+
+**August 17, 2022**
+
+Effects for Direct3D 11 (FX11) is a management runtime for authoring HLSL shaders, render state, and runtime variables together.
+
+This code is designed to build with Visual Studio 2019 (16.11 or later) or Visual Studio 2022. Use of the Windows 10 May 2020 Update SDK ([19041](https://walbourn.github.io/windows-10-may-2020-update-sdk/)) or later is required.
+
+These components are designed to work without requiring any content from the legacy DirectX SDK. For details, see [Where is the DirectX SDK?](https://aka.ms/dxsdk).
+
+*This project is 'archived'. It is still available for use for legacy projects or when using older developer education materials, but use of it for new projects is not recommended.*
+
+## Disclaimer
+
+Effects 11 is being provided as a porting aid for older code that makes use of the Effects 10 (FX10) API or Effects 9 (FX9)
+API in the deprecated D3DX9 library. See [Microsoft Docs](https://docs.microsoft.com/en-us/windows/win32/direct3d11/d3d11-graphics-programming-guide-effects-differences) for a list of differences compared to the Effects 10 (FX10) library.
+
+The Effects 11 library is for use in Win32 desktop applications. FX11 requires the D3DCompiler API be available at runtime
+to provide shader reflection functionality, and this API is not deployable for Windows Store apps on Windows 8.0, Windows RT,
+or Windows phone 8.0.
+
+The fx_5_0 profile support in the HLSL compiler is deprecated, and does not fully support DirectX 11.1 HLSL features
+such as minimum precision types. It is supported in the Windows 8.1 SDK version of the HLSL compiler (FXC.EXE) and
+D3DCompile API (46), is supported but generates a deprecation warning with D3DCompile API (47). The fx profiles
+are not supported by the DXIL (DXC.EXE) compiler.
+
+## Documentation
+
+Documentation is available on the [GitHub wiki](https://github.com/Microsoft/FX11/wiki).
+
+## Notices
+
+All content and source code for this package are subject to the terms of the [MIT License](https://github.com/microsoft/FX11/blob/main/LICENSE).
+
+## Support
+
+For questions, consider using [Stack Overflow](https://stackoverflow.com/questions/tagged/d3dx) with the *d3dx* tag.
+
+## Contributing
+
+This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
+
+## Trademarks
+
+This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.
+
+## Credits
+
+The Effects library for Direct3D 9 (FX9) was the work of Loren McQuade with contributions from Relja Markovic.
+
+The Effects library for Direct3D 10 (FX10) was the work of John Rapp and Kutta Srinivasan as a rewrite of the FX9 library with contributions from Anuj Gosalia, Kev Gee, Sam Glassenberg, Relja Markovic, and Ian McIntyre.
+
+The Effects library for Direct3D 11 (FX11) is the work of Ian McIntyre based on FX10 with contributions from Michael Oneppo and Chuck Walbourn.
+
+## Samples
+
+* Direct3D Tutorial 11-14
+* BasicHLSLFX11, DynamicShaderLinkageFX11, FixedFuncEMUFX11, InstancingFX11
+
+These are hosted on [GitHub](https://github.com/walbourn/directx-sdk-samples)
diff --git a/lib/win32/Effects11/ReadMe.txt b/lib/win32/Effects11/ReadMe.txt
deleted file mode 100644
index 1b87e37888..0000000000
--- a/lib/win32/Effects11/ReadMe.txt
+++ /dev/null
@@ -1,178 +0,0 @@
-EFFECTS FOR DIRECT3D 11 (FX11)
-------------------------------
-
-Copyright (c) Microsoft Corporation. All rights reserved.
-
-April 26, 2019
-
-Effects for Direct3D 11 (FX11) is a management runtime for authoring HLSL shaders, render
-state, and runtime variables together.
-
-This code is designed to build with Visual Studio 2015 Update 3, Visual Studio 2017,
-or Visual Studio 2019. It is recommended that you make use of VS 2015 Update 3,
-Windows Tools 1.4.1, and the Windows 10 Anniversary Update SDK (14393) -or-
-VS 2017 (15.9 update) / VS 2019 with the Windows 10 October 2018 Update SDK (17763).
-
-These components are designed to work without requiring any content from the
-legacy DirectX SDK. For details, see "Where is the DirectX SDK?"
-<https://aka.ms/dxsdk>.
-
-All content and source code for this package are subject to the terms of the MIT License.
-<http://opensource.org/licenses/MIT>.
-
-For the latest version of FX11, more detailed documentation, etc., please visit the project site.
-
-http://go.microsoft.com/fwlink/p/?LinkId=271568
-
-This project has adopted the Microsoft Open Source Code of Conduct. For more information see the
-Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
-
-https://opensource.microsoft.com/codeofconduct/
-
-
--------
-SAMPLES
--------
-
-Direct3D Tutorial 11-14
-BasicHLSLFX11, DynamicShaderLinkageFX11, FixedFuncEMUFX11, InstancingFX11
-
-These samples are hosted on GitHub <https://github.com/walbourn/directx-sdk-samples>
-
-
-----------
-DISCLAIMER
-----------
-
-Effects 11 is being provided as a porting aid for older code that makes use of the Effects 10 (FX10) API or Effects 9 (FX9)
-API in the deprecated D3DX9 library. See MSDN for a list of differences compared to the Effects 10 (FX10) library.
-
-https://msdn.microsoft.com/en-us/library/windows/desktop/ff476141.aspx
-
-The Effects 11 library is for use in Win32 desktop applications. FX11 requires the D3DCompiler API be available at runtime
-to provide shader reflection functionality, and this API is not deployable for Windows Store apps on Windows 8.0, Windows RT,
-or Windows phone 8.0.
-
-The fx_5_0 profile support in the HLSL compiler is deprecated, and does not fully support DirectX 11.1 HLSL features
-such as minimum precision types. It is supported in the Windows 8.1 SDK version of the HLSL compiler (FXC.EXE) and
-D3DCompile API (#46), is supported but generates a deprecation warning with D3DCompile API (#47), and could be removed
-in a future update.
-
-
----------------
-RELEASE HISTORY
----------------
-
-April 26, 2019 (11.26)
- Added VS 2019 desktop projects
- VS 2017 updated for Windows 10 October 2018 Update SDK (17763)
- Minor code cleanup
-
-July 12, 2018 (11.25)
- Added D3DX11DebugMute function
- Minor project and code cleanup
-
-May 31, 2018 (11.24)
- VS 2017 updated for Windows 10 April 2018 Update SDK (17134)
-
-May 11, 2018 (11.23)
- Retired VS 2013 projects
- Code cleanup
-
-February 27, 2018 (11.22)
- Minor code update
-
-November 2, 2017 (11.21)
- VS 2017 updated for Windows 10 Fall Creators Update SDK (16299)
-
-October 13, 2017 (11.20)
- Updated for VS 2017 update 15.1 - 15.3 and Windows 10 SDK (15063)
-
-March 10, 2017 (11.19)
- Add VS 2017 projects
- Minor code cleanup
-
-September 15, 2016 (11.18)
- Minor code cleanup
-
-August 2, 2016 (11.17)
- Updated for VS 2015 Update 3 and Windows 10 SDK (14393)
- Added 'D' suffix to debug libraries per request
-
-April 26, 2016 (11.16)
- Retired VS 2012 projects
- Minor code and project file cleanup
-
-November 30, 2015 (11.15)
- Updated for VS 2015 Update 1 and Windows 10 SDK (10586)
-
-July 29, 2015 (11.14)
- Updated for VS 2015 and Windows 10 SDK RTM
- Retired VS 2010 projects
-
-June 17, 2015 (11.13)
- Fix for Get/SetFloatVectorArray with an offset
-
-April 14, 2015 (11.12)
- More updates for VS 2015
-
-November 24, 2014 (11.11)
- Updates for Visual Studio 2015 Technical Preview
-
-July 15, 2014 (11.10)
- Minor code review fixes
-
-January 24, 2014 (11.09)
- VS 2010 projects now require Windows 8.1 SDK
- Added pragma for needed libs to public header
- Minor code cleanup
-
-October 21, 2013 (11.08)
- Updated for Visual Studio 2013 and Windows 8.1 SDK RTM
-
-July 16, 2013 (11.07)
- Added VS 2013 Preview project files
- Cleaned up project files
- Fixed a number of /analyze issues
-
-June 13, 2013 (11.06)
- Added GetMatrixPointerArray, GetMatrixTransposePointerArray, SetMatrixPointerArray, SetMatrixTransposePointerArray methods
- Reverted back to BOOL in some cases because sizeof(bool)==1, sizeof(BOOL)==4
- Some code-cleanup: minor SAL fix, removed bad assert, and added use of override keyword
-
-February 22, 2013 (11.05)
- Cleaned up some warning level 4 warnings
-
-November 6, 2012 (11.04)
- Added IUnknown as a base class for all Effects 11 interfaces to simplify use in managed interop sceanrios, although the
- lifetime for these objects is still based on the lifetime of the parent ID3DX11Effect object. Therefore reference counting
- is ignored for these interfaces.
- ID3DX11EffectType, ID3DX11EffectVariable and derived classes, ID3DX11EffectPass,
- ID3DX11EffectTechnique, and ID3DX11EffectGroup
-
-October 24, 2012 (11.03)
- Removed the dependency on the D3DX11 headers, so FX11 no longer requires the legacy DirectX SDK to build.
- It does require the d3dcompiler.h header from either the Windows 8.0 SDK or from the legacy DirectX SDK
- Removed references to D3D10 constants and interfaces
- Deleted the d3dx11dbg.cpp and d3dx11dbg.h files
- Deleted the D3DX11_EFFECT_PASS flags which were never implemented
- General C++ code cleanups (nullptr, C++ style casting, stdint.h types, Safer CRT, etc.) which are compatible with Visual C++ 2010 and 2012
- SAL2 annotation and /analyze cleanup
- Added population of Direct3D debug names for object naming support in PIX and the SDK debug layer
- Added additional optional parameter to D3DX11CreateEffectFromMemory to provide a debug name
- Added D3DX11CreateEffectFromFile, D3DX11CompileEffectFromMemory, and D3DX11CompileEffectFromFile
-
-June 2010 (11.02)
- The DirectX SDK (June 2010) included an update with some minor additional bug fixes. This also included the Effects 11-based
- sample DynamicShaderLinkageFX11. This is the last version to support Visual Studio 2008. The source code is located in
- Samples\C++\Effects11.
-
-February 2010 (11.01)
- An update was shipped with the DirectX SDK (February 2010). This fixed a problem with the library which prevented it from
- working correctly on 9.x and 10.x feature levels. This is the last version to support Visual Studio 2005. The source code
- is located in Samples\C++\Effects11.
-
-August 2009 (11.00)
- The initial release of Effects 11 (FX11) was in the DirectX SDK (August 2009). The source code is located in
- Utilities\Source\Effects11. This is essentially the Effects 10 (FX10) system ported to Direct3D 11.0 with
- support for effects pools removed and support for groups added.
diff --git a/lib/win32/Effects11/SECURITY.md b/lib/win32/Effects11/SECURITY.md
new file mode 100644
index 0000000000..869fdfe2b2
--- /dev/null
+++ b/lib/win32/Effects11/SECURITY.md
@@ -0,0 +1,41 @@
+<!-- BEGIN MICROSOFT SECURITY.MD V0.0.7 BLOCK -->
+
+## Security
+
+Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
+
+If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.
+
+## Reporting Security Issues
+
+**Please do not report security vulnerabilities through public GitHub issues.**
+
+Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).
+
+If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).
+
+You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
+
+Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
+
+ * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
+ * Full paths of source file(s) related to the manifestation of the issue
+ * The location of the affected source code (tag/branch/commit or direct URL)
+ * Any special configuration required to reproduce the issue
+ * Step-by-step instructions to reproduce the issue
+ * Proof-of-concept or exploit code (if possible)
+ * Impact of the issue, including how an attacker might exploit the issue
+
+This information will help us triage your report more quickly.
+
+If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.
+
+## Preferred Languages
+
+We prefer all communications to be in English.
+
+## Policy
+
+Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).
+
+<!-- END MICROSOFT SECURITY.MD BLOCK -->
diff --git a/lib/win32/Effects11/d3dxGlobal.cpp b/lib/win32/Effects11/d3dxGlobal.cpp
index 3cca34fdc8..6e22e48b3a 100644
--- a/lib/win32/Effects11/d3dxGlobal.cpp
+++ b/lib/win32/Effects11/d3dxGlobal.cpp
@@ -3,7 +3,7 @@
//
// Direct3D 11 Effects implementation for helper data structures
//
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//
// http://go.microsoft.com/fwlink/p/?LinkId=271568
@@ -261,7 +261,7 @@ CDataBlockStore::CDataBlockStore() noexcept :
m_Offset(0),
m_IsAligned(false)
{
-#if _DEBUG
+#ifdef _DEBUG
m_cAllocations = 0;
#endif
}
@@ -332,7 +332,7 @@ void* CDataBlockStore::Allocate(_In_ uint32_t bufferSize)
{
void *pRetValue = nullptr;
-#if _DEBUG
+#ifdef _DEBUG
m_cAllocations++;
#endif
diff --git a/lib/win32/Effects11/inc/d3dx11effect.h b/lib/win32/Effects11/inc/d3dx11effect.h
index d2663aca99..04a17da1ff 100644
--- a/lib/win32/Effects11/inc/d3dx11effect.h
+++ b/lib/win32/Effects11/inc/d3dx11effect.h
@@ -3,7 +3,7 @@
//
// Direct3D 11 Effect Types & APIs Header
//
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//
// http://go.microsoft.com/fwlink/p/?LinkId=271568
@@ -11,7 +11,7 @@
#pragma once
-#define D3DX11_EFFECTS_VERSION 1126
+#define D3DX11_EFFECTS_VERSION 1128
#if defined(_XBOX_ONE) && defined(_TITLE)
#include <d3d11_x.h>
diff --git a/lib/win32/Effects11/inc/d3dxGlobal.h b/lib/win32/Effects11/inc/d3dxGlobal.h
index 5ab587ffc6..2018c1951b 100644
--- a/lib/win32/Effects11/inc/d3dxGlobal.h
+++ b/lib/win32/Effects11/inc/d3dxGlobal.h
@@ -3,7 +3,7 @@
//
// Direct3D 11 Effects helper defines and data structures
//
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//
// http://go.microsoft.com/fwlink/p/?LinkId=271568
@@ -71,13 +71,6 @@ using namespace D3DX11Debug;
#define D3DX11FLTASSIGN(a,b) { *reinterpret_cast< UINT32* >(&(a)) = *reinterpret_cast< UINT32* >(&(b)); }
-#ifdef _DEBUG
-extern void __cdecl D3DXDebugPrintf(UINT lvl, _In_z_ _Printf_format_string_ LPCSTR szFormat, ...);
-#define DPF D3DXDebugPrintf
-#else
-#define DPF
-#endif
-
// Preferred data alignment -- must be a power of 2!
static const uint32_t c_DataAlignment = sizeof(UINT_PTR);
@@ -204,14 +197,14 @@ public:
HRESULT m_hLastError;
CEffectVector<T>() noexcept :
- m_hLastError(S_OK),
+#if _DEBUG
+ m_pCastData(nullptr),
+#endif
m_pData(nullptr),
m_CurSize(0),
- m_MaxSize(0)
+ m_MaxSize(0),
+ m_hLastError(S_OK)
{
-#if _DEBUG
- m_pCastData = nullptr;
-#endif // _DEBUG
}
~CEffectVector<T>()
@@ -433,45 +426,44 @@ lExit:
//////////////////////////////////////////////////////////////////////////
// CEffectVectorOwner - implements a vector of ptrs to objects. The vector owns the objects.
//////////////////////////////////////////////////////////////////////////
-template<class T>
-class CEffectVectorOwner : public CEffectVector<typename T*>
+template<class T> class CEffectVectorOwner : public CEffectVector<T*>
{
public:
~CEffectVectorOwner<T>()
{
Clear();
- for (size_t i = 0; i < this->m_CurSize; i++)
- SAFE_DELETE(((T**)this->m_pData)[i]);
+ for (size_t i=0; i<m_CurSize; i++)
+ SAFE_DELETE(((T**)m_pData)[i]);
- SAFE_DELETE_ARRAY(this->m_pData);
+ SAFE_DELETE_ARRAY(m_pData);
}
void Clear()
{
Empty();
- SAFE_DELETE_ARRAY(this->m_pData);
- this->m_MaxSize = 0;
+ SAFE_DELETE_ARRAY(m_pData);
+ m_MaxSize = 0;
}
void Empty()
{
// manually invoke destructor on all elements
- for (size_t i = 0; i < this->m_CurSize; ++i)
+ for (size_t i = 0; i < m_CurSize; ++ i)
{
- SAFE_DELETE(((T**)this->m_pData)[i]);
+ SAFE_DELETE(((T**)m_pData)[i]);
}
- this->m_CurSize = 0;
- this->m_hLastError = S_OK;
+ m_CurSize = 0;
+ m_hLastError = S_OK;
}
void Delete(_In_ uint32_t index)
{
- assert(index < this->m_CurSize);
+ assert(index < m_CurSize);
- SAFE_DELETE(((T**)this->m_pData)[index]);
+ SAFE_DELETE(((T**)m_pData)[index]);
- CEffectVector<T*>::Delete(index);
+ CEffectVector<T*>::Delete(index);
}
};
@@ -1255,9 +1247,9 @@ public:
void Cleanup()
{
- this->CleanArray();
- this->m_NumHashSlots = 0;
- this->m_NumEntries = 0;
+ CleanArray();
+ m_NumHashSlots = 0;
+ m_NumEntries = 0;
}
~CEffectHashTableWithPrivateHeap()
@@ -1279,21 +1271,18 @@ public:
assert(m_pPrivateHeap);
_Analysis_assume_(m_pPrivateHeap);
- assert(this->m_NumHashSlots > 0);
-
- using HashEntry = typename CEffectHashTable<T, pfnIsEqual>::SHashEntry;
-
- HashEntry* pHashEntry;
- uint32_t index = Hash % this->m_NumHashSlots;
+ assert(m_NumHashSlots > 0);
+ SHashEntry *pHashEntry;
+ uint32_t index = Hash % m_NumHashSlots;
- VN(pHashEntry = new (*this->m_pPrivateHeap) HashEntry);
- pHashEntry->pNext = this->m_rgpHashEntries[index];
+ VN( pHashEntry = new(*m_pPrivateHeap) SHashEntry );
+ pHashEntry->pNext = m_rgpHashEntries[index];
pHashEntry->Data = Data;
pHashEntry->Hash = Hash;
- this->m_rgpHashEntries[index] = pHashEntry;
+ m_rgpHashEntries[index] = pHashEntry;
- ++this->m_NumEntries;
+ ++ m_NumEntries;
lExit:
return hr;
diff --git a/lib/win32/Effects11/pchfx.h b/lib/win32/Effects11/pchfx.h
index 1991014b73..9436a1a93f 100644
--- a/lib/win32/Effects11/pchfx.h
+++ b/lib/win32/Effects11/pchfx.h
@@ -3,7 +3,7 @@
//
// Direct3D 11 shader effects precompiled header
//
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//
// http://go.microsoft.com/fwlink/p/?LinkId=271568
@@ -24,11 +24,8 @@
#include <D3DCompiler_x.h>
#define DCOMMON_H_INCLUDED
#define NO_D3D11_DEBUG_NAME
-#elif (_WIN32_WINNT >= 0x0602) || defined(_WIN7_PLATFORM_UPDATE)
-#include <d3d11_1.h>
-#include <D3DCompiler.h>
#else
-#include <d3d11.h>
+#include <d3d11_1.h>
#include <D3DCompiler.h>
#endif
@@ -49,8 +46,8 @@
#include "d3dxGlobal.h"
-#include <stddef.h>
-#include <stdlib.h>
+#include <cstddef>
+#include <cstdlib>
#include "Effect.h"
#include "EffectStateBase11.h"