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
7532c759
Commit
7532c759
authored
Dec 19, 2006
by
Stefan Dösinger
Committed by
Alexandre Julliard
Dec 19, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Add the state dirtification infrastructure.
parent
6c04a187
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
0 deletions
+45
-0
device.c
dlls/wined3d/device.c
+13
-0
drawprim.c
dlls/wined3d/drawprim.c
+12
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+20
-0
No files found.
dlls/wined3d/device.c
View file @
7532c759
...
...
@@ -7084,3 +7084,16 @@ const DWORD SavedVertexStates_T[NUM_SAVEDVERTEXSTATES_T] = {
const
DWORD
SavedVertexStates_S
[
NUM_SAVEDVERTEXSTATES_S
]
=
{
WINED3DSAMP_DMAPOFFSET
};
void
IWineD3DDeviceImpl_MarkStateDirty
(
IWineD3DDeviceImpl
*
This
,
DWORD
state
)
{
DWORD
rep
=
StateTable
[
state
].
representative
;
DWORD
idx
;
BYTE
shift
;
if
(
!
rep
||
isStateDirty
(
This
,
rep
))
return
;
This
->
dirtyArray
[
This
->
numDirtyEntries
++
]
=
rep
;
idx
=
rep
>>
5
;
shift
=
rep
&
0x1f
;
This
->
isStateDirty
[
idx
]
|=
(
1
<<
shift
);
}
dlls/wined3d/drawprim.c
View file @
7532c759
...
...
@@ -2129,6 +2129,8 @@ void drawPrimitive(IWineD3DDevice *iface,
IWineD3DSwapChainImpl
*
swapchain
;
int
i
;
BOOL
fixup
=
FALSE
;
DWORD
dirtyState
,
idx
;
BYTE
shift
;
BOOL
lighting_changed
,
lighting_original
=
FALSE
;
...
...
@@ -2163,6 +2165,16 @@ void drawPrimitive(IWineD3DDevice *iface,
/* Ok, we will be updating the screen from here onwards so grab the lock */
ENTER_GL
();
/* Apply dirty states */
for
(
i
=
0
;
i
<
This
->
numDirtyEntries
;
i
++
)
{
dirtyState
=
This
->
dirtyArray
[
i
];
idx
=
dirtyState
>>
5
;
shift
=
dirtyState
&
0x1f
;
This
->
isStateDirty
[
idx
]
&=
~
(
1
<<
shift
);
StateTable
[
dirtyState
].
apply
(
dirtyState
,
This
->
stateBlock
);
}
This
->
numDirtyEntries
=
0
;
/* This makes the whole list clean */
if
(
DrawPrimStrideData
)
{
/* Note: this is a ddraw fixed-function code path */
...
...
dlls/wined3d/wined3d_private.h
View file @
7532c759
...
...
@@ -413,6 +413,8 @@ typedef void (*APPLYSTATEFUNC)(DWORD state, IWineD3DStateBlockImpl *stateblock);
#define STATE_RENDER(a) (a)
#define STATE_IS_RENDER(a) ((a) >= STATE_RENDER(1) && (a) <= STATE_RENDER(WINEHIGHEST_RENDER_STATE))
#define STATE_HIGHEST (STATE_RENDER(WINEHIGHEST_RENDER_STATE))
struct
StateEntry
{
DWORD
representative
;
...
...
@@ -627,10 +629,28 @@ typedef struct IWineD3DDeviceImpl
/* Final position fixup constant */
float
posFixup
[
4
];
/* State dirtification
* dirtyArray is an array that contains markers for dirty states. numDirtyEntries states are dirty, their numbers are in indices
* 0...numDirtyEntries - 1. isStateDirty is a redundant copy of the dirtyArray. Technically only one of them would be needed,
* but with the help of both it is easy to find out if a state is dirty(just check the array index), and for applying dirty states
* only numDirtyEntries array elements have to be checked, not STATE_HIGHEST states.
*/
DWORD
dirtyArray
[
STATE_HIGHEST
+
1
];
/* Won't get bigger than that, a state is never marked dirty 2 times */
DWORD
numDirtyEntries
;
DWORD
isStateDirty
[
STATE_HIGHEST
/
32
+
1
];
/* Bitmap to find out quickly if a state is dirty */
}
IWineD3DDeviceImpl
;
extern
const
IWineD3DDeviceVtbl
IWineD3DDevice_Vtbl
;
void
IWineD3DDeviceImpl_MarkStateDirty
(
IWineD3DDeviceImpl
*
This
,
DWORD
state
);
static
inline
BOOL
isStateDirty
(
IWineD3DDeviceImpl
*
This
,
DWORD
state
)
{
DWORD
idx
=
state
>>
5
;
BYTE
shift
=
state
&
0x1f
;
return
This
->
isStateDirty
[
idx
]
&
(
1
<<
shift
);
}
/* Support for IWineD3DResource ::Set/Get/FreePrivateData. I don't think
* anybody uses it for much so a good implementation is optional. */
typedef
struct
PrivateData
...
...
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