Commit de3b0dff authored by Jason Edmeades's avatar Jason Edmeades Committed by Alexandre Julliard

The 'w' component is used more than just for the vertex, so we cannot

do the projection mapping ourselves. Also tidy up a tracepoint, and preinitialize the shaders output as windows seems to.
parent 3a82706e
...@@ -1152,7 +1152,7 @@ HRESULT WINAPI IDirect3D8Impl_CreateDevice (LPDIRECT3D8 iface, ...@@ -1152,7 +1152,7 @@ HRESULT WINAPI IDirect3D8Impl_CreateDevice (LPDIRECT3D8 iface,
object->view_ident = 1; object->view_ident = 1;
object->last_was_rhw = 0; object->last_was_rhw = 0;
TRACE("(%p,%d) All defaults now set up, leaving CreateDevice\n", This, Adapter); TRACE("(%p,%d) All defaults now set up, leaving CreateDevice with %p\n", This, Adapter, object);
return D3D_OK; return D3D_OK;
} }
......
...@@ -623,9 +623,10 @@ void draw_vertex(LPDIRECT3DDEVICE8 iface, /* interf ...@@ -623,9 +623,10 @@ void draw_vertex(LPDIRECT3DDEVICE8 iface, /* interf
VTRACE(("Vertex: glVertex:x,y,z=%f,%f,%f\n", x,y,z)); VTRACE(("Vertex: glVertex:x,y,z=%f,%f,%f\n", x,y,z));
glVertex3f(x, y, z); glVertex3f(x, y, z);
} else { } else {
GLfloat w = 1.0f / rhw; /* Cannot optimize by dividing through by rhw as rhw is required
later for perspective in the GL pipeline for vertex shaders */
VTRACE(("Vertex: glVertex:x,y,z=%f,%f,%f / rhw=%f\n", x,y,z,rhw)); VTRACE(("Vertex: glVertex:x,y,z=%f,%f,%f / rhw=%f\n", x,y,z,rhw));
glVertex4f(x * w, y * w, z * w, 1.0f); glVertex4f(x,y,z,rhw);
} }
} }
} }
...@@ -1189,7 +1190,7 @@ void drawStridedSlow(LPDIRECT3DDEVICE8 iface, Direct3DVertexStridedData *sd, ...@@ -1189,7 +1190,7 @@ void drawStridedSlow(LPDIRECT3DDEVICE8 iface, Direct3DVertexStridedData *sd,
glVertex3f(x, y, z); glVertex3f(x, y, z);
} else { } else {
VTRACE(("Vertex: glVertex:x,y,z=%f,%f,%f / rhw=%f\n", x,y,z,rhw)); VTRACE(("Vertex: glVertex:x,y,z=%f,%f,%f / rhw=%f\n", x,y,z,rhw));
glVertex4f(x / rhw, y / rhw, z / rhw, 1.0f / rhw); glVertex4f(x,y,z,rhw);
} }
} }
...@@ -1265,8 +1266,14 @@ void drawStridedSoftwareVS(LPDIRECT3DDEVICE8 iface, Direct3DVertexStridedData *s ...@@ -1265,8 +1266,14 @@ void drawStridedSoftwareVS(LPDIRECT3DDEVICE8 iface, Direct3DVertexStridedData *s
/* Fill the vertex shader input */ /* Fill the vertex shader input */
IDirect3DDeviceImpl_FillVertexShaderInput(This, vertex_shader, SkipnStrides); IDirect3DDeviceImpl_FillVertexShaderInput(This, vertex_shader, SkipnStrides);
/* Now execute the vertex shader */ /* Initialize the output fields to the same defaults as it would normally have */
memset(&vertex_shader->output, 0, sizeof(VSHADEROUTPUTDATA8)); memset(&vertex_shader->output, 0, sizeof(VSHADEROUTPUTDATA8));
vertex_shader->output.oD[0].x = 1.0;
vertex_shader->output.oD[0].y = 1.0;
vertex_shader->output.oD[0].z = 1.0;
vertex_shader->output.oD[0].w = 1.0;
/* Now execute the vertex shader */
IDirect3DVertexShaderImpl_ExecuteSW(vertex_shader, &vertex_shader->input, &vertex_shader->output); IDirect3DVertexShaderImpl_ExecuteSW(vertex_shader, &vertex_shader->input, &vertex_shader->output);
/* /*
......
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