mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 13:30:02 +00:00
D3D9: Implement flat shading via state.
This commit is contained in:
parent
b845278d7d
commit
5b62c8afb8
@ -204,10 +204,13 @@ void DrawEngineDX9::ApplyDrawState(int prim) {
|
||||
if (gstate.isModeClear()) {
|
||||
// Set Cull
|
||||
dxstate.cullMode.set(false, false);
|
||||
// Well, probably doesn't matter...
|
||||
dxstate.shadeMode.set(D3DSHADE_GOURAUD);
|
||||
} else {
|
||||
// Set cull
|
||||
bool wantCull = !gstate.isModeThrough() && prim != GE_PRIM_RECTANGLES && gstate.isCullEnabled();
|
||||
dxstate.cullMode.set(wantCull, gstate.getCullMode());
|
||||
dxstate.shadeMode.set(gstate.getShadeMode() == GE_SHADE_GOURAUD ? D3DSHADE_GOURAUD : D3DSHADE_FLAT);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,8 @@ const CommonCommandTableEntry commonCommandTable[] = {
|
||||
{ GE_CMD_FOGENABLE, FLAG_FLUSHBEFOREONCHANGE, DIRTY_VERTEXSHADER_STATE | DIRTY_FRAGMENTSHADER_STATE},
|
||||
{ GE_CMD_TEXMODE, FLAG_FLUSHBEFOREONCHANGE, DIRTY_TEXTURE_PARAMS | DIRTY_FRAGMENTSHADER_STATE },
|
||||
{ GE_CMD_TEXSHADELS, FLAG_FLUSHBEFOREONCHANGE, DIRTY_VERTEXSHADER_STATE },
|
||||
{ GE_CMD_SHADEMODE, FLAG_FLUSHBEFOREONCHANGE, DIRTY_VERTEXSHADER_STATE | DIRTY_FRAGMENTSHADER_STATE },
|
||||
// Raster state for Direct3D 9, uncommon.
|
||||
{ GE_CMD_SHADEMODE, FLAG_FLUSHBEFOREONCHANGE, DIRTY_VERTEXSHADER_STATE | DIRTY_FRAGMENTSHADER_STATE | DIRTY_RASTER_STATE },
|
||||
{ GE_CMD_TEXFUNC, FLAG_FLUSHBEFOREONCHANGE, DIRTY_FRAGMENTSHADER_STATE },
|
||||
{ GE_CMD_COLORTEST, FLAG_FLUSHBEFOREONCHANGE, DIRTY_FRAGMENTSHADER_STATE },
|
||||
{ GE_CMD_ALPHATESTENABLE, FLAG_FLUSHBEFOREONCHANGE, DIRTY_FRAGMENTSHADER_STATE },
|
||||
|
@ -35,6 +35,7 @@ void DirectXState::Restore() {
|
||||
scissorRect.restore(); count++;
|
||||
|
||||
cullMode.restore(); count++;
|
||||
shadeMode.restore(); count++;
|
||||
|
||||
depthTest.restore(); count++;
|
||||
depthFunc.restore(); count++;
|
||||
|
@ -455,6 +455,7 @@ public:
|
||||
BoolUnused dither;
|
||||
|
||||
CullMode cullMode;
|
||||
DxState1<D3DRS_SHADEMODE, D3DSHADE_GOURAUD> shadeMode;
|
||||
|
||||
BoolState<D3DRS_ZENABLE, false> depthTest;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user