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
bc07ad05
Commit
bc07ad05
authored
Apr 06, 2009
by
Stefan Dösinger
Committed by
Alexandre Julliard
Apr 08, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8, d3d9: Don't rely on the wined3d buffer type.
parent
55fc9022
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
71 additions
and
54 deletions
+71
-54
directx.c
dlls/d3d8/directx.c
+13
-1
indexbuffer.c
dlls/d3d8/indexbuffer.c
+6
-7
vertexbuffer.c
dlls/d3d8/vertexbuffer.c
+6
-7
device.c
dlls/d3d9/device.c
+13
-11
directx.c
dlls/d3d9/directx.c
+13
-1
vertexbuffer.c
dlls/d3d9/vertexbuffer.c
+7
-7
device.c
dlls/wined3d/device.c
+12
-17
directx.c
dlls/wined3d/directx.c
+1
-1
utils.c
dlls/wined3d/utils.c
+0
-2
No files found.
dlls/d3d8/directx.c
View file @
bc07ad05
...
...
@@ -188,11 +188,23 @@ static HRESULT WINAPI IDirect3D8Impl_CheckDeviceFormat (LPDIRECT3D8 i
DWORD
Usage
,
D3DRESOURCETYPE
RType
,
D3DFORMAT
CheckFormat
)
{
IDirect3D8Impl
*
This
=
(
IDirect3D8Impl
*
)
iface
;
HRESULT
hr
;
WINED3DRESOURCETYPE
WineD3DRType
;
TRACE
(
"(%p)->(%d, %d, %d, %08x, %d, %d)
\n
"
,
This
,
Adapter
,
DeviceType
,
AdapterFormat
,
Usage
,
RType
,
CheckFormat
);
switch
(
RType
)
{
case
D3DRTYPE_VERTEXBUFFER
:
case
D3DRTYPE_INDEXBUFFER
:
WineD3DRType
=
WINED3DRTYPE_BUFFER
;
break
;
default:
WineD3DRType
=
RType
;
break
;
}
EnterCriticalSection
(
&
d3d8_cs
);
hr
=
IWineD3D_CheckDeviceFormat
(
This
->
WineD3D
,
Adapter
,
DeviceType
,
wined3dformat_from_d3dformat
(
AdapterFormat
),
Usage
,
RType
,
wined3dformat_from_d3dformat
(
CheckFormat
),
SURFACE_OPENGL
);
Usage
,
WineD3D
RType
,
wined3dformat_from_d3dformat
(
CheckFormat
),
SURFACE_OPENGL
);
LeaveCriticalSection
(
&
d3d8_cs
);
return
hr
;
}
...
...
dlls/d3d8/indexbuffer.c
View file @
bc07ad05
...
...
@@ -149,13 +149,9 @@ static void WINAPI IDirect3DIndexBuffer8Impl_PreLoad(LPDIRECT3DINDEXBUFFER8 ifac
static
D3DRESOURCETYPE
WINAPI
IDirect3DIndexBuffer8Impl_GetType
(
LPDIRECT3DINDEXBUFFER8
iface
)
{
IDirect3DIndexBuffer8Impl
*
This
=
(
IDirect3DIndexBuffer8Impl
*
)
iface
;
D3DRESOURCETYPE
type
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
TRACE
(
"(%p)
\n
"
,
This
);
EnterCriticalSection
(
&
d3d8_cs
);
type
=
IWineD3DIndexBuffer_GetType
(
This
->
wineD3DIndexBuffer
);
LeaveCriticalSection
(
&
d3d8_cs
);
return
type
;
return
D3DRTYPE_INDEXBUFFER
;
}
/* IDirect3DIndexBuffer8 Interface follow: */
...
...
@@ -190,7 +186,10 @@ static HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetDesc(LPDIRECT3DINDEXBUFFER8 i
hr
=
IWineD3DIndexBuffer_GetDesc
(
This
->
wineD3DIndexBuffer
,
(
WINED3DINDEXBUFFER_DESC
*
)
pDesc
);
LeaveCriticalSection
(
&
d3d8_cs
);
if
(
SUCCEEDED
(
hr
))
pDesc
->
Format
=
d3dformat_from_wined3dformat
(
pDesc
->
Format
);
if
(
SUCCEEDED
(
hr
))
{
pDesc
->
Format
=
d3dformat_from_wined3dformat
(
pDesc
->
Format
);
pDesc
->
Type
=
D3DRTYPE_INDEXBUFFER
;
}
return
hr
;
}
...
...
dlls/d3d8/vertexbuffer.c
View file @
bc07ad05
...
...
@@ -151,13 +151,9 @@ static void WINAPI IDirect3DVertexBuffer8Impl_PreLoad(LPDIRECT3DVERTEXBUFFER8 if
static
D3DRESOURCETYPE
WINAPI
IDirect3DVertexBuffer8Impl_GetType
(
LPDIRECT3DVERTEXBUFFER8
iface
)
{
IDirect3DVertexBuffer8Impl
*
This
=
(
IDirect3DVertexBuffer8Impl
*
)
iface
;
D3DRESOURCETYPE
type
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
TRACE
(
"(%p)
\n
"
,
This
);
EnterCriticalSection
(
&
d3d8_cs
);
type
=
IWineD3DBuffer_GetType
(
This
->
wineD3DVertexBuffer
);
LeaveCriticalSection
(
&
d3d8_cs
);
return
type
;
return
D3DRTYPE_VERTEXBUFFER
;
}
/* IDirect3DVertexBuffer8 Interface follow: */
...
...
@@ -192,7 +188,10 @@ static HRESULT WINAPI IDirect3DVertexBuffer8Impl_GetDesc(LPDIRECT3DVERTEXBUFFER8
hr
=
IWineD3DBuffer_GetDesc
(
This
->
wineD3DVertexBuffer
,
(
WINED3DVERTEXBUFFER_DESC
*
)
pDesc
);
LeaveCriticalSection
(
&
d3d8_cs
);
if
(
SUCCEEDED
(
hr
))
pDesc
->
Format
=
d3dformat_from_wined3dformat
(
pDesc
->
Format
);
if
(
SUCCEEDED
(
hr
))
{
pDesc
->
Type
=
D3DRTYPE_VERTEXBUFFER
;
pDesc
->
Format
=
d3dformat_from_wined3dformat
(
pDesc
->
Format
);
}
return
hr
;
}
...
...
dlls/d3d9/device.c
View file @
bc07ad05
...
...
@@ -428,17 +428,18 @@ static HRESULT WINAPI reset_enum_callback(IWineD3DResource *resource, void *data
HRESULT
ret
=
S_OK
;
WINED3DSURFACE_DESC
surface_desc
;
WINED3DVOLUME_DESC
volume_desc
;
WINE
D3DINDEXBUFFER_DESC
index_desc
;
WINE
D3DVERTEXBUFFER_DESC
vertex_desc
;
D3DINDEXBUFFER_DESC
index_desc
;
D3DVERTEXBUFFER_DESC
vertex_desc
;
WINED3DFORMAT
dummy_format
;
WINED3DMULTISAMPLE_TYPE
dummy_multisampletype
;
DWORD
dummy_dword
;
WINED3DPOOL
pool
=
WINED3DPOOL_SCRATCH
;
/* a harmless pool */
I
Unknown
*
parent
;
I
Direct3DResource9
*
parent
;
type
=
IWineD3DResource_GetType
(
resource
);
IWineD3DResource_GetParent
(
resource
,
(
IUnknown
**
)
&
parent
);
type
=
IDirect3DResource9_GetType
(
parent
);
switch
(
type
)
{
case
WINE
D3DRTYPE_SURFACE
:
case
D3DRTYPE_SURFACE
:
surface_desc
.
Format
=
&
dummy_format
;
surface_desc
.
Type
=
&
type
;
surface_desc
.
Usage
=
&
dummy_dword
;
...
...
@@ -452,7 +453,7 @@ static HRESULT WINAPI reset_enum_callback(IWineD3DResource *resource, void *data
IWineD3DSurface_GetDesc
((
IWineD3DSurface
*
)
resource
,
&
surface_desc
);
break
;
case
WINE
D3DRTYPE_VOLUME
:
case
D3DRTYPE_VOLUME
:
volume_desc
.
Format
=
&
dummy_format
;
volume_desc
.
Type
=
&
type
;
volume_desc
.
Usage
=
&
dummy_dword
;
...
...
@@ -464,13 +465,13 @@ static HRESULT WINAPI reset_enum_callback(IWineD3DResource *resource, void *data
IWineD3DVolume_GetDesc
((
IWineD3DVolume
*
)
resource
,
&
volume_desc
);
break
;
case
WINE
D3DRTYPE_INDEXBUFFER
:
I
WineD3DIndexBuffer_GetDesc
((
IWineD3DIndexBuffer
*
)
resource
,
&
index_desc
);
case
D3DRTYPE_INDEXBUFFER
:
I
Direct3DIndexBuffer9_GetDesc
((
IDirect3DIndexBuffer9
*
)
parent
,
&
index_desc
);
pool
=
index_desc
.
Pool
;
break
;
case
WINE
D3DRTYPE_VERTEXBUFFER
:
I
WineD3DBuffer_GetDesc
((
IWineD3DBuffer
*
)
resource
,
&
vertex_desc
);
case
D3DRTYPE_VERTEXBUFFER
:
I
Direct3DVertexBuffer9_GetDesc
((
IDirect3DVertexBuffer9
*
)
parent
,
&
vertex_desc
);
pool
=
vertex_desc
.
Pool
;
break
;
...
...
@@ -482,7 +483,6 @@ static HRESULT WINAPI reset_enum_callback(IWineD3DResource *resource, void *data
}
if
(
pool
==
WINED3DPOOL_DEFAULT
)
{
IWineD3DResource_GetParent
(
resource
,
&
parent
);
if
(
IUnknown_Release
(
parent
)
==
0
)
{
TRACE
(
"Parent %p is an implicit resource with ref 0
\n
"
,
parent
);
}
else
{
...
...
@@ -490,6 +490,8 @@ static HRESULT WINAPI reset_enum_callback(IWineD3DResource *resource, void *data
ret
=
S_FALSE
;
*
resources_ok
=
FALSE
;
}
}
else
{
IUnknown_Release
(
parent
);
}
IWineD3DResource_Release
(
resource
);
...
...
dlls/d3d9/directx.c
View file @
bc07ad05
...
...
@@ -194,11 +194,23 @@ static HRESULT WINAPI IDirect3D9Impl_CheckDeviceFormat(LPDIRECT3D9EX iface,
DWORD
Usage
,
D3DRESOURCETYPE
RType
,
D3DFORMAT
CheckFormat
)
{
IDirect3D9Impl
*
This
=
(
IDirect3D9Impl
*
)
iface
;
HRESULT
hr
;
WINED3DRESOURCETYPE
WineD3DRType
;
TRACE
(
"%p
\n
"
,
This
);
switch
(
RType
)
{
case
D3DRTYPE_VERTEXBUFFER
:
case
D3DRTYPE_INDEXBUFFER
:
WineD3DRType
=
WINED3DRTYPE_BUFFER
;
break
;
default:
WineD3DRType
=
RType
;
break
;
}
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3D_CheckDeviceFormat
(
This
->
WineD3D
,
Adapter
,
DeviceType
,
wined3dformat_from_d3dformat
(
AdapterFormat
),
Usage
,
RType
,
wined3dformat_from_d3dformat
(
CheckFormat
),
SURFACE_OPENGL
);
Usage
,
WineD3D
RType
,
wined3dformat_from_d3dformat
(
CheckFormat
),
SURFACE_OPENGL
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
hr
;
}
...
...
dlls/d3d9/vertexbuffer.c
View file @
bc07ad05
...
...
@@ -154,13 +154,9 @@ static void WINAPI IDirect3DVertexBuffer9Impl_PreLoad(LPDIRECT3DVERTEXBUFFER9 if
static
D3DRESOURCETYPE
WINAPI
IDirect3DVertexBuffer9Impl_GetType
(
LPDIRECT3DVERTEXBUFFER9
iface
)
{
IDirect3DVertexBuffer9Impl
*
This
=
(
IDirect3DVertexBuffer9Impl
*
)
iface
;
D3DRESOURCETYPE
ret
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
TRACE
(
"(%p)
\n
"
,
This
);
EnterCriticalSection
(
&
d3d9_cs
);
ret
=
IWineD3DBuffer_GetType
(
This
->
wineD3DVertexBuffer
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
ret
;
return
D3DRTYPE_VERTEXBUFFER
;
}
/* IDirect3DVertexBuffer9 Interface follow: */
...
...
@@ -195,7 +191,11 @@ static HRESULT WINAPI IDirect3DVertexBuffer9Impl_GetDesc(LPDIRECT3DVERTEXBUFFER9
hr
=
IWineD3DBuffer_GetDesc
(
This
->
wineD3DVertexBuffer
,
(
WINED3DVERTEXBUFFER_DESC
*
)
pDesc
);
LeaveCriticalSection
(
&
d3d9_cs
);
if
(
SUCCEEDED
(
hr
))
pDesc
->
Format
=
d3dformat_from_wined3dformat
(
pDesc
->
Format
);
if
(
SUCCEEDED
(
hr
))
{
pDesc
->
Format
=
d3dformat_from_wined3dformat
(
pDesc
->
Format
);
pDesc
->
Type
=
D3DRTYPE_VERTEXBUFFER
;
}
return
hr
;
}
...
...
dlls/wined3d/device.c
View file @
bc07ad05
...
...
@@ -532,7 +532,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexBuffer(IWineD3DDevice *ifac
}
object
->
vtbl
=
&
wined3d_buffer_vtbl
;
hr
=
resource_init
(
&
object
->
resource
,
WINED3DRTYPE_
VERTEX
BUFFER
,
This
,
Size
,
Usage
,
format_desc
,
Pool
,
parent
);
hr
=
resource_init
(
&
object
->
resource
,
WINED3DRTYPE_BUFFER
,
This
,
Size
,
Usage
,
format_desc
,
Pool
,
parent
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize resource, returning %#x
\n
"
,
hr
);
...
...
@@ -650,7 +650,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateIndexBuffer(IWineD3DDevice *iface
}
object
->
lpVtbl
=
&
IWineD3DIndexBuffer_Vtbl
;
hr
=
resource_init
(
&
object
->
resource
,
WINED3DRTYPE_
INDEX
BUFFER
,
This
,
Length
,
Usage
,
format_desc
,
Pool
,
parent
);
hr
=
resource_init
(
&
object
->
resource
,
WINED3DRTYPE_BUFFER
,
This
,
Length
,
Usage
,
format_desc
,
Pool
,
parent
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize resource, returning %#x
\n
"
,
hr
);
...
...
@@ -7905,7 +7905,7 @@ static void WINAPI IWineD3DDeviceImpl_ResourceReleased(IWineD3DDevice *iface, IW
case
WINED3DRTYPE_VOLUME
:
/* TODO: nothing really? */
break
;
case
WINED3DRTYPE_
VERTEX
BUFFER
:
case
WINED3DRTYPE_BUFFER
:
{
int
streamNumber
;
TRACE
(
"Cleaning up stream pointers
\n
"
);
...
...
@@ -7928,25 +7928,20 @@ static void WINAPI IWineD3DDeviceImpl_ResourceReleased(IWineD3DDevice *iface, IW
}
}
}
}
break
;
case
WINED3DRTYPE_INDEXBUFFER
:
if
(
This
->
updateStateBlock
!=
NULL
)
{
/* ==NULL when device is being destroyed */
if
(
This
->
updateStateBlock
->
pIndexData
==
(
IWineD3DIndexBuffer
*
)
resource
)
{
This
->
updateStateBlock
->
pIndexData
=
NULL
;
if
(
This
->
updateStateBlock
!=
NULL
)
{
/* ==NULL when device is being destroyed */
if
(
This
->
updateStateBlock
->
pIndexData
==
(
IWineD3DIndexBuffer
*
)
resource
)
{
This
->
updateStateBlock
->
pIndexData
=
NULL
;
}
}
}
if
(
This
->
stateBlock
!=
NULL
)
{
/* ==NULL when device is being destroyed */
if
(
This
->
stateBlock
->
pIndexData
==
(
IWineD3DIndexBuffer
*
)
resource
)
{
This
->
stateBlock
->
pIndexData
=
NULL
;
if
(
This
->
stateBlock
!=
NULL
)
{
/* ==NULL when device is being destroyed */
if
(
This
->
stateBlock
->
pIndexData
==
(
IWineD3DIndexBuffer
*
)
resource
)
{
This
->
stateBlock
->
pIndexData
=
NULL
;
}
}
}
break
;
case
WINED3DRTYPE_BUFFER
:
/* Nothing to do, yet.*/
break
;
default
:
FIXME
(
"(%p) unknown resource type %p %u
\n
"
,
This
,
resource
,
IWineD3DResource_GetType
(
resource
));
break
;
...
...
dlls/wined3d/directx.c
View file @
bc07ad05
...
...
@@ -3047,7 +3047,7 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
/* Do nothing, continue with checking the format below */
break
;
}
}
else
if
(
(
RType
==
WINED3DRTYPE_INDEXBUFFER
)
||
(
RType
==
WINED3DRTYPE_VERTEXBUFFER
)
){
}
else
if
(
RType
==
WINED3DRTYPE_BUFFER
){
/* For instance vertexbuffer/indexbuffer aren't supported yet because no Windows drivers seem to offer it */
TRACE_
(
d3d_caps
)(
"Unhandled resource type D3DRTYPE_INDEXBUFFER / D3DRTYPE_VERTEXBUFFER
\n
"
);
return
WINED3DERR_NOTAVAILABLE
;
...
...
dlls/wined3d/utils.c
View file @
bc07ad05
...
...
@@ -996,8 +996,6 @@ const char* debug_d3dresourcetype(WINED3DRESOURCETYPE res) {
RES_TO_STR
(
WINED3DRTYPE_TEXTURE
);
RES_TO_STR
(
WINED3DRTYPE_VOLUMETEXTURE
);
RES_TO_STR
(
WINED3DRTYPE_CUBETEXTURE
);
RES_TO_STR
(
WINED3DRTYPE_VERTEXBUFFER
);
RES_TO_STR
(
WINED3DRTYPE_INDEXBUFFER
);
RES_TO_STR
(
WINED3DRTYPE_BUFFER
);
#undef RES_TO_STR
default:
...
...
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