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
55124ec0
Commit
55124ec0
authored
Sep 02, 2005
by
Oliver Stieber
Committed by
Alexandre Julliard
Sep 02, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the tracking of stream frequency and flags. Stream flags and
frequency aren't handled at the moment.
parent
3cbbd412
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
5 deletions
+76
-5
device.c
dlls/wined3d/device.c
+76
-5
No files found.
dlls/wined3d/device.c
View file @
55124ec0
...
@@ -1540,9 +1540,35 @@ HRESULT WINAPI IWineD3DDeviceImpl_GetFVF(IWineD3DDevice *iface, DWORD *pfvf) {
...
@@ -1540,9 +1540,35 @@ HRESULT WINAPI IWineD3DDeviceImpl_GetFVF(IWineD3DDevice *iface, DWORD *pfvf) {
* Get / Set Stream Source
* Get / Set Stream Source
*****/
*****/
HRESULT
WINAPI
IWineD3DDeviceImpl_SetStreamSource
(
IWineD3DDevice
*
iface
,
UINT
StreamNumber
,
IWineD3DVertexBuffer
*
pStreamData
,
UINT
OffsetInBytes
,
UINT
Stride
)
{
HRESULT
WINAPI
IWineD3DDeviceImpl_SetStreamSource
(
IWineD3DDevice
*
iface
,
UINT
StreamNumber
,
IWineD3DVertexBuffer
*
pStreamData
,
UINT
OffsetInBytes
,
UINT
Stride
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DVertexBuffer
*
oldSrc
;
IWineD3DVertexBuffer
*
oldSrc
;
/**TODO: instance and index data, see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/programmingguide/advancedtopics/DrawingMultipleInstances.asp
and
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/d3d/interfaces/idirect3ddevice9/SetStreamSourceFreq.asp
**************/
/* D3d9 only, but shouldn't hurt d3d8 */
UINT
streamFlags
;
streamFlags
=
StreamNumber
&
(
D3DSTREAMSOURCE_INDEXEDDATA
|
D3DSTREAMSOURCE_INSTANCEDATA
);
if
(
streamFlags
)
{
if
(
streamFlags
&
D3DSTREAMSOURCE_INDEXEDDATA
)
{
FIXME
(
"stream index data not supported
\n
"
);
}
if
(
streamFlags
&
D3DSTREAMSOURCE_INDEXEDDATA
)
{
FIXME
(
"stream instance data not supported
\n
"
);
}
}
StreamNumber
&=
~
(
D3DSTREAMSOURCE_INDEXEDDATA
|
D3DSTREAMSOURCE_INSTANCEDATA
);
if
(
StreamNumber
>=
MAX_STREAMS
)
{
WARN
(
"Stream out of range %d
\n
"
,
StreamNumber
);
return
D3DERR_INVALIDCALL
;
}
oldSrc
=
This
->
stateBlock
->
streamSource
[
StreamNumber
];
oldSrc
=
This
->
stateBlock
->
streamSource
[
StreamNumber
];
TRACE
(
"(%p) : StreamNo: %d, OldStream (%p), NewStream (%p), NewStride %d
\n
"
,
This
,
StreamNumber
,
oldSrc
,
pStreamData
,
Stride
);
TRACE
(
"(%p) : StreamNo: %d, OldStream (%p), NewStream (%p), NewStride %d
\n
"
,
This
,
StreamNumber
,
oldSrc
,
pStreamData
,
Stride
);
...
@@ -1551,6 +1577,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetStreamSource(IWineD3DDevice *iface, UINT St
...
@@ -1551,6 +1577,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetStreamSource(IWineD3DDevice *iface, UINT St
This
->
updateStateBlock
->
streamStride
[
StreamNumber
]
=
Stride
;
This
->
updateStateBlock
->
streamStride
[
StreamNumber
]
=
Stride
;
This
->
updateStateBlock
->
streamSource
[
StreamNumber
]
=
pStreamData
;
This
->
updateStateBlock
->
streamSource
[
StreamNumber
]
=
pStreamData
;
This
->
updateStateBlock
->
streamOffset
[
StreamNumber
]
=
OffsetInBytes
;
This
->
updateStateBlock
->
streamOffset
[
StreamNumber
]
=
OffsetInBytes
;
This
->
updateStateBlock
->
streamFlags
[
StreamNumber
]
=
streamFlags
;
/* Handle recording of state blocks */
/* Handle recording of state blocks */
if
(
This
->
isRecordingState
)
{
if
(
This
->
isRecordingState
)
{
...
@@ -1559,6 +1586,10 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetStreamSource(IWineD3DDevice *iface, UINT St
...
@@ -1559,6 +1586,10 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetStreamSource(IWineD3DDevice *iface, UINT St
}
}
/* Not recording... */
/* Not recording... */
/* Need to do a getParent and pass the reffs up */
/* MSDN says ..... When an application no longer holds a references to this interface, the interface will automatically be freed.
which suggests that we shouldn't be ref counting? and do need a _release on the stream source to reset the stream source
so for now, just count internally */
if
(
pStreamData
!=
NULL
)
{
if
(
pStreamData
!=
NULL
)
{
IUnknown
*
newVertexBufferParent
;
IUnknown
*
newVertexBufferParent
;
/* GetParent will add a ref, so leave it hanging until the vertex buffer is cleared */
/* GetParent will add a ref, so leave it hanging until the vertex buffer is cleared */
...
@@ -1576,12 +1607,38 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetStreamSource(IWineD3DDevice *iface, UINT St
...
@@ -1576,12 +1607,38 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetStreamSource(IWineD3DDevice *iface, UINT St
HRESULT
WINAPI
IWineD3DDeviceImpl_GetStreamSource
(
IWineD3DDevice
*
iface
,
UINT
StreamNumber
,
IWineD3DVertexBuffer
**
pStream
,
UINT
*
pOffset
,
UINT
*
pStride
)
{
HRESULT
WINAPI
IWineD3DDeviceImpl_GetStreamSource
(
IWineD3DDevice
*
iface
,
UINT
StreamNumber
,
IWineD3DVertexBuffer
**
pStream
,
UINT
*
pOffset
,
UINT
*
pStride
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
UINT
streamFlags
;
TRACE
(
"(%p) : StreamNo: %d, Stream (%p), Stride %d
\n
"
,
This
,
StreamNumber
,
This
->
stateBlock
->
streamSource
[
StreamNumber
],
This
->
stateBlock
->
streamStride
[
StreamNumber
]);
TRACE
(
"(%p) : StreamNo: %d, Stream (%p), Stride %d
\n
"
,
This
,
StreamNumber
,
This
->
stateBlock
->
streamSource
[
StreamNumber
],
This
->
stateBlock
->
streamStride
[
StreamNumber
]);
streamFlags
=
StreamNumber
&
(
D3DSTREAMSOURCE_INDEXEDDATA
|
D3DSTREAMSOURCE_INSTANCEDATA
);
if
(
streamFlags
)
{
if
(
streamFlags
&
D3DSTREAMSOURCE_INDEXEDDATA
)
{
FIXME
(
"stream index data not supported
\n
"
);
}
if
(
streamFlags
&
D3DSTREAMSOURCE_INDEXEDDATA
)
{
FIXME
(
"stream instance data not supported
\n
"
);
}
}
StreamNumber
&=
~
(
D3DSTREAMSOURCE_INDEXEDDATA
|
D3DSTREAMSOURCE_INSTANCEDATA
);
if
(
StreamNumber
>=
MAX_STREAMS
)
{
WARN
(
"Stream out of range %d
\n
"
,
StreamNumber
);
return
D3DERR_INVALIDCALL
;
}
*
pStream
=
This
->
stateBlock
->
streamSource
[
StreamNumber
];
*
pStream
=
This
->
stateBlock
->
streamSource
[
StreamNumber
];
*
pStride
=
This
->
stateBlock
->
streamStride
[
StreamNumber
];
*
pStride
=
This
->
stateBlock
->
streamStride
[
StreamNumber
];
*
pOffset
=
This
->
stateBlock
->
streamOffset
[
StreamNumber
];
*
pOffset
=
This
->
stateBlock
->
streamOffset
[
StreamNumber
];
if
(
*
pStream
!=
NULL
)
IWineD3DVertexBuffer_AddRef
(
*
pStream
);
/* We have created a new reference to the VB */
if
(
*
pStream
==
NULL
)
{
FIXME
(
"Attempting to get an empty stream %d, returning D3DERR_INVALIDCALL
\n
"
,
StreamNumber
);
return
D3DERR_INVALIDCALL
;
}
IWineD3DVertexBuffer_AddRef
(
*
pStream
);
/* We have created a new reference to the VB */
return
D3D_OK
;
return
D3D_OK
;
}
}
...
@@ -1598,14 +1655,28 @@ VertexOffset = StartVertex / Divider * StreamStride +
...
@@ -1598,14 +1655,28 @@ VertexOffset = StartVertex / Divider * StreamStride +
HRESULT
WINAPI
IWineD3DDeviceImpl_SetStreamSourceFreq
(
IWineD3DDevice
*
iface
,
UINT
StreamNumber
,
UINT
Divider
)
{
HRESULT
WINAPI
IWineD3DDeviceImpl_SetStreamSourceFreq
(
IWineD3DDevice
*
iface
,
UINT
StreamNumber
,
UINT
Divider
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
FIXME
(
"(%p) : stub
\n
"
,
This
);
TRACE
(
"(%p) StreamNumber(%d), Divider(%d)
\n
"
,
This
,
StreamNumber
,
Divider
);
This
->
updateStateBlock
->
streamFlags
[
StreamNumber
]
=
Divider
&
(
D3DSTREAMSOURCE_INSTANCEDATA
|
D3DSTREAMSOURCE_INDEXEDDATA
);
This
->
updateStateBlock
->
changed
.
streamFreq
[
StreamNumber
]
=
TRUE
;
This
->
updateStateBlock
->
set
.
streamFreq
[
StreamNumber
]
=
TRUE
;
This
->
updateStateBlock
->
streamFreq
[
StreamNumber
]
=
Divider
&
0x7FFFFF
;
if
(
This
->
updateStateBlock
->
streamFlags
[
StreamNumber
]
||
This
->
updateStateBlock
->
streamFreq
[
StreamNumber
]
!=
1
)
{
FIXME
(
"Stream indexing not fully supported
\n
"
);
}
return
D3D_OK
;
return
D3D_OK
;
}
}
HRESULT
WINAPI
IWineD3DDeviceImpl_GetStreamSourceFreq
(
IWineD3DDevice
*
iface
,
UINT
StreamNumber
,
UINT
*
Divider
)
{
HRESULT
WINAPI
IWineD3DDeviceImpl_GetStreamSourceFreq
(
IWineD3DDevice
*
iface
,
UINT
StreamNumber
,
UINT
*
Divider
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
FIXME
(
"(%p) : stub
\n
"
,
This
);
TRACE
(
"(%p) StreamNumber(%d), Divider(%p)
\n
"
,
This
,
StreamNumber
,
Divider
);
*
Divider
=
This
->
updateStateBlock
->
streamFreq
[
StreamNumber
]
|
This
->
updateStateBlock
->
streamFlags
[
StreamNumber
];
TRACE
(
"(%p) : returning %d
\n
"
,
This
,
*
Divider
);
return
D3D_OK
;
return
D3D_OK
;
}
}
...
...
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