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
c739c387
Commit
c739c387
authored
Feb 12, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Feb 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Add a per context structure for context management.
parent
890f63a1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
8 deletions
+23
-8
drawprim.c
dlls/wined3d/drawprim.c
+5
-1
state.c
dlls/wined3d/state.c
+0
-0
surface.c
dlls/wined3d/surface.c
+4
-4
wined3d_private.h
dlls/wined3d/wined3d_private.h
+14
-3
No files found.
dlls/wined3d/drawprim.c
View file @
c739c387
...
...
@@ -1181,6 +1181,7 @@ void drawPrimitive(IWineD3DDevice *iface,
int
i
;
DWORD
dirtyState
,
idx
;
BYTE
shift
;
WineD3DContext
*
context
;
/* Signals other modules that a drawing is in progress and the stateblock finalized */
This
->
isInDraw
=
TRUE
;
...
...
@@ -1197,13 +1198,16 @@ void drawPrimitive(IWineD3DDevice *iface,
/* Ok, we will be updating the screen from here onwards so grab the lock */
ENTER_GL
();
/* TODO: Find the correct context for the render target / thread */
context
=
&
This
->
contexts
[
This
->
activeContext
];
/* 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
);
StateTable
[
dirtyState
].
apply
(
dirtyState
,
This
->
stateBlock
,
context
);
}
This
->
numDirtyEntries
=
0
;
/* This makes the whole list clean */
...
...
dlls/wined3d/state.c
View file @
c739c387
This diff is collapsed.
Click to expand it.
dlls/wined3d/surface.c
View file @
c739c387
...
...
@@ -1169,8 +1169,8 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) {
per drawprim (and leave set - it will sort itself out due to last_was_rhw */
myDevice
->
last_was_rhw
=
TRUE
;
/* Apply the projection and world matrices, it sets up orthogonal projection due to last_was_rhw */
StateTable
[
STATE_TRANSFORM
(
WINED3DTS_PROJECTION
)].
apply
(
STATE_TRANSFORM
(
WINED3DTS_PROJECTION
),
myDevice
->
stateBlock
);
StateTable
[
STATE_TRANSFORM
(
WINED3DTS_WORLDMATRIX
(
0
))].
apply
(
STATE_TRANSFORM
(
WINED3DTS_WORLDMATRIX
(
0
)),
myDevice
->
stateBlock
);
StateTable
[
STATE_TRANSFORM
(
WINED3DTS_PROJECTION
)].
apply
(
STATE_TRANSFORM
(
WINED3DTS_PROJECTION
),
myDevice
->
stateBlock
,
&
myDevice
->
contexts
[
myDevice
->
activeContext
]
);
StateTable
[
STATE_TRANSFORM
(
WINED3DTS_WORLDMATRIX
(
0
))].
apply
(
STATE_TRANSFORM
(
WINED3DTS_WORLDMATRIX
(
0
)),
myDevice
->
stateBlock
,
&
myDevice
->
contexts
[
myDevice
->
activeContext
]
);
/* Will reapply the projection matrix too */
IWineD3DDeviceImpl_MarkStateDirty
(
myDevice
,
STATE_VDECL
);
...
...
@@ -2497,8 +2497,8 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *
*/
myDevice
->
last_was_rhw
=
TRUE
;
/* Apply the projection matrix, it sets up orthogonal projection due to last_was_rhw */
StateTable
[
STATE_TRANSFORM
(
WINED3DTS_PROJECTION
)].
apply
(
STATE_TRANSFORM
(
WINED3DTS_PROJECTION
),
myDevice
->
stateBlock
);
StateTable
[
STATE_TRANSFORM
(
WINED3DTS_WORLDMATRIX
(
0
))].
apply
(
STATE_TRANSFORM
(
WINED3DTS_WORLDMATRIX
(
0
)),
myDevice
->
stateBlock
);
StateTable
[
STATE_TRANSFORM
(
WINED3DTS_PROJECTION
)].
apply
(
STATE_TRANSFORM
(
WINED3DTS_PROJECTION
),
myDevice
->
stateBlock
,
&
myDevice
->
contexts
[
myDevice
->
activeContext
]
);
StateTable
[
STATE_TRANSFORM
(
WINED3DTS_WORLDMATRIX
(
0
))].
apply
(
STATE_TRANSFORM
(
WINED3DTS_WORLDMATRIX
(
0
)),
myDevice
->
stateBlock
,
&
myDevice
->
contexts
[
myDevice
->
activeContext
]
);
/* That will reapply the projection matrix too */
IWineD3DDeviceImpl_MarkStateDirty
(
myDevice
,
STATE_VDECL
);
...
...
dlls/wined3d/wined3d_private.h
View file @
c739c387
...
...
@@ -405,8 +405,16 @@ DWORD get_flexible_vertex_size(DWORD d3dvtVertexType);
#define GET_TEXCOORD_SIZE_FROM_FVF(d3dvtVertexType, tex_num) \
(((((d3dvtVertexType) >> (16 + (2 * (tex_num)))) + 1) & 0x03) + 1)
/* The new context manager that should deal with onscreen and offscreen rendering */
typedef
struct
WineD3DContext
{
/* TODO: Dirty State list */
/* TODO: Render target / swapchain this ctx belongs to */
/* TODO: Thread this ctx belongs to */
/* TODO: Per context state chaches */
}
WineD3DContext
;
/* Routines and structures related to state management */
typedef
void
(
*
APPLYSTATEFUNC
)(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
);
typedef
void
(
*
APPLYSTATEFUNC
)(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
WineD3DContext
*
ctx
);
#define STATE_RENDER(a) (a)
#define STATE_IS_RENDER(a) ((a) >= STATE_RENDER(1) && (a) <= STATE_RENDER(WINEHIGHEST_RENDER_STATE))
...
...
@@ -511,7 +519,7 @@ typedef struct IWineD3DImpl
extern
const
IWineD3DVtbl
IWineD3D_Vtbl
;
/** Hacked out start of a context manager!! **/
/** Hacked out start of a context manager!!
- Subject to removal
**/
typedef
struct
glContext
{
int
Width
;
int
Height
;
...
...
@@ -639,7 +647,7 @@ typedef struct IWineD3DDeviceImpl
HRESULT
state
;
BOOL
d3d_initialized
;
/* Screen buffer resources */
/* Screen buffer resources
- subject to removal
*/
glContext
contextCache
[
CONTEXT_CACHE
];
/* A flag to check for proper BeginScene / EndScene call pairs */
...
...
@@ -681,6 +689,9 @@ typedef struct IWineD3DDeviceImpl
WineDirect3DVertexStridedData
*
up_strided
;
BOOL
useDrawStridedSlow
;
/* Context management */
WineD3DContext
contexts
[
1
];
/* Dynamic array later */
UINT
activeContext
;
/* Only 0 for now */
}
IWineD3DDeviceImpl
;
extern
const
IWineD3DDeviceVtbl
IWineD3DDevice_Vtbl
;
...
...
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