Commit b4bee025 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Move the viewport to the vertex and misc pipeline states.

parent 4b831a5d
...@@ -3627,7 +3627,7 @@ static void vertexdeclaration(DWORD state, IWineD3DStateBlockImpl *stateblock, W ...@@ -3627,7 +3627,7 @@ static void vertexdeclaration(DWORD state, IWineD3DStateBlockImpl *stateblock, W
} }
} }
static void viewport(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { static void viewport_miscpart(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
UINT width, height; UINT width, height;
IWineD3DSurfaceImpl *target; IWineD3DSurfaceImpl *target;
...@@ -3649,7 +3649,9 @@ static void viewport(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCon ...@@ -3649,7 +3649,9 @@ static void viewport(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCon
} }
checkGLcall("glViewport"); checkGLcall("glViewport");
}
static void viewport_vertexpart(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
stateblock->wineD3DDevice->posFixup[2] = 1.0 / stateblock->viewport.Width; stateblock->wineD3DDevice->posFixup[2] = 1.0 / stateblock->viewport.Width;
stateblock->wineD3DDevice->posFixup[3] = -stateblock->wineD3DDevice->posFixup[1] / stateblock->viewport.Height; stateblock->wineD3DDevice->posFixup[3] = -stateblock->wineD3DDevice->posFixup[1] / stateblock->viewport.Height;
if(!isStateDirty(context, STATE_TRANSFORM(WINED3DTS_PROJECTION))) { if(!isStateDirty(context, STATE_TRANSFORM(WINED3DTS_PROJECTION))) {
...@@ -4839,7 +4841,7 @@ const struct StateEntry FFPStateTable[] = ...@@ -4839,7 +4841,7 @@ const struct StateEntry FFPStateTable[] =
{ /* , STATE_INDEXBUFFER */ STATE_INDEXBUFFER, indexbuffer }, { /* , STATE_INDEXBUFFER */ STATE_INDEXBUFFER, indexbuffer },
{ /* , STATE_VDECL */ STATE_VDECL, NULL }, { /* , STATE_VDECL */ STATE_VDECL, NULL },
{ /* , STATE_VSHADER */ STATE_VDECL, NULL }, { /* , STATE_VSHADER */ STATE_VDECL, NULL },
{ /* , STATE_VIEWPORT */ STATE_VIEWPORT, viewport }, { /* , STATE_VIEWPORT */ STATE_VIEWPORT, NULL },
{ /* , STATE_VERTEXSHADERCONSTANT */ STATE_VERTEXSHADERCONSTANT, NULL }, { /* , STATE_VERTEXSHADERCONSTANT */ STATE_VERTEXSHADERCONSTANT, NULL },
{ /* , STATE_PIXELSHADERCONSTANT */ STATE_VERTEXSHADERCONSTANT, NULL }, { /* , STATE_PIXELSHADERCONSTANT */ STATE_VERTEXSHADERCONSTANT, NULL },
/* Lights */ /* Lights */
...@@ -4911,6 +4913,8 @@ const struct StateEntryTemplate misc_state_template[] = { ...@@ -4911,6 +4913,8 @@ const struct StateEntryTemplate misc_state_template[] = {
*/ */
{ STATE_VERTEXSHADERCONSTANT, { STATE_VERTEXSHADERCONSTANT, shaderconstant }}, { STATE_VERTEXSHADERCONSTANT, { STATE_VERTEXSHADERCONSTANT, shaderconstant }},
{ STATE_PIXELSHADERCONSTANT, { STATE_VERTEXSHADERCONSTANT, shaderconstant }}, { STATE_PIXELSHADERCONSTANT, { STATE_VERTEXSHADERCONSTANT, shaderconstant }},
/* Viewport */
{ STATE_VIEWPORT, { STATE_VIEWPORT, viewport_miscpart }},
{0 /* Terminate */, { 0, 0 }}, {0 /* Terminate */, { 0, 0 }},
}; };
...@@ -4961,6 +4965,8 @@ const struct StateEntryTemplate ffp_vertexstate_template[] = { ...@@ -4961,6 +4965,8 @@ const struct StateEntryTemplate ffp_vertexstate_template[] = {
{ STATE_ACTIVELIGHT(5), { STATE_ACTIVELIGHT(5), light }}, { STATE_ACTIVELIGHT(5), { STATE_ACTIVELIGHT(5), light }},
{ STATE_ACTIVELIGHT(6), { STATE_ACTIVELIGHT(6), light }}, { STATE_ACTIVELIGHT(6), { STATE_ACTIVELIGHT(6), light }},
{ STATE_ACTIVELIGHT(7), { STATE_ACTIVELIGHT(7), light }}, { STATE_ACTIVELIGHT(7), { STATE_ACTIVELIGHT(7), light }},
/* Viewport */
{ STATE_VIEWPORT, { STATE_VIEWPORT, viewport_vertexpart }},
{0 /* Terminate */, { 0, 0 }}, {0 /* Terminate */, { 0, 0 }},
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment