Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
c5d457c8
Commit
c5d457c8
authored
Jul 11, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 11, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Store a struct wined3d_bo_address in struct wined3d_stream_info_element.
Instead of using separate fields for the buffer object and offset.
parent
89bf30a2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
93 additions
and
89 deletions
+93
-89
buffer.c
dlls/wined3d/buffer.c
+2
-2
device.c
dlls/wined3d/device.c
+24
-21
drawprim.c
dlls/wined3d/drawprim.c
+14
-14
state.c
dlls/wined3d/state.c
+49
-47
wined3d_private.h
dlls/wined3d/wined3d_private.h
+4
-5
No files found.
dlls/wined3d/buffer.c
View file @
c5d457c8
...
...
@@ -265,7 +265,7 @@ static BOOL buffer_process_converted_attribute(struct wined3d_buffer *This,
}
}
data
=
(((
DWORD_PTR
)
attrib
->
data
)
+
offset
)
%
This
->
stride
;
data
=
(((
DWORD_PTR
)
attrib
->
data
.
addr
)
+
offset
)
%
This
->
stride
;
attrib_size
=
attrib
->
format
->
component_count
*
attrib
->
format
->
component_size
;
for
(
i
=
0
;
i
<
attrib_size
;
++
i
)
{
...
...
@@ -294,7 +294,7 @@ static BOOL buffer_check_attribute(struct wined3d_buffer *This, const struct win
* there, on nonexistent attribs the vbo is 0.
*/
if
(
!
(
si
->
use_map
&
(
1
<<
attrib_idx
))
||
attrib
->
buffer_object
!=
This
->
buffer_object
)
||
attrib
->
data
.
buffer_object
!=
This
->
buffer_object
)
return
FALSE
;
format
=
attrib
->
format
->
id
;
...
...
dlls/wined3d/device.c
View file @
c5d457c8
...
...
@@ -293,10 +293,9 @@ void device_stream_info_from_declaration(struct wined3d_device *device,
element
->
offset
,
stride
,
debug_d3dformat
(
element
->
format
->
id
),
data
.
buffer_object
);
stream_info
->
elements
[
idx
].
format
=
element
->
format
;
stream_info
->
elements
[
idx
].
data
=
data
;
stream_info
->
elements
[
idx
].
stride
=
stride
;
stream_info
->
elements
[
idx
].
data
=
data
.
addr
;
stream_info
->
elements
[
idx
].
stream_idx
=
element
->
input_slot
;
stream_info
->
elements
[
idx
].
buffer_object
=
data
.
buffer_object
;
if
(
!
device
->
adapter
->
gl_info
.
supported
[
ARB_VERTEX_ARRAY_BGRA
]
&&
element
->
format
->
id
==
WINED3DFMT_B8G8R8A8_UNORM
)
...
...
@@ -324,11 +323,12 @@ void device_stream_info_from_declaration(struct wined3d_device *device,
buffer
=
device
->
stateBlock
->
state
.
streams
[
element
->
stream_idx
].
buffer
;
wined3d_buffer_preload
(
buffer
);
/* If
PreL
oad dropped the buffer object, update the stream info. */
if
(
buffer
->
buffer_object
!=
element
->
buffer_object
)
/* If
the prel
oad dropped the buffer object, update the stream info. */
if
(
buffer
->
buffer_object
!=
element
->
data
.
buffer_object
)
{
element
->
buffer_object
=
0
;
element
->
data
=
buffer_get_sysmem
(
buffer
,
&
device
->
adapter
->
gl_info
)
+
(
ptrdiff_t
)
element
->
data
;
element
->
data
.
buffer_object
=
0
;
element
->
data
.
addr
=
buffer_get_sysmem
(
buffer
,
&
device
->
adapter
->
gl_info
)
+
(
ptrdiff_t
)
element
->
data
.
addr
;
}
if
(
buffer
->
query
)
...
...
@@ -340,11 +340,11 @@ void device_stream_info_from_declaration(struct wined3d_device *device,
static
void
stream_info_element_from_strided
(
const
struct
wined3d_gl_info
*
gl_info
,
const
struct
WineDirect3DStridedData
*
strided
,
struct
wined3d_stream_info_element
*
e
)
{
e
->
data
.
addr
=
strided
->
lpData
;
e
->
data
.
buffer_object
=
0
;
e
->
format
=
wined3d_get_format
(
gl_info
,
strided
->
format
);
e
->
stride
=
strided
->
dwStride
;
e
->
data
=
strided
->
lpData
;
e
->
stream_idx
=
0
;
e
->
buffer_object
=
0
;
}
static
void
device_stream_info_from_strided
(
const
struct
wined3d_gl_info
*
gl_info
,
...
...
@@ -3287,7 +3287,7 @@ static HRESULT process_vertices_strided(struct wined3d_device *device, DWORD dwD
((
DestFVF
&
WINED3DFVF_POSITION_MASK
)
==
WINED3DFVF_XYZRHW
)
)
{
/* The position first */
const
struct
wined3d_stream_info_element
*
element
=
&
stream_info
->
elements
[
WINED3D_FFP_POSITION
];
const
float
*
p
=
(
const
float
*
)(
element
->
data
+
i
*
element
->
stride
);
const
float
*
p
=
(
const
float
*
)(
element
->
data
.
addr
+
i
*
element
->
stride
);
float
x
,
y
,
z
,
rhw
;
TRACE
(
"In: ( %06.2f %06.2f %06.2f )
\n
"
,
p
[
0
],
p
[
1
],
p
[
2
]);
...
...
@@ -3401,9 +3401,10 @@ static HRESULT process_vertices_strided(struct wined3d_device *device, DWORD dwD
dest_ptr
+=
sizeof
(
DWORD
);
if
(
dest_conv
)
dest_conv
+=
sizeof
(
DWORD
);
}
if
(
DestFVF
&
WINED3DFVF_NORMAL
)
{
if
(
DestFVF
&
WINED3DFVF_NORMAL
)
{
const
struct
wined3d_stream_info_element
*
element
=
&
stream_info
->
elements
[
WINED3D_FFP_NORMAL
];
const
float
*
normal
=
(
const
float
*
)(
element
->
data
+
i
*
element
->
stride
);
const
float
*
normal
=
(
const
float
*
)(
element
->
data
.
addr
+
i
*
element
->
stride
);
/* AFAIK this should go into the lighting information */
FIXME
(
"Didn't expect the destination to have a normal
\n
"
);
copy_and_next
(
dest_ptr
,
normal
,
3
*
sizeof
(
float
));
...
...
@@ -3412,9 +3413,10 @@ static HRESULT process_vertices_strided(struct wined3d_device *device, DWORD dwD
}
}
if
(
DestFVF
&
WINED3DFVF_DIFFUSE
)
{
if
(
DestFVF
&
WINED3DFVF_DIFFUSE
)
{
const
struct
wined3d_stream_info_element
*
element
=
&
stream_info
->
elements
[
WINED3D_FFP_DIFFUSE
];
const
DWORD
*
color_d
=
(
const
DWORD
*
)(
element
->
data
+
i
*
element
->
stride
);
const
DWORD
*
color_d
=
(
const
DWORD
*
)(
element
->
data
.
addr
+
i
*
element
->
stride
);
if
(
!
(
stream_info
->
use_map
&
(
1
<<
WINED3D_FFP_DIFFUSE
)))
{
static
BOOL
warned
=
FALSE
;
...
...
@@ -3447,7 +3449,7 @@ static HRESULT process_vertices_strided(struct wined3d_device *device, DWORD dwD
{
/* What's the color value in the feedback buffer? */
const
struct
wined3d_stream_info_element
*
element
=
&
stream_info
->
elements
[
WINED3D_FFP_SPECULAR
];
const
DWORD
*
color_s
=
(
const
DWORD
*
)(
element
->
data
+
i
*
element
->
stride
);
const
DWORD
*
color_s
=
(
const
DWORD
*
)(
element
->
data
.
addr
+
i
*
element
->
stride
);
if
(
!
(
stream_info
->
use_map
&
(
1
<<
WINED3D_FFP_SPECULAR
)))
{
static
BOOL
warned
=
FALSE
;
...
...
@@ -3476,9 +3478,10 @@ static HRESULT process_vertices_strided(struct wined3d_device *device, DWORD dwD
}
}
for
(
tex_index
=
0
;
tex_index
<
numTextures
;
tex_index
++
)
{
for
(
tex_index
=
0
;
tex_index
<
numTextures
;
++
tex_index
)
{
const
struct
wined3d_stream_info_element
*
element
=
&
stream_info
->
elements
[
WINED3D_FFP_TEXCOORD0
+
tex_index
];
const
float
*
tex_coord
=
(
const
float
*
)(
element
->
data
+
i
*
element
->
stride
);
const
float
*
tex_coord
=
(
const
float
*
)(
element
->
data
.
addr
+
i
*
element
->
stride
);
if
(
!
(
stream_info
->
use_map
&
(
1
<<
(
WINED3D_FFP_TEXCOORD0
+
tex_index
))))
{
ERR
(
"No source texture, but destination requests one
\n
"
);
...
...
@@ -3559,18 +3562,18 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device,
if
(
!
(
stream_info
.
use_map
&
(
1
<<
i
)))
continue
;
e
=
&
stream_info
.
elements
[
i
];
if
(
e
->
buffer_object
)
if
(
e
->
data
.
buffer_object
)
{
struct
wined3d_buffer
*
vb
=
device
->
stateBlock
->
state
.
streams
[
e
->
stream_idx
].
buffer
;
e
->
buffer_object
=
0
;
e
->
data
=
(
BYTE
*
)((
ULONG_PTR
)
e
->
data
+
(
ULONG_PTR
)
buffer_get_sysmem
(
vb
,
gl_info
));
e
->
data
.
buffer_object
=
0
;
e
->
data
.
addr
=
(
BYTE
*
)((
ULONG_PTR
)
e
->
data
.
addr
+
(
ULONG_PTR
)
buffer_get_sysmem
(
vb
,
gl_info
));
ENTER_GL
();
GL_EXTCALL
(
glDeleteBuffersARB
(
1
,
&
vb
->
buffer_object
));
vb
->
buffer_object
=
0
;
LEAVE_GL
();
}
if
(
e
->
data
)
e
->
data
+=
e
->
stride
*
src_start_idx
;
if
(
e
->
data
.
addr
)
e
->
data
.
addr
+=
e
->
stride
*
src_start_idx
;
}
}
...
...
dlls/wined3d/drawprim.c
View file @
c5d457c8
...
...
@@ -111,13 +111,13 @@ static void drawStridedSlow(struct wined3d_device *device, const struct wined3d_
if
(
si
->
use_map
&
(
1
<<
WINED3D_FFP_POSITION
))
{
element
=
&
si
->
elements
[
WINED3D_FFP_POSITION
];
position
=
element
->
data
+
streams
[
element
->
stream_idx
].
offset
;
position
=
element
->
data
.
addr
+
streams
[
element
->
stream_idx
].
offset
;
}
if
(
si
->
use_map
&
(
1
<<
WINED3D_FFP_NORMAL
))
{
element
=
&
si
->
elements
[
WINED3D_FFP_NORMAL
];
normal
=
element
->
data
+
streams
[
element
->
stream_idx
].
offset
;
normal
=
element
->
data
.
addr
+
streams
[
element
->
stream_idx
].
offset
;
}
else
{
...
...
@@ -128,7 +128,7 @@ static void drawStridedSlow(struct wined3d_device *device, const struct wined3d_
if
(
si
->
use_map
&
(
1
<<
WINED3D_FFP_DIFFUSE
))
{
element
=
&
si
->
elements
[
WINED3D_FFP_DIFFUSE
];
diffuse
=
element
->
data
+
streams
[
element
->
stream_idx
].
offset
;
diffuse
=
element
->
data
.
addr
+
streams
[
element
->
stream_idx
].
offset
;
if
(
num_untracked_materials
&&
element
->
format
->
id
!=
WINED3DFMT_B8G8R8A8_UNORM
)
FIXME
(
"Implement diffuse color tracking from %s
\n
"
,
debug_d3dformat
(
element
->
format
->
id
));
...
...
@@ -141,7 +141,7 @@ static void drawStridedSlow(struct wined3d_device *device, const struct wined3d_
if
(
si
->
use_map
&
(
1
<<
WINED3D_FFP_SPECULAR
))
{
element
=
&
si
->
elements
[
WINED3D_FFP_SPECULAR
];
specular
=
element
->
data
+
streams
[
element
->
stream_idx
].
offset
;
specular
=
element
->
data
.
addr
+
streams
[
element
->
stream_idx
].
offset
;
/* special case where the fog density is stored in the specular alpha channel */
if
(
state
->
render_states
[
WINED3DRS_FOGENABLE
]
...
...
@@ -201,7 +201,7 @@ static void drawStridedSlow(struct wined3d_device *device, const struct wined3d_
if
(
si
->
use_map
&
(
1
<<
(
WINED3D_FFP_TEXCOORD0
+
coordIdx
)))
{
element
=
&
si
->
elements
[
WINED3D_FFP_TEXCOORD0
+
coordIdx
];
texCoords
[
coordIdx
]
=
element
->
data
+
streams
[
element
->
stream_idx
].
offset
;
texCoords
[
coordIdx
]
=
element
->
data
.
addr
+
streams
[
element
->
stream_idx
].
offset
;
tex_mask
|=
(
1
<<
textureNo
);
}
else
...
...
@@ -465,7 +465,7 @@ static void drawStridedSlowVs(const struct wined3d_gl_info *gl_info, const struc
{
if
(
!
(
si
->
use_map
&
(
1
<<
i
)))
continue
;
ptr
=
si
->
elements
[
i
].
data
+
si
->
elements
[
i
].
stride
*
SkipnStrides
ptr
=
si
->
elements
[
i
].
data
.
addr
+
si
->
elements
[
i
].
stride
*
SkipnStrides
+
state
->
streams
[
si
->
elements
[
i
].
stream_idx
].
offset
;
send_attribute
(
gl_info
,
si
->
elements
[
i
].
format
->
id
,
i
,
ptr
);
...
...
@@ -529,10 +529,10 @@ static void drawStridedInstanced(const struct wined3d_gl_info *gl_info, const st
for
(
i
=
0
;
i
<
numInstances
;
i
++
)
{
/* Specify the instanced attributes using immediate mode calls */
for
(
j
=
0
;
j
<
numInstancedAttribs
;
j
++
)
{
const
BYTE
*
ptr
=
si
->
elements
[
instancedData
[
j
]].
data
const
BYTE
*
ptr
=
si
->
elements
[
instancedData
[
j
]].
data
.
addr
+
si
->
elements
[
instancedData
[
j
]].
stride
*
i
+
state
->
streams
[
si
->
elements
[
instancedData
[
j
]].
stream_idx
].
offset
;
if
(
si
->
elements
[
instancedData
[
j
]].
buffer_object
)
if
(
si
->
elements
[
instancedData
[
j
]].
data
.
buffer_object
)
{
struct
wined3d_buffer
*
vb
=
state
->
streams
[
si
->
elements
[
instancedData
[
j
]].
stream_idx
].
buffer
;
ptr
+=
(
ULONG_PTR
)
buffer_get_sysmem
(
vb
,
gl_info
);
...
...
@@ -568,11 +568,11 @@ static void remove_vbos(const struct wined3d_gl_info *gl_info,
if
(
!
(
s
->
use_map
&
(
1
<<
i
)))
continue
;
e
=
&
s
->
elements
[
i
];
if
(
e
->
buffer_object
)
if
(
e
->
data
.
buffer_object
)
{
struct
wined3d_buffer
*
vb
=
state
->
streams
[
e
->
stream_idx
].
buffer
;
e
->
buffer_object
=
0
;
e
->
data
=
(
BYTE
*
)((
ULONG_PTR
)
e
->
data
+
(
ULONG_PTR
)
buffer_get_sysmem
(
vb
,
gl_info
));
e
->
data
.
buffer_object
=
0
;
e
->
data
.
addr
=
(
BYTE
*
)((
ULONG_PTR
)
e
->
data
.
addr
+
(
ULONG_PTR
)
buffer_get_sysmem
(
vb
,
gl_info
));
}
}
}
...
...
@@ -814,13 +814,13 @@ HRESULT tesselate_rectpatch(struct wined3d_device *This, struct WineD3DRectPatch
device_stream_info_from_declaration
(
This
,
FALSE
,
&
stream_info
,
NULL
);
e
=
&
stream_info
.
elements
[
WINED3D_FFP_POSITION
];
if
(
e
->
buffer_object
)
if
(
e
->
data
.
buffer_object
)
{
struct
wined3d_buffer
*
vb
=
This
->
stateBlock
->
state
.
streams
[
e
->
stream_idx
].
buffer
;
e
->
data
=
(
BYTE
*
)((
ULONG_PTR
)
e
->
data
+
(
ULONG_PTR
)
buffer_get_sysmem
(
vb
,
context
->
gl_info
));
e
->
data
.
addr
=
(
BYTE
*
)((
ULONG_PTR
)
e
->
data
.
addr
+
(
ULONG_PTR
)
buffer_get_sysmem
(
vb
,
context
->
gl_info
));
}
vtxStride
=
e
->
stride
;
data
=
e
->
data
+
data
=
e
->
data
.
addr
+
vtxStride
*
info
->
Stride
*
info
->
StartVertexOffsetHeight
+
vtxStride
*
info
->
StartVertexOffsetWidth
;
...
...
dlls/wined3d/state.c
View file @
c5d457c8
...
...
@@ -3294,14 +3294,14 @@ static void loadTexCoords(const struct wined3d_gl_info *gl_info, struct wined3d_
const
struct
wined3d_stream_info_element
*
e
=
&
si
->
elements
[
WINED3D_FFP_TEXCOORD0
+
coordIdx
];
const
struct
wined3d_stream_state
*
stream
=
&
stateblock
->
state
.
streams
[
e
->
stream_idx
];
TRACE
(
"Setting up texture %u, idx %d, co
rdindx %u, data %p
\n
"
,
textureNo
,
mapped_stage
,
coordIdx
,
e
->
data
);
TRACE
(
"Setting up texture %u, idx %d, co
ordindx %u, data {%#x:%p}.
\n
"
,
textureNo
,
mapped_stage
,
coordIdx
,
e
->
data
.
buffer_object
,
e
->
data
.
addr
);
if
(
*
curVBO
!=
e
->
buffer_object
)
if
(
*
curVBO
!=
e
->
data
.
buffer_object
)
{
GL_EXTCALL
(
glBindBufferARB
(
GL_ARRAY_BUFFER_ARB
,
e
->
buffer_object
));
GL_EXTCALL
(
glBindBufferARB
(
GL_ARRAY_BUFFER_ARB
,
e
->
data
.
buffer_object
));
checkGLcall
(
"glBindBufferARB"
);
*
curVBO
=
e
->
buffer_object
;
*
curVBO
=
e
->
data
.
buffer_object
;
}
GL_EXTCALL
(
glClientActiveTextureARB
(
GL_TEXTURE0_ARB
+
mapped_stage
));
...
...
@@ -3309,9 +3309,11 @@ static void loadTexCoords(const struct wined3d_gl_info *gl_info, struct wined3d_
/* The coords to supply depend completely on the fvf / vertex shader */
glTexCoordPointer
(
e
->
format
->
gl_vtx_format
,
e
->
format
->
gl_vtx_type
,
e
->
stride
,
e
->
data
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
e
->
data
.
addr
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
glEnableClientState
(
GL_TEXTURE_COORD_ARRAY
);
}
else
{
}
else
{
GL_EXTCALL
(
glMultiTexCoord4fARB
(
GL_TEXTURE0_ARB
+
mapped_stage
,
0
,
0
,
0
,
1
));
}
}
...
...
@@ -4094,15 +4096,15 @@ static void loadNumberedArrays(struct wined3d_stateblock *stateblock,
continue
;
}
TRACE_
(
d3d_shader
)(
"Loading array %u [VBO=%u]
\n
"
,
i
,
stream_info
->
elements
[
i
].
buffer_object
);
TRACE_
(
d3d_shader
)(
"Loading array %u [VBO=%u]
\n
"
,
i
,
stream_info
->
elements
[
i
].
data
.
buffer_object
);
if
(
stream_info
->
elements
[
i
].
stride
)
{
if
(
curVBO
!=
stream_info
->
elements
[
i
].
buffer_object
)
if
(
curVBO
!=
stream_info
->
elements
[
i
].
data
.
buffer_object
)
{
GL_EXTCALL
(
glBindBufferARB
(
GL_ARRAY_BUFFER_ARB
,
stream_info
->
elements
[
i
].
buffer_object
));
GL_EXTCALL
(
glBindBufferARB
(
GL_ARRAY_BUFFER_ARB
,
stream_info
->
elements
[
i
].
data
.
buffer_object
));
checkGLcall
(
"glBindBufferARB"
);
curVBO
=
stream_info
->
elements
[
i
].
buffer_object
;
curVBO
=
stream_info
->
elements
[
i
].
data
.
buffer_object
;
}
/* Use the VBO to find out if a vertex buffer exists, not the vb
* pointer. vb can point to a user pointer data blob. In that case
...
...
@@ -4112,7 +4114,7 @@ static void loadNumberedArrays(struct wined3d_stateblock *stateblock,
GL_EXTCALL
(
glVertexAttribPointerARB
(
i
,
stream_info
->
elements
[
i
].
format
->
gl_vtx_format
,
stream_info
->
elements
[
i
].
format
->
gl_vtx_type
,
stream_info
->
elements
[
i
].
format
->
gl_normalized
,
stream_info
->
elements
[
i
].
stride
,
stream_info
->
elements
[
i
].
data
stream_info
->
elements
[
i
].
stride
,
stream_info
->
elements
[
i
].
data
.
addr
+
stateblock
->
state
.
load_base_vertex_index
*
stream_info
->
elements
[
i
].
stride
+
stream
->
offset
));
...
...
@@ -4128,8 +4130,8 @@ static void loadNumberedArrays(struct wined3d_stateblock *stateblock,
* glVertexAttribPointerARB doesn't do that. Instead disable the
* pointer and set up the attribute statically. But we have to
* figure out the system memory address. */
const
BYTE
*
ptr
=
stream_info
->
elements
[
i
].
data
+
stream
->
offset
;
if
(
stream_info
->
elements
[
i
].
buffer_object
)
const
BYTE
*
ptr
=
stream_info
->
elements
[
i
].
data
.
addr
+
stream
->
offset
;
if
(
stream_info
->
elements
[
i
].
data
.
buffer_object
)
{
vb
=
stream
->
buffer
;
ptr
+=
(
ULONG_PTR
)
buffer_get_sysmem
(
vb
,
gl_info
);
...
...
@@ -4249,27 +4251,27 @@ static void loadVertexData(const struct wined3d_context *context, struct wined3d
if
(
gl_info
->
supported
[
ARB_VERTEX_BLEND
])
{
TRACE
(
"Blend %u %p %u
\n
"
,
e
->
format
->
component_count
,
e
->
data
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
,
e
->
stride
+
stream
->
offset
);
e
->
data
.
addr
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
,
e
->
stride
+
stream
->
offset
);
glEnableClientState
(
GL_WEIGHT_ARRAY_ARB
);
checkGLcall
(
"glEnableClientState(GL_WEIGHT_ARRAY_ARB)"
);
GL_EXTCALL
(
glVertexBlendARB
(
e
->
format
->
component_count
+
1
));
if
(
curVBO
!=
e
->
buffer_object
)
if
(
curVBO
!=
e
->
data
.
buffer_object
)
{
GL_EXTCALL
(
glBindBufferARB
(
GL_ARRAY_BUFFER_ARB
,
e
->
buffer_object
));
GL_EXTCALL
(
glBindBufferARB
(
GL_ARRAY_BUFFER_ARB
,
e
->
data
.
buffer_object
));
checkGLcall
(
"glBindBufferARB"
);
curVBO
=
e
->
buffer_object
;
curVBO
=
e
->
data
.
buffer_object
;
}
TRACE
(
"glWeightPointerARB(%#x, %#x, %#x, %p);
\n
"
,
e
->
format
->
gl_vtx_format
,
e
->
format
->
gl_vtx_type
,
e
->
stride
,
e
->
data
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
e
->
data
.
addr
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
GL_EXTCALL
(
glWeightPointerARB
(
e
->
format
->
gl_vtx_format
,
e
->
format
->
gl_vtx_type
,
e
->
stride
,
e
->
data
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
));
e
->
data
.
addr
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
));
checkGLcall
(
"glWeightPointerARB"
);
...
...
@@ -4313,11 +4315,11 @@ static void loadVertexData(const struct wined3d_context *context, struct wined3d
e
=
&
si
->
elements
[
WINED3D_FFP_POSITION
];
stream
=
&
stateblock
->
state
.
streams
[
e
->
stream_idx
];
if
(
curVBO
!=
e
->
buffer_object
)
if
(
curVBO
!=
e
->
data
.
buffer_object
)
{
GL_EXTCALL
(
glBindBufferARB
(
GL_ARRAY_BUFFER_ARB
,
e
->
buffer_object
));
GL_EXTCALL
(
glBindBufferARB
(
GL_ARRAY_BUFFER_ARB
,
e
->
data
.
buffer_object
));
checkGLcall
(
"glBindBufferARB"
);
curVBO
=
e
->
buffer_object
;
curVBO
=
e
->
data
.
buffer_object
;
}
/* min(WINED3D_ATR_FORMAT(position),3) to Disable RHW mode as 'w' coord
...
...
@@ -4328,20 +4330,20 @@ static void loadVertexData(const struct wined3d_context *context, struct wined3d
This only applies to user pointer sources, in VBOs the vertices are fixed up
*/
if
(
!
e
->
buffer_object
)
if
(
!
e
->
data
.
buffer_object
)
{
TRACE
(
"glVertexPointer(3, %#x, %#x, %p);
\n
"
,
e
->
format
->
gl_vtx_type
,
e
->
stride
,
e
->
data
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
e
->
data
.
addr
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
glVertexPointer
(
3
/* min(e->format->gl_vtx_format, 3) */
,
e
->
format
->
gl_vtx_type
,
e
->
stride
,
e
->
data
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
e
->
data
.
addr
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
}
else
{
TRACE
(
"glVertexPointer(%#x, %#x, %#x, %p);
\n
"
,
e
->
format
->
gl_vtx_format
,
e
->
format
->
gl_vtx_type
,
e
->
stride
,
e
->
data
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
e
->
data
.
addr
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
glVertexPointer
(
e
->
format
->
gl_vtx_format
,
e
->
format
->
gl_vtx_type
,
e
->
stride
,
e
->
data
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
e
->
data
.
addr
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
}
checkGLcall
(
"glVertexPointer(...)"
);
glEnableClientState
(
GL_VERTEX_ARRAY
);
...
...
@@ -4354,17 +4356,17 @@ static void loadVertexData(const struct wined3d_context *context, struct wined3d
e
=
&
si
->
elements
[
WINED3D_FFP_NORMAL
];
stream
=
&
stateblock
->
state
.
streams
[
e
->
stream_idx
];
if
(
curVBO
!=
e
->
buffer_object
)
if
(
curVBO
!=
e
->
data
.
buffer_object
)
{
GL_EXTCALL
(
glBindBufferARB
(
GL_ARRAY_BUFFER_ARB
,
e
->
buffer_object
));
GL_EXTCALL
(
glBindBufferARB
(
GL_ARRAY_BUFFER_ARB
,
e
->
data
.
buffer_object
));
checkGLcall
(
"glBindBufferARB"
);
curVBO
=
e
->
buffer_object
;
curVBO
=
e
->
data
.
buffer_object
;
}
TRACE
(
"glNormalPointer(%#x, %#x, %p);
\n
"
,
e
->
format
->
gl_vtx_type
,
e
->
stride
,
e
->
data
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
e
->
data
.
addr
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
glNormalPointer
(
e
->
format
->
gl_vtx_type
,
e
->
stride
,
e
->
data
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
e
->
data
.
addr
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
checkGLcall
(
"glNormalPointer(...)"
);
glEnableClientState
(
GL_NORMAL_ARRAY
);
checkGLcall
(
"glEnableClientState(GL_NORMAL_ARRAY)"
);
...
...
@@ -4388,18 +4390,18 @@ static void loadVertexData(const struct wined3d_context *context, struct wined3d
e
=
&
si
->
elements
[
WINED3D_FFP_DIFFUSE
];
stream
=
&
stateblock
->
state
.
streams
[
e
->
stream_idx
];
if
(
curVBO
!=
e
->
buffer_object
)
if
(
curVBO
!=
e
->
data
.
buffer_object
)
{
GL_EXTCALL
(
glBindBufferARB
(
GL_ARRAY_BUFFER_ARB
,
e
->
buffer_object
));
GL_EXTCALL
(
glBindBufferARB
(
GL_ARRAY_BUFFER_ARB
,
e
->
data
.
buffer_object
));
checkGLcall
(
"glBindBufferARB"
);
curVBO
=
e
->
buffer_object
;
curVBO
=
e
->
data
.
buffer_object
;
}
TRACE
(
"glColorPointer(%#x, %#x %#x, %p);
\n
"
,
e
->
format
->
gl_vtx_format
,
e
->
format
->
gl_vtx_type
,
e
->
stride
,
e
->
data
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
e
->
data
.
addr
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
glColorPointer
(
e
->
format
->
gl_vtx_format
,
e
->
format
->
gl_vtx_type
,
e
->
stride
,
e
->
data
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
e
->
data
.
addr
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
checkGLcall
(
"glColorPointer(4, GL_UNSIGNED_BYTE, ...)"
);
glEnableClientState
(
GL_COLOR_ARRAY
);
checkGLcall
(
"glEnableClientState(GL_COLOR_ARRAY)"
);
...
...
@@ -4422,11 +4424,11 @@ static void loadVertexData(const struct wined3d_context *context, struct wined3d
GLenum
type
=
e
->
format
->
gl_vtx_type
;
GLint
format
=
e
->
format
->
gl_vtx_format
;
if
(
curVBO
!=
e
->
buffer_object
)
if
(
curVBO
!=
e
->
data
.
buffer_object
)
{
GL_EXTCALL
(
glBindBufferARB
(
GL_ARRAY_BUFFER_ARB
,
e
->
buffer_object
));
GL_EXTCALL
(
glBindBufferARB
(
GL_ARRAY_BUFFER_ARB
,
e
->
data
.
buffer_object
));
checkGLcall
(
"glBindBufferARB"
);
curVBO
=
e
->
buffer_object
;
curVBO
=
e
->
data
.
buffer_object
;
}
if
(
format
!=
4
||
(
gl_info
->
quirks
&
WINED3D_QUIRK_ALLOWS_SPECULAR_ALPHA
))
...
...
@@ -4437,9 +4439,9 @@ static void loadVertexData(const struct wined3d_context *context, struct wined3d
* 4 component secondary colors use it
*/
TRACE
(
"glSecondaryColorPointer(%#x, %#x, %#x, %p);
\n
"
,
format
,
type
,
e
->
stride
,
e
->
data
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
e
->
data
.
addr
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
GL_EXTCALL
(
glSecondaryColorPointerEXT
(
format
,
type
,
e
->
stride
,
e
->
data
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
));
e
->
data
.
addr
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
));
checkGLcall
(
"glSecondaryColorPointerEXT(format, type, ...)"
);
}
else
...
...
@@ -4448,9 +4450,9 @@ static void loadVertexData(const struct wined3d_context *context, struct wined3d
{
case
GL_UNSIGNED_BYTE
:
TRACE
(
"glSecondaryColorPointer(3, GL_UNSIGNED_BYTE, %#x, %p);
\n
"
,
e
->
stride
,
e
->
data
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
e
->
data
.
addr
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
GL_EXTCALL
(
glSecondaryColorPointerEXT
(
3
,
GL_UNSIGNED_BYTE
,
e
->
stride
,
e
->
data
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
));
e
->
data
.
addr
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
));
checkGLcall
(
"glSecondaryColorPointerEXT(3, GL_UNSIGNED_BYTE, ...)"
);
break
;
...
...
@@ -4458,9 +4460,9 @@ static void loadVertexData(const struct wined3d_context *context, struct wined3d
FIXME
(
"Add 4 component specular color pointers for type %x
\n
"
,
type
);
/* Make sure that the right color component is dropped */
TRACE
(
"glSecondaryColorPointer(3, %#x, %#x, %p);
\n
"
,
type
,
e
->
stride
,
e
->
data
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
e
->
data
.
addr
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
GL_EXTCALL
(
glSecondaryColorPointerEXT
(
3
,
type
,
e
->
stride
,
e
->
data
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
));
e
->
data
.
addr
+
stateblock
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
));
checkGLcall
(
"glSecondaryColorPointerEXT(3, type, ...)"
);
}
}
...
...
dlls/wined3d/wined3d_private.h
View file @
c5d457c8
...
...
@@ -847,9 +847,9 @@ do {
/* Trace vector and strided data information */
#define TRACE_STRIDED(si, name) do { if (si->use_map & (1 << name)) \
TRACE( #name "
=(data:%p, stride:%d, format:%#x, vbo %d
, stream %u)\n", \
si->elements[name].data
, si->elements[name].stride, si->elements[name].format->id
, \
si->elements[name].buffer_object
, si->elements[name].stream_idx); } while(0)
TRACE( #name "
= (data {%#x:%p}, stride %d, format %s
, stream %u)\n", \
si->elements[name].data
.buffer_object, si->elements[name].data.addr, si->elements[name].stride
, \
debug_d3dformat(si->elements[name].format->id)
, si->elements[name].stream_idx); } while(0)
/* Global variables */
extern
const
float
identity
[
16
]
DECLSPEC_HIDDEN
;
...
...
@@ -904,10 +904,9 @@ struct wined3d_bo_address
struct
wined3d_stream_info_element
{
const
struct
wined3d_format
*
format
;
struct
wined3d_bo_address
data
;
GLsizei
stride
;
const
BYTE
*
data
;
UINT
stream_idx
;
GLuint
buffer_object
;
};
struct
wined3d_stream_info
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment