Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/d3d9/d3d9_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ namespace dxvk {
return D3D_OK; //m_device->SetColorKey(colorKeyLow, colorKeyHigh);
}

HRESULT DxvkD3D8Bridge::SetLegacyLightsState(bool legacyLightsState, bool isD3DLight2) {
m_device->SetRenderState(D3DRS_NORMALIZENORMALS, legacyLightsState);
return m_device->SetLegacyLightsState(legacyLightsState, isD3DLight2);
HRESULT DxvkD3D8Bridge::SetLegacyLightsState(bool legacyLightsState) {
return m_device->SetLegacyLightsState(legacyLightsState);
}

HRESULT DxvkD3D8Bridge::UpdateTextureFromBuffer(
Expand Down
4 changes: 2 additions & 2 deletions src/d3d9/d3d9_bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ IDxvkD3D8Bridge : public IUnknown {
virtual HRESULT ResetSwapChain(D3DPRESENT_PARAMETERS* Params) = 0;
virtual HRESULT SetColorKeyState(bool colorKeyState) = 0;
virtual HRESULT SetColorKey(DWORD colorKeyLow, DWORD colorKeyHigh) = 0;
virtual HRESULT SetLegacyLightsState(bool legacyLightsState, bool isD3DLight2) = 0;
virtual HRESULT SetLegacyLightsState(bool legacyLightsState) = 0;

virtual HRESULT UpdateTextureFromBuffer(
IDirect3DSurface9* pDestSurface,
Expand Down Expand Up @@ -102,7 +102,7 @@ namespace dxvk {
HRESULT ResetSwapChain(D3DPRESENT_PARAMETERS* Params);
HRESULT SetColorKeyState(bool colorKeyState);
HRESULT SetColorKey(DWORD colorKeyLow, DWORD colorKeyHigh);
HRESULT SetLegacyLightsState(bool legacyLightsState, bool isD3DLight2);
HRESULT SetLegacyLightsState(bool legacyLightsState);

HRESULT UpdateTextureFromBuffer(
IDirect3DSurface9* pDestSurface,
Expand Down
1 change: 0 additions & 1 deletion src/d3d9/d3d9_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6896,7 +6896,6 @@ namespace dxvk {
key.Data.Contents.EmissiveSource = m_state.renderStates[D3DRS_EMISSIVEMATERIALSOURCE] & mask;

key.Data.Contents.UseLegacyLights = m_useLegacyLights;
key.Data.Contents.IsD3DLight2 = m_isD3DLight2;

uint32_t lightCount = 0;

Expand Down
5 changes: 2 additions & 3 deletions src/d3d9/d3d9_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -929,11 +929,11 @@ namespace dxvk {

HRESULT ResetState(D3DPRESENT_PARAMETERS* pPresentationParameters);

HRESULT SetLegacyLightsState(bool legacyLightState, bool isD3DLight2) {
HRESULT SetLegacyLightsState(bool legacyLightState) {
if (likely(m_useLegacyLights != legacyLightState)) {
m_useLegacyLights = legacyLightState;
m_isD3DLight2 = isD3DLight2;
}

return D3D_OK;
}

Expand Down Expand Up @@ -1306,7 +1306,6 @@ namespace dxvk {

// D3D6 and earlier legacy light model state
bool m_useLegacyLights = false;
bool m_isD3DLight2 = false;

bool m_isD3D8Compatible;
bool m_amdATOC = false;
Expand Down
4 changes: 2 additions & 2 deletions src/d3d9/d3d9_fixed_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ namespace dxvk {

uint32_t delta = m_module.opFSub(m_vec3Type, position, vtx3);
uint32_t d = m_module.opLength(m_floatType, delta);
if (m_vsKey.Data.Contents.UseLegacyLights && m_vsKey.Data.Contents.IsD3DLight2) {
if (m_vsKey.Data.Contents.UseLegacyLights) {
d = m_module.opFSub(m_floatType, range, d);
d = m_module.opFDiv(m_floatType, d, range);
}
Expand All @@ -1096,7 +1096,7 @@ namespace dxvk {
atten = m_module.opFDiv (m_floatType, m_module.constf32(1.0f), atten);
atten = m_module.opNMin (m_floatType, atten, m_module.constf32(FLT_MAX));

if (m_vsKey.Data.Contents.UseLegacyLights && m_vsKey.Data.Contents.IsD3DLight2)
if (m_vsKey.Data.Contents.UseLegacyLights)
atten = m_module.opSelect(m_floatType, m_module.opFOrdLessThan(bool_t, d, m_module.constf32(0.0f)), m_module.constf32(0.0f), atten);
else
atten = m_module.opSelect(m_floatType, m_module.opFOrdGreaterThan(bool_t, d, range), m_module.constf32(0.0f), atten);
Expand Down
1 change: 0 additions & 1 deletion src/d3d9/d3d9_fixed_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ namespace dxvk {
uint32_t LightCount : 4;

uint32_t UseLegacyLights : 1;
uint32_t IsD3DLight2 : 1;

uint32_t TexcoordDeclMask : 24;
uint32_t HasFog : 1;
Expand Down
Loading
Loading