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
fd7c1cbf
Commit
fd7c1cbf
authored
Sep 14, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 14, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: IWineD3DBuffer_GetDesc() should never fail.
parent
ad917d36
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
70 deletions
+38
-70
buffer.c
dlls/d3d8/buffer.c
+15
-23
buffer.c
dlls/d3d9/buffer.c
+15
-23
device.c
dlls/ddraw/device.c
+3
-4
vertexbuffer.c
dlls/ddraw/vertexbuffer.c
+3
-16
buffer.c
dlls/wined3d/buffer.c
+1
-3
wined3d.idl
include/wine/wined3d.idl
+1
-1
No files found.
dlls/d3d8/buffer.c
View file @
fd7c1cbf
...
...
@@ -212,25 +212,21 @@ static HRESULT WINAPI d3d8_vertexbuffer_GetDesc(IDirect3DVertexBuffer8 *iface, D
{
IDirect3DVertexBuffer8Impl
*
buffer
=
(
IDirect3DVertexBuffer8Impl
*
)
iface
;
WINED3DBUFFER_DESC
wined3d_desc
;
HRESULT
hr
;
TRACE
(
"iface %p, desc %p.
\n
"
,
iface
,
desc
);
wined3d_mutex_lock
();
hr
=
IWineD3DBuffer_GetDesc
(
buffer
->
wineD3DVertexBuffer
,
&
wined3d_desc
);
IWineD3DBuffer_GetDesc
(
buffer
->
wineD3DVertexBuffer
,
&
wined3d_desc
);
wined3d_mutex_unlock
();
if
(
SUCCEEDED
(
hr
))
{
desc
->
Type
=
D3DRTYPE_VERTEXBUFFER
;
desc
->
Usage
=
wined3d_desc
.
Usage
;
desc
->
Pool
=
wined3d_desc
.
Pool
;
desc
->
Size
=
wined3d_desc
.
Size
;
desc
->
FVF
=
buffer
->
fvf
;
desc
->
Format
=
D3DFMT_VERTEXDATA
;
}
desc
->
Type
=
D3DRTYPE_VERTEXBUFFER
;
desc
->
Usage
=
wined3d_desc
.
Usage
;
desc
->
Pool
=
wined3d_desc
.
Pool
;
desc
->
Size
=
wined3d_desc
.
Size
;
desc
->
FVF
=
buffer
->
fvf
;
desc
->
Format
=
D3DFMT_VERTEXDATA
;
return
hr
;
return
D3D_OK
;
}
static
const
IDirect3DVertexBuffer8Vtbl
Direct3DVertexBuffer8_Vtbl
=
...
...
@@ -479,25 +475,21 @@ static HRESULT WINAPI d3d8_indexbuffer_Unlock(IDirect3DIndexBuffer8 *iface)
static
HRESULT
WINAPI
d3d8_indexbuffer_GetDesc
(
IDirect3DIndexBuffer8
*
iface
,
D3DINDEXBUFFER_DESC
*
desc
)
{
IDirect3DIndexBuffer8Impl
*
buffer
=
(
IDirect3DIndexBuffer8Impl
*
)
iface
;
HRESULT
hr
;
WINED3DBUFFER_DESC
wined3d_desc
;
TRACE
(
"iface %p, desc %p.
\n
"
,
iface
,
desc
);
wined3d_mutex_lock
();
hr
=
IWineD3DBuffer_GetDesc
(
buffer
->
wineD3DIndexBuffer
,
&
wined3d_desc
);
IWineD3DBuffer_GetDesc
(
buffer
->
wineD3DIndexBuffer
,
&
wined3d_desc
);
wined3d_mutex_unlock
();
if
(
SUCCEEDED
(
hr
))
{
desc
->
Format
=
d3dformat_from_wined3dformat
(
buffer
->
format
);
desc
->
Type
=
D3DRTYPE_INDEXBUFFER
;
desc
->
Usage
=
wined3d_desc
.
Usage
;
desc
->
Pool
=
wined3d_desc
.
Pool
;
desc
->
Size
=
wined3d_desc
.
Size
;
}
desc
->
Format
=
d3dformat_from_wined3dformat
(
buffer
->
format
);
desc
->
Type
=
D3DRTYPE_INDEXBUFFER
;
desc
->
Usage
=
wined3d_desc
.
Usage
;
desc
->
Pool
=
wined3d_desc
.
Pool
;
desc
->
Size
=
wined3d_desc
.
Size
;
return
hr
;
return
D3D_OK
;
}
static
const
IDirect3DIndexBuffer8Vtbl
d3d8_indexbuffer_vtbl
=
...
...
dlls/d3d9/buffer.c
View file @
fd7c1cbf
...
...
@@ -214,25 +214,21 @@ static HRESULT WINAPI d3d9_vertexbuffer_GetDesc(IDirect3DVertexBuffer9 *iface, D
{
IDirect3DVertexBuffer9Impl
*
buffer
=
(
IDirect3DVertexBuffer9Impl
*
)
iface
;
WINED3DBUFFER_DESC
wined3d_desc
;
HRESULT
hr
;
TRACE
(
"iface %p, desc %p.
\n
"
,
iface
,
desc
);
wined3d_mutex_lock
();
hr
=
IWineD3DBuffer_GetDesc
(
buffer
->
wineD3DVertexBuffer
,
&
wined3d_desc
);
IWineD3DBuffer_GetDesc
(
buffer
->
wineD3DVertexBuffer
,
&
wined3d_desc
);
wined3d_mutex_unlock
();
if
(
SUCCEEDED
(
hr
))
{
desc
->
Format
=
D3DFMT_VERTEXDATA
;
desc
->
Usage
=
wined3d_desc
.
Usage
;
desc
->
Pool
=
wined3d_desc
.
Pool
;
desc
->
Size
=
wined3d_desc
.
Size
;
desc
->
Type
=
D3DRTYPE_VERTEXBUFFER
;
desc
->
FVF
=
buffer
->
fvf
;
}
desc
->
Format
=
D3DFMT_VERTEXDATA
;
desc
->
Usage
=
wined3d_desc
.
Usage
;
desc
->
Pool
=
wined3d_desc
.
Pool
;
desc
->
Size
=
wined3d_desc
.
Size
;
desc
->
Type
=
D3DRTYPE_VERTEXBUFFER
;
desc
->
FVF
=
buffer
->
fvf
;
return
hr
;
return
D3D_OK
;
}
static
const
IDirect3DVertexBuffer9Vtbl
d3d9_vertexbuffer_vtbl
=
...
...
@@ -482,24 +478,20 @@ static HRESULT WINAPI d3d9_indexbuffer_GetDesc(IDirect3DIndexBuffer9 *iface, D3D
{
IDirect3DIndexBuffer9Impl
*
buffer
=
(
IDirect3DIndexBuffer9Impl
*
)
iface
;
WINED3DBUFFER_DESC
wined3d_desc
;
HRESULT
hr
;
TRACE
(
"iface %p, desc %p.
\n
"
,
iface
,
desc
);
wined3d_mutex_lock
();
hr
=
IWineD3DBuffer_GetDesc
(
buffer
->
wineD3DIndexBuffer
,
&
wined3d_desc
);
IWineD3DBuffer_GetDesc
(
buffer
->
wineD3DIndexBuffer
,
&
wined3d_desc
);
wined3d_mutex_unlock
();
if
(
SUCCEEDED
(
hr
))
{
desc
->
Format
=
d3dformat_from_wined3dformat
(
buffer
->
format
);
desc
->
Usage
=
wined3d_desc
.
Usage
;
desc
->
Pool
=
wined3d_desc
.
Pool
;
desc
->
Size
=
wined3d_desc
.
Size
;
desc
->
Type
=
D3DRTYPE_INDEXBUFFER
;
}
desc
->
Format
=
d3dformat_from_wined3dformat
(
buffer
->
format
);
desc
->
Usage
=
wined3d_desc
.
Usage
;
desc
->
Pool
=
wined3d_desc
.
Pool
;
desc
->
Size
=
wined3d_desc
.
Size
;
desc
->
Type
=
D3DRTYPE_INDEXBUFFER
;
return
hr
;
return
D3D_OK
;
}
static
const
IDirect3DIndexBuffer9Vtbl
d3d9_indexbuffer_vtbl
=
...
...
dlls/ddraw/device.c
View file @
fd7c1cbf
...
...
@@ -4345,10 +4345,9 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
}
/* check that the buffer is large enough to hold the indices,
* reallocate if necessary.
*/
hr
=
IWineD3DBuffer_GetDesc
(
This
->
indexbuffer
,
&
desc
);
if
(
desc
.
Size
<
IndexCount
*
sizeof
(
WORD
))
* reallocate if necessary. */
IWineD3DBuffer_GetDesc
(
This
->
indexbuffer
,
&
desc
);
if
(
desc
.
Size
<
IndexCount
*
sizeof
(
WORD
))
{
UINT
size
=
max
(
desc
.
Size
*
2
,
IndexCount
*
sizeof
(
WORD
));
IWineD3DBuffer
*
buffer
;
...
...
dlls/ddraw/vertexbuffer.c
View file @
fd7c1cbf
...
...
@@ -232,13 +232,7 @@ IDirect3DVertexBufferImpl_Lock(IDirect3DVertexBuffer7 *iface,
if
(
Size
)
{
/* Get the size, for returning it, and for locking */
hr
=
IWineD3DBuffer_GetDesc
(
This
->
wineD3DVertexBuffer
,
&
Desc
);
if
(
hr
!=
D3D_OK
)
{
ERR
(
"(%p) IWineD3DBuffer::GetDesc failed with hr=%08x
\n
"
,
This
,
hr
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
hr
;
}
IWineD3DBuffer_GetDesc
(
This
->
wineD3DVertexBuffer
,
&
Desc
);
*
Size
=
Desc
.
Size
;
}
...
...
@@ -425,26 +419,19 @@ IDirect3DVertexBufferImpl_GetVertexBufferDesc(IDirect3DVertexBuffer7 *iface,
{
IDirect3DVertexBufferImpl
*
This
=
(
IDirect3DVertexBufferImpl
*
)
iface
;
WINED3DBUFFER_DESC
WDesc
;
HRESULT
hr
;
TRACE
(
"iface %p, desc %p.
\n
"
,
iface
,
Desc
);
if
(
!
Desc
)
return
DDERR_INVALIDPARAMS
;
EnterCriticalSection
(
&
ddraw_cs
);
hr
=
IWineD3DBuffer_GetDesc
(
This
->
wineD3DVertexBuffer
,
&
WDesc
);
if
(
hr
!=
D3D_OK
)
{
ERR
(
"(%p) IWineD3DBuffer::GetDesc failed with hr=%08x
\n
"
,
This
,
hr
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
hr
;
}
IWineD3DBuffer_GetDesc
(
This
->
wineD3DVertexBuffer
,
&
WDesc
);
LeaveCriticalSection
(
&
ddraw_cs
);
/* Now fill the Desc structure */
Desc
->
dwCaps
=
This
->
Caps
;
Desc
->
dwFVF
=
This
->
fvf
;
Desc
->
dwNumVertices
=
WDesc
.
Size
/
get_flexible_vertex_size
(
This
->
fvf
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
D3D_OK
;
}
...
...
dlls/wined3d/buffer.c
View file @
fd7c1cbf
...
...
@@ -1413,7 +1413,7 @@ static HRESULT STDMETHODCALLTYPE buffer_Unmap(IWineD3DBuffer *iface)
return
WINED3D_OK
;
}
static
HRESULT
STDMETHODCALLTYPE
buffer_GetDesc
(
IWineD3DBuffer
*
iface
,
WINED3DBUFFER_DESC
*
desc
)
static
void
STDMETHODCALLTYPE
buffer_GetDesc
(
IWineD3DBuffer
*
iface
,
WINED3DBUFFER_DESC
*
desc
)
{
struct
wined3d_buffer
*
This
=
(
struct
wined3d_buffer
*
)
iface
;
...
...
@@ -1423,8 +1423,6 @@ static HRESULT STDMETHODCALLTYPE buffer_GetDesc(IWineD3DBuffer *iface, WINED3DBU
desc
->
Usage
=
This
->
resource
.
usage
;
desc
->
Pool
=
This
->
resource
.
pool
;
desc
->
Size
=
This
->
resource
.
size
;
return
WINED3D_OK
;
}
static
const
struct
IWineD3DBufferVtbl
wined3d_buffer_vtbl
=
...
...
include/wine/wined3d.idl
View file @
fd7c1cbf
...
...
@@ -2736,7 +2736,7 @@ interface IWineD3DBuffer : IWineD3DResource
)
;
HRESULT
Unmap
(
)
;
HRESULT
GetDesc
(
void
GetDesc
(
[
out
]
WINED3DBUFFER_DESC
*
desc
)
;
}
...
...
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