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
5a63b79a
Commit
5a63b79a
authored
Sep 18, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Sep 19, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Untie culling and offscreen rendering.
parent
132f06cd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
23 deletions
+22
-23
context.c
dlls/wined3d/context.c
+2
-2
state.c
dlls/wined3d/state.c
+17
-20
wined3d_private.h
dlls/wined3d/wined3d_private.h
+3
-1
No files found.
dlls/wined3d/context.c
View file @
5a63b79a
...
...
@@ -706,11 +706,11 @@ static inline WineD3DContext *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurf
IWineD3DSwapChain_Release
(
swapchain
);
if
(
oldRenderOffscreen
)
{
Context_MarkStateDirty
(
context
,
WINED3DRS_CULLMODE
);
Context_MarkStateDirty
(
context
,
WINED3DTS_PROJECTION
);
Context_MarkStateDirty
(
context
,
STATE_VDECL
);
Context_MarkStateDirty
(
context
,
STATE_VIEWPORT
);
Context_MarkStateDirty
(
context
,
STATE_SCISSORRECT
);
Context_MarkStateDirty
(
context
,
STATE_FRONTFACE
);
}
}
else
{
...
...
@@ -794,11 +794,11 @@ static inline WineD3DContext *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurf
}
if
(
!
oldRenderOffscreen
)
{
Context_MarkStateDirty
(
context
,
WINED3DRS_CULLMODE
);
Context_MarkStateDirty
(
context
,
WINED3DTS_PROJECTION
);
Context_MarkStateDirty
(
context
,
STATE_VDECL
);
Context_MarkStateDirty
(
context
,
STATE_VIEWPORT
);
Context_MarkStateDirty
(
context
,
STATE_SCISSORRECT
);
Context_MarkStateDirty
(
context
,
STATE_FRONTFACE
);
}
}
if
(
readTexture
)
{
...
...
dlls/wined3d/state.c
View file @
5a63b79a
...
...
@@ -132,11 +132,9 @@ static void state_zenable(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD
}
static
void
state_cullmode
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
WineD3DContext
*
context
)
{
/* TODO: Put this into the offscreen / onscreen rendering block due to device->render_offscreen */
/* If we are culling "back faces with clockwise vertices" then
set front faces to be counter clockwise and enable culling
of back faces */
/* glFrontFace() is set in context.c at context init and on an offscreen / onscreen rendering
* switch
*/
switch
((
WINED3DCULL
)
stateblock
->
renderState
[
WINED3DRS_CULLMODE
])
{
case
WINED3DCULL_NONE
:
glDisable
(
GL_CULL_FACE
);
...
...
@@ -145,26 +143,14 @@ static void state_cullmode(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine
case
WINED3DCULL_CW
:
glEnable
(
GL_CULL_FACE
);
checkGLcall
(
"glEnable GL_CULL_FACE"
);
if
(
stateblock
->
wineD3DDevice
->
render_offscreen
)
{
glFrontFace
(
GL_CW
);
checkGLcall
(
"glFrontFace GL_CW"
);
}
else
{
glFrontFace
(
GL_CCW
);
checkGLcall
(
"glFrontFace GL_CCW"
);
}
glCullFace
(
GL_BACK
);
glCullFace
(
GL_FRONT
);
checkGLcall
(
"glCullFace(GL_FRONT)"
);
break
;
case
WINED3DCULL_CCW
:
glEnable
(
GL_CULL_FACE
);
checkGLcall
(
"glEnable GL_CULL_FACE"
);
if
(
stateblock
->
wineD3DDevice
->
render_offscreen
)
{
glFrontFace
(
GL_CCW
);
checkGLcall
(
"glFrontFace GL_CCW"
);
}
else
{
glFrontFace
(
GL_CW
);
checkGLcall
(
"glFrontFace GL_CW"
);
}
glCullFace
(
GL_BACK
);
checkGLcall
(
"glCullFace(GL_BACK)"
);
break
;
default:
FIXME
(
"Unrecognized/Unhandled WINED3DCULL value %d
\n
"
,
stateblock
->
renderState
[
WINED3DRS_CULLMODE
]);
...
...
@@ -3605,6 +3591,16 @@ static void indexbuffer(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
}
}
static
void
frontface
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
WineD3DContext
*
context
)
{
if
(
stateblock
->
wineD3DDevice
->
render_offscreen
)
{
glFrontFace
(
GL_CCW
);
checkGLcall
(
"glFrontFace(GL_CCW)"
);
}
else
{
glFrontFace
(
GL_CW
);
checkGLcall
(
"glFrontFace(GL_CW)"
);
}
}
const
struct
StateEntry
StateTable
[]
=
{
/* State name representative, apply function */
...
...
@@ -4676,4 +4672,5 @@ const struct StateEntry StateTable[] =
{
/* STATE_CLIPPLANE(31) */
STATE_CLIPPLANE
(
31
),
clipplane
},
{
/* STATE_MATERIAL */
STATE_RENDER
(
WINED3DRS_SPECULARENABLE
),
state_specularenable
},
{
/* STATE_FRONTFACE */
STATE_FRONTFACE
,
frontface
},
};
dlls/wined3d/wined3d_private.h
View file @
5a63b79a
...
...
@@ -481,7 +481,9 @@ typedef void (*APPLYSTATEFUNC)(DWORD state, IWineD3DStateBlockImpl *stateblock,
#define STATE_MATERIAL (STATE_CLIPPLANE(MAX_CLIPPLANES))
#define STATE_HIGHEST (STATE_MATERIAL)
#define STATE_FRONTFACE (STATE_MATERIAL + 1)
#define STATE_HIGHEST (STATE_FRONTFACE)
struct
StateEntry
{
...
...
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