Removed never-set union field : X_D3DVertexShader.CxbxVertexShaderHandle to avoid using garbage data.
This commit is contained in:
parent
456906b6b4
commit
0c470044fb
|
@ -3151,7 +3151,9 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SelectVertexShader)
|
|||
|
||||
if(pXboxVertexShader != nullptr)
|
||||
{
|
||||
pCxbxVertexShader = (CxbxVertexShader *)(pXboxVertexShader->CxbxVertexShaderHandle);
|
||||
LOG_TEST_CASE("Assigned g_VertexShaderSlots");
|
||||
// Was : pCxbxVertexShader = (CxbxVertexShader *)(pXboxVertexShader->CxbxVertexShaderHandle);
|
||||
// However, the CxbxVertexShaderHandle union is never set, so could lead to using undefined data!
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1060,11 +1060,8 @@ struct X_D3DVertexShader
|
|||
DWORD TotalSize; // seems to include both the function and ?constants?
|
||||
DWORD NumberOfDimensionsPerTexture; // Guesswork, since all 4 bytes (for all 4 textures) are most often set to 0 (or 2 when a texture isn't used) and 1, 3 and 4 also occur (and nothing else)
|
||||
X_VERTEXATTRIBUTEFORMAT VertexAttribute;
|
||||
union {
|
||||
DWORD CxbxVertexShaderHandle; // This is probably the least damaging part to overwrite : We put a pointer to our CbxVertexShader here
|
||||
DWORD FunctionData[X_VSH_MAX_INSTRUCTION_COUNT]; // probably the binary function data and ?constants? (data continues futher outside this struct, up to TotalSize DWORD's)
|
||||
};
|
||||
};
|
||||
|
||||
// vertex shader input registers for fixed function vertex shader
|
||||
|
||||
|
|
Loading…
Reference in New Issue