Moved XbPushBuffer.h, XbVertexBuffer.h and XbVertexShader.h outside the XTL namespace.
Moved Cxbx-specific types from XbD3DTypes.h towards appropriate above header files. Fixed up all XTL-hell that resulted from this.
This commit is contained in:
parent
b01a6c97cf
commit
32e155e1ba
|
@ -43,6 +43,9 @@ namespace xboxkrnl
|
|||
#include "EmuShared.h"
|
||||
#include "gui\DbgConsole.h"
|
||||
#include "core\hle\D3D8\ResourceTracker.h"
|
||||
#include "core\hle\D3D8\XbVertexBuffer.h"
|
||||
#include "core\hle\D3D8\XbVertexShader.h"
|
||||
#include "core\hle\D3D8\XbPushBuffer.h"
|
||||
#include "core\kernel\memory-manager\VMManager.h" // for g_VMManager
|
||||
#include "core\kernel\support\EmuXTL.h"
|
||||
#include "Logging.h"
|
||||
|
@ -148,7 +151,7 @@ static DWORD g_VBLastSwap = 0;
|
|||
static XTL::D3DSWAPDATA g_SwapData = {0};
|
||||
static DWORD g_SwapLast = 0;
|
||||
|
||||
static XTL::CxbxVertexBufferConverter VertexBufferConverter = {};
|
||||
static CxbxVertexBufferConverter VertexBufferConverter = {};
|
||||
|
||||
// cached Direct3D state variable(s)
|
||||
static XTL::IDirect3DIndexBuffer *pClosingLineLoopIndexBuffer = nullptr;
|
||||
|
@ -156,7 +159,7 @@ static XTL::IDirect3DIndexBuffer *pClosingLineLoopIndexBuffer = nullptr;
|
|||
static XTL::IDirect3DIndexBuffer *pQuadToTriangleD3DIndexBuffer = nullptr;
|
||||
static UINT QuadToTriangleD3DIndexBuffer_Size = 0; // = NrOfQuadVertices
|
||||
|
||||
static XTL::INDEX16 *pQuadToTriangleIndexBuffer = nullptr;
|
||||
static INDEX16 *pQuadToTriangleIndexBuffer = nullptr;
|
||||
static UINT QuadToTriangleIndexBuffer_Size = 0; // = NrOfQuadVertices
|
||||
|
||||
static XTL::IDirect3DSurface *g_DefaultHostDepthBufferSuface = NULL;
|
||||
|
@ -2525,7 +2528,7 @@ void CxbxUpdateActiveIndexBuffer
|
|||
}
|
||||
|
||||
EmuLog(LOG_LEVEL::DEBUG, "CxbxUpdateActiveIndexBuffer: Copying %d indices (D3DFMT_INDEX16)", IndexCount);
|
||||
memcpy(pData, pIndexData, IndexCount * sizeof(XTL::INDEX16));
|
||||
memcpy(pData, pIndexData, IndexCount * sizeof(INDEX16));
|
||||
|
||||
indexBuffer.pHostIndexBuffer->Unlock();
|
||||
}
|
||||
|
@ -3725,7 +3728,7 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_CreateVertexShader)
|
|||
CxbxVertexShader* pCxbxVertexShader = (CxbxVertexShader*)calloc(1, sizeof(CxbxVertexShader));
|
||||
D3DVERTEXELEMENT *pRecompiledDeclaration = nullptr;
|
||||
|
||||
pRecompiledDeclaration = XTL::EmuRecompileVshDeclaration((DWORD*)pDeclaration,
|
||||
pRecompiledDeclaration = EmuRecompileVshDeclaration((DWORD*)pDeclaration,
|
||||
/*bIsFixedFunction=*/pFunction == NULL,
|
||||
&XboxDeclarationCount,
|
||||
&HostDeclarationSize,
|
||||
|
@ -3749,7 +3752,7 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_CreateVertexShader)
|
|||
{
|
||||
bool bUseDeclarationOnly = false;
|
||||
|
||||
hRet = XTL::EmuRecompileVshFunction((DWORD*)pFunction,
|
||||
hRet = EmuRecompileVshFunction((DWORD*)pFunction,
|
||||
/*bNoReservedConstants=*/g_VertexShaderConstantMode == X_D3DSCM_NORESERVEDCONSTANTS,
|
||||
pRecompiledDeclaration,
|
||||
&bUseDeclarationOnly,
|
||||
|
@ -7354,11 +7357,11 @@ constexpr UINT QuadToTriangleVertexCount(UINT NrOfQuadVertices)
|
|||
|
||||
// TODO : Move to own file
|
||||
bool WindingClockwise = true;
|
||||
constexpr unsigned int IndicesPerPage = PAGE_SIZE / sizeof(XTL::INDEX16);
|
||||
constexpr unsigned int IndicesPerPage = PAGE_SIZE / sizeof(INDEX16);
|
||||
constexpr unsigned int InputQuadsPerPage = ((IndicesPerPage * VERTICES_PER_QUAD) / VERTICES_PER_TRIANGLE) / TRIANGLES_PER_QUAD;
|
||||
|
||||
// TODO : Move to own file
|
||||
XTL::INDEX16 *CxbxAssureQuadListIndexBuffer(UINT NrOfQuadVertices)
|
||||
INDEX16 *CxbxAssureQuadListIndexBuffer(UINT NrOfQuadVertices)
|
||||
{
|
||||
if (QuadToTriangleIndexBuffer_Size < NrOfQuadVertices)
|
||||
{
|
||||
|
@ -7369,10 +7372,10 @@ XTL::INDEX16 *CxbxAssureQuadListIndexBuffer(UINT NrOfQuadVertices)
|
|||
if (pQuadToTriangleIndexBuffer != nullptr)
|
||||
free(pQuadToTriangleIndexBuffer);
|
||||
|
||||
pQuadToTriangleIndexBuffer = (XTL::INDEX16 *)malloc(sizeof(XTL::INDEX16) * NrOfTriangleVertices);
|
||||
pQuadToTriangleIndexBuffer = (INDEX16 *)malloc(sizeof(INDEX16) * NrOfTriangleVertices);
|
||||
|
||||
UINT i = 0;
|
||||
XTL::INDEX16 j = 0;
|
||||
INDEX16 j = 0;
|
||||
while (i + 6 < NrOfTriangleVertices)
|
||||
{
|
||||
if (WindingClockwise) {
|
||||
|
@ -7423,7 +7426,7 @@ void CxbxAssureQuadListD3DIndexBuffer(UINT NrOfQuadVertices)
|
|||
// Round the number of indices up so we'll allocate whole pages
|
||||
QuadToTriangleD3DIndexBuffer_Size = RoundUp(NrOfQuadVertices, InputQuadsPerPage);
|
||||
UINT NrOfTriangleVertices = QuadToTriangleVertexCount(QuadToTriangleD3DIndexBuffer_Size); // 4 > 6
|
||||
UINT uiIndexBufferSize = sizeof(XTL::INDEX16) * NrOfTriangleVertices;
|
||||
UINT uiIndexBufferSize = sizeof(INDEX16) * NrOfTriangleVertices;
|
||||
|
||||
// Create a new native index buffer of the above determined size :
|
||||
if (pQuadToTriangleD3DIndexBuffer != nullptr) {
|
||||
|
@ -7445,7 +7448,7 @@ void CxbxAssureQuadListD3DIndexBuffer(UINT NrOfQuadVertices)
|
|||
CxbxKrnlCleanup("CxbxAssureQuadListD3DIndexBuffer : IndexBuffer Create Failed!");
|
||||
|
||||
// Put quadlist-to-triangle-list index mappings into this buffer :
|
||||
XTL::INDEX16* pIndexBufferData = nullptr;
|
||||
INDEX16* pIndexBufferData = nullptr;
|
||||
hRet = pQuadToTriangleD3DIndexBuffer->Lock(0, uiIndexBufferSize, (D3DLockData **)&pIndexBufferData, D3DLOCK_DISCARD);
|
||||
DEBUG_D3DRESULT(hRet, "pQuadToTriangleD3DIndexBuffer->Lock");
|
||||
|
||||
|
@ -7467,13 +7470,13 @@ void CxbxAssureQuadListD3DIndexBuffer(UINT NrOfQuadVertices)
|
|||
|
||||
// TODO : Move to own file
|
||||
// Calls SetIndices with a separate index-buffer, that's populated with the supplied indices.
|
||||
void CxbxDrawIndexedClosingLine(XTL::INDEX16 LowIndex, XTL::INDEX16 HighIndex)
|
||||
void CxbxDrawIndexedClosingLine(INDEX16 LowIndex, INDEX16 HighIndex)
|
||||
{
|
||||
LOG_INIT // Allows use of DEBUG_D3DRESULT
|
||||
|
||||
HRESULT hRet;
|
||||
|
||||
const UINT uiIndexBufferSize = sizeof(XTL::INDEX16) * 2; // 4 bytes needed for 2 indices
|
||||
const UINT uiIndexBufferSize = sizeof(INDEX16) * 2; // 4 bytes needed for 2 indices
|
||||
if (pClosingLineLoopIndexBuffer == nullptr) {
|
||||
hRet = g_pD3DDevice->CreateIndexBuffer(
|
||||
uiIndexBufferSize,
|
||||
|
@ -7487,7 +7490,7 @@ void CxbxDrawIndexedClosingLine(XTL::INDEX16 LowIndex, XTL::INDEX16 HighIndex)
|
|||
CxbxKrnlCleanup("Unable to create pClosingLineLoopIndexBuffer for D3DPT_LINELOOP emulation");
|
||||
}
|
||||
|
||||
XTL::INDEX16 *pCxbxClosingLineLoopIndexBufferData = nullptr;
|
||||
INDEX16 *pCxbxClosingLineLoopIndexBufferData = nullptr;
|
||||
hRet = pClosingLineLoopIndexBuffer->Lock(0, uiIndexBufferSize, (D3DLockData **)(&pCxbxClosingLineLoopIndexBufferData), D3DLOCK_DISCARD);
|
||||
DEBUG_D3DRESULT(hRet, "pClosingLineLoopIndexBuffer->Lock");
|
||||
|
||||
|
@ -7514,11 +7517,11 @@ void CxbxDrawIndexedClosingLine(XTL::INDEX16 LowIndex, XTL::INDEX16 HighIndex)
|
|||
}
|
||||
|
||||
// TODO : Move to own file
|
||||
void CxbxDrawIndexedClosingLineUP(XTL::INDEX16 LowIndex, XTL::INDEX16 HighIndex, void *pHostVertexStreamZeroData, UINT uiHostVertexStreamZeroStride)
|
||||
void CxbxDrawIndexedClosingLineUP(INDEX16 LowIndex, INDEX16 HighIndex, void *pHostVertexStreamZeroData, UINT uiHostVertexStreamZeroStride)
|
||||
{
|
||||
LOG_INIT // Allows use of DEBUG_D3DRESULT
|
||||
|
||||
XTL::INDEX16 CxbxClosingLineIndices[2] = { LowIndex, HighIndex };
|
||||
INDEX16 CxbxClosingLineIndices[2] = { LowIndex, HighIndex };
|
||||
|
||||
HRESULT hRet = g_pD3DDevice->DrawIndexedPrimitiveUP(
|
||||
XTL::D3DPT_LINELIST,
|
||||
|
@ -7537,7 +7540,7 @@ void CxbxDrawIndexedClosingLineUP(XTL::INDEX16 LowIndex, XTL::INDEX16 HighIndex,
|
|||
|
||||
// Requires assigned pIndexData
|
||||
// Called by D3DDevice_DrawIndexedVertices and EmuExecutePushBufferRaw (twice)
|
||||
void XTL::CxbxDrawIndexed(CxbxDrawContext &DrawContext)
|
||||
void CxbxDrawIndexed(CxbxDrawContext &DrawContext)
|
||||
{
|
||||
LOG_INIT // Allows use of DEBUG_D3DRESULT
|
||||
|
||||
|
@ -7548,7 +7551,7 @@ void XTL::CxbxDrawIndexed(CxbxDrawContext &DrawContext)
|
|||
CxbxUpdateActiveIndexBuffer(DrawContext.pIndexData, DrawContext.dwVertexCount);
|
||||
VertexBufferConverter.Apply(&DrawContext);
|
||||
|
||||
if (DrawContext.XboxPrimitiveType == X_D3DPT_QUADLIST) {
|
||||
if (DrawContext.XboxPrimitiveType == XTL::X_D3DPT_QUADLIST) {
|
||||
UINT uiStartIndex = 0;
|
||||
int iNumVertices = (int)DrawContext.dwVertexCount;
|
||||
// Indexed quadlist can be drawn using unpatched indexes via multiple draws of 2 'strip' triangles :
|
||||
|
@ -7564,7 +7567,7 @@ void XTL::CxbxDrawIndexed(CxbxDrawContext &DrawContext)
|
|||
|
||||
// Emulate a quad by drawing each as a fan of 2 triangles
|
||||
HRESULT hRet = g_pD3DDevice->DrawIndexedPrimitive(
|
||||
D3DPT_TRIANGLEFAN,
|
||||
XTL::D3DPT_TRIANGLEFAN,
|
||||
DrawContext.dwIndexBase,
|
||||
LowIndex, // minIndex
|
||||
(HighIndex - LowIndex) + 1, // NumVertices
|
||||
|
@ -7596,7 +7599,7 @@ void XTL::CxbxDrawIndexed(CxbxDrawContext &DrawContext)
|
|||
DEBUG_D3DRESULT(hRet, "g_pD3DDevice->DrawIndexedPrimitive");
|
||||
|
||||
g_dwPrimPerFrame += DrawContext.dwHostPrimitiveCount;
|
||||
if (DrawContext.XboxPrimitiveType == X_D3DPT_LINELOOP) {
|
||||
if (DrawContext.XboxPrimitiveType == XTL::X_D3DPT_LINELOOP) {
|
||||
// Close line-loops using a final single line, drawn from the end to the start vertex
|
||||
LOG_TEST_CASE("X_D3DPT_LINELOOP");
|
||||
// Read the end and start index from the supplied index data
|
||||
|
@ -7619,7 +7622,7 @@ void XTL::CxbxDrawIndexed(CxbxDrawContext &DrawContext)
|
|||
// TODO : Move to own file
|
||||
// Drawing function specifically for rendering Xbox draw calls supplying a 'User Pointer'.
|
||||
// Called by D3DDevice_DrawVerticesUP, EmuExecutePushBufferRaw and EmuFlushIVB
|
||||
void XTL::CxbxDrawPrimitiveUP(CxbxDrawContext &DrawContext)
|
||||
void CxbxDrawPrimitiveUP(CxbxDrawContext &DrawContext)
|
||||
{
|
||||
LOG_INIT // Allows use of DEBUG_D3DRESULT
|
||||
|
||||
|
@ -7629,7 +7632,7 @@ void XTL::CxbxDrawPrimitiveUP(CxbxDrawContext &DrawContext)
|
|||
assert(DrawContext.dwIndexBase == 0); // No IndexBase under Draw*UP
|
||||
|
||||
VertexBufferConverter.Apply(&DrawContext);
|
||||
if (DrawContext.XboxPrimitiveType == X_D3DPT_QUADLIST) {
|
||||
if (DrawContext.XboxPrimitiveType == XTL::X_D3DPT_QUADLIST) {
|
||||
// LOG_TEST_CASE("X_D3DPT_QUADLIST"); // X-Marbles and XDK Sample PlayField hits this case
|
||||
// Draw quadlists using a single 'quad-to-triangle mapping' index buffer :
|
||||
INDEX16 *pIndexData = CxbxAssureQuadListIndexBuffer(DrawContext.dwVertexCount);
|
||||
|
@ -7642,12 +7645,12 @@ void XTL::CxbxDrawPrimitiveUP(CxbxDrawContext &DrawContext)
|
|||
INDEX16 HighIndex = (INDEX16)(DrawContext.dwVertexCount - 1);
|
||||
|
||||
HRESULT hRet = g_pD3DDevice->DrawIndexedPrimitiveUP(
|
||||
D3DPT_TRIANGLELIST, // Draw indexed triangles instead of quads
|
||||
XTL::D3DPT_TRIANGLELIST, // Draw indexed triangles instead of quads
|
||||
LowIndex, // MinVertexIndex
|
||||
(HighIndex - LowIndex) + 1, // NumVertexIndices
|
||||
PrimitiveCount,
|
||||
pIndexData,
|
||||
D3DFMT_INDEX16, // IndexDataFormat
|
||||
XTL::D3DFMT_INDEX16, // IndexDataFormat
|
||||
DrawContext.pHostVertexStreamZeroData,
|
||||
DrawContext.uiHostVertexStreamZeroStride
|
||||
);
|
||||
|
@ -7666,7 +7669,7 @@ void XTL::CxbxDrawPrimitiveUP(CxbxDrawContext &DrawContext)
|
|||
DEBUG_D3DRESULT(hRet, "g_pD3DDevice->DrawPrimitiveUP");
|
||||
|
||||
g_dwPrimPerFrame += DrawContext.dwHostPrimitiveCount;
|
||||
if (DrawContext.XboxPrimitiveType == X_D3DPT_LINELOOP) {
|
||||
if (DrawContext.XboxPrimitiveType == XTL::X_D3DPT_LINELOOP) {
|
||||
// Note : XDK samples reaching this case : DebugKeyboard, Gamepad, Tiling, ShadowBuffer
|
||||
// Since we can use pHostVertexStreamZeroData here, we can close the line simpler than
|
||||
// via CxbxDrawIndexedClosingLine, by drawing two indices via DrawIndexedPrimitiveUP.
|
||||
|
@ -8324,9 +8327,9 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetPalette)
|
|||
// g_pD3DDevice9->SetCurrentTexturePalette(Stage, Stage);
|
||||
|
||||
if (Stage < XTL::X_D3DTS_STAGECOUNT) {
|
||||
if (g_pCurrentPalette[Stage] != GetDataFromXboxResource(pPalette) && XTL::EmuD3DActiveTexture[Stage] != nullptr) {
|
||||
if (g_pCurrentPalette[Stage] != GetDataFromXboxResource(pPalette) && EmuD3DActiveTexture[Stage] != nullptr) {
|
||||
// If the palette for a texture has changed, we need to re-convert the texture
|
||||
FreeHostResource(GetHostResourceKey(XTL::EmuD3DActiveTexture[Stage]));
|
||||
FreeHostResource(GetHostResourceKey(EmuD3DActiveTexture[Stage]));
|
||||
}
|
||||
|
||||
// Cache palette data and size
|
||||
|
|
|
@ -11,13 +11,13 @@
|
|||
// Walk an index buffer to find the minimum and maximum indices
|
||||
|
||||
// Default implementation
|
||||
void WalkIndexBuffer_NoSIMD(XTL::INDEX16 & LowIndex, XTL::INDEX16 & HighIndex, XTL::INDEX16 * pIndexData, DWORD dwIndexCount)
|
||||
void WalkIndexBuffer_NoSIMD(INDEX16 & LowIndex, INDEX16 & HighIndex, INDEX16 * pIndexData, DWORD dwIndexCount)
|
||||
{
|
||||
// Determine highest and lowest index in use
|
||||
LowIndex = pIndexData[0];
|
||||
HighIndex = LowIndex;
|
||||
for (unsigned int i = 1; i < dwIndexCount; i++) {
|
||||
XTL::INDEX16 Index = pIndexData[i];
|
||||
INDEX16 Index = pIndexData[i];
|
||||
if (LowIndex > Index)
|
||||
LowIndex = Index;
|
||||
if (HighIndex < Index)
|
||||
|
@ -26,7 +26,7 @@ void WalkIndexBuffer_NoSIMD(XTL::INDEX16 & LowIndex, XTL::INDEX16 & HighIndex, X
|
|||
}
|
||||
|
||||
//SSE 4.1 implementation
|
||||
void WalkIndexBuffer_SSE41(XTL::INDEX16 & LowIndex, XTL::INDEX16 & HighIndex, XTL::INDEX16 * pIndexData, DWORD dwIndexCount)
|
||||
void WalkIndexBuffer_SSE41(INDEX16 & LowIndex, INDEX16 & HighIndex, INDEX16 * pIndexData, DWORD dwIndexCount)
|
||||
{
|
||||
// We can fit 8 ushorts into 128 bit SIMD registers
|
||||
int iterations = dwIndexCount / 8;
|
||||
|
@ -58,8 +58,8 @@ void WalkIndexBuffer_SSE41(XTL::INDEX16 & LowIndex, XTL::INDEX16 & HighIndex, XT
|
|||
max = _mm_minpos_epu16(max);
|
||||
|
||||
// Get the min and max out
|
||||
LowIndex = (XTL::INDEX16) _mm_cvtsi128_si32(min);
|
||||
HighIndex = (XTL::INDEX16) USHRT_MAX - _mm_cvtsi128_si32(max); // invert back
|
||||
LowIndex = (INDEX16) _mm_cvtsi128_si32(min);
|
||||
HighIndex = (INDEX16) USHRT_MAX - _mm_cvtsi128_si32(max); // invert back
|
||||
|
||||
// Compare with the remaining values that didn't fit neatly into the SIMD registers
|
||||
for (DWORD i = dwIndexCount - remainder; i < dwIndexCount; i++) {
|
||||
|
@ -74,8 +74,8 @@ void WalkIndexBuffer_SSE41(XTL::INDEX16 & LowIndex, XTL::INDEX16 & HighIndex, XT
|
|||
// TODO AVX2, AVX512 implementations
|
||||
|
||||
// Detect SSE support to select real implementation on first call
|
||||
void(*WalkIndexBuffer)(XTL::INDEX16 &, XTL::INDEX16 &, XTL::INDEX16 *, DWORD) =
|
||||
[](XTL::INDEX16 &LowIndex, XTL::INDEX16 &HighIndex, XTL::INDEX16 *pIndexData, DWORD dwIndexCount)
|
||||
void(*WalkIndexBuffer)(INDEX16 &, INDEX16 &, INDEX16 *, DWORD) =
|
||||
[](INDEX16 &LowIndex, INDEX16 &HighIndex, INDEX16 *pIndexData, DWORD dwIndexCount)
|
||||
{
|
||||
SimdCaps supports;
|
||||
if (supports.SSE41())
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
|
||||
extern void(*WalkIndexBuffer)
|
||||
(
|
||||
XTL::INDEX16 &LowIndex,
|
||||
XTL::INDEX16 &HighIndex,
|
||||
XTL::INDEX16 *pIndexData,
|
||||
INDEX16 &LowIndex,
|
||||
INDEX16 &HighIndex,
|
||||
INDEX16 *pIndexData,
|
||||
DWORD dwIndexCount
|
||||
);
|
||||
|
||||
|
|
|
@ -1111,8 +1111,6 @@ const int X_D3DVSDT_PBYTE4 = 0x44; // xbox ext. 4D packed byte expanded to
|
|||
const int X_D3DVSDT_FLOAT2H = 0x72; // xbox ext. 3D float that expands to (value, value, 0.0, value). Useful for projective texture coordinates.
|
||||
const int X_D3DVSDT_NONE = 0x02; // xbox ext. nsp
|
||||
|
||||
typedef WORD INDEX16;
|
||||
|
||||
typedef enum _X_D3DVSD_TOKENTYPE
|
||||
{
|
||||
X_D3DVSD_TOKEN_NOP = 0, // NOP or extension
|
||||
|
@ -1210,96 +1208,6 @@ typedef DWORD NV2AMETHOD;
|
|||
//
|
||||
|
||||
// Host vertex shader counts
|
||||
#define VSH_MAX_TEMPORARY_REGISTERS 32
|
||||
#define VSH_MAX_INTERMEDIATE_COUNT 1024 // The maximum number of intermediate format slots
|
||||
#define VSH_VS11_MAX_INSTRUCTION_COUNT 128
|
||||
#define VSH_VS2X_MAX_INSTRUCTION_COUNT 256
|
||||
#define VSH_VS30_MAX_INSTRUCTION_COUNT 512
|
||||
|
||||
#define CXBX_D3DVS_CONSTREG_VERTEXDATA4F_BASE (X_D3DVS_CONSTREG_COUNT + 1)
|
||||
|
||||
typedef struct _CxbxPixelShader
|
||||
{
|
||||
//IDirect3DPixelShader* pShader;
|
||||
//ID3DXConstantTable *pConstantTable;
|
||||
DWORD Handle;
|
||||
|
||||
BOOL bBumpEnvMap;
|
||||
|
||||
// constants
|
||||
DWORD PSRealC0[8];
|
||||
DWORD PSRealC1[8];
|
||||
DWORD PSRealFC0;
|
||||
DWORD PSRealFC1;
|
||||
|
||||
BOOL bConstantsInitialized;
|
||||
BOOL bConstantsChanged;
|
||||
|
||||
DWORD dwStatus;
|
||||
X_D3DPIXELSHADERDEF PSDef;
|
||||
|
||||
DWORD dwStageMap[X_D3DTS_STAGECOUNT];
|
||||
|
||||
}
|
||||
CxbxPixelShader;
|
||||
|
||||
typedef struct _CxbxVertexShaderStreamElement
|
||||
{
|
||||
UINT XboxType; // The stream element data types (xbox)
|
||||
UINT HostByteSize; // The stream element data sizes (pc)
|
||||
}
|
||||
CxbxVertexShaderStreamElement;
|
||||
|
||||
/* See host typedef struct _D3DVERTEXELEMENT9
|
||||
{
|
||||
WORD Stream; // Stream index
|
||||
WORD Offset; // Offset in the stream in bytes
|
||||
BYTE Type; // Data type
|
||||
BYTE Method; // Processing method
|
||||
BYTE Usage; // Semantics
|
||||
BYTE UsageIndex; // Semantic index
|
||||
} D3DVERTEXELEMENT9, *LPD3DVERTEXELEMENT9;
|
||||
*/
|
||||
|
||||
typedef struct _CxbxVertexShaderStreamInfo
|
||||
{
|
||||
BOOL NeedPatch; // This is to know whether it's data which must be patched
|
||||
BOOL DeclPosition;
|
||||
WORD HostVertexStride;
|
||||
DWORD NumberOfVertexElements; // Number of the stream data types
|
||||
WORD CurrentStreamNumber;
|
||||
CxbxVertexShaderStreamElement VertexElements[X_VSH_MAX_ATTRIBUTES + 16]; // TODO : Why 16 extrahost additions?)
|
||||
}
|
||||
CxbxVertexShaderStreamInfo;
|
||||
|
||||
typedef struct _CxbxVertexShaderInfo
|
||||
{
|
||||
UINT NumberOfVertexStreams; // The number of streams the vertex shader uses
|
||||
CxbxVertexShaderStreamInfo VertexStreams[X_VSH_MAX_STREAMS];
|
||||
}
|
||||
CxbxVertexShaderInfo;
|
||||
|
||||
typedef struct _CxbxVertexShader
|
||||
{
|
||||
// These are the parameters given by the XBE,
|
||||
// we save them to be able to return them when necessary.
|
||||
DWORD* pXboxDeclarationCopy;
|
||||
DWORD XboxDeclarationCount; // Xbox's number of DWORD-sized X_D3DVSD* tokens
|
||||
DWORD XboxFunctionSize;
|
||||
DWORD* pXboxFunctionCopy;
|
||||
UINT XboxNrAddressSlots;
|
||||
DWORD XboxVertexShaderType;
|
||||
// DWORD XboxStatus; // Used by VshHandleIsValidShader()
|
||||
|
||||
// The resulting host variables
|
||||
DWORD HostFVF; // Flexible Vertex Format (used when there's no host vertex shader)
|
||||
XTL::IDirect3DVertexShader* pHostVertexShader; // if nullptr, use SetFVF(HostFVF);
|
||||
XTL::IDirect3DVertexDeclaration* pHostVertexDeclaration;
|
||||
DWORD HostDeclarationSize;
|
||||
|
||||
// Needed for dynamic stream patching
|
||||
CxbxVertexShaderInfo VertexShaderInfo;
|
||||
}
|
||||
CxbxVertexShader;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -31,8 +31,11 @@
|
|||
|
||||
#include "core\kernel\support\Emu.h"
|
||||
#include "core\kernel\support\EmuXTL.h"
|
||||
#include "XbD3D8Types.h" // For X_D3DFORMAT
|
||||
namespace XTL {
|
||||
#include "core\hle\D3D8\XbD3D8Types.h" // For X_D3DFORMAT
|
||||
}
|
||||
#include "core\hle\D3D8\ResourceTracker.h"
|
||||
#include "core\hle\D3D8\XbPushBuffer.h"
|
||||
#include "devices/video/nv2a.h" // For g_NV2A, PGRAPHState
|
||||
#include "devices/video/nv2a_int.h" // For NV** defines
|
||||
#include "Logging.h"
|
||||
|
@ -47,7 +50,7 @@ static void DbgDumpMesh(WORD *pIndexData, DWORD dwCount);
|
|||
|
||||
// Determine the size (in number of floating point texture coordinates) of the texture format (indexed 0 .. 3).
|
||||
// This is the reverse of the D3DFVF_TEXCOORDSIZE[0..3] macros.
|
||||
int XTL::DxbxFVF_GetNumberOfTextureCoordinates(DWORD dwFVF, int aTextureIndex)
|
||||
int DxbxFVF_GetNumberOfTextureCoordinates(DWORD dwFVF, int aTextureIndex)
|
||||
{
|
||||
// See D3DFVF_TEXCOORDSIZE1()
|
||||
switch ((dwFVF >> ((aTextureIndex * 2) + 16)) & 3) {
|
||||
|
@ -63,7 +66,7 @@ int XTL::DxbxFVF_GetNumberOfTextureCoordinates(DWORD dwFVF, int aTextureIndex)
|
|||
|
||||
// Dxbx Note: This code appeared in EmuExecutePushBufferRaw and occured
|
||||
// in EmuFlushIVB too, so it's generalize in this single implementation.
|
||||
UINT XTL::DxbxFVFToVertexSizeInBytes(DWORD dwFVF, BOOL bIncludeTextures)
|
||||
UINT DxbxFVFToVertexSizeInBytes(DWORD dwFVF, BOOL bIncludeTextures)
|
||||
{
|
||||
/*
|
||||
X_D3DFVF_POSITION_MASK = $00E; // Dec /2 #fl
|
||||
|
@ -115,12 +118,14 @@ UINT XTL::DxbxFVFToVertexSizeInBytes(DWORD dwFVF, BOOL bIncludeTextures)
|
|||
return Result;
|
||||
}
|
||||
|
||||
void XTL::EmuExecutePushBuffer
|
||||
void EmuExecutePushBuffer
|
||||
(
|
||||
X_D3DPushBuffer *pPushBuffer,
|
||||
X_D3DFixup *pFixup
|
||||
XTL::X_D3DPushBuffer *pPushBuffer,
|
||||
XTL::X_D3DFixup *pFixup
|
||||
)
|
||||
{
|
||||
using namespace XTL;
|
||||
|
||||
//Check whether Fixup exists or not.
|
||||
if (pFixup != NULL) {
|
||||
LOG_TEST_CASE("PushBuffer has fixups");
|
||||
|
@ -451,12 +456,14 @@ typedef union {
|
|||
#define COMMAND_WORD_MASK_JUMP_LONG 0xFFFFFFFC /* 2 .. 28 */
|
||||
} nv_fifo_command;
|
||||
|
||||
extern void XTL::EmuExecutePushBufferRaw
|
||||
extern void EmuExecutePushBufferRaw
|
||||
(
|
||||
void *pPushData,
|
||||
uint32_t uSizeInBytes
|
||||
)
|
||||
{
|
||||
using namespace XTL; // for logging
|
||||
|
||||
HLE_init_pgraph_plugins(); // TODO : Move to more approriate spot
|
||||
|
||||
// Test-case : Azurik (see https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/issues/360)
|
||||
|
@ -492,7 +499,7 @@ extern void XTL::EmuExecutePushBufferRaw
|
|||
uint32_t *dma_put; // pushbuffer current end address
|
||||
uint32_t *dma_get; //pushbuffer current read address
|
||||
struct {
|
||||
NV2AMETHOD mthd; // Current method
|
||||
XTL::NV2AMETHOD mthd; // Current method
|
||||
uint32_t subc; // :3 = Current subchannel
|
||||
uint32_t mcnt; // :24 = Current method count
|
||||
bool ni; // Current command's NI (non-increasing) flag
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
// ******************************************************************
|
||||
#ifndef XBPUSHBUFFER_H
|
||||
#define XBPUSHBUFFER_H
|
||||
|
||||
#include "core/hle/D3D8/XbVertexBuffer.h" // for CxbxDrawContext
|
||||
|
||||
extern int DxbxFVF_GetNumberOfTextureCoordinates(DWORD dwFVF, int aTextureIndex);
|
||||
extern UINT DxbxFVFToVertexSizeInBytes(DWORD dwFVF, BOOL bIncludeTextures);
|
||||
|
@ -33,8 +35,8 @@ extern void CxbxDrawPrimitiveUP(CxbxDrawContext &DrawContext);
|
|||
|
||||
extern void EmuExecutePushBuffer
|
||||
(
|
||||
X_D3DPushBuffer *pPushBuffer,
|
||||
X_D3DFixup *pFixup
|
||||
XTL::X_D3DPushBuffer *pPushBuffer,
|
||||
XTL::X_D3DFixup *pFixup
|
||||
);
|
||||
|
||||
extern void EmuExecutePushBufferRaw
|
||||
|
|
|
@ -33,6 +33,8 @@
|
|||
#include "core\kernel\support\Emu.h"
|
||||
#include "core\kernel\support\EmuXTL.h"
|
||||
#include "core\hle\D3D8\ResourceTracker.h"
|
||||
#include "core\hle\D3D8\XbPushBuffer.h" // for DxbxFVF_GetNumberOfTextureCoordinates
|
||||
#include "core\hle\D3D8\XbVertexBuffer.h"
|
||||
|
||||
#include <ctime>
|
||||
#include <chrono>
|
||||
|
@ -41,18 +43,18 @@
|
|||
#define MAX_STREAM_NOT_USED_TIME (2 * CLOCKS_PER_SEC) // TODO: Trim the not used time
|
||||
|
||||
// Inline vertex buffer emulation
|
||||
extern XTL::X_D3DPRIMITIVETYPE XTL::g_InlineVertexBuffer_PrimitiveType = XTL::X_D3DPT_INVALID;
|
||||
extern DWORD XTL::g_InlineVertexBuffer_FVF = 0;
|
||||
extern struct XTL::_D3DIVB *XTL::g_InlineVertexBuffer_Table = nullptr;
|
||||
extern UINT XTL::g_InlineVertexBuffer_TableLength = 0;
|
||||
extern UINT XTL::g_InlineVertexBuffer_TableOffset = 0;
|
||||
extern XTL::X_D3DPRIMITIVETYPE g_InlineVertexBuffer_PrimitiveType = XTL::X_D3DPT_INVALID;
|
||||
extern DWORD g_InlineVertexBuffer_FVF = 0;
|
||||
extern struct _D3DIVB *g_InlineVertexBuffer_Table = nullptr;
|
||||
extern UINT g_InlineVertexBuffer_TableLength = 0;
|
||||
extern UINT g_InlineVertexBuffer_TableOffset = 0;
|
||||
|
||||
FLOAT *g_InlineVertexBuffer_pData = nullptr;
|
||||
UINT g_InlineVertexBuffer_DataSize = 0;
|
||||
|
||||
extern XTL::X_D3DVertexBuffer *g_pVertexBuffer = NULL;
|
||||
|
||||
extern DWORD XTL::g_dwPrimPerFrame = 0;
|
||||
extern DWORD g_dwPrimPerFrame = 0;
|
||||
extern XTL::X_D3DVertexBuffer*g_D3DStreams[X_VSH_MAX_STREAMS];
|
||||
extern UINT g_D3DStreamStrides[X_VSH_MAX_STREAMS];
|
||||
extern XTL::X_D3DSurface* g_pXboxRenderTarget;
|
||||
|
@ -62,7 +64,7 @@ bool GetHostRenderTargetDimensions(DWORD* pHostWidth, DWORD* pHostHeight, XTL::I
|
|||
uint32_t GetPixelContainerWidth(XTL::X_D3DPixelContainer* pPixelContainer);
|
||||
uint32_t GetPixelContainerHeight(XTL::X_D3DPixelContainer* pPixelContainer);
|
||||
|
||||
void XTL::CxbxPatchedStream::Activate(XTL::CxbxDrawContext *pDrawContext, UINT uiStream) const
|
||||
void CxbxPatchedStream::Activate(CxbxDrawContext *pDrawContext, UINT uiStream) const
|
||||
{
|
||||
//LOG_INIT // Allows use of DEBUG_D3DRESULT
|
||||
|
||||
|
@ -86,12 +88,12 @@ void XTL::CxbxPatchedStream::Activate(XTL::CxbxDrawContext *pDrawContext, UINT u
|
|||
}
|
||||
}
|
||||
|
||||
XTL::CxbxPatchedStream::CxbxPatchedStream()
|
||||
CxbxPatchedStream::CxbxPatchedStream()
|
||||
{
|
||||
isValid = false;
|
||||
}
|
||||
|
||||
XTL::CxbxPatchedStream::~CxbxPatchedStream()
|
||||
CxbxPatchedStream::~CxbxPatchedStream()
|
||||
{
|
||||
if (bCachedHostVertexStreamZeroDataIsAllocated) {
|
||||
free(pCachedHostVertexStreamZeroData);
|
||||
|
@ -106,7 +108,7 @@ XTL::CxbxPatchedStream::~CxbxPatchedStream()
|
|||
}
|
||||
}
|
||||
|
||||
XTL::CxbxVertexBufferConverter::CxbxVertexBufferConverter()
|
||||
CxbxVertexBufferConverter::CxbxVertexBufferConverter()
|
||||
{
|
||||
m_uiNbrStreams = 0;
|
||||
m_pVertexShaderInfo = nullptr;
|
||||
|
@ -145,9 +147,9 @@ int CountActiveD3DStreams()
|
|||
return lastStreamIndex;
|
||||
}
|
||||
|
||||
XTL::CxbxVertexShaderInfo *GetCxbxVertexShaderInfo(DWORD XboxVertexShaderHandle); // forward
|
||||
CxbxVertexShaderInfo *GetCxbxVertexShaderInfo(DWORD XboxVertexShaderHandle); // forward
|
||||
|
||||
UINT XTL::CxbxVertexBufferConverter::GetNbrStreams(CxbxDrawContext *pDrawContext)
|
||||
UINT CxbxVertexBufferConverter::GetNbrStreams(CxbxDrawContext *pDrawContext)
|
||||
{
|
||||
// Draw..Up always have one stream
|
||||
if (pDrawContext->pXboxVertexStreamZeroData != xbnullptr) {
|
||||
|
@ -195,7 +197,7 @@ inline FLOAT ByteToFloat(const BYTE value)
|
|||
return ((FLOAT)value) / 255.0f;
|
||||
}
|
||||
|
||||
XTL::CxbxPatchedStream& XTL::CxbxVertexBufferConverter::GetPatchedStream(uint64_t key)
|
||||
CxbxPatchedStream& CxbxVertexBufferConverter::GetPatchedStream(uint64_t key)
|
||||
{
|
||||
// First, attempt to fetch an existing patched stream
|
||||
auto it = m_PatchedStreams.find(key);
|
||||
|
@ -222,7 +224,7 @@ XTL::CxbxPatchedStream& XTL::CxbxVertexBufferConverter::GetPatchedStream(uint64_
|
|||
return stream;
|
||||
}
|
||||
|
||||
void XTL::CxbxVertexBufferConverter::PrintStats()
|
||||
void CxbxVertexBufferConverter::PrintStats()
|
||||
{
|
||||
printf("Vertex Buffer Cache Status: \n");
|
||||
printf("- Cache Size: %d\n", m_PatchedStreams.size());
|
||||
|
@ -230,7 +232,7 @@ void XTL::CxbxVertexBufferConverter::PrintStats()
|
|||
printf("- Misses: %d\n", m_TotalCacheMisses);
|
||||
}
|
||||
|
||||
void XTL::CxbxVertexBufferConverter::ConvertStream
|
||||
void CxbxVertexBufferConverter::ConvertStream
|
||||
(
|
||||
CxbxDrawContext *pDrawContext,
|
||||
UINT uiStream
|
||||
|
@ -257,7 +259,7 @@ void XTL::CxbxVertexBufferConverter::ConvertStream
|
|||
if (i + 1 <= dwTexN) {
|
||||
pActivePixelContainer[i].NrTexCoords = DxbxFVF_GetNumberOfTextureCoordinates(XboxFVF, i);
|
||||
// TODO : Use GetXboxBaseTexture()
|
||||
X_D3DBaseTexture *pXboxBaseTexture = EmuD3DActiveTexture[i];
|
||||
XTL::X_D3DBaseTexture *pXboxBaseTexture = XTL::EmuD3DActiveTexture[i];
|
||||
if (pXboxBaseTexture != xbnullptr) {
|
||||
extern XTL::X_D3DFORMAT GetXboxPixelContainerFormat(const XTL::X_D3DPixelContainer *pXboxPixelContainer); // TODO : Move to XTL-independent header file
|
||||
|
||||
|
@ -297,7 +299,7 @@ void XTL::CxbxVertexBufferConverter::ConvertStream
|
|||
UINT uiHostVertexStride = 0;
|
||||
DWORD dwHostVertexDataSize = 0;
|
||||
uint8_t *pHostVertexData = nullptr;
|
||||
IDirect3DVertexBuffer *pNewHostVertexBuffer = nullptr;
|
||||
XTL::IDirect3DVertexBuffer *pNewHostVertexBuffer = nullptr;
|
||||
|
||||
if (pDrawContext->pXboxVertexStreamZeroData != xbnullptr) {
|
||||
// There should only be one stream (stream zero) in this case
|
||||
|
@ -440,7 +442,7 @@ void XTL::CxbxVertexBufferConverter::ConvertStream
|
|||
// Dxbx note : The following code handles only the D3DVSDT enums that need conversion;
|
||||
// All other cases are catched by the memcpy in the default-block.
|
||||
switch (pVertexShaderStreamInfo->VertexElements[uiElement].XboxType) {
|
||||
case X_D3DVSDT_NORMSHORT1: { // 0x11:
|
||||
case XTL::X_D3DVSDT_NORMSHORT1: { // 0x11:
|
||||
// Test-cases : Halo - Combat Evolved
|
||||
XboxElementByteSize = 1 * sizeof(SHORT);
|
||||
if (g_D3DCaps.DeclTypes & D3DDTCAPS_SHORT2N) {
|
||||
|
@ -456,7 +458,7 @@ void XTL::CxbxVertexBufferConverter::ConvertStream
|
|||
}
|
||||
break;
|
||||
}
|
||||
case X_D3DVSDT_NORMSHORT2: { // 0x21:
|
||||
case XTL::X_D3DVSDT_NORMSHORT2: { // 0x21:
|
||||
// Test-cases : Baldur's Gate: Dark Alliance 2, F1 2002, Gun, Halo - Combat Evolved, Scrapland
|
||||
XboxElementByteSize = 2 * sizeof(SHORT);
|
||||
if (g_D3DCaps.DeclTypes & D3DDTCAPS_SHORT2N) {
|
||||
|
@ -476,7 +478,7 @@ void XTL::CxbxVertexBufferConverter::ConvertStream
|
|||
}
|
||||
break;
|
||||
}
|
||||
case X_D3DVSDT_NORMSHORT3: { // 0x31:
|
||||
case XTL::X_D3DVSDT_NORMSHORT3: { // 0x31:
|
||||
// Test-cases : Cel Damage, Constantine, Destroy All Humans!
|
||||
XboxElementByteSize = 3 * sizeof(SHORT);
|
||||
if (g_D3DCaps.DeclTypes & D3DDTCAPS_SHORT4N) {
|
||||
|
@ -495,7 +497,7 @@ void XTL::CxbxVertexBufferConverter::ConvertStream
|
|||
}
|
||||
break;
|
||||
}
|
||||
case X_D3DVSDT_NORMSHORT4: { // 0x41:
|
||||
case XTL::X_D3DVSDT_NORMSHORT4: { // 0x41:
|
||||
// Test-cases : Judge Dredd: Dredd vs Death, NHL Hitz 2002, Silent Hill 2, Sneakers, Tony Hawk Pro Skater 4
|
||||
XboxElementByteSize = 4 * sizeof(SHORT);
|
||||
if (g_D3DCaps.DeclTypes & D3DDTCAPS_SHORT4N) {
|
||||
|
@ -519,7 +521,7 @@ void XTL::CxbxVertexBufferConverter::ConvertStream
|
|||
}
|
||||
break;
|
||||
}
|
||||
case X_D3DVSDT_NORMPACKED3: { // 0x16:
|
||||
case XTL::X_D3DVSDT_NORMPACKED3: { // 0x16:
|
||||
// Test-cases : Dashboard
|
||||
XboxElementByteSize = 1 * sizeof(int32_t);
|
||||
// Make it FLOAT3
|
||||
|
@ -539,14 +541,14 @@ void XTL::CxbxVertexBufferConverter::ConvertStream
|
|||
pHostVertexAsFloat[2] = PackedIntToFloat(NormPacked3.z, 511.0f, 512.f);
|
||||
break;
|
||||
}
|
||||
case X_D3DVSDT_SHORT1: { // 0x15:
|
||||
case XTL::X_D3DVSDT_SHORT1: { // 0x15:
|
||||
XboxElementByteSize = 1 * sizeof(SHORT);
|
||||
// Make it SHORT2 and set the second short to 0
|
||||
pHostVertexAsShort[0] = pXboxVertexAsShort[0];
|
||||
pHostVertexAsShort[1] = 0;
|
||||
break;
|
||||
}
|
||||
case X_D3DVSDT_SHORT3: { // 0x35:
|
||||
case XTL::X_D3DVSDT_SHORT3: { // 0x35:
|
||||
// Test-cases : Turok
|
||||
XboxElementByteSize = 3 * sizeof(SHORT);
|
||||
// Make it a SHORT4 and set the fourth short to 1
|
||||
|
@ -556,7 +558,7 @@ void XTL::CxbxVertexBufferConverter::ConvertStream
|
|||
pHostVertexAsShort[3] = 1; // Turok verified (character disappears when this is 32767)
|
||||
break;
|
||||
}
|
||||
case X_D3DVSDT_PBYTE1: { // 0x14:
|
||||
case XTL::X_D3DVSDT_PBYTE1: { // 0x14:
|
||||
XboxElementByteSize = 1 * sizeof(BYTE);
|
||||
if (g_D3DCaps.DeclTypes & D3DDTCAPS_UBYTE4N) {
|
||||
// Make it UBYTE4N
|
||||
|
@ -572,7 +574,7 @@ void XTL::CxbxVertexBufferConverter::ConvertStream
|
|||
}
|
||||
break;
|
||||
}
|
||||
case X_D3DVSDT_PBYTE2: { // 0x24:
|
||||
case XTL::X_D3DVSDT_PBYTE2: { // 0x24:
|
||||
XboxElementByteSize = 2 * sizeof(BYTE);
|
||||
if (g_D3DCaps.DeclTypes & D3DDTCAPS_UBYTE4N) {
|
||||
// Make it UBYTE4N
|
||||
|
@ -589,7 +591,7 @@ void XTL::CxbxVertexBufferConverter::ConvertStream
|
|||
}
|
||||
break;
|
||||
}
|
||||
case X_D3DVSDT_PBYTE3: { // 0x34:
|
||||
case XTL::X_D3DVSDT_PBYTE3: { // 0x34:
|
||||
// Test-cases : Turok
|
||||
XboxElementByteSize = 3 * sizeof(BYTE);
|
||||
if (g_D3DCaps.DeclTypes & D3DDTCAPS_UBYTE4N) {
|
||||
|
@ -608,7 +610,7 @@ void XTL::CxbxVertexBufferConverter::ConvertStream
|
|||
}
|
||||
break;
|
||||
}
|
||||
case X_D3DVSDT_PBYTE4: { // 0x44:
|
||||
case XTL::X_D3DVSDT_PBYTE4: { // 0x44:
|
||||
// Test-case : Jet Set Radio Future
|
||||
XboxElementByteSize = 4 * sizeof(BYTE);
|
||||
if (g_D3DCaps.DeclTypes & D3DDTCAPS_UBYTE4N) {
|
||||
|
@ -632,7 +634,7 @@ void XTL::CxbxVertexBufferConverter::ConvertStream
|
|||
}
|
||||
break;
|
||||
}
|
||||
case X_D3DVSDT_FLOAT2H: { // 0x72:
|
||||
case XTL::X_D3DVSDT_FLOAT2H: { // 0x72:
|
||||
XboxElementByteSize = 3 * sizeof(FLOAT);
|
||||
// Make it FLOAT4 and set the third float to 0.0
|
||||
pHostVertexAsFloat[0] = pXboxVertexAsFloat[0];
|
||||
|
@ -641,7 +643,7 @@ void XTL::CxbxVertexBufferConverter::ConvertStream
|
|||
pHostVertexAsFloat[3] = pXboxVertexAsFloat[2];
|
||||
break;
|
||||
}
|
||||
case X_D3DVSDT_NONE: { // 0x02: // Skip it
|
||||
case XTL::X_D3DVSDT_NONE: { // 0x02: // Skip it
|
||||
// Test-case : WWE RAW2
|
||||
LOG_TEST_CASE("X_D3DVSDT_NONE");
|
||||
break;
|
||||
|
@ -675,7 +677,7 @@ void XTL::CxbxVertexBufferConverter::ConvertStream
|
|||
|
||||
// Locate texture coordinate offset in vertex structure.
|
||||
if (bNeedTextureNormalization) {
|
||||
uiTextureCoordinatesByteOffsetInVertex = XTL::DxbxFVFToVertexSizeInBytes(XboxFVF, /*bIncludeTextures=*/false);
|
||||
uiTextureCoordinatesByteOffsetInVertex = DxbxFVFToVertexSizeInBytes(XboxFVF, /*bIncludeTextures=*/false);
|
||||
if (bNeedVertexPatching) {
|
||||
LOG_TEST_CASE("Potential xbox vs host texture-offset difference! (bNeedVertexPatching within bNeedTextureNormalization)");
|
||||
}
|
||||
|
@ -784,9 +786,9 @@ void XTL::CxbxVertexBufferConverter::ConvertStream
|
|||
patchedStream.Activate(pDrawContext, uiStream);
|
||||
}
|
||||
|
||||
void XTL::CxbxVertexBufferConverter::Apply(CxbxDrawContext *pDrawContext)
|
||||
void CxbxVertexBufferConverter::Apply(CxbxDrawContext *pDrawContext)
|
||||
{
|
||||
if ((pDrawContext->XboxPrimitiveType < X_D3DPT_POINTLIST) || (pDrawContext->XboxPrimitiveType > X_D3DPT_POLYGON))
|
||||
if ((pDrawContext->XboxPrimitiveType < XTL::X_D3DPT_POINTLIST) || (pDrawContext->XboxPrimitiveType > XTL::X_D3DPT_POLYGON))
|
||||
CxbxKrnlCleanup("Unknown primitive type: 0x%.02X\n", pDrawContext->XboxPrimitiveType);
|
||||
|
||||
m_pVertexShaderInfo = nullptr;
|
||||
|
@ -812,7 +814,7 @@ void XTL::CxbxVertexBufferConverter::Apply(CxbxDrawContext *pDrawContext)
|
|||
ConvertStream(pDrawContext, uiStream);
|
||||
}
|
||||
|
||||
if (pDrawContext->XboxPrimitiveType == X_D3DPT_QUADSTRIP) {
|
||||
if (pDrawContext->XboxPrimitiveType == XTL::X_D3DPT_QUADSTRIP) {
|
||||
// Quad strip is just like a triangle strip, but requires two vertices per primitive.
|
||||
// A quadstrip starts with 4 vertices and adds 2 vertices per additional quad.
|
||||
// This is much like a trianglestrip, which starts with 3 vertices and adds
|
||||
|
@ -823,12 +825,12 @@ void XTL::CxbxVertexBufferConverter::Apply(CxbxDrawContext *pDrawContext)
|
|||
// handled by d3d :
|
||||
// Test-case : XDK Samples (FocusBlur, MotionBlur, Trees, PaintEffect, PlayField)
|
||||
// No need to set : pDrawContext->XboxPrimitiveType = X_D3DPT_TRIANGLESTRIP;
|
||||
pDrawContext->dwHostPrimitiveCount = EmuD3DVertex2PrimitiveCount(X_D3DPT_TRIANGLESTRIP, pDrawContext->dwVertexCount);
|
||||
pDrawContext->dwHostPrimitiveCount = EmuD3DVertex2PrimitiveCount(XTL::X_D3DPT_TRIANGLESTRIP, pDrawContext->dwVertexCount);
|
||||
} else {
|
||||
pDrawContext->dwHostPrimitiveCount = EmuD3DVertex2PrimitiveCount(pDrawContext->XboxPrimitiveType, pDrawContext->dwVertexCount);
|
||||
}
|
||||
|
||||
if (pDrawContext->XboxPrimitiveType == X_D3DPT_POLYGON) {
|
||||
if (pDrawContext->XboxPrimitiveType == XTL::X_D3DPT_POLYGON) {
|
||||
// Convex polygon is the same as a triangle fan.
|
||||
// No need to set : pDrawContext->XboxPrimitiveType = X_D3DPT_TRIANGLEFAN;
|
||||
// Test-case : Panzer Dragoon ORTA (when entering in-game)
|
||||
|
@ -836,9 +838,9 @@ void XTL::CxbxVertexBufferConverter::Apply(CxbxDrawContext *pDrawContext)
|
|||
}
|
||||
}
|
||||
|
||||
VOID XTL::EmuFlushIVB()
|
||||
VOID EmuFlushIVB()
|
||||
{
|
||||
CxbxUpdateNativeD3DResources();
|
||||
XTL::CxbxUpdateNativeD3DResources();
|
||||
|
||||
// Parse IVB table with current FVF shader if possible.
|
||||
bool bFVF = VshHandleIsFVF(g_CurrentXboxVertexShaderHandle);
|
||||
|
|
|
@ -29,9 +29,12 @@
|
|||
|
||||
//#include <ctime> // Conflict with io.h
|
||||
|
||||
//#include "core\kernel\support\EmuXTL.h"
|
||||
#include "core\hle\D3D8\XbVertexShader.h" // for CxbxVertexShaderInfo
|
||||
|
||||
typedef struct _CxbxDrawContext
|
||||
{
|
||||
IN X_D3DPRIMITIVETYPE XboxPrimitiveType;
|
||||
IN XTL::X_D3DPRIMITIVETYPE XboxPrimitiveType;
|
||||
IN DWORD dwVertexCount;
|
||||
IN DWORD dwStartVertex; // Only D3DDevice_DrawVertices sets this (potentially higher than default 0)
|
||||
// The current vertex shader, used to identify the streams
|
||||
|
@ -54,7 +57,7 @@ class CxbxPatchedStream
|
|||
public:
|
||||
CxbxPatchedStream();
|
||||
~CxbxPatchedStream();
|
||||
void Activate(XTL::CxbxDrawContext *pDrawContext, UINT uiStream) const;
|
||||
void Activate(CxbxDrawContext *pDrawContext, UINT uiStream) const;
|
||||
bool isValid = false;
|
||||
XTL::X_D3DPRIMITIVETYPE XboxPrimitiveType = XTL::X_D3DPT_NONE;
|
||||
PVOID pCachedXboxVertexData = xbnullptr;
|
||||
|
@ -88,7 +91,7 @@ class CxbxVertexBufferConverter
|
|||
std::list<CxbxPatchedStream> m_PatchedStreamUsageList; // Linked list of vertex streams, least recently used is last in the list
|
||||
CxbxPatchedStream& GetPatchedStream(uint64_t); // Fetches (or inserts) a patched stream associated with the given key
|
||||
|
||||
XTL::CxbxVertexShaderInfo *m_pVertexShaderInfo;
|
||||
CxbxVertexShaderInfo *m_pVertexShaderInfo;
|
||||
|
||||
// Returns the number of streams of a patch
|
||||
UINT GetNbrStreams(CxbxDrawContext *pPatchDesc);
|
||||
|
@ -98,7 +101,7 @@ class CxbxVertexBufferConverter
|
|||
};
|
||||
|
||||
// inline vertex buffer emulation
|
||||
extern X_D3DPRIMITIVETYPE g_InlineVertexBuffer_PrimitiveType;
|
||||
extern XTL::X_D3DPRIMITIVETYPE g_InlineVertexBuffer_PrimitiveType;
|
||||
extern DWORD g_InlineVertexBuffer_FVF;
|
||||
|
||||
extern struct _D3DIVB
|
||||
|
@ -107,11 +110,11 @@ extern struct _D3DIVB
|
|||
FLOAT Rhw; // X_D3DVSDE_VERTEX (*) > D3DFVF_XYZ / D3DFVF_XYZRHW
|
||||
FLOAT Blend[4]; // X_D3DVSDE_BLENDWEIGHT > D3DFVF_XYZB1 (and 3 more up to D3DFVF_XYZB4)
|
||||
XTL::D3DXVECTOR3 Normal; // X_D3DVSDE_NORMAL > D3DFVF_NORMAL
|
||||
D3DCOLOR Diffuse; // X_D3DVSDE_DIFFUSE > D3DFVF_DIFFUSE
|
||||
D3DCOLOR Specular; // X_D3DVSDE_SPECULAR > D3DFVF_SPECULAR
|
||||
XTL::D3DCOLOR Diffuse; // X_D3DVSDE_DIFFUSE > D3DFVF_DIFFUSE
|
||||
XTL::D3DCOLOR Specular; // X_D3DVSDE_SPECULAR > D3DFVF_SPECULAR
|
||||
FLOAT Fog; // X_D3DVSDE_FOG > D3DFVF_FOG unavailable; TODO : How to handle?
|
||||
D3DCOLOR BackDiffuse; // X_D3DVSDE_BACKDIFFUSE > D3DFVF_BACKDIFFUSE unavailable; TODO : How to handle?
|
||||
D3DCOLOR BackSpecular; // X_D3DVSDE_BACKSPECULAR > D3DFVF_BACKSPECULAR unavailable; TODO : How to handle?
|
||||
XTL::D3DCOLOR BackDiffuse; // X_D3DVSDE_BACKDIFFUSE > D3DFVF_BACKDIFFUSE unavailable; TODO : How to handle?
|
||||
XTL::D3DCOLOR BackSpecular; // X_D3DVSDE_BACKSPECULAR > D3DFVF_BACKSPECULAR unavailable; TODO : How to handle?
|
||||
XTL::D3DXVECTOR4 TexCoord[4]; // X_D3DVSDE_TEXCOORD0 > D3DFVF_TEX1 (and 4 more up to D3DFVF_TEX4)
|
||||
|
||||
// (*) X_D3DVSDE_POSITION and X_D3DVSDE_VERTEX both set Position, but Rhw seems optional,
|
||||
|
|
|
@ -33,6 +33,8 @@
|
|||
#include "core\kernel\support\Emu.h"
|
||||
#include "core\kernel\support\EmuFS.h"
|
||||
#include "core\kernel\support\EmuXTL.h"
|
||||
#include "core\hle\D3D8\XbVertexShader.h"
|
||||
|
||||
#include "XbD3D8Types.h" // For X_D3DVSDE_*
|
||||
#include <sstream>
|
||||
#include <unordered_map>
|
||||
|
@ -45,7 +47,7 @@
|
|||
#define VSH_MAX_INSTRUCTION_COUNT VSH_VS2X_MAX_INSTRUCTION_COUNT // == 256
|
||||
#endif
|
||||
|
||||
// Host Vertex Shader version (mustn't conflict with any VERSION_XVS*)
|
||||
// Internal Vertex Shader version (mustn't conflict with any VERSION_XVS*)
|
||||
#define VERSION_CXBX 0x7863 // 'cx' Cxbx vertex shader, not an official value, used in VshConvertShader() and VshWriteShader()
|
||||
|
||||
#define DbgVshPrintf \
|
||||
|
@ -1743,8 +1745,8 @@ class XboxVertexDeclarationConverter
|
|||
{
|
||||
protected:
|
||||
// Internal variables
|
||||
XTL::CxbxVertexShaderInfo* pVertexShaderInfoToSet;
|
||||
XTL::CxbxVertexShaderStreamInfo* pCurrentVertexShaderStreamInfo = nullptr;
|
||||
CxbxVertexShaderInfo* pVertexShaderInfoToSet;
|
||||
CxbxVertexShaderStreamInfo* pCurrentVertexShaderStreamInfo = nullptr;
|
||||
DWORD temporaryCount;
|
||||
bool IsFixedFunction;
|
||||
XTL::D3DVERTEXELEMENT* pRecompiled;
|
||||
|
@ -2153,7 +2155,7 @@ private:
|
|||
}
|
||||
|
||||
// save patching information
|
||||
XTL::CxbxVertexShaderStreamElement *pCurrentElement = &(pCurrentVertexShaderStreamInfo->VertexElements[pCurrentVertexShaderStreamInfo->NumberOfVertexElements]);
|
||||
CxbxVertexShaderStreamElement *pCurrentElement = &(pCurrentVertexShaderStreamInfo->VertexElements[pCurrentVertexShaderStreamInfo->NumberOfVertexElements]);
|
||||
pCurrentElement->XboxType = XboxVertexElementDataType;
|
||||
pCurrentElement->HostByteSize = HostVertexElementByteSize;
|
||||
pCurrentVertexShaderStreamInfo->NumberOfVertexElements++;
|
||||
|
@ -2230,7 +2232,7 @@ private:
|
|||
}
|
||||
|
||||
public:
|
||||
XTL::D3DVERTEXELEMENT *Convert(DWORD* pXboxDeclaration, bool bIsFixedFunction, XTL::CxbxVertexShaderInfo* pCxbxVertexShaderInfo)
|
||||
XTL::D3DVERTEXELEMENT *Convert(DWORD* pXboxDeclaration, bool bIsFixedFunction, CxbxVertexShaderInfo* pCxbxVertexShaderInfo)
|
||||
{
|
||||
using namespace XTL;
|
||||
|
||||
|
@ -2281,7 +2283,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
XTL::D3DVERTEXELEMENT *XTL::EmuRecompileVshDeclaration
|
||||
XTL::D3DVERTEXELEMENT *EmuRecompileVshDeclaration
|
||||
(
|
||||
DWORD *pXboxDeclaration,
|
||||
bool bIsFixedFunction,
|
||||
|
@ -2301,16 +2303,18 @@ XTL::D3DVERTEXELEMENT *XTL::EmuRecompileVshDeclaration
|
|||
}
|
||||
|
||||
// recompile xbox vertex shader function
|
||||
extern HRESULT XTL::EmuRecompileVshFunction
|
||||
extern HRESULT EmuRecompileVshFunction
|
||||
(
|
||||
DWORD *pXboxFunction,
|
||||
bool bNoReservedConstants,
|
||||
D3DVERTEXELEMENT *pRecompiledDeclaration,
|
||||
XTL::D3DVERTEXELEMENT *pRecompiledDeclaration,
|
||||
bool *pbUseDeclarationOnly,
|
||||
DWORD *pXboxFunctionSize,
|
||||
LPD3DXBUFFER *ppRecompiledShader
|
||||
XTL::LPD3DXBUFFER *ppRecompiledShader
|
||||
)
|
||||
{
|
||||
using namespace XTL;
|
||||
|
||||
X_VSH_SHADER_HEADER *pXboxVertexShaderHeader = (X_VSH_SHADER_HEADER*)pXboxFunction;
|
||||
DWORD *pToken;
|
||||
boolean EOI = false;
|
||||
|
@ -2437,7 +2441,7 @@ extern HRESULT XTL::EmuRecompileVshFunction
|
|||
return hRet;
|
||||
}
|
||||
|
||||
extern void XTL::FreeVertexDynamicPatch(CxbxVertexShader *pVertexShader)
|
||||
extern void FreeVertexDynamicPatch(CxbxVertexShader *pVertexShader)
|
||||
{
|
||||
pVertexShader->VertexShaderInfo.NumberOfVertexStreams = 0;
|
||||
}
|
||||
|
@ -2448,7 +2452,7 @@ boolean VshHandleIsValidShader(DWORD XboxVertexShaderHandle)
|
|||
#if 0
|
||||
//printf( "VS = 0x%.08X\n", XboxVertexShaderHandle );
|
||||
|
||||
XTL::CxbxVertexShader *pCxbxVertexShader = XTL::GetCxbxVertexShader(XboxVertexShaderHandle);
|
||||
CxbxVertexShader *pCxbxVertexShader = GetCxbxVertexShader(XboxVertexShaderHandle);
|
||||
if (pCxbxVertexShader) {
|
||||
if (pCxbxVertexShader->XboxStatus != 0)
|
||||
{
|
||||
|
@ -2470,16 +2474,16 @@ boolean VshHandleIsValidShader(DWORD XboxVertexShaderHandle)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
extern boolean XTL::IsValidCurrentShader(void)
|
||||
extern boolean IsValidCurrentShader(void)
|
||||
{
|
||||
// Dxbx addition : There's no need to call
|
||||
// XTL_EmuIDirect3DDevice_GetVertexShader, just check g_CurrentXboxVertexShaderHandle :
|
||||
return VshHandleIsValidShader(g_CurrentXboxVertexShaderHandle);
|
||||
}
|
||||
|
||||
XTL::CxbxVertexShaderInfo *GetCxbxVertexShaderInfo(DWORD XboxVertexShaderHandle)
|
||||
CxbxVertexShaderInfo *GetCxbxVertexShaderInfo(DWORD XboxVertexShaderHandle)
|
||||
{
|
||||
XTL::CxbxVertexShader *pCxbxVertexShader = XTL::GetCxbxVertexShader(XboxVertexShaderHandle);
|
||||
CxbxVertexShader *pCxbxVertexShader = GetCxbxVertexShader(XboxVertexShaderHandle);
|
||||
|
||||
for (uint32_t i = 0; i < pCxbxVertexShader->VertexShaderInfo.NumberOfVertexStreams; i++)
|
||||
{
|
||||
|
@ -2491,9 +2495,9 @@ XTL::CxbxVertexShaderInfo *GetCxbxVertexShaderInfo(DWORD XboxVertexShaderHandle)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
std::unordered_map<DWORD, XTL::CxbxVertexShader*> g_CxbxVertexShaders;
|
||||
std::unordered_map<DWORD, CxbxVertexShader*> g_CxbxVertexShaders;
|
||||
|
||||
XTL::CxbxVertexShader* XTL::GetCxbxVertexShader(DWORD XboxVertexShaderHandle)
|
||||
CxbxVertexShader* GetCxbxVertexShader(DWORD XboxVertexShaderHandle)
|
||||
{
|
||||
if (VshHandleIsVertexShader(XboxVertexShaderHandle)) {
|
||||
auto it = g_CxbxVertexShaders.find(XboxVertexShaderHandle);
|
||||
|
@ -2505,7 +2509,7 @@ XTL::CxbxVertexShader* XTL::GetCxbxVertexShader(DWORD XboxVertexShaderHandle)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
void XTL::SetCxbxVertexShader(DWORD XboxVertexShaderHandle, XTL::CxbxVertexShader* shader)
|
||||
void SetCxbxVertexShader(DWORD XboxVertexShaderHandle, CxbxVertexShader* shader)
|
||||
{
|
||||
auto it = g_CxbxVertexShaders.find(XboxVertexShaderHandle);
|
||||
if (it != g_CxbxVertexShaders.end() && it->second != nullptr && shader != nullptr) {
|
||||
|
|
|
@ -25,16 +25,86 @@
|
|||
#ifndef XBVERTEXSHADER_H
|
||||
#define XBVERTEXSHADER_H
|
||||
|
||||
#include "Cxbx.h"
|
||||
//#include "Cxbx.h"
|
||||
//#include "core\hle\D3D8\XbVertexBuffer.h" // for CxbxVertexShaderStreamInfo
|
||||
namespace XTL {
|
||||
#include "core\hle\D3D8\XbD3D8Types.h" // for X_VSH_MAX_ATTRIBUTES
|
||||
}
|
||||
|
||||
// Host vertex shader counts
|
||||
#define VSH_MAX_TEMPORARY_REGISTERS 32
|
||||
#define VSH_MAX_INTERMEDIATE_COUNT 1024 // The maximum number of intermediate format slots
|
||||
#define VSH_VS11_MAX_INSTRUCTION_COUNT 128
|
||||
#define VSH_VS2X_MAX_INSTRUCTION_COUNT 256
|
||||
#define VSH_VS30_MAX_INSTRUCTION_COUNT 512
|
||||
|
||||
typedef struct _CxbxVertexShaderStreamElement
|
||||
{
|
||||
UINT XboxType; // The stream element data types (xbox)
|
||||
UINT HostByteSize; // The stream element data sizes (pc)
|
||||
}
|
||||
CxbxVertexShaderStreamElement;
|
||||
|
||||
/* See host typedef struct _D3DVERTEXELEMENT9
|
||||
{
|
||||
WORD Stream; // Stream index
|
||||
WORD Offset; // Offset in the stream in bytes
|
||||
BYTE Type; // Data type
|
||||
BYTE Method; // Processing method
|
||||
BYTE Usage; // Semantics
|
||||
BYTE UsageIndex; // Semantic index
|
||||
} D3DVERTEXELEMENT9, *LPD3DVERTEXELEMENT9;
|
||||
*/
|
||||
|
||||
typedef struct _CxbxVertexShaderStreamInfo
|
||||
{
|
||||
BOOL NeedPatch; // This is to know whether it's data which must be patched
|
||||
BOOL DeclPosition;
|
||||
WORD HostVertexStride;
|
||||
DWORD NumberOfVertexElements; // Number of the stream data types
|
||||
WORD CurrentStreamNumber;
|
||||
CxbxVertexShaderStreamElement VertexElements[X_VSH_MAX_ATTRIBUTES + 16]; // TODO : Why 16 extrahost additions?)
|
||||
}
|
||||
CxbxVertexShaderStreamInfo;
|
||||
|
||||
typedef struct _CxbxVertexShaderInfo
|
||||
{
|
||||
UINT NumberOfVertexStreams; // The number of streams the vertex shader uses
|
||||
CxbxVertexShaderStreamInfo VertexStreams[X_VSH_MAX_STREAMS];
|
||||
}
|
||||
CxbxVertexShaderInfo;
|
||||
|
||||
typedef struct _CxbxVertexShader
|
||||
{
|
||||
// These are the parameters given by the XBE,
|
||||
// we save them to be able to return them when necessary.
|
||||
DWORD* pXboxDeclarationCopy;
|
||||
DWORD XboxDeclarationCount; // Xbox's number of DWORD-sized X_D3DVSD* tokens
|
||||
DWORD XboxFunctionSize;
|
||||
DWORD* pXboxFunctionCopy;
|
||||
UINT XboxNrAddressSlots;
|
||||
DWORD XboxVertexShaderType;
|
||||
// DWORD XboxStatus; // Used by VshHandleIsValidShader()
|
||||
|
||||
// The resulting host variables
|
||||
DWORD HostFVF; // Flexible Vertex Format (used when there's no host vertex shader)
|
||||
XTL::IDirect3DVertexShader* pHostVertexShader; // if nullptr, use SetFVF(HostFVF);
|
||||
XTL::IDirect3DVertexDeclaration* pHostVertexDeclaration;
|
||||
DWORD HostDeclarationSize;
|
||||
|
||||
// Needed for dynamic stream patching
|
||||
CxbxVertexShaderInfo VertexShaderInfo;
|
||||
}
|
||||
CxbxVertexShader;
|
||||
|
||||
// recompile xbox vertex shader declaration
|
||||
extern D3DVERTEXELEMENT *EmuRecompileVshDeclaration
|
||||
extern XTL::D3DVERTEXELEMENT *EmuRecompileVshDeclaration
|
||||
(
|
||||
DWORD *pXboxDeclaration,
|
||||
bool bIsFixedFunction,
|
||||
DWORD *pXboxDeclarationCount,
|
||||
DWORD *pHostDeclarationSize,
|
||||
XTL::CxbxVertexShaderInfo *pCxbxVertexShaderInfo
|
||||
CxbxVertexShaderInfo *pCxbxVertexShaderInfo
|
||||
);
|
||||
|
||||
// recompile xbox vertex shader function
|
||||
|
@ -42,10 +112,10 @@ extern HRESULT EmuRecompileVshFunction
|
|||
(
|
||||
DWORD *pXboxFunction,
|
||||
bool bNoReservedConstants,
|
||||
D3DVERTEXELEMENT *pRecompiledDeclaration,
|
||||
XTL::D3DVERTEXELEMENT *pRecompiledDeclaration,
|
||||
bool *pbUseDeclarationOnly,
|
||||
DWORD *pXboxFunctionSize,
|
||||
LPD3DXBUFFER *ppRecompiledShader
|
||||
XTL::LPD3DXBUFFER *ppRecompiledShader
|
||||
);
|
||||
|
||||
extern void FreeVertexDynamicPatch(CxbxVertexShader *pVertexShader);
|
||||
|
@ -55,7 +125,7 @@ extern boolean IsValidCurrentShader(void);
|
|||
|
||||
inline boolean VshHandleIsVertexShader(DWORD Handle) { return (Handle & X_D3DFVF_RESERVED0) ? TRUE : FALSE; }
|
||||
inline boolean VshHandleIsFVF(DWORD Handle) { return !VshHandleIsVertexShader(Handle); }
|
||||
inline X_D3DVertexShader *VshHandleToXboxVertexShader(DWORD Handle) { return (X_D3DVertexShader *)(Handle & ~X_D3DFVF_RESERVED0);}
|
||||
inline XTL::X_D3DVertexShader *VshHandleToXboxVertexShader(DWORD Handle) { return (XTL::X_D3DVertexShader *)(Handle & ~X_D3DFVF_RESERVED0);}
|
||||
|
||||
extern CxbxVertexShader* GetCxbxVertexShader(DWORD XboxVertexShaderHandle);
|
||||
extern void SetCxbxVertexShader(DWORD XboxVertexShaderHandle, CxbxVertexShader* shader);
|
||||
|
|
|
@ -77,6 +77,7 @@ typedef struct DUMMY_KERNEL
|
|||
IMAGE_SECTION_HEADER SectionHeader;
|
||||
} *PDUMMY_KERNEL;
|
||||
|
||||
typedef WORD INDEX16;
|
||||
|
||||
extern bool g_DisablePixelShaders;
|
||||
extern bool g_UseAllCores;
|
||||
|
|
|
@ -33,9 +33,6 @@ namespace XTL
|
|||
#include "core\hle\XAPI\Xapi.h"
|
||||
#include "core\hle\D3D8\Direct3D9/Direct3D9.h"
|
||||
#include "core\hle\D3D8\XbConvert.h"
|
||||
#include "core\hle\D3D8\XbVertexBuffer.h"
|
||||
#include "core\hle\D3D8\XbPushBuffer.h"
|
||||
#include "core\hle\D3D8\XbVertexShader.h"
|
||||
#include "core\hle\D3D8\XbPixelShader.h"
|
||||
#include "core\hle\D3D8\XbState.h"
|
||||
#include "core\hle\DSOUND\DirectSound\DirectSound.hpp"
|
||||
|
|
Loading…
Reference in New Issue