Remove unneeded HostDeclarationSize

This commit is contained in:
PatrickvL 2019-12-19 18:16:36 +01:00
parent 270462d22c
commit 56af31aede
3 changed files with 1 additions and 7 deletions

View File

@ -4122,14 +4122,12 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_CreateVertexShader)
// Now, we can create the host vertex shader // Now, we can create the host vertex shader
DWORD XboxDeclarationCount = 0; DWORD XboxDeclarationCount = 0;
DWORD HostDeclarationSize = 0;
CxbxVertexShader* pCxbxVertexShader = (CxbxVertexShader*)calloc(1, sizeof(CxbxVertexShader)); CxbxVertexShader* pCxbxVertexShader = (CxbxVertexShader*)calloc(1, sizeof(CxbxVertexShader));
D3DVERTEXELEMENT *pRecompiledDeclaration = nullptr; D3DVERTEXELEMENT *pRecompiledDeclaration = nullptr;
pRecompiledDeclaration = EmuRecompileVshDeclaration((DWORD*)pDeclaration, pRecompiledDeclaration = EmuRecompileVshDeclaration((DWORD*)pDeclaration,
/*bIsFixedFunction=*/pFunction == xbnullptr, /*bIsFixedFunction=*/pFunction == xbnullptr,
&XboxDeclarationCount, &XboxDeclarationCount,
&HostDeclarationSize,
&pCxbxVertexShader->VertexShaderInfo); &pCxbxVertexShader->VertexShaderInfo);
// Create the vertex declaration // Create the vertex declaration

View File

@ -620,7 +620,6 @@ protected:
public: public:
// Output // Output
DWORD XboxDeclarationCount; DWORD XboxDeclarationCount;
DWORD HostDeclarationSize;
private: private:
#define D3DDECLUSAGE_UNSUPPORTED ((D3DDECLUSAGE)-1) #define D3DDECLUSAGE_UNSUPPORTED ((D3DDECLUSAGE)-1)
@ -1425,7 +1424,7 @@ public:
// Calculate size of declaration // Calculate size of declaration
XboxDeclarationCount = VshGetDeclarationCount(pXboxVertexDeclarationCopy); XboxDeclarationCount = VshGetDeclarationCount(pXboxVertexDeclarationCopy);
// For Direct3D9, we need to reserve at least twice the number of elements, as one token can generate two registers (in and out) : // For Direct3D9, we need to reserve at least twice the number of elements, as one token can generate two registers (in and out) :
HostDeclarationSize = XboxDeclarationCount * sizeof(D3DVERTEXELEMENT) * 2; unsigned HostDeclarationSize = XboxDeclarationCount * sizeof(D3DVERTEXELEMENT) * 2;
D3DVERTEXELEMENT *Result = (D3DVERTEXELEMENT *)calloc(1, HostDeclarationSize); D3DVERTEXELEMENT *Result = (D3DVERTEXELEMENT *)calloc(1, HostDeclarationSize);
pRecompiled = Result; pRecompiled = Result;
@ -1470,7 +1469,6 @@ D3DVERTEXELEMENT *EmuRecompileVshDeclaration
DWORD *pXboxDeclaration, DWORD *pXboxDeclaration,
bool bIsFixedFunction, bool bIsFixedFunction,
DWORD *pXboxDeclarationCount, DWORD *pXboxDeclarationCount,
DWORD *pHostDeclarationSize,
CxbxVertexShaderInfo *pCxbxVertexShaderInfo CxbxVertexShaderInfo *pCxbxVertexShaderInfo
) )
{ {
@ -1479,7 +1477,6 @@ D3DVERTEXELEMENT *EmuRecompileVshDeclaration
D3DVERTEXELEMENT* pHostVertexElements = Converter.Convert(pXboxDeclaration, bIsFixedFunction, pCxbxVertexShaderInfo); D3DVERTEXELEMENT* pHostVertexElements = Converter.Convert(pXboxDeclaration, bIsFixedFunction, pCxbxVertexShaderInfo);
*pXboxDeclarationCount = Converter.XboxDeclarationCount; *pXboxDeclarationCount = Converter.XboxDeclarationCount;
*pHostDeclarationSize = Converter.HostDeclarationSize;
return pHostVertexElements; return pHostVertexElements;
} }

View File

@ -102,7 +102,6 @@ extern D3DVERTEXELEMENT *EmuRecompileVshDeclaration
DWORD *pXboxDeclaration, DWORD *pXboxDeclaration,
bool bIsFixedFunction, bool bIsFixedFunction,
DWORD *pXboxDeclarationCount, DWORD *pXboxDeclarationCount,
DWORD *pHostDeclarationSize,
CxbxVertexShaderInfo *pCxbxVertexShaderInfo CxbxVertexShaderInfo *pCxbxVertexShaderInfo
); );