Merge pull request #1771 from PatrickvL/correct_render_state_info
Corrections in render state information
This commit is contained in:
commit
81bf7e06c7
|
@ -6192,8 +6192,8 @@ VOID __fastcall XTL::EMUPATCH(D3DDevice_SetRenderState_Simple)
|
|||
|
||||
// Fetch the RenderState conversion info for the given input
|
||||
int XboxRenderStateIndex = -1;
|
||||
for (int i = 0; i <= X_D3DRS_DONOTCULLUNCOMPRESSED; i++) {
|
||||
if (DxbxRenderStateInfo[i].M == PUSH_METHOD(Method)) {
|
||||
for (int i = X_D3DRS_FIRST; i <= X_D3DRS_LAST; i++) {
|
||||
if (GetDxbxRenderStateInfo(i).M == PUSH_METHOD(Method)) {
|
||||
XboxRenderStateIndex = i;
|
||||
break;
|
||||
}
|
||||
|
@ -6201,11 +6201,11 @@ VOID __fastcall XTL::EMUPATCH(D3DDevice_SetRenderState_Simple)
|
|||
|
||||
// If we could not map it, log and return
|
||||
if (XboxRenderStateIndex == -1) {
|
||||
EmuLog(LOG_LEVEL::WARNING, "RenderState_Simple(0x%.08X (%s), 0x%.08X) could not be found in RenderState table", Method, DxbxRenderStateInfo[XboxRenderStateIndex].S, Value);
|
||||
EmuLog(LOG_LEVEL::WARNING, "RenderState_Simple(0x%.08X (%s), 0x%.08X) could not be found in RenderState table", Method, GetDxbxRenderStateInfo(XboxRenderStateIndex).S, Value);
|
||||
return;
|
||||
}
|
||||
|
||||
EmuLog(LOG_LEVEL::DEBUG, "RenderState_Simple: %s = 0x%08X", DxbxRenderStateInfo[XboxRenderStateIndex].S, Value);
|
||||
EmuLog(LOG_LEVEL::DEBUG, "RenderState_Simple: %s = 0x%08X", GetDxbxRenderStateInfo(XboxRenderStateIndex).S, Value);
|
||||
|
||||
XboxRenderStates.SetXboxRenderState(XboxRenderStateIndex, Value);
|
||||
}
|
||||
|
|
|
@ -57,6 +57,17 @@ bool XboxRenderStateConverter::Init()
|
|||
return true;
|
||||
}
|
||||
|
||||
bool IsRenderStateAvailableInCurrentXboxD3D8Lib(RenderStateInfo& aRenderStateInfo)
|
||||
{
|
||||
bool bIsRenderStateAvailable = (aRenderStateInfo.V <= g_LibVersion_D3D8);
|
||||
if (aRenderStateInfo.R > 0) { // Applies to XTL::X_D3DRS_MULTISAMPLETYPE
|
||||
// Note : X_D3DRS_MULTISAMPLETYPE seems the only render state that got
|
||||
// removed (from 4039 onwards), so we check that limitation here as well
|
||||
bIsRenderStateAvailable &= (g_LibVersion_D3D8 < aRenderStateInfo.R);
|
||||
}
|
||||
return bIsRenderStateAvailable;
|
||||
}
|
||||
|
||||
void XboxRenderStateConverter::VerifyAndFixDeferredRenderStateOffset()
|
||||
{
|
||||
DWORD CullModeOffset = g_SymbolAddresses["D3DRS_CULLMODE"];
|
||||
|
@ -68,8 +79,9 @@ void XboxRenderStateConverter::VerifyAndFixDeferredRenderStateOffset()
|
|||
|
||||
// Calculate index of D3DRS_CULLMODE for this XDK. We start counting from the first deferred state (D3DRS_FOGENABLE)
|
||||
DWORD CullModeIndex = 0;
|
||||
for (int i = XTL::X_D3DRS_FOGENABLE; i < XTL::X_D3DRS_CULLMODE; i++) {
|
||||
if (DxbxRenderStateInfo[i].V <= g_LibVersion_D3D8) {
|
||||
for (int i = XTL::X_D3DRS_DEFERRED_FIRST; i < XTL::X_D3DRS_CULLMODE; i++) {
|
||||
auto RenderStateInfo = GetDxbxRenderStateInfo(i);
|
||||
if (IsRenderStateAvailableInCurrentXboxD3D8Lib(RenderStateInfo)) {
|
||||
CullModeIndex++;
|
||||
}
|
||||
}
|
||||
|
@ -85,22 +97,23 @@ void XboxRenderStateConverter::VerifyAndFixDeferredRenderStateOffset()
|
|||
void XboxRenderStateConverter::DeriveRenderStateOffsetFromDeferredRenderStateOffset()
|
||||
{
|
||||
// When this function is called. D3D__RenderState actually points to the first deferred render state
|
||||
// this is D3DRS_FOGENABLE. We can count back from this using our RenderStateInfo table to find
|
||||
// (this is X_D3DRS_FOGENABLE). We can count back from this using our RenderStateInfo table to find
|
||||
// the start of D3D__RenderStates.
|
||||
|
||||
// Count the number of render states (for this XDK) between 0 and D3DRS_FOGENABLE
|
||||
int FogEnableOffset = 0;
|
||||
for (unsigned int RenderState = XTL::X_D3DRS_PSALPHAINPUTS0; RenderState < XTL::X_D3DRS_FOGENABLE; RenderState++) {
|
||||
// Count the number of render states (for this XDK) between 0 and the first deferred render state (D3DRS_FOGENABLE)
|
||||
int FirstDeferredRenderStateOffset = 0;
|
||||
for (unsigned int RenderState = XTL::X_D3DRS_FIRST; RenderState < XTL::X_D3DRS_DEFERRED_FIRST; RenderState++) {
|
||||
// if the current renderstate exists in this XDK version, count it
|
||||
if (DxbxRenderStateInfo[RenderState].V <= g_LibVersion_D3D8) {
|
||||
FogEnableOffset++;
|
||||
auto RenderStateInfo = GetDxbxRenderStateInfo(RenderState);
|
||||
if (IsRenderStateAvailableInCurrentXboxD3D8Lib(RenderStateInfo)) {
|
||||
FirstDeferredRenderStateOffset++;
|
||||
}
|
||||
}
|
||||
|
||||
// At this point, FogEnableOffset should point to the index of D3DRS_FOGENABLE for the given XDK
|
||||
// At this point, FirstDeferredRenderStateOffset should point to the index of D3DRS_FOGENABLE for the given XDK
|
||||
// This will be correct as long as our table DxbxRenderStateInfo is correct
|
||||
// We can get the correct 0 offset by using a negative index
|
||||
D3D__RenderState = &D3D__RenderState[-FogEnableOffset];
|
||||
D3D__RenderState = &D3D__RenderState[-FirstDeferredRenderStateOffset];
|
||||
}
|
||||
|
||||
void XboxRenderStateConverter::BuildRenderStateMappingTable()
|
||||
|
@ -110,15 +123,16 @@ void XboxRenderStateConverter::BuildRenderStateMappingTable()
|
|||
XboxRenderStateOffsets.fill(-1);
|
||||
|
||||
int XboxIndex = 0;
|
||||
for (unsigned int RenderState = XTL::X_D3DRS_PSALPHAINPUTS0; RenderState <= XTL::X_D3DRS_LAST; RenderState++) {
|
||||
if (DxbxRenderStateInfo[RenderState].V <= g_LibVersion_D3D8) {
|
||||
for (unsigned int RenderState = XTL::X_D3DRS_FIRST; RenderState <= XTL::X_D3DRS_LAST; RenderState++) {
|
||||
auto RenderStateInfo = GetDxbxRenderStateInfo(RenderState);
|
||||
if (IsRenderStateAvailableInCurrentXboxD3D8Lib(RenderStateInfo)) {
|
||||
XboxRenderStateOffsets[RenderState] = XboxIndex;
|
||||
EmuLog(LOG_LEVEL::INFO, "%s = %d", DxbxRenderStateInfo[RenderState].S, XboxIndex);
|
||||
EmuLog(LOG_LEVEL::INFO, "%s = %d", RenderStateInfo.S, XboxIndex);
|
||||
XboxIndex++;
|
||||
continue;
|
||||
}
|
||||
|
||||
EmuLog(LOG_LEVEL::INFO, "%s Not Present", DxbxRenderStateInfo[RenderState].S);
|
||||
EmuLog(LOG_LEVEL::INFO, "%s Not Present", RenderStateInfo.S);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -153,7 +167,7 @@ bool XboxRenderStateConverter::XboxRenderStateValueChanged(uint32_t State)
|
|||
void XboxRenderStateConverter::SetXboxRenderState(uint32_t State, uint32_t Value)
|
||||
{
|
||||
if (!XboxRenderStateExists(State)) {
|
||||
EmuLog(LOG_LEVEL::WARNING, "Attempt to write a Renderstate (%s) that does not exist in the current D3D8 XDK Version (%d)", DxbxRenderStateInfo[State].S, g_LibVersion_D3D8);
|
||||
EmuLog(LOG_LEVEL::WARNING, "Attempt to write a Renderstate (%s) that does not exist in the current D3D8 XDK Version (%d)", GetDxbxRenderStateInfo(State).S, g_LibVersion_D3D8);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -163,7 +177,7 @@ void XboxRenderStateConverter::SetXboxRenderState(uint32_t State, uint32_t Value
|
|||
uint32_t XboxRenderStateConverter::GetXboxRenderState(uint32_t State)
|
||||
{
|
||||
if (!XboxRenderStateExists(State)) {
|
||||
EmuLog(LOG_LEVEL::WARNING, "Attempt to read a Renderstate (%s) that does not exist in the current D3D8 XDK Version (%d)", DxbxRenderStateInfo[State].S, g_LibVersion_D3D8);
|
||||
EmuLog(LOG_LEVEL::WARNING, "Attempt to read a Renderstate (%s) that does not exist in the current D3D8 XDK Version (%d)", GetDxbxRenderStateInfo(State).S, g_LibVersion_D3D8);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -172,7 +186,7 @@ uint32_t XboxRenderStateConverter::GetXboxRenderState(uint32_t State)
|
|||
|
||||
void XboxRenderStateConverter::StoreInitialValues()
|
||||
{
|
||||
for (unsigned int RenderState = XTL::X_D3DRS_PSALPHAINPUTS0; RenderState <= XTL::X_D3DRS_LAST; RenderState++) {
|
||||
for (unsigned int RenderState = XTL::X_D3DRS_FIRST; RenderState <= XTL::X_D3DRS_LAST; RenderState++) {
|
||||
// Skip Render States that don't exist within this XDK
|
||||
if (!XboxRenderStateExists(RenderState)) {
|
||||
continue;
|
||||
|
@ -203,7 +217,7 @@ void XboxRenderStateConverter::Apply()
|
|||
}
|
||||
|
||||
auto Value = GetXboxRenderState(RenderState);
|
||||
EmuLog(LOG_LEVEL::DEBUG, "XboxRenderStateConverter::Apply(%s, %X)\n", DxbxRenderStateInfo[RenderState].S, Value);
|
||||
EmuLog(LOG_LEVEL::DEBUG, "XboxRenderStateConverter::Apply(%s, %X)\n", GetDxbxRenderStateInfo(RenderState).S, Value);
|
||||
|
||||
if (RenderState <= XTL::X_D3DRS_SIMPLE_LAST) {
|
||||
ApplySimpleRenderState(RenderState, Value);
|
||||
|
@ -219,6 +233,8 @@ void XboxRenderStateConverter::Apply()
|
|||
|
||||
void XboxRenderStateConverter::ApplySimpleRenderState(uint32_t State, uint32_t Value)
|
||||
{
|
||||
auto RenderStateInfo = GetDxbxRenderStateInfo(State);
|
||||
|
||||
switch (State) {
|
||||
case XTL::X_D3DRS_COLORWRITEENABLE: {
|
||||
DWORD OrigValue = Value;
|
||||
|
@ -278,23 +294,25 @@ void XboxRenderStateConverter::ApplySimpleRenderState(uint32_t State, uint32_t V
|
|||
break;
|
||||
default:
|
||||
// Only log missing state if it has a PC counterpart
|
||||
if (DxbxRenderStateInfo[State].PC != 0) {
|
||||
EmuLog(LOG_LEVEL::WARNING, "ApplySimpleRenderState(%s, 0x%.08X) is unimplemented!", DxbxRenderStateInfo[State].S, Value);
|
||||
if (RenderStateInfo.PC != 0) {
|
||||
EmuLog(LOG_LEVEL::WARNING, "ApplySimpleRenderState(%s, 0x%.08X) is unimplemented!", RenderStateInfo.S, Value);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Skip RenderStates that don't have a defined PC counterpart
|
||||
if (DxbxRenderStateInfo[State].PC == 0) {
|
||||
if (RenderStateInfo.PC == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
g_pD3DDevice->SetRenderState((D3DRENDERSTATETYPE)(DxbxRenderStateInfo[State].PC), Value);
|
||||
g_pD3DDevice->SetRenderState((D3DRENDERSTATETYPE)(RenderStateInfo.PC), Value);
|
||||
}
|
||||
|
||||
void XboxRenderStateConverter::ApplyDeferredRenderState(uint32_t State, uint32_t Value)
|
||||
{
|
||||
// Convert from Xbox Data Formats to PC
|
||||
auto RenderStateInfo = GetDxbxRenderStateInfo(State);
|
||||
|
||||
// Convert from Xbox Data Formats to PC
|
||||
switch (State) {
|
||||
case XTL::X_D3DRS_FOGSTART:
|
||||
case XTL::X_D3DRS_FOGEND: {
|
||||
|
@ -373,23 +391,25 @@ void XboxRenderStateConverter::ApplyDeferredRenderState(uint32_t State, uint32_t
|
|||
} break;
|
||||
default:
|
||||
// Only log missing state if it has a PC counterpart
|
||||
if (DxbxRenderStateInfo[State].PC != 0) {
|
||||
EmuLog(LOG_LEVEL::WARNING, "ApplyDeferredRenderState(%s, 0x%.08X) is unimplemented!", DxbxRenderStateInfo[State].S, Value);
|
||||
if (RenderStateInfo.PC != 0) {
|
||||
EmuLog(LOG_LEVEL::WARNING, "ApplyDeferredRenderState(%s, 0x%.08X) is unimplemented!", RenderStateInfo.S, Value);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Skip RenderStates that don't have a defined PC counterpart
|
||||
if (DxbxRenderStateInfo[State].PC == 0) {
|
||||
if (RenderStateInfo.PC == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
g_pD3DDevice->SetRenderState(DxbxRenderStateInfo[State].PC, Value);
|
||||
g_pD3DDevice->SetRenderState(RenderStateInfo.PC, Value);
|
||||
}
|
||||
|
||||
void XboxRenderStateConverter::ApplyComplexRenderState(uint32_t State, uint32_t Value)
|
||||
{
|
||||
switch (State) {
|
||||
auto RenderStateInfo = GetDxbxRenderStateInfo(State);
|
||||
|
||||
switch (State) {
|
||||
case XTL::X_D3DRS_VERTEXBLEND:
|
||||
// convert from Xbox direct3d to PC direct3d enumeration
|
||||
if (Value <= 1) {
|
||||
|
@ -439,16 +459,16 @@ void XboxRenderStateConverter::ApplyComplexRenderState(uint32_t State, uint32_t
|
|||
break;
|
||||
default:
|
||||
// Only log missing state if it has a PC counterpart
|
||||
if (DxbxRenderStateInfo[State].PC != 0) {
|
||||
EmuLog(LOG_LEVEL::WARNING, "ApplyComplexRenderState(%s, 0x%.08X) is unimplemented!", DxbxRenderStateInfo[State].S, Value);
|
||||
if (RenderStateInfo.PC != 0) {
|
||||
EmuLog(LOG_LEVEL::WARNING, "ApplyComplexRenderState(%s, 0x%.08X) is unimplemented!", RenderStateInfo.S, Value);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Skip RenderStates that don't have a defined PC counterpart
|
||||
if (DxbxRenderStateInfo[State].PC == 0) {
|
||||
if (RenderStateInfo.PC == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
g_pD3DDevice->SetRenderState(DxbxRenderStateInfo[State].PC, Value);
|
||||
g_pD3DDevice->SetRenderState(RenderStateInfo.PC, Value);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,9 @@
|
|||
|
||||
#define LOG_PREFIX CXBXR_MODULE::D3DCVT
|
||||
|
||||
#include "core\kernel\support\Emu.h"
|
||||
#include "common\Settings.hpp" // for g_LibVersion_D3D8
|
||||
#include "core\kernel\support\Emu.h"
|
||||
|
||||
#include "XbConvert.h"
|
||||
|
||||
// About format color components:
|
||||
|
@ -1330,10 +1332,18 @@ void EmuUnswizzleBox
|
|||
}
|
||||
}
|
||||
} // EmuUnswizzleBox NOPATCH
|
||||
|
||||
|
||||
// Notes :
|
||||
// * most renderstates were introduced in the (lowest known) XDK version : 3424
|
||||
// * additional renderstates were introduced between 3434 and 4627
|
||||
// * we MUST list exact versions for each of those, since their inserts impacts mapping!
|
||||
// * renderstates were finalized in 4627 (so no change after that version)
|
||||
// * renderstates after D3DRS_MULTISAMPLEMASK have no host mapping, thus no impact
|
||||
// * D3DRS_MULTISAMPLETYPE seems the only renderstate that got removed (after 3944, before 4039)
|
||||
// * all renderstates marked 3424 are also verified present in 3944
|
||||
const RenderStateInfo DxbxRenderStateInfo[] = {
|
||||
|
||||
// String Ord Version Type Method Native
|
||||
// String Ord Version Type Method Native
|
||||
{ "D3DRS_PSALPHAINPUTS0" /*= 0*/, 3424, xtDWORD, NV2A_RC_IN_ALPHA(0) },
|
||||
{ "D3DRS_PSALPHAINPUTS1" /*= 1*/, 3424, xtDWORD, NV2A_RC_IN_ALPHA(1) },
|
||||
{ "D3DRS_PSALPHAINPUTS2" /*= 2*/, 3424, xtDWORD, NV2A_RC_IN_ALPHA(2) },
|
||||
|
@ -1413,69 +1423,70 @@ const RenderStateInfo DxbxRenderStateInfo[] = {
|
|||
{ "D3DRS_BLENDCOLOR" /*= 75*/, 3424, xtD3DCOLOR, NV2A_BLEND_COLOR, D3DRS_BLENDFACTOR, "D3DCOLOR for D3DBLEND_CONSTANTCOLOR" },
|
||||
// D3D9 D3DRS_BLENDFACTOR : D3DCOLOR used for a constant blend factor during alpha blending for devices that support D3DPBLENDCAPS_BLENDFACTOR
|
||||
{ "D3DRS_SWATHWIDTH" /*= 76*/, 3424, xtD3DSWATH, NV2A_SWATH_WIDTH },
|
||||
{ "D3DRS_POLYGONOFFSETZSLOPESCALE" /*= 77*/, 3424, xtFloat, NV2A_POLYGON_OFFSET_FACTOR, D3DRS_NONE, "float Z factor for shadow maps" },
|
||||
{ "D3DRS_POLYGONOFFSETZSLOPESCALE" /*= 77*/, 3424, xtFloat, NV2A_POLYGON_OFFSET_FACTOR, D3DRS_UNSUPPORTED, "float Z factor for shadow maps" },
|
||||
{ "D3DRS_POLYGONOFFSETZOFFSET" /*= 78*/, 3424, xtFloat, NV2A_POLYGON_OFFSET_UNITS },
|
||||
{ "D3DRS_POINTOFFSETENABLE" /*= 79*/, 3424, xtBOOL, NV2A_POLYGON_OFFSET_POINT_ENABLE },
|
||||
{ "D3DRS_WIREFRAMEOFFSETENABLE" /*= 80*/, 3424, xtBOOL, NV2A_POLYGON_OFFSET_LINE_ENABLE },
|
||||
{ "D3DRS_SOLIDOFFSETENABLE" /*= 81*/, 3424, xtBOOL, NV2A_POLYGON_OFFSET_FILL_ENABLE },
|
||||
{ "D3DRS_DEPTHCLIPCONTROL" /*= 82*/, 4432, xtD3DDCC, NV2A_DEPTHCLIPCONTROL },
|
||||
{ "D3DRS_STIPPLEENABLE" /*= 83*/, 4627, xtBOOL, NV2A_POLYGON_STIPPLE_ENABLE },
|
||||
{ "D3DRS_SIMPLE_UNUSED8" /*= 84*/, 4627, xtDWORD, 0 },
|
||||
{ "D3DRS_SIMPLE_UNUSED7" /*= 85*/, 4627, xtDWORD, 0 },
|
||||
{ "D3DRS_SIMPLE_UNUSED6" /*= 86*/, 4627, xtDWORD, 0 },
|
||||
{ "D3DRS_SIMPLE_UNUSED5" /*= 87*/, 4627, xtDWORD, 0 },
|
||||
{ "D3DRS_SIMPLE_UNUSED4" /*= 88*/, 4627, xtDWORD, 0 },
|
||||
{ "D3DRS_SIMPLE_UNUSED3" /*= 89*/, 4627, xtDWORD, 0 },
|
||||
{ "D3DRS_SIMPLE_UNUSED2" /*= 90*/, 4627, xtDWORD, 0 },
|
||||
{ "D3DRS_SIMPLE_UNUSED1" /*= 91*/, 4627, xtDWORD, 0 },
|
||||
{ "D3DRS_DEPTHCLIPCONTROL" /*= 82*/, 4432, xtD3DDCC, NV2A_DEPTHCLIPCONTROL }, // Verified absent in 4361, present in 4432 TODO : Might be introduced around 4400?
|
||||
{ "D3DRS_STIPPLEENABLE" /*= 83*/, 4627, xtBOOL, NV2A_POLYGON_STIPPLE_ENABLE }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between?
|
||||
{ "D3DRS_SIMPLE_UNUSED8" /*= 84*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between?
|
||||
{ "D3DRS_SIMPLE_UNUSED7" /*= 85*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between?
|
||||
{ "D3DRS_SIMPLE_UNUSED6" /*= 86*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between?
|
||||
{ "D3DRS_SIMPLE_UNUSED5" /*= 87*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between?
|
||||
{ "D3DRS_SIMPLE_UNUSED4" /*= 88*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between?
|
||||
{ "D3DRS_SIMPLE_UNUSED3" /*= 89*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between?
|
||||
{ "D3DRS_SIMPLE_UNUSED2" /*= 90*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between?
|
||||
{ "D3DRS_SIMPLE_UNUSED1" /*= 91*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between?
|
||||
// End of "simple" render states, continuing with "deferred" render states :
|
||||
{ "D3DRS_FOGENABLE" /*= 92*/, 3424, xtBOOL, NV2A_FOG_ENABLE, D3DRS_FOGENABLE },
|
||||
{ "D3DRS_FOGTABLEMODE" /*= 93*/, 3424, xtD3DFOGMODE, NV2A_FOG_MODE, D3DRS_FOGTABLEMODE },
|
||||
{ "D3DRS_FOGSTART" /*= 94*/, 3424, xtFloat, NV2A_FOG_COORD_DIST, D3DRS_FOGSTART },
|
||||
{ "D3DRS_FOGEND" /*= 95*/, 3424, xtFloat, NV2A_FOG_MODE, D3DRS_FOGEND },
|
||||
{ "D3DRS_FOGDENSITY" /*= 96*/, 3424, xtFloat, NV2A_FOG_EQUATION_CONSTANT, D3DRS_FOGDENSITY }, // + NV2A_FOG_EQUATION_LINEAR + NV2A_FOG_EQUATION_QUADRATIC
|
||||
{ "D3DRS_RANGEFOGENABLE" /*= 97*/, 3424, xtBOOL, NV2A_FOG_COORD_DIST, D3DRS_RANGEFOGENABLE },
|
||||
{ "D3DRS_WRAP0" /*= 98*/, 3424, xtD3DWRAP, NV2A_TX_WRAP(0), D3DRS_WRAP0 },
|
||||
{ "D3DRS_WRAP1" /*= 99*/, 3424, xtD3DWRAP, NV2A_TX_WRAP(1), D3DRS_WRAP1 },
|
||||
{ "D3DRS_WRAP2" /*= 100*/, 3424, xtD3DWRAP, NV2A_TX_WRAP(2), D3DRS_WRAP2 },
|
||||
{ "D3DRS_WRAP3" /*= 101*/, 3424, xtD3DWRAP, NV2A_TX_WRAP(3), D3DRS_WRAP3 },
|
||||
{ "D3DRS_LIGHTING" /*= 102*/, 3424, xtBOOL, NV2A_LIGHT_MODEL, D3DRS_LIGHTING }, // TODO : Needs push-buffer data conversion
|
||||
{ "D3DRS_SPECULARENABLE" /*= 103*/, 3424, xtBOOL, NV2A_RC_FINAL0, D3DRS_SPECULARENABLE },
|
||||
{ "D3DRS_LOCALVIEWER" /*= 104*/, 3424, xtBOOL, 0, D3DRS_LOCALVIEWER },
|
||||
{ "D3DRS_COLORVERTEX" /*= 105*/, 3424, xtBOOL, 0, D3DRS_COLORVERTEX },
|
||||
{ "D3DRS_BACKSPECULARMATERIALSOURCE" /*= 106*/, 3424, xtD3DMCS, 0 }, // nsp.
|
||||
{ "D3DRS_BACKDIFFUSEMATERIALSOURCE" /*= 107*/, 3424, xtD3DMCS, 0 }, // nsp.
|
||||
{ "D3DRS_BACKAMBIENTMATERIALSOURCE" /*= 108*/, 3424, xtD3DMCS, 0 }, // nsp.
|
||||
{ "D3DRS_BACKEMISSIVEMATERIALSOURCE" /*= 109*/, 3424, xtD3DMCS, 0 }, // nsp.
|
||||
{ "D3DRS_SPECULARMATERIALSOURCE" /*= 110*/, 3424, xtD3DMCS, NV2A_COLOR_MATERIAL, D3DRS_SPECULARMATERIALSOURCE },
|
||||
{ "D3DRS_DIFFUSEMATERIALSOURCE" /*= 111*/, 3424, xtD3DMCS, 0, D3DRS_DIFFUSEMATERIALSOURCE },
|
||||
{ "D3DRS_AMBIENTMATERIALSOURCE" /*= 112*/, 3424, xtD3DMCS, 0, D3DRS_AMBIENTMATERIALSOURCE },
|
||||
{ "D3DRS_EMISSIVEMATERIALSOURCE" /*= 113*/, 3424, xtD3DMCS, 0, D3DRS_EMISSIVEMATERIALSOURCE },
|
||||
{ "D3DRS_BACKAMBIENT" /*= 114*/, 3424, xtD3DCOLOR, NV2A_LIGHT_MODEL_BACK_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_R }, // ..NV2A_MATERIAL_FACTOR_BACK_B nsp. Was NV2A_LIGHT_MODEL_BACK_AMBIENT_R
|
||||
{ "D3DRS_AMBIENT" /*= 115*/, 3424, xtD3DCOLOR, NV2A_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_R, D3DRS_AMBIENT }, // ..NV2A_LIGHT_MODEL_FRONT_AMBIENT_B + NV2A_MATERIAL_FACTOR_FRONT_R..NV2A_MATERIAL_FACTOR_FRONT_A Was NV2A_LIGHT_MODEL_FRONT_AMBIENT_R
|
||||
{ "D3DRS_POINTSIZE" /*= 116*/, 3424, xtFloat, NV2A_POINT_PARAMETER(0), D3DRS_POINTSIZE },
|
||||
{ "D3DRS_POINTSIZE_MIN" /*= 117*/, 3424, xtFloat, 0, D3DRS_POINTSIZE_MIN },
|
||||
{ "D3DRS_POINTSPRITEENABLE" /*= 118*/, 3424, xtBOOL, NV2A_POINT_SMOOTH_ENABLE, D3DRS_POINTSPRITEENABLE },
|
||||
{ "D3DRS_POINTSCALEENABLE" /*= 119*/, 3424, xtBOOL, NV2A_POINT_PARAMETERS_ENABLE, D3DRS_POINTSCALEENABLE },
|
||||
{ "D3DRS_POINTSCALE_A" /*= 120*/, 3424, xtFloat, 0, D3DRS_POINTSCALE_A },
|
||||
{ "D3DRS_POINTSCALE_B" /*= 121*/, 3424, xtFloat, 0, D3DRS_POINTSCALE_B },
|
||||
{ "D3DRS_POINTSCALE_C" /*= 122*/, 3424, xtFloat, 0, D3DRS_POINTSCALE_C },
|
||||
{ "D3DRS_POINTSIZE_MAX" /*= 123*/, 3424, xtFloat, 0, D3DRS_POINTSIZE_MAX },
|
||||
{ "D3DRS_PATCHEDGESTYLE" /*= 124*/, 3424, xtDWORD, 0, D3DRS_PATCHEDGESTYLE }, // D3DPATCHEDGESTYLE?
|
||||
{ "D3DRS_PATCHSEGMENTS" /*= 125*/, 3424, xtDWORD, 0 }, // nsp. // D3DRS_PATCHSEGMENTS exists in Direct3D 8, but not in 9 !?
|
||||
// Verified as XDK 3911 Deferred RenderStates (3424 yet to do)
|
||||
{ "D3DRS_FOGENABLE" /*= 92*/, 3424, xtBOOL, NV2A_FOG_ENABLE, D3DRS_FOGENABLE }, // TRUE to enable fog blending
|
||||
{ "D3DRS_FOGTABLEMODE" /*= 93*/, 3424, xtD3DFOGMODE, NV2A_FOG_MODE, D3DRS_FOGTABLEMODE }, // D3DFOGMODE
|
||||
{ "D3DRS_FOGSTART" /*= 94*/, 3424, xtFloat, NV2A_FOG_COORD_DIST, D3DRS_FOGSTART }, // float fog start (for both vertex and pixel fog)
|
||||
{ "D3DRS_FOGEND" /*= 95*/, 3424, xtFloat, NV2A_FOG_MODE, D3DRS_FOGEND }, // float fog end
|
||||
{ "D3DRS_FOGDENSITY" /*= 96*/, 3424, xtFloat, NV2A_FOG_EQUATION_CONSTANT, D3DRS_FOGDENSITY }, // float fog density // + NV2A_FOG_EQUATION_LINEAR + NV2A_FOG_EQUATION_QUADRATIC
|
||||
{ "D3DRS_RANGEFOGENABLE" /*= 97*/, 3424, xtBOOL, NV2A_FOG_COORD_DIST, D3DRS_RANGEFOGENABLE }, // TRUE to enable range-based fog
|
||||
{ "D3DRS_WRAP0" /*= 98*/, 3424, xtD3DWRAP, NV2A_TX_WRAP(0), D3DRS_WRAP0 }, // D3DWRAP* flags (D3DWRAP_U, D3DWRAPCOORD_0, etc.) for 1st texture coord.
|
||||
{ "D3DRS_WRAP1" /*= 99*/, 3424, xtD3DWRAP, NV2A_TX_WRAP(1), D3DRS_WRAP1 }, // D3DWRAP* flags (D3DWRAP_U, D3DWRAPCOORD_0, etc.) for 2nd texture coord.
|
||||
{ "D3DRS_WRAP2" /*= 100*/, 3424, xtD3DWRAP, NV2A_TX_WRAP(2), D3DRS_WRAP2 }, // D3DWRAP* flags (D3DWRAP_U, D3DWRAPCOORD_0, etc.) for 3rd texture coord.
|
||||
{ "D3DRS_WRAP3" /*= 101*/, 3424, xtD3DWRAP, NV2A_TX_WRAP(3), D3DRS_WRAP3 }, // D3DWRAP* flags (D3DWRAP_U, D3DWRAPCOORD_0, etc.) for 4th texture coord.
|
||||
{ "D3DRS_LIGHTING" /*= 102*/, 3424, xtBOOL, NV2A_LIGHT_MODEL, D3DRS_LIGHTING }, // TRUE to enable lighting // TODO : Needs push-buffer data conversion
|
||||
{ "D3DRS_SPECULARENABLE" /*= 103*/, 3424, xtBOOL, NV2A_RC_FINAL0, D3DRS_SPECULARENABLE }, // TRUE to enable specular
|
||||
{ "D3DRS_LOCALVIEWER" /*= 104*/, 3424, xtBOOL, 0, D3DRS_LOCALVIEWER }, // TRUE to enable camera-relative specular highlights
|
||||
{ "D3DRS_COLORVERTEX" /*= 105*/, 3424, xtBOOL, 0, D3DRS_COLORVERTEX }, // TRUE to enable per-vertex color
|
||||
{ "D3DRS_BACKSPECULARMATERIALSOURCE" /*= 106*/, 3424, xtD3DMCS, 0 }, // D3DMATERIALCOLORSOURCE (Xbox extension) nsp.
|
||||
{ "D3DRS_BACKDIFFUSEMATERIALSOURCE" /*= 107*/, 3424, xtD3DMCS, 0 }, // D3DMATERIALCOLORSOURCE (Xbox extension) nsp.
|
||||
{ "D3DRS_BACKAMBIENTMATERIALSOURCE" /*= 108*/, 3424, xtD3DMCS, 0 }, // D3DMATERIALCOLORSOURCE (Xbox extension) nsp.
|
||||
{ "D3DRS_BACKEMISSIVEMATERIALSOURCE" /*= 109*/, 3424, xtD3DMCS, 0 }, // D3DMATERIALCOLORSOURCE (Xbox extension) nsp.
|
||||
{ "D3DRS_SPECULARMATERIALSOURCE" /*= 110*/, 3424, xtD3DMCS, NV2A_COLOR_MATERIAL, D3DRS_SPECULARMATERIALSOURCE }, // D3DMATERIALCOLORSOURCE
|
||||
{ "D3DRS_DIFFUSEMATERIALSOURCE" /*= 111*/, 3424, xtD3DMCS, 0, D3DRS_DIFFUSEMATERIALSOURCE }, // D3DMATERIALCOLORSOURCE
|
||||
{ "D3DRS_AMBIENTMATERIALSOURCE" /*= 112*/, 3424, xtD3DMCS, 0, D3DRS_AMBIENTMATERIALSOURCE }, // D3DMATERIALCOLORSOURCE
|
||||
{ "D3DRS_EMISSIVEMATERIALSOURCE" /*= 113*/, 3424, xtD3DMCS, 0, D3DRS_EMISSIVEMATERIALSOURCE }, // D3DMATERIALCOLORSOURCE
|
||||
{ "D3DRS_BACKAMBIENT" /*= 114*/, 3424, xtD3DCOLOR, NV2A_LIGHT_MODEL_BACK_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_R }, // D3DCOLOR (Xbox extension) // ..NV2A_MATERIAL_FACTOR_BACK_B nsp. Was NV2A_LIGHT_MODEL_BACK_AMBIENT_R
|
||||
{ "D3DRS_AMBIENT" /*= 115*/, 3424, xtD3DCOLOR, NV2A_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_R, D3DRS_AMBIENT }, // D3DCOLOR // ..NV2A_LIGHT_MODEL_FRONT_AMBIENT_B + NV2A_MATERIAL_FACTOR_FRONT_R..NV2A_MATERIAL_FACTOR_FRONT_A Was NV2A_LIGHT_MODEL_FRONT_AMBIENT_R
|
||||
{ "D3DRS_POINTSIZE" /*= 116*/, 3424, xtFloat, NV2A_POINT_PARAMETER(0), D3DRS_POINTSIZE }, // float point size
|
||||
{ "D3DRS_POINTSIZE_MIN" /*= 117*/, 3424, xtFloat, 0, D3DRS_POINTSIZE_MIN }, // float point size min threshold
|
||||
{ "D3DRS_POINTSPRITEENABLE" /*= 118*/, 3424, xtBOOL, NV2A_POINT_SMOOTH_ENABLE, D3DRS_POINTSPRITEENABLE }, // TRUE to enable point sprites
|
||||
{ "D3DRS_POINTSCALEENABLE" /*= 119*/, 3424, xtBOOL, NV2A_POINT_PARAMETERS_ENABLE, D3DRS_POINTSCALEENABLE }, // TRUE to enable point size scaling
|
||||
{ "D3DRS_POINTSCALE_A" /*= 120*/, 3424, xtFloat, 0, D3DRS_POINTSCALE_A }, // float point attenuation A value
|
||||
{ "D3DRS_POINTSCALE_B" /*= 121*/, 3424, xtFloat, 0, D3DRS_POINTSCALE_B }, // float point attenuation B value
|
||||
{ "D3DRS_POINTSCALE_C" /*= 122*/, 3424, xtFloat, 0, D3DRS_POINTSCALE_C }, // float point attenuation C value
|
||||
{ "D3DRS_POINTSIZE_MAX" /*= 123*/, 3424, xtFloat, 0, D3DRS_POINTSIZE_MAX }, // float point size max threshold
|
||||
{ "D3DRS_PATCHEDGESTYLE" /*= 124*/, 3424, xtDWORD, 0, D3DRS_PATCHEDGESTYLE }, // D3DPATCHEDGESTYLE
|
||||
{ "D3DRS_PATCHSEGMENTS" /*= 125*/, 3424, xtDWORD, 0 }, // DWORD number of segments per edge when drawing patches, nsp (D3DRS_PATCHSEGMENTS exists in Direct3D 8, but not in 9)
|
||||
// TODO -oDxbx : Is X_D3DRS_SWAPFILTER really a xtD3DMULTISAMPLE_TYPE?
|
||||
{ "D3DRS_SWAPFILTER" /*= 126*/, 4039, xtD3DMULTISAMPLE_TYPE, 0, D3DRS_NONE, "D3DTEXF_LINEAR etc. filter to use for Swap" }, // nsp.
|
||||
{ "D3DRS_PRESENTATIONINTERVAL" /*= 127*/, 4627, xtDWORD, 0 }, // nsp.
|
||||
{ "D3DRS_DEFERRED_UNUSED8" /*= 128*/, 4627, xtDWORD, 0 },
|
||||
{ "D3DRS_DEFERRED_UNUSED7" /*= 129*/, 4627, xtDWORD, 0 },
|
||||
{ "D3DRS_DEFERRED_UNUSED6" /*= 130*/, 4627, xtDWORD, 0 },
|
||||
{ "D3DRS_DEFERRED_UNUSED5" /*= 131*/, 4627, xtDWORD, 0 },
|
||||
{ "D3DRS_DEFERRED_UNUSED4" /*= 132*/, 4627, xtDWORD, 0 },
|
||||
{ "D3DRS_DEFERRED_UNUSED3" /*= 133*/, 4627, xtDWORD, 0 },
|
||||
{ "D3DRS_DEFERRED_UNUSED2" /*= 134*/, 4627, xtDWORD, 0 },
|
||||
{ "D3DRS_DEFERRED_UNUSED1" /*= 135*/, 4627, xtDWORD, 0 },
|
||||
{ "D3DRS_SWAPFILTER" /*= 126*/, 4039, xtD3DMULTISAMPLE_TYPE, 0, D3DRS_UNSUPPORTED, "D3DTEXF_LINEAR etc. filter to use for Swap" }, // nsp. Verified absent in 3944, present in 4039 TODO : Might be introduced in 4034?
|
||||
{ "D3DRS_PRESENTATIONINTERVAL" /*= 127*/, 4627, xtDWORD, 0 }, // nsp. Verified absent in 4531, present in 4627 TODO : might be introduced in between?
|
||||
{ "D3DRS_DEFERRED_UNUSED8" /*= 128*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between?
|
||||
{ "D3DRS_DEFERRED_UNUSED7" /*= 129*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between?
|
||||
{ "D3DRS_DEFERRED_UNUSED6" /*= 130*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between?
|
||||
{ "D3DRS_DEFERRED_UNUSED5" /*= 131*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between?
|
||||
{ "D3DRS_DEFERRED_UNUSED4" /*= 132*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between?
|
||||
{ "D3DRS_DEFERRED_UNUSED3" /*= 133*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between?
|
||||
{ "D3DRS_DEFERRED_UNUSED2" /*= 134*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between?
|
||||
{ "D3DRS_DEFERRED_UNUSED1" /*= 135*/, 4627, xtDWORD, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between?
|
||||
// End of "deferred" render states, continuing with "complex" render states :
|
||||
{ "D3DRS_PSTEXTUREMODES" /*= 136*/, 3424, xtDWORD, 0 },
|
||||
{ "D3DRS_PSTEXTUREMODES" /*= 136*/, 3424, xtDWORD, 0 }, // This is where pPSDef->PSTextureModes is stored (outside the pPSDEF - see DxbxUpdateActivePixelShader)
|
||||
{ "D3DRS_VERTEXBLEND" /*= 137*/, 3424, xtD3DVERTEXBLENDFLAGS, NV2A_SKIN_MODE, D3DRS_VERTEXBLEND },
|
||||
{ "D3DRS_FOGCOLOR" /*= 138*/, 3424, xtD3DCOLOR, NV2A_FOG_COLOR, D3DRS_FOGCOLOR }, // SwapRgb
|
||||
{ "D3DRS_FILLMODE" /*= 139*/, 3424, xtD3DFILLMODE, NV2A_POLYGON_MODE_FRONT, D3DRS_FILLMODE },
|
||||
|
@ -1493,20 +1504,25 @@ const RenderStateInfo DxbxRenderStateInfo[] = {
|
|||
{ "D3DRS_EDGEANTIALIAS" /*= 151*/, 3424, xtBOOL, NV2A_LINE_SMOOTH_ENABLE, D3DRS_ANTIALIASEDLINEENABLE }, // Was D3DRS_EDGEANTIALIAS. Dxbx note : No Xbox ext. (according to Direct3D8) !
|
||||
{ "D3DRS_MULTISAMPLEANTIALIAS" /*= 152*/, 3424, xtBOOL, NV2A_MULTISAMPLE_CONTROL, D3DRS_MULTISAMPLEANTIALIAS },
|
||||
{ "D3DRS_MULTISAMPLEMASK" /*= 153*/, 3424, xtDWORD, NV2A_MULTISAMPLE_CONTROL, D3DRS_MULTISAMPLEMASK },
|
||||
// { "D3DRS_MULTISAMPLETYPE" /*= 154*/, 3424, xtD3DMULTISAMPLE_TYPE, 0 }, // [-3911] \_ aliasses D3DMULTISAMPLE_TYPE
|
||||
{ "D3DRS_MULTISAMPLEMODE" /*= 154*/, 3425 /* really 4361 but shares slot with previous entry */, xtD3DMULTISAMPLEMODE, 0 }, // [4361+] / D3DMULTISAMPLEMODE for the backbuffer
|
||||
{ "D3DRS_MULTISAMPLERENDERTARGETMODE" /*= 155*/, 4242, xtD3DMULTISAMPLEMODE, NV2A_RT_FORMAT },
|
||||
{ "D3DRS_SHADOWFUNC" /*= 156*/, 3424, xtD3DCMPFUNC, NV2A_TX_RCOMP },
|
||||
{ "D3DRS_LINEWIDTH" /*= 157*/, 3424, xtFloat, NV2A_LINE_WIDTH },
|
||||
{ "D3DRS_SAMPLEALPHA" /*= 158*/, 4627, xtD3DSAMPLEALPHA, 0 }, // TODO : Later than 3424, but earlier then 4627?
|
||||
{ "D3DRS_DXT1NOISEENABLE" /*= 159*/, 3424, xtBOOL, NV2A_CLEAR_DEPTH_VALUE },
|
||||
{ "D3DRS_YUVENABLE" /*= 160*/, 3911, xtBOOL, NV2A_CONTROL0 },
|
||||
{ "D3DRS_OCCLUSIONCULLENABLE" /*= 161*/, 3911, xtBOOL, NV2A_OCCLUDE_ZSTENCIL_EN },
|
||||
{ "D3DRS_STENCILCULLENABLE" /*= 162*/, 3911, xtBOOL, NV2A_OCCLUDE_ZSTENCIL_EN },
|
||||
{ "D3DRS_ROPZCMPALWAYSREAD" /*= 163*/, 3911, xtBOOL, 0 },
|
||||
{ "D3DRS_ROPZREAD" /*= 164*/, 3911, xtBOOL, 0 },
|
||||
{ "D3DRS_DONOTCULLUNCOMPRESSED" /*= 165*/, 3911, xtBOOL, 0 }
|
||||
{ "D3DRS_MULTISAMPLETYPE" /*= 154*/, 3424, xtD3DMULTISAMPLE_TYPE, 0, D3DRS_UNSUPPORTED, "aliasses D3DMULTISAMPLE_TYPE, removed from 4039 onward", 4039 }, // Verified present in 3944, removed in 4039 TODO : Might be removed in 4034?
|
||||
{ "D3DRS_MULTISAMPLEMODE" /*= 155*/, 4039, xtD3DMULTISAMPLEMODE, 0 }, // D3DMULTISAMPLEMODE for the backbuffer. Verified absent in 3944, present in 4039 TODO : Might be introduced in 4034?
|
||||
{ "D3DRS_MULTISAMPLERENDERTARGETMODE" /*= 156*/, 4034, xtD3DMULTISAMPLEMODE, NV2A_RT_FORMAT }, // Verified absent in 3944, present in 4039. Presence in 4034 is based on test-case : The Simpsons Road Rage
|
||||
{ "D3DRS_SHADOWFUNC" /*= 157*/, 3424, xtD3DCMPFUNC, NV2A_TX_RCOMP },
|
||||
{ "D3DRS_LINEWIDTH" /*= 158*/, 3424, xtFloat, NV2A_LINE_WIDTH },
|
||||
{ "D3DRS_SAMPLEALPHA" /*= 159*/, 4627, xtD3DSAMPLEALPHA, 0 }, // Verified absent in 4531, present in 4627 TODO : might be introduced in between?
|
||||
{ "D3DRS_DXT1NOISEENABLE" /*= 160*/, 3424, xtBOOL, NV2A_CLEAR_DEPTH_VALUE },
|
||||
{ "D3DRS_YUVENABLE" /*= 161*/, 3911, xtBOOL, NV2A_CONTROL0 }, // Verified present in 3944
|
||||
{ "D3DRS_OCCLUSIONCULLENABLE" /*= 162*/, 3911, xtBOOL, NV2A_OCCLUDE_ZSTENCIL_EN }, // Verified present in 3944
|
||||
{ "D3DRS_STENCILCULLENABLE" /*= 163*/, 3911, xtBOOL, NV2A_OCCLUDE_ZSTENCIL_EN }, // Verified present in 3944
|
||||
{ "D3DRS_ROPZCMPALWAYSREAD" /*= 164*/, 3911, xtBOOL, 0 }, // Verified present in 3944
|
||||
{ "D3DRS_ROPZREAD" /*= 165*/, 3911, xtBOOL, 0 }, // Verified present in 3944
|
||||
{ "D3DRS_DONOTCULLUNCOMPRESSED" /*= 166*/, 3911, xtBOOL, 0 } // Verified present in 3944
|
||||
};
|
||||
|
||||
const RenderStateInfo& GetDxbxRenderStateInfo(int State)
|
||||
{
|
||||
return DxbxRenderStateInfo[State];
|
||||
}
|
||||
|
||||
/*Direct3D8 states unused :
|
||||
D3DRS_LINEPATTERN
|
||||
|
|
|
@ -1810,12 +1810,14 @@ typedef struct _RenderStateInfo {
|
|||
TXBType T = xt_Unknown; // The Xbox data type. Defaults to xt_Unknown.
|
||||
XTL::NV2AMETHOD M; // The related push buffer method. Not always a 1-to-1 mapping. Needs push-buffer interpretation & conversion code.
|
||||
D3DRENDERSTATETYPE PC = (D3DRENDERSTATETYPE)0; // Map XBox to PC render state
|
||||
char *N; // XDK notes. Defaults to ''.
|
||||
char *N; // XDK notes. Defaults to ''.
|
||||
WORD R; // The XDK version since which a render state was removed
|
||||
}
|
||||
RenderStateInfo;
|
||||
|
||||
#define D3DRS_NONE ((D3DRENDERSTATETYPE)0)
|
||||
#define D3DRS_UNSUPPORTED ((D3DRENDERSTATETYPE)0)
|
||||
|
||||
extern const RenderStateInfo& GetDxbxRenderStateInfo(int State);
|
||||
|
||||
extern const RenderStateInfo DxbxRenderStateInfo[];
|
||||
|
||||
#endif
|
||||
|
|
|
@ -84,8 +84,8 @@
|
|||
#define IDirect3DSwapChain IDirect3DSwapChain9
|
||||
#define IDirect3DQuery IDirect3DQuery9
|
||||
|
||||
namespace XTL {
|
||||
|
||||
namespace XTL {
|
||||
|
||||
// TODO : Declare these aliasses as Xbox type
|
||||
typedef D3DLIGHT9 X_D3DLIGHT8;
|
||||
typedef D3DMATERIAL9 X_D3DMATERIAL8;
|
||||
|
@ -649,7 +649,7 @@ typedef enum _X_D3DRENDERSTATETYPE {
|
|||
|
||||
// Dxbx note : These declarations are from XDK version 5933, the most recent and complete version.
|
||||
// Older versions are slightly different (some members are missing), so we use a mapping table to
|
||||
// cater for the differences (see DxbxBuildRenderStateMappingTable). This enables to ignore these
|
||||
// cater for the differences (see XboxRenderStateConverter::BuildRenderStateMappingTable). This enables to ignore these
|
||||
// version-differences in the rest of our code (unless it matters somehow); We write like this :
|
||||
// XboxRenderStates.SetXboxRenderState(X_D3DRENDERSTATETYPE, Value);
|
||||
//
|
||||
|
@ -737,14 +737,14 @@ typedef enum _X_D3DRENDERSTATETYPE {
|
|||
X_D3DRS_STENCILMASK = 72, // BYTE mask value used in stencil test
|
||||
X_D3DRS_STENCILWRITEMASK = 73, // BYTE write mask applied to values written to stencil buffer
|
||||
X_D3DRS_BLENDOP = 74, // D3DBLENDOP setting
|
||||
X_D3DRS_BLENDCOLOR = 75, // D3DCOLOR for D3DBLEND_CONSTANTCOLOR (Xbox ext.)
|
||||
X_D3DRS_BLENDCOLOR = 75, // D3DCOLOR for D3DBLEND_CONSTANTCOLOR
|
||||
X_D3DRS_SWATHWIDTH = 76, // D3DSWATHWIDTH (Xbox ext.)
|
||||
X_D3DRS_POLYGONOFFSETZSLOPESCALE = 77, // float Z factor for shadow maps (Xbox ext.)
|
||||
X_D3DRS_POLYGONOFFSETZOFFSET = 78, // Xbox ext.
|
||||
X_D3DRS_POINTOFFSETENABLE = 79, // Xbox ext.
|
||||
X_D3DRS_WIREFRAMEOFFSETENABLE = 80, // Xbox ext.
|
||||
X_D3DRS_SOLIDOFFSETENABLE = 81, // Xbox ext.
|
||||
X_D3DRS_DEPTHCLIPCONTROL = 82, // [4627+] Xbox ext.
|
||||
X_D3DRS_DEPTHCLIPCONTROL = 82, // [4432+] Xbox ext.
|
||||
X_D3DRS_STIPPLEENABLE = 83, // [4627+] Xbox ext.
|
||||
X_D3DRS_SIMPLE_UNUSED8 = 84, // [4627+]
|
||||
X_D3DRS_SIMPLE_UNUSED7 = 85, // [4627+]
|
||||
|
@ -789,8 +789,8 @@ typedef enum _X_D3DRENDERSTATETYPE {
|
|||
X_D3DRS_POINTSIZE_MAX = 123,
|
||||
X_D3DRS_PATCHEDGESTYLE = 124, // Dxbx addition
|
||||
X_D3DRS_PATCHSEGMENTS = 125,
|
||||
X_D3DRS_SWAPFILTER = 126, // [4361+] Xbox ext. nsp. D3DTEXF_LINEAR etc. filter to use for Swap
|
||||
X_D3DRS_PRESENTATIONINTERVAL = 127, // [4627+] Xbox ext. nsp.
|
||||
X_D3DRS_SWAPFILTER = 126, // [4039+] Xbox ext. nsp. D3DTEXF_LINEAR etc. filter to use for Swap
|
||||
X_D3DRS_PRESENTATIONINTERVAL = 127, // [4627+] Xbox ext. nsp. TODO : Use 4361?
|
||||
X_D3DRS_DEFERRED_UNUSED8 = 128, // [4627+]
|
||||
X_D3DRS_DEFERRED_UNUSED7 = 129, // [4627+]
|
||||
X_D3DRS_DEFERRED_UNUSED6 = 130, // [4627+]
|
||||
|
@ -814,23 +814,24 @@ typedef enum _X_D3DRENDERSTATETYPE {
|
|||
X_D3DRS_CULLMODE = 147,
|
||||
X_D3DRS_TEXTUREFACTOR = 148,
|
||||
X_D3DRS_ZBIAS = 149,
|
||||
X_D3DRS_LOGICOP = 150, // Xbox ext.
|
||||
X_D3DRS_LOGICOP = 150, // Xbox ext. nsp.
|
||||
X_D3DRS_EDGEANTIALIAS = 151, // Dxbx note : No Xbox ext. (according to Direct3D8) !
|
||||
X_D3DRS_MULTISAMPLEANTIALIAS = 152,
|
||||
X_D3DRS_MULTISAMPLEMASK = 153,
|
||||
X_D3DRS_MULTISAMPLETYPE = 154, // [-3911] Xbox ext. \_ aliasses D3DMULTISAMPLE_TYPE
|
||||
X_D3DRS_MULTISAMPLEMODE = 154, // [4361+] Xbox ext. / D3DMULTISAMPLEMODE for the backbuffer
|
||||
X_D3DRS_MULTISAMPLERENDERTARGETMODE = 155, // [4361+] Xbox ext.
|
||||
X_D3DRS_SHADOWFUNC = 156, // D3DCMPFUNC (Xbox extension)
|
||||
X_D3DRS_LINEWIDTH = 157, // Xbox ext.
|
||||
X_D3DRS_SAMPLEALPHA = 158, // Xbox ext.
|
||||
X_D3DRS_DXT1NOISEENABLE = 159, // Xbox ext.
|
||||
X_D3DRS_YUVENABLE = 160, // [3911+] Xbox ext.
|
||||
X_D3DRS_OCCLUSIONCULLENABLE = 161, // [3911+] Xbox ext.
|
||||
X_D3DRS_STENCILCULLENABLE = 162, // [3911+] Xbox ext.
|
||||
X_D3DRS_ROPZCMPALWAYSREAD = 163, // [3911+] Xbox ext.
|
||||
X_D3DRS_ROPZREAD = 164, // [3911+] Xbox ext.
|
||||
X_D3DRS_DONOTCULLUNCOMPRESSED = 165, // [3911+] Xbox ext.
|
||||
X_D3DRS_MULTISAMPLETYPE = 154, // [-4039] Xbox ext.
|
||||
// Note : X_D3DRS_MULTISAMPLETYPE seems the only one that got removed, but it does need a slot, so the rest is increased by 1 compared to 5933.
|
||||
X_D3DRS_MULTISAMPLEMODE = 155, // [4361+] Xbox ext. // D3DMULTISAMPLEMODE for the backbuffer
|
||||
X_D3DRS_MULTISAMPLERENDERTARGETMODE = 156, // [4039+] Xbox ext.
|
||||
X_D3DRS_SHADOWFUNC = 157, // D3DCMPFUNC (Xbox extension)
|
||||
X_D3DRS_LINEWIDTH = 158, // Xbox ext.
|
||||
X_D3DRS_SAMPLEALPHA = 159, // Xbox ext.
|
||||
X_D3DRS_DXT1NOISEENABLE = 160, // Xbox ext.
|
||||
X_D3DRS_YUVENABLE = 161, // [3911+] Xbox ext.
|
||||
X_D3DRS_OCCLUSIONCULLENABLE = 162, // [3911+] Xbox ext.
|
||||
X_D3DRS_STENCILCULLENABLE = 163, // [3911+] Xbox ext.
|
||||
X_D3DRS_ROPZCMPALWAYSREAD = 164, // [3911+] Xbox ext.
|
||||
X_D3DRS_ROPZREAD = 165, // [3911+] Xbox ext.
|
||||
X_D3DRS_DONOTCULLUNCOMPRESSED = 166, // [3911+] Xbox ext.
|
||||
// End of "complex" render states.
|
||||
X_D3DRS_UNK = 0x7fffffff // deferred render state "unknown" flag
|
||||
} X_D3DRENDERSTATETYPE;
|
||||
|
@ -1211,6 +1212,6 @@ typedef DWORD NV2AMETHOD;
|
|||
// Host vertex shader counts
|
||||
#define CXBX_D3DVS_CONSTREG_VERTEXDATA4F_BASE (X_D3DVS_CONSTREG_COUNT + 1)
|
||||
|
||||
} // end of namespace XTL
|
||||
} // end of namespace XTL
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue