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
9092f557
Commit
9092f557
authored
Aug 19, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Aug 27, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Non-primary stateblocks hold an internal reference on indexbuffers.
parent
4cda5ca9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
device.c
dlls/wined3d/device.c
+7
-0
stateblock.c
dlls/wined3d/stateblock.c
+9
-3
No files found.
dlls/wined3d/device.c
View file @
9092f557
...
...
@@ -519,6 +519,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface,
IWineD3DVertexBuffer_AddRef
(
object
->
streamSource
[
i
]);
}
}
if
(
object
->
pIndexData
)
{
IWineD3DIndexBuffer_AddRef
(
object
->
pIndexData
);
}
}
else
if
(
Type
==
WINED3DSBT_PIXELSTATE
)
{
...
...
@@ -572,6 +575,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface,
for
(
i
=
0
;
i
<
MAX_STREAMS
;
i
++
)
{
object
->
streamSource
[
i
]
=
NULL
;
}
object
->
pIndexData
=
NULL
;
}
else
if
(
Type
==
WINED3DSBT_VERTEXSTATE
)
{
...
...
@@ -632,6 +636,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface,
IWineD3DVertexBuffer_AddRef
(
object
->
streamSource
[
i
]);
}
}
object
->
pIndexData
=
NULL
;
}
else
{
FIXME
(
"Unrecognized state block type %d
\n
"
,
Type
);
}
...
...
@@ -2821,6 +2826,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetIndices(IWineD3DDevice *iface, IWine
/* Handle recording of state blocks */
if
(
This
->
isRecordingState
)
{
TRACE
(
"Recording... not performing anything
\n
"
);
if
(
pIndexData
)
IWineD3DIndexBuffer_AddRef
(
pIndexData
);
if
(
oldIdxs
)
IWineD3DIndexBuffer_Release
(
oldIdxs
);
return
WINED3D_OK
;
}
...
...
dlls/wined3d/stateblock.c
View file @
9092f557
...
...
@@ -262,7 +262,6 @@ static ULONG WINAPI IWineD3DStateBlockImpl_Release(IWineD3DStateBlock *iface) {
}
}
}
if
(
This
->
pIndexData
)
IWineD3DIndexBuffer_Release
(
This
->
pIndexData
);
}
for
(
counter
=
0
;
counter
<
MAX_STREAMS
;
counter
++
)
{
...
...
@@ -272,6 +271,7 @@ static ULONG WINAPI IWineD3DStateBlockImpl_Release(IWineD3DStateBlock *iface) {
}
}
}
if
(
This
->
pIndexData
)
IWineD3DIndexBuffer_Release
(
This
->
pIndexData
);
for
(
counter
=
0
;
counter
<
LIGHTMAP_SIZE
;
counter
++
)
{
struct
list
*
e1
,
*
e2
;
...
...
@@ -488,7 +488,9 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface)
if
(
This
->
changed
.
indices
&&
((
This
->
pIndexData
!=
targetStateBlock
->
pIndexData
)
||
(
This
->
baseVertexIndex
!=
targetStateBlock
->
baseVertexIndex
)))
{
TRACE
(
"Updating pindexData to %p, baseVertexIndex to %d
\n
"
,
targetStateBlock
->
pIndexData
,
targetStateBlock
->
baseVertexIndex
);
targetStateBlock
->
pIndexData
,
targetStateBlock
->
baseVertexIndex
);
if
(
targetStateBlock
->
pIndexData
)
IWineD3DIndexBuffer_AddRef
(
targetStateBlock
->
pIndexData
);
if
(
This
->
pIndexData
)
IWineD3DIndexBuffer_Release
(
This
->
pIndexData
);
This
->
pIndexData
=
targetStateBlock
->
pIndexData
;
This
->
baseVertexIndex
=
targetStateBlock
->
baseVertexIndex
;
}
...
...
@@ -604,7 +606,6 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface)
memcpy
(
This
->
streamOffset
,
targetStateBlock
->
streamOffset
,
sizeof
(
This
->
streamOffset
));
memcpy
(
This
->
streamFreq
,
targetStateBlock
->
streamFreq
,
sizeof
(
This
->
streamFreq
));
memcpy
(
This
->
streamFlags
,
targetStateBlock
->
streamFlags
,
sizeof
(
This
->
streamFlags
));
This
->
pIndexData
=
targetStateBlock
->
pIndexData
;
This
->
baseVertexIndex
=
targetStateBlock
->
baseVertexIndex
;
memcpy
(
This
->
transforms
,
targetStateBlock
->
transforms
,
sizeof
(
This
->
transforms
));
record_lights
(
This
,
targetStateBlock
);
...
...
@@ -623,6 +624,11 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface)
memcpy
(
This
->
samplerState
,
targetStateBlock
->
samplerState
,
sizeof
(
This
->
samplerState
));
This
->
scissorRect
=
targetStateBlock
->
scissorRect
;
if
(
targetStateBlock
->
pIndexData
!=
This
->
pIndexData
)
{
if
(
targetStateBlock
->
pIndexData
)
IWineD3DIndexBuffer_AddRef
(
targetStateBlock
->
pIndexData
);
if
(
This
->
pIndexData
)
IWineD3DIndexBuffer_Release
(
This
->
pIndexData
);
This
->
pIndexData
=
targetStateBlock
->
pIndexData
;
}
for
(
i
=
0
;
i
<
MAX_STREAMS
;
i
++
)
{
if
(
targetStateBlock
->
streamSource
[
i
]
!=
This
->
streamSource
[
i
])
{
if
(
targetStateBlock
->
streamSource
[
i
])
IWineD3DVertexBuffer_AddRef
(
targetStateBlock
->
streamSource
[
i
]);
...
...
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