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
2eaf05bf
Commit
2eaf05bf
authored
Jun 04, 2003
by
Jason Edmeades
Committed by
Alexandre Julliard
Jun 04, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid the use of glGet when we know the information locally.
parent
84cd1925
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
32 deletions
+22
-32
d3d8_private.h
dlls/d3d8/d3d8_private.h
+2
-0
device.c
dlls/d3d8/device.c
+11
-30
stateblock.c
dlls/d3d8/stateblock.c
+9
-2
No files found.
dlls/d3d8/d3d8_private.h
View file @
2eaf05bf
...
...
@@ -322,6 +322,8 @@ struct IDirect3DDevice8Impl
UINT
srcBlend
;
UINT
dstBlend
;
UINT
alphafunc
;
UINT
stencilfunc
;
/* State block related */
BOOL
isRecordingState
;
...
...
dlls/d3d8/device.c
View file @
2eaf05bf
...
...
@@ -1234,7 +1234,8 @@ HRESULT WINAPI IDirect3DDevice8Impl_Present(LPDIRECT3DDEVICE8 iface, CONST REC
ENTER_GL
();
glXSwapBuffers
(
This
->
display
,
This
->
drawable
);
checkGLcall
(
"glXSwapBuffers"
);
/* Dont call checkGLcall, as glGetError is not applicable here */
TRACE
(
"glXSwapBuffers called, Starting new frame"
);
LEAVE_GL
();
...
...
@@ -2922,10 +2923,7 @@ HRESULT WINAPI IDirect3DDevice8Impl_SetRenderState(LPDIRECT3DDEVICE8 iface, D3
case
D3DRS_ALPHAFUNC
:
{
int
glParm
=
GL_LESS
;
float
ref
=
1
.
0
;
glGetFloatv
(
GL_ALPHA_TEST_REF
,
&
ref
);
checkGLcall
(
"glGetFloatv(GL_ALPHA_TEST_REF, &ref);"
);
float
ref
=
((
float
)
This
->
StateBlock
->
renderstate
[
D3DRS_ALPHAREF
])
/
255
.
0
f
;
switch
((
D3DCMPFUNC
)
Value
)
{
case
D3DCMP_NEVER
:
glParm
=
GL_NEVER
;
break
;
...
...
@@ -2941,18 +2939,16 @@ HRESULT WINAPI IDirect3DDevice8Impl_SetRenderState(LPDIRECT3DDEVICE8 iface, D3
}
TRACE
(
"glAlphaFunc with Parm=%x, ref=%f
\n
"
,
glParm
,
ref
);
glAlphaFunc
(
glParm
,
ref
);
This
->
alphafunc
=
glParm
;
checkGLcall
(
"glAlphaFunc"
);
}
break
;
case
D3DRS_ALPHAREF
:
{
int
glParm
=
GL_LESS
;
int
glParm
=
This
->
alphafunc
;
float
ref
=
1
.
0
f
;
glGetIntegerv
(
GL_ALPHA_TEST_FUNC
,
&
glParm
);
checkGLcall
(
"glGetFloatv(GL_ALPHA_TEST_FUNC, &glParm);"
);
ref
=
((
float
)
Value
)
/
255
.
0
f
;
TRACE
(
"glAlphaFunc with Parm=%x, ref=%f
\n
"
,
glParm
,
ref
);
glAlphaFunc
(
glParm
,
ref
);
...
...
@@ -3075,13 +3071,8 @@ HRESULT WINAPI IDirect3DDevice8Impl_SetRenderState(LPDIRECT3DDEVICE8 iface, D3
case
D3DRS_STENCILFUNC
:
{
int
glParm
=
GL_ALWAYS
;
int
ref
=
0
;
GLuint
mask
=
0xFFFFFFFF
;
glGetIntegerv
(
GL_STENCIL_REF
,
&
ref
);
checkGLcall
(
"glGetFloatv(GL_STENCIL_REF, &ref);"
);
glGetIntegerv
(
GL_STENCIL_VALUE_MASK
,
&
mask
);
checkGLcall
(
"glGetFloatv(GL_STENCIL_VALUE_MASK, &glParm);"
);
int
ref
=
This
->
StateBlock
->
renderstate
[
D3DRS_STENCILREF
];
GLuint
mask
=
This
->
StateBlock
->
renderstate
[
D3DRS_STENCILMASK
];
switch
((
D3DCMPFUNC
)
Value
)
{
case
D3DCMP_NEVER
:
glParm
=
GL_NEVER
;
break
;
...
...
@@ -3103,14 +3094,9 @@ HRESULT WINAPI IDirect3DDevice8Impl_SetRenderState(LPDIRECT3DDEVICE8 iface, D3
case
D3DRS_STENCILREF
:
{
int
glParm
=
GL_ALWAYS
;
int
glParm
=
This
->
stencilfunc
;
int
ref
=
0
;
GLuint
mask
=
0xFFFFFFFF
;
glGetIntegerv
(
GL_STENCIL_FUNC
,
&
glParm
);
checkGLcall
(
"glGetFloatv(GL_STENCIL_FUNC, &glParm);"
);
glGetIntegerv
(
GL_STENCIL_VALUE_MASK
,
&
mask
);
checkGLcall
(
"glGetFloatv(GL_STENCIL_VALUE_MASK, &glParm);"
);
GLuint
mask
=
This
->
StateBlock
->
renderstate
[
D3DRS_STENCILMASK
];
ref
=
Value
;
TRACE
(
"glStencilFunc with Parm=%x, ref=%d, mask=%x
\n
"
,
glParm
,
ref
,
mask
);
...
...
@@ -3121,15 +3107,10 @@ HRESULT WINAPI IDirect3DDevice8Impl_SetRenderState(LPDIRECT3DDEVICE8 iface, D3
case
D3DRS_STENCILMASK
:
{
int
glParm
=
GL_ALWAYS
;
int
ref
=
0
.
0
;
int
glParm
=
This
->
stencilfunc
;
int
ref
=
This
->
StateBlock
->
renderstate
[
D3DRS_STENCILREF
]
;
GLuint
mask
=
Value
;
glGetIntegerv
(
GL_STENCIL_REF
,
&
ref
);
checkGLcall
(
"glGetFloatv(GL_STENCIL_REF, &ref);"
);
glGetIntegerv
(
GL_STENCIL_FUNC
,
&
glParm
);
checkGLcall
(
"glGetFloatv(GL_STENCIL_FUNC, &glParm);"
);
TRACE
(
"glStencilFunc with Parm=%x, ref=%d, mask=%x
\n
"
,
glParm
,
ref
,
mask
);
glStencilFunc
(
glParm
,
ref
,
mask
);
checkGLcall
(
"glStencilFunc"
);
...
...
dlls/d3d8/stateblock.c
View file @
2eaf05bf
...
...
@@ -106,9 +106,16 @@ HRESULT WINAPI IDirect3DDeviceImpl_InitStartupStateBlock(IDirect3DDevice8Impl* T
IDirect3DDevice8Impl_SetRenderState
(
iface
,
D3DRS_STENCILFAIL
,
D3DSTENCILOP_KEEP
);
IDirect3DDevice8Impl_SetRenderState
(
iface
,
D3DRS_STENCILZFAIL
,
D3DSTENCILOP_KEEP
);
IDirect3DDevice8Impl_SetRenderState
(
iface
,
D3DRS_STENCILPASS
,
D3DSTENCILOP_KEEP
);
/* Setting stencil func also uses values for stencil ref/mask, so manually set defaults
* so only a single call performed (and ensure defaults initialized before making that call)
*
* IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_STENCILREF, 0);
* IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_STENCILMASK, 0xFFFFFFFF);
*/
This
->
StateBlock
->
renderstate
[
D3DRS_STENCILREF
]
=
0
;
This
->
StateBlock
->
renderstate
[
D3DRS_STENCILMASK
]
=
0xFFFFFFFF
;
IDirect3DDevice8Impl_SetRenderState
(
iface
,
D3DRS_STENCILFUNC
,
D3DCMP_ALWAYS
);
IDirect3DDevice8Impl_SetRenderState
(
iface
,
D3DRS_STENCILREF
,
0
);
IDirect3DDevice8Impl_SetRenderState
(
iface
,
D3DRS_STENCILMASK
,
0xFFFFFFFF
);
IDirect3DDevice8Impl_SetRenderState
(
iface
,
D3DRS_STENCILWRITEMASK
,
0xFFFFFFFF
);
IDirect3DDevice8Impl_SetRenderState
(
iface
,
D3DRS_TEXTUREFACTOR
,
0xFFFFFFFF
);
IDirect3DDevice8Impl_SetRenderState
(
iface
,
D3DRS_WRAP0
,
0
);
...
...
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