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.
This commit is contained in:
Jason Edmeades 2003-09-25 20:22:21 +00:00 committed by Alexandre Julliard
parent 3a82706e54
commit de3b0dfffb
2 changed files with 12 additions and 5 deletions

View File

@ -1152,7 +1152,7 @@ HRESULT WINAPI IDirect3D8Impl_CreateDevice (LPDIRECT3D8 iface,
object->view_ident = 1;
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;
}

View File

@ -623,9 +623,10 @@ void draw_vertex(LPDIRECT3DDEVICE8 iface, /* interf
VTRACE(("Vertex: glVertex:x,y,z=%f,%f,%f\n", x,y,z));
glVertex3f(x, y, z);
} 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));
glVertex4f(x * w, y * w, z * w, 1.0f);
glVertex4f(x,y,z,rhw);
}
}
}
@ -1189,7 +1190,7 @@ void drawStridedSlow(LPDIRECT3DDEVICE8 iface, Direct3DVertexStridedData *sd,
glVertex3f(x, y, z);
} else {
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
/* Fill the vertex shader input */
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));
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);
/*