[D3D] Fix vertex array decision test.
Lionel Ulmer
lionel.ulmer at free.fr
Mon Dec 8 12:30:31 CST 2003
Changelog:
- limit usage of vertex arrays to correct states
--
Lionel Ulmer - http://www.bbrox.org/
-------------- next part --------------
--- dlls/ddraw_CVS/d3ddevice/mesa.c Sun Nov 23 19:42:57 2003
+++ dlls/ddraw/d3ddevice/mesa.c Sat Dec 6 14:18:37 2003
@@ -1356,13 +1356,15 @@
for now to some 'special' cases where we can do a direct mapping between D3D
types and GL types.
- Note that in the future all calls will go through vertex arrays but the arrays
- will be generated by this function. */
+ Note: in the future all calls will go through vertex arrays but the arrays
+ will be generated by this function.
+
+ Note2: colours cannot be mapped directly because they are stored as BGRA in memory
+ (ie not as an array of R, G, B, A as OpenGL does it but as a LWORD 0xAARRGGBB
+ which, as we are little indian, gives a B, G, R, A storage in memory.
+ */
if (((d3dvtVertexType & D3DFVF_POSITION_MASK) == D3DFVF_XYZ) && /* Standard XYZ vertices */
- (((d3dvtVertexType & (D3DFVF_DIFFUSE|D3DFVF_SPECULAR)) == 0) || /* Either no colours */
- (((d3dvtVertexType & D3DFVF_DIFFUSE) != 0) && /* Or diffuse only but the Alpha component is not used */
- (This->state_block.render_state[D3DRENDERSTATE_ALPHATESTENABLE - 1] == FALSE) &&
- (This->state_block.render_state[D3DRENDERSTATE_ALPHABLENDENABLE - 1] == FALSE)))) {
+ ((d3dvtVertexType & (D3DFVF_DIFFUSE|D3DFVF_SPECULAR)) == 0)) {
int tex_stage;
TRACE(" using GL vertex arrays for performance !\n");
/* First, the vertices (we are sure we have some :-) */
More information about the wine-patches
mailing list