Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
ee65d59c
Commit
ee65d59c
authored
Dec 16, 2002
by
Lionel Ulmer
Committed by
Alexandre Julliard
Dec 16, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a memory leak and optimize a little bit the generic path.
parent
c301b390
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
9 deletions
+32
-9
mesa.c
dlls/ddraw/d3ddevice/mesa.c
+20
-9
mesa_private.h
dlls/ddraw/mesa_private.h
+12
-0
No files found.
dlls/ddraw/d3ddevice/mesa.c
View file @
ee65d59c
...
...
@@ -282,6 +282,8 @@ GL_IDirect3DDeviceImpl_7_3T_2T_1T_Release(LPDIRECT3DDEVICE7 iface)
if
(
This
->
current_texture
[
0
]
!=
NULL
)
IDirect3DTexture2_Release
(
ICOM_INTERFACE
(
This
->
current_texture
[
0
],
IDirect3DTexture2
));
if
(
glThis
->
handler
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
ENTER_GL
();
glXDestroyContext
(
glThis
->
display
,
glThis
->
gl_context
);
LEAVE_GL
();
...
...
@@ -902,12 +904,6 @@ typedef struct {
float
tu1
,
tv1
;
}
D3DFVF_TLVERTEX_1
;
typedef
struct
{
int
offset
;
int
extra
;
void
(
*
handler
)(
char
*
vertex
,
int
offset
,
int
extra
);
}
D3DFVF_GENERIC
;
/* These are the various handler used in the generic path */
static
void
handle_xyz
(
char
*
vertex
,
int
offset
,
int
extra
)
{
glVertex3fv
((
float
*
)
(
vertex
+
offset
));
...
...
@@ -1018,14 +1014,22 @@ static void draw_primitive_7(IDirect3DDeviceImpl *This,
Note that people should write a fast path for all vertex formats out there...
*/
DWORD
elements
;
DWORD
size
=
get_flexible_vertex_size
(
d3dvtVertexType
,
&
elements
)
;
DWORD
size
;
char
*
vertices
=
(
char
*
)
lpvVertices
;
int
index
;
int
current_offset
=
0
;
int
current_position
=
0
;
D3DFVF_GENERIC
*
handler
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
elements
*
sizeof
(
D3DFVF_GENERIC
))
;
D3DFVF_GENERIC
*
handler
;
WARN
(
" using draw_primitive generic path - for better performance, add a fast path for your vertex case !
\n
"
);
if
((
glThis
->
last_vertex_format
!=
d3dvtVertexType
)
||
(
glThis
->
handler
==
NULL
))
{
if
(
glThis
->
handler
==
NULL
)
HeapFree
(
GetProcessHeap
(),
0
,
glThis
->
handler
);
size
=
get_flexible_vertex_size
(
d3dvtVertexType
,
&
elements
);
glThis
->
handler
=
handler
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
elements
*
sizeof
(
D3DFVF_GENERIC
));
glThis
->
last_vertex_format
=
d3dvtVertexType
;
glThis
->
last_vertex_format_size
=
size
;
glThis
->
last_vertex_format_elements
=
elements
;
if
((
d3dvtVertexType
&
D3DFVF_POSITION_MASK
)
==
D3DFVF_XYZ
)
{
handler
[
elements
-
1
].
handler
=
handle_xyz
;
...
...
@@ -1070,6 +1074,13 @@ static void draw_primitive_7(IDirect3DDeviceImpl *This,
current_offset
+=
2
*
sizeof
(
D3DVALUE
);
}
}
}
else
{
handler
=
glThis
->
handler
;
size
=
glThis
->
last_vertex_format_size
;
elements
=
glThis
->
last_vertex_format_elements
;
}
WARN
(
" using draw_primitive generic path - for better performance, add a fast path for your vertex case !
\n
"
);
for
(
index
=
0
;
index
<
dwIndexCount
;
index
++
)
{
int
i
=
(
dwIndices
==
NULL
)
?
index
:
dwIndices
[
index
];
...
...
dlls/ddraw/mesa_private.h
View file @
ee65d59c
...
...
@@ -99,6 +99,12 @@ typedef struct IDirect3DTextureGLImpl
void
(
*
unlock_update
)(
IDirectDrawSurfaceImpl
*
This
,
LPCRECT
pRect
);
}
IDirect3DTextureGLImpl
;
typedef
struct
{
int
offset
;
int
extra
;
void
(
*
handler
)(
char
*
vertex
,
int
offset
,
int
extra
);
}
D3DFVF_GENERIC
;
typedef
struct
IDirect3DDeviceGLImpl
{
struct
IDirect3DDeviceImpl
parent
;
...
...
@@ -112,6 +118,12 @@ typedef struct IDirect3DDeviceGLImpl
BOOLEAN
last_vertices_transformed
;
BOOLEAN
last_vertices_lit
;
/* This is to optimize a little bit the 'slow generic' path for the DrawPrimitive stuff */
D3DFVF_GENERIC
*
handler
;
DWORD
last_vertex_format
;
DWORD
last_vertex_format_size
;
DWORD
last_vertex_format_elements
;
D3DMATRIX
*
world_mat
;
D3DMATRIX
*
view_mat
;
D3DMATRIX
*
proj_mat
;
...
...
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