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
c8fe24d2
Commit
c8fe24d2
authored
Jul 24, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 24, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Explicitly pass the context to surface_load_ds_location().
parent
2c71b853
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
21 deletions
+18
-21
device.c
dlls/wined3d/device.c
+5
-5
drawprim.c
dlls/wined3d/drawprim.c
+3
-2
surface.c
dlls/wined3d/surface.c
+9
-13
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/device.c
View file @
c8fe24d2
...
...
@@ -4948,19 +4948,19 @@ HRESULT IWineD3DDeviceImpl_ClearSurface(IWineD3DDeviceImpl *This, IWineD3DSurfa
if
(
vp
->
X
!=
0
||
vp
->
Y
!=
0
||
vp
->
Width
<
depth_stencil
->
currentDesc
.
Width
||
vp
->
Height
<
depth_stencil
->
currentDesc
.
Height
)
{
surface_load_ds_location
(
This
->
stencilBufferTarget
,
location
);
surface_load_ds_location
(
This
->
stencilBufferTarget
,
context
,
location
);
}
else
if
(
This
->
stateBlock
->
renderState
[
WINED3DRS_SCISSORTESTENABLE
]
&&
(
This
->
stateBlock
->
scissorRect
.
left
>
0
||
This
->
stateBlock
->
scissorRect
.
top
>
0
||
This
->
stateBlock
->
scissorRect
.
right
<
depth_stencil
->
currentDesc
.
Width
||
This
->
stateBlock
->
scissorRect
.
bottom
<
depth_stencil
->
currentDesc
.
Height
))
{
surface_load_ds_location
(
This
->
stencilBufferTarget
,
location
);
surface_load_ds_location
(
This
->
stencilBufferTarget
,
context
,
location
);
}
else
if
(
Count
>
0
&&
pRects
&&
(
pRects
[
0
].
x1
>
0
||
pRects
[
0
].
y1
>
0
||
pRects
[
0
].
x2
<
depth_stencil
->
currentDesc
.
Width
||
pRects
[
0
].
y2
<
depth_stencil
->
currentDesc
.
Height
))
{
surface_load_ds_location
(
This
->
stencilBufferTarget
,
location
);
surface_load_ds_location
(
This
->
stencilBufferTarget
,
context
,
location
);
}
}
...
...
@@ -6591,8 +6591,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetDepthStencilSurface(IWineD3DDevice *
||
((
IWineD3DSurfaceImpl
*
)
This
->
stencilBufferTarget
)
->
Flags
&
SFLAG_DISCARD
)
{
surface_modify_ds_location
(
This
->
stencilBufferTarget
,
SFLAG_DS_DISCARDED
);
}
else
{
ActivateContext
(
This
,
This
->
render_targets
[
0
],
CTXUSAGE_RESOURCELOAD
);
surface_load_ds_location
(
This
->
stencilBufferTarget
,
SFLAG_DS_OFFSCREEN
);
struct
WineD3DContext
*
context
=
ActivateContext
(
This
,
This
->
render_targets
[
0
],
CTXUSAGE_RESOURCELOAD
);
surface_load_ds_location
(
This
->
stencilBufferTarget
,
context
,
SFLAG_DS_OFFSCREEN
);
surface_modify_ds_location
(
This
->
stencilBufferTarget
,
SFLAG_DS_OFFSCREEN
);
}
}
...
...
dlls/wined3d/drawprim.c
View file @
c8fe24d2
...
...
@@ -558,6 +558,7 @@ void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT numberOfVertice
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DSurfaceImpl
*
target
;
struct
WineD3DContext
*
context
;
unsigned
int
i
;
if
(
!
index_count
)
return
;
...
...
@@ -579,7 +580,7 @@ void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT numberOfVertice
/* Signals other modules that a drawing is in progress and the stateblock finalized */
This
->
isInDraw
=
TRUE
;
ActivateContext
(
This
,
This
->
render_targets
[
0
],
CTXUSAGE_DRAWPRIM
);
context
=
ActivateContext
(
This
,
This
->
render_targets
[
0
],
CTXUSAGE_DRAWPRIM
);
if
(
This
->
stencilBufferTarget
)
{
/* Note that this depends on the ActivateContext call above to set
...
...
@@ -590,7 +591,7 @@ void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT numberOfVertice
DWORD
location
=
This
->
render_offscreen
?
SFLAG_DS_OFFSCREEN
:
SFLAG_DS_ONSCREEN
;
if
(
This
->
stateBlock
->
renderState
[
WINED3DRS_ZWRITEENABLE
]
||
This
->
stateBlock
->
renderState
[
WINED3DRS_ZENABLE
])
surface_load_ds_location
(
This
->
stencilBufferTarget
,
location
);
surface_load_ds_location
(
This
->
stencilBufferTarget
,
context
,
location
);
if
(
This
->
stateBlock
->
renderState
[
WINED3DRS_ZWRITEENABLE
])
surface_modify_ds_location
(
This
->
stencilBufferTarget
,
location
);
}
...
...
dlls/wined3d/surface.c
View file @
c8fe24d2
...
...
@@ -4370,7 +4370,8 @@ void surface_modify_ds_location(IWineD3DSurface *iface, DWORD location) {
}
/* Context activation is done by the caller. */
void
surface_load_ds_location
(
IWineD3DSurface
*
iface
,
DWORD
location
)
{
void
surface_load_ds_location
(
IWineD3DSurface
*
iface
,
struct
WineD3DContext
*
context
,
DWORD
location
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
IWineD3DDeviceImpl
*
device
=
This
->
resource
.
wineD3DDevice
;
...
...
@@ -4404,7 +4405,7 @@ void surface_load_ds_location(IWineD3DSurface *iface, DWORD location) {
/* Note that we use depth_blt here as well, rather than glCopyTexImage2D
* directly on the FBO texture. That's because we need to flip. */
context_bind_fbo
(
device
->
activeC
ontext
,
GL_FRAMEBUFFER_EXT
,
NULL
);
context_bind_fbo
(
c
ontext
,
GL_FRAMEBUFFER_EXT
,
NULL
);
if
(
This
->
texture_target
==
GL_TEXTURE_RECTANGLE_ARB
)
{
glGetIntegerv
(
GL_TEXTURE_BINDING_RECTANGLE_ARB
,
&
old_binding
);
...
...
@@ -4439,20 +4440,17 @@ void surface_load_ds_location(IWineD3DSurface *iface, DWORD location) {
device
->
depth_blt_rb_h
=
This
->
currentDesc
.
Height
;
}
context_bind_fbo
(
device
->
activeContext
,
GL_FRAMEBUFFER_EXT
,
&
device
->
activeC
ontext
->
dst_fbo
);
context_bind_fbo
(
context
,
GL_FRAMEBUFFER_EXT
,
&
c
ontext
->
dst_fbo
);
GL_EXTCALL
(
glFramebufferRenderbufferEXT
(
GL_FRAMEBUFFER_EXT
,
GL_COLOR_ATTACHMENT0_EXT
,
GL_RENDERBUFFER_EXT
,
device
->
depth_blt_rb
));
checkGLcall
(
"glFramebufferRenderbufferEXT"
);
context_attach_depth_stencil_fbo
(
device
->
activeC
ontext
,
GL_FRAMEBUFFER_EXT
,
iface
,
FALSE
);
context_attach_depth_stencil_fbo
(
c
ontext
,
GL_FRAMEBUFFER_EXT
,
iface
,
FALSE
);
/* Do the actual blit */
surface_depth_blt
(
This
,
device
->
depth_blt_texture
,
This
->
currentDesc
.
Width
,
This
->
currentDesc
.
Height
,
bind_target
);
checkGLcall
(
"depth_blt"
);
if
(
device
->
activeContext
->
current_fbo
)
{
context_bind_fbo
(
device
->
activeContext
,
GL_FRAMEBUFFER_EXT
,
&
device
->
activeContext
->
current_fbo
->
id
);
}
else
{
context_bind_fbo
(
device
->
activeContext
,
GL_FRAMEBUFFER_EXT
,
NULL
);
}
if
(
context
->
current_fbo
)
context_bind_fbo
(
context
,
GL_FRAMEBUFFER_EXT
,
&
context
->
current_fbo
->
id
);
else
context_bind_fbo
(
context
,
GL_FRAMEBUFFER_EXT
,
NULL
);
LEAVE_GL
();
}
else
{
...
...
@@ -4464,14 +4462,12 @@ void surface_load_ds_location(IWineD3DSurface *iface, DWORD location) {
ENTER_GL
();
context_bind_fbo
(
device
->
activeC
ontext
,
GL_FRAMEBUFFER_EXT
,
NULL
);
context_bind_fbo
(
c
ontext
,
GL_FRAMEBUFFER_EXT
,
NULL
);
surface_depth_blt
(
This
,
This
->
texture_name
,
This
->
currentDesc
.
Width
,
This
->
currentDesc
.
Height
,
This
->
texture_target
);
checkGLcall
(
"depth_blt"
);
if
(
device
->
activeContext
->
current_fbo
)
{
context_bind_fbo
(
device
->
activeContext
,
GL_FRAMEBUFFER_EXT
,
&
device
->
activeContext
->
current_fbo
->
id
);
}
if
(
context
->
current_fbo
)
context_bind_fbo
(
context
,
GL_FRAMEBUFFER_EXT
,
&
context
->
current_fbo
->
id
);
LEAVE_GL
();
}
else
{
...
...
dlls/wined3d/wined3d_private.h
View file @
c8fe24d2
...
...
@@ -2533,7 +2533,7 @@ void state_fog_fragpart(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
void
surface_add_dirty_rect
(
IWineD3DSurface
*
iface
,
const
RECT
*
dirty_rect
);
GLenum
surface_get_gl_buffer
(
IWineD3DSurface
*
iface
,
IWineD3DSwapChain
*
swapchain
);
void
surface_load_ds_location
(
IWineD3DSurface
*
iface
,
DWORD
location
);
void
surface_load_ds_location
(
IWineD3DSurface
*
iface
,
struct
WineD3DContext
*
context
,
DWORD
location
);
void
surface_modify_ds_location
(
IWineD3DSurface
*
iface
,
DWORD
location
);
void
surface_set_compatible_renderbuffer
(
IWineD3DSurface
*
iface
,
unsigned
int
width
,
unsigned
int
height
);
void
surface_set_texture_name
(
IWineD3DSurface
*
iface
,
GLuint
name
,
BOOL
srgb_name
);
...
...
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