mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[d3d9] Don't perform clipping in FF if disabled
Avoids unnecessary matrix multiplications in the shader, given this isn't as cheap as it is for programmable.
This commit is contained in:
parent
0c16cc7749
commit
7d3ec74b40
@ -1668,6 +1668,8 @@ namespace dxvk {
|
|||||||
bool changed = states[State] != Value;
|
bool changed = states[State] != Value;
|
||||||
|
|
||||||
if (likely(changed)) {
|
if (likely(changed)) {
|
||||||
|
const bool oldClipPlaneEnabled = IsClipPlaneEnabled();
|
||||||
|
|
||||||
const bool oldDepthBiasEnabled = IsDepthBiasEnabled();
|
const bool oldDepthBiasEnabled = IsDepthBiasEnabled();
|
||||||
|
|
||||||
const bool oldATOC = IsAlphaToCoverageEnabled();
|
const bool oldATOC = IsAlphaToCoverageEnabled();
|
||||||
@ -1836,9 +1838,15 @@ namespace dxvk {
|
|||||||
m_flags.set(D3D9DeviceFlag::DirtyRasterizerState);
|
m_flags.set(D3D9DeviceFlag::DirtyRasterizerState);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case D3DRS_CLIPPLANEENABLE:
|
case D3DRS_CLIPPLANEENABLE: {
|
||||||
|
const bool clipPlaneEnabled = IsClipPlaneEnabled();
|
||||||
|
|
||||||
|
if (clipPlaneEnabled != oldClipPlaneEnabled)
|
||||||
|
m_flags.set(D3D9DeviceFlag::DirtyFFVertexShader);
|
||||||
|
|
||||||
m_flags.set(D3D9DeviceFlag::DirtyClipPlanes);
|
m_flags.set(D3D9DeviceFlag::DirtyClipPlanes);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case D3DRS_ALPHAREF:
|
case D3DRS_ALPHAREF:
|
||||||
UpdatePushConstant<D3D9RenderStateItem::AlphaRef>();
|
UpdatePushConstant<D3D9RenderStateItem::AlphaRef>();
|
||||||
@ -5946,6 +5954,8 @@ namespace dxvk {
|
|||||||
key.Data.Contents.VertexBlendCount = m_state.renderStates[D3DRS_VERTEXBLEND] & 0xff;
|
key.Data.Contents.VertexBlendCount = m_state.renderStates[D3DRS_VERTEXBLEND] & 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
key.Data.Contents.VertexClipping = IsClipPlaneEnabled();
|
||||||
|
|
||||||
EmitCs([
|
EmitCs([
|
||||||
this,
|
this,
|
||||||
cKey = key,
|
cKey = key,
|
||||||
|
@ -776,6 +776,10 @@ namespace dxvk {
|
|||||||
return m_state.renderStates[D3DRS_ZENABLE] && m_state.depthStencil != nullptr;
|
return m_state.renderStates[D3DRS_ZENABLE] && m_state.depthStencil != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool IsClipPlaneEnabled() {
|
||||||
|
return m_state.renderStates[D3DRS_CLIPPLANEENABLE] != 0;
|
||||||
|
}
|
||||||
|
|
||||||
void BindMultiSampleState();
|
void BindMultiSampleState();
|
||||||
|
|
||||||
void BindBlendState();
|
void BindBlendState();
|
||||||
|
@ -1163,7 +1163,8 @@ namespace dxvk {
|
|||||||
uint32_t pointSize = m_module.opFClamp(m_floatType, pointInfo.defaultValue, pointInfo.min, pointInfo.max);
|
uint32_t pointSize = m_module.opFClamp(m_floatType, pointInfo.defaultValue, pointInfo.min, pointInfo.max);
|
||||||
m_module.opStore(m_vs.out.POINTSIZE, pointSize);
|
m_module.opStore(m_vs.out.POINTSIZE, pointSize);
|
||||||
|
|
||||||
emitVsClipping(vtx);
|
if (m_vsKey.Data.Contents.VertexClipping)
|
||||||
|
emitVsClipping(vtx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -107,6 +107,8 @@ namespace dxvk {
|
|||||||
uint32_t VertexBlendMode : 2;
|
uint32_t VertexBlendMode : 2;
|
||||||
uint32_t VertexBlendIndexed : 1;
|
uint32_t VertexBlendIndexed : 1;
|
||||||
uint32_t VertexBlendCount : 3;
|
uint32_t VertexBlendCount : 3;
|
||||||
|
|
||||||
|
uint32_t VertexClipping : 1;
|
||||||
} Contents;
|
} Contents;
|
||||||
|
|
||||||
uint32_t Primitive[4];
|
uint32_t Primitive[4];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user