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
ef65b233
Commit
ef65b233
authored
Jun 09, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jun 11, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Some render target->texture blit context handling.
parent
09aefe21
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
13 deletions
+16
-13
device.c
dlls/wined3d/device.c
+12
-3
surface.c
dlls/wined3d/surface.c
+4
-10
No files found.
dlls/wined3d/device.c
View file @
ef65b233
...
...
@@ -5553,9 +5553,6 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED
TRACE
(
"src_rect [%u, %u]->[%u, %u]
\n
"
,
src_rect
->
x1
,
src_rect
->
y1
,
src_rect
->
x2
,
src_rect
->
y2
);
TRACE
(
"dst_rect [%u, %u]->[%u, %u]
\n
"
,
dst_rect
->
x1
,
dst_rect
->
y1
,
dst_rect
->
x2
,
dst_rect
->
y2
);
glDisable
(
GL_SCISSOR_TEST
);
IWineD3DDeviceImpl_MarkStateDirty
(
This
,
STATE_RENDER
(
WINED3DRS_SCISSORTESTENABLE
));
switch
(
filter
)
{
case
WINED3DTEXF_LINEAR
:
gl_filter
=
GL_LINEAR
;
...
...
@@ -5571,10 +5568,12 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED
/* Attach src surface to src fbo */
src_swapchain
=
get_swapchain
(
src_surface
);
ENTER_GL
();
if
(
src_swapchain
)
{
GLenum
buffer
;
TRACE
(
"Source surface %p is onscreen
\n
"
,
src_surface
);
ActivateContext
(
This
,
src_surface
,
CTXUSAGE_RESOURCELOAD
);
GL_EXTCALL
(
glBindFramebufferEXT
(
GL_READ_FRAMEBUFFER_EXT
,
0
));
buffer
=
surface_get_gl_buffer
(
src_surface
,
src_swapchain
);
...
...
@@ -5597,6 +5596,7 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED
GLenum
buffer
;
TRACE
(
"Destination surface %p is onscreen
\n
"
,
dst_surface
);
ActivateContext
(
This
,
dst_surface
,
CTXUSAGE_RESOURCELOAD
);
GL_EXTCALL
(
glBindFramebufferEXT
(
GL_DRAW_FRAMEBUFFER_EXT
,
0
));
buffer
=
surface_get_gl_buffer
(
dst_surface
,
dst_swapchain
);
...
...
@@ -5607,11 +5607,19 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED
dst_rect
->
y2
=
((
IWineD3DSurfaceImpl
*
)
dst_surface
)
->
currentDesc
.
Height
-
dst_rect
->
y2
;
}
else
{
TRACE
(
"Destination surface %p is offscreen
\n
"
,
dst_surface
);
/* No src or dst swapchain? Make sure some context is active(multithreading) */
if
(
!
src_swapchain
)
{
ActivateContext
(
This
,
This
->
lastActiveRenderTarget
,
CTXUSAGE_RESOURCELOAD
);
}
bind_fbo
(
iface
,
GL_DRAW_FRAMEBUFFER_EXT
,
&
This
->
dst_fbo
);
attach_surface_fbo
(
This
,
GL_DRAW_FRAMEBUFFER_EXT
,
0
,
dst_surface
);
glDrawBuffer
(
GL_COLOR_ATTACHMENT0_EXT
);
checkGLcall
(
"glDrawBuffer()"
);
}
glDisable
(
GL_SCISSOR_TEST
);
IWineD3DDeviceImpl_MarkStateDirty
(
This
,
STATE_RENDER
(
WINED3DRS_SCISSORTESTENABLE
));
if
(
flip
)
{
GL_EXTCALL
(
glBlitFramebufferEXT
(
src_rect
->
x1
,
src_rect
->
y1
,
src_rect
->
x2
,
src_rect
->
y2
,
...
...
@@ -5636,6 +5644,7 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED
glDrawBuffer
(
GL_BACK
);
checkGLcall
(
"glDrawBuffer()"
);
}
LEAVE_GL
();
}
static
HRESULT
WINAPI
IWineD3DDeviceImpl_SetRenderTarget
(
IWineD3DDevice
*
iface
,
DWORD
RenderTargetIndex
,
IWineD3DSurface
*
pRenderTarget
)
{
...
...
dlls/wined3d/surface.c
View file @
ef65b233
...
...
@@ -2385,6 +2385,7 @@ static inline void fb_copy_to_texture_direct(IWineD3DSurfaceImpl *This, IWineD3D
ENTER_GL
();
ActivateContext
(
myDevice
,
SrcSurface
,
CTXUSAGE_BLIT
);
IWineD3DSurface_PreLoad
((
IWineD3DSurface
*
)
This
);
/* Bind the target texture */
glBindTexture
(
GL_TEXTURE_2D
,
This
->
glDescription
.
textureName
);
...
...
@@ -2470,6 +2471,7 @@ static inline void fb_copy_to_texture_hwstretch(IWineD3DSurfaceImpl *This, IWine
/* Activate the Proper context for reading from the source surface, set it up for blitting */
ENTER_GL
();
ActivateContext
(
myDevice
,
SrcSurface
,
CTXUSAGE_BLIT
);
IWineD3DSurface_PreLoad
((
IWineD3DSurface
*
)
This
);
/* Try to use an aux buffer for drawing the rectangle. This way it doesn't need restoring.
* This way we don't have to wait for the 2nd readback to finish to leave this function.
...
...
@@ -2802,17 +2804,9 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *
/* Destination color key is checked above */
}
/* Call preload for the surface to make sure it isn't dirty */
if
(
GL_SUPPORT
(
ARB_MULTITEXTURE
))
{
GL_EXTCALL
(
glActiveTextureARB
(
GL_TEXTURE0_ARB
));
checkGLcall
(
"glActiveTextureARB"
);
}
IWineD3DDeviceImpl_MarkStateDirty
(
This
->
resource
.
wineD3DDevice
,
STATE_SAMPLER
(
0
));
IWineD3DSurface_PreLoad
((
IWineD3DSurface
*
)
This
);
/* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag
* glCopyTexSubImage is a bit picky about the parameters we pass to it
*/
* glCopyTexSubImage is a bit picky about the parameters we pass to it
*/
if
(
SrcRect
)
{
if
(
SrcRect
->
top
<
SrcRect
->
bottom
)
{
srect
.
y1
=
SrcRect
->
top
;
...
...
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