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
d1ea48b9
Commit
d1ea48b9
authored
Apr 26, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 26, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Simply pass an IWineD3DSurfaceImpl pointer to surface_internal_preload().
parent
c56d3c19
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
28 deletions
+32
-28
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+1
-1
context.c
dlls/wined3d/context.c
+3
-3
device.c
dlls/wined3d/device.c
+1
-1
surface.c
dlls/wined3d/surface.c
+26
-22
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/arb_program_shader.c
View file @
d1ea48b9
...
...
@@ -6906,7 +6906,7 @@ HRESULT arbfp_blit_surface(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *src_
RECT
dst_rect
=
*
dst_rect_in
;
/* Now load the surface */
surface_internal_preload
(
(
IWineD3DSurface
*
)
src_surface
,
SRGB_RGB
);
surface_internal_preload
(
src_surface
,
SRGB_RGB
);
/* Activate the destination context, set it up for blitting */
context
=
context_acquire
(
device
,
dst_surface
,
CTXUSAGE_BLIT
);
...
...
dlls/wined3d/context.c
View file @
d1ea48b9
...
...
@@ -2003,7 +2003,7 @@ static void context_apply_state(struct wined3d_context *context, IWineD3DDeviceI
if
(
context
->
render_offscreen
)
{
FIXME
(
"Activating for CTXUSAGE_BLIT for an offscreen target with ORM_FBO. This should be avoided.
\n
"
);
surface_internal_preload
(
(
IWineD3DSurface
*
)
context
->
current_rt
,
SRGB_RGB
);
surface_internal_preload
(
context
->
current_rt
,
SRGB_RGB
);
ENTER_GL
();
context_bind_fbo
(
context
,
GL_FRAMEBUFFER
,
&
context
->
dst_fbo
);
...
...
@@ -2149,11 +2149,11 @@ static void context_setup_target(IWineD3DDeviceImpl *device,
/* Read the back buffer of the old drawable into the destination texture. */
if
(
context
->
current_rt
->
texture_name_srgb
)
{
surface_internal_preload
(
(
IWineD3DSurface
*
)
context
->
current_rt
,
SRGB_BOTH
);
surface_internal_preload
(
context
->
current_rt
,
SRGB_BOTH
);
}
else
{
surface_internal_preload
(
(
IWineD3DSurface
*
)
context
->
current_rt
,
SRGB_RGB
);
surface_internal_preload
(
context
->
current_rt
,
SRGB_RGB
);
}
IWineD3DSurface_ModifyLocation
((
IWineD3DSurface
*
)
context
->
current_rt
,
SFLAG_INDRAWABLE
,
FALSE
);
...
...
dlls/wined3d/device.c
View file @
d1ea48b9
...
...
@@ -5247,7 +5247,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface,
LEAVE_GL
();
/* Make sure the surface is loaded and up to date */
surface_internal_preload
(
dst_
surface
,
SRGB_RGB
);
surface_internal_preload
(
dst_
impl
,
SRGB_RGB
);
IWineD3DSurface_BindTexture
(
dst_surface
,
FALSE
);
src_w
=
src_impl
->
currentDesc
.
Width
;
...
...
dlls/wined3d/surface.c
View file @
d1ea48b9
...
...
@@ -1071,46 +1071,49 @@ static ULONG WINAPI IWineD3DSurfaceImpl_Release(IWineD3DSurface *iface)
IWineD3DSurface IWineD3DResource parts follow
**************************************************** */
void
surface_internal_preload
(
IWineD3DSurface
*
i
face
,
enum
WINED3DSRGB
srgb
)
void
surface_internal_preload
(
IWineD3DSurface
Impl
*
sur
face
,
enum
WINED3DSRGB
srgb
)
{
/* TODO: check for locks */
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
IWineD3DDeviceImpl
*
device
=
This
->
resource
.
device
;
IWineD3DDeviceImpl
*
device
=
surface
->
resource
.
device
;
IWineD3DBaseTexture
*
baseTexture
=
NULL
;
TRACE
(
"(%p)Checking to see if the container is a base texture
\n
"
,
This
);
if
(
IWineD3DSurface_GetContainer
(
iface
,
&
IID_IWineD3DBaseTexture
,
(
void
**
)
&
baseTexture
)
==
WINED3D_OK
)
{
IWineD3DBaseTextureImpl
*
tex_impl
=
(
IWineD3DBaseTextureImpl
*
)
baseTexture
;
TRACE
(
"(%p)Checking to see if the container is a base texture
\n
"
,
surface
);
if
(
SUCCEEDED
(
IWineD3DSurface_GetContainer
((
IWineD3DSurface
*
)
surface
,
&
IID_IWineD3DBaseTexture
,
(
void
**
)
&
baseTexture
)))
{
IWineD3DBaseTextureImpl
*
tex_impl
=
(
IWineD3DBaseTextureImpl
*
)
baseTexture
;
TRACE
(
"Passing to container
\n
"
);
tex_impl
->
baseTexture
.
internal_preload
(
baseTexture
,
srgb
);
IWineD3DBaseTexture_Release
(
baseTexture
);
}
else
{
struct
wined3d_context
*
context
=
NULL
;
TRACE
(
"(%p) : About to load surface
\n
"
,
This
);
TRACE
(
"(%p) : About to load surface
\n
"
,
surface
);
if
(
!
device
->
isInDraw
)
context
=
context_acquire
(
device
,
NULL
,
CTXUSAGE_RESOURCELOAD
);
if
(
This
->
resource
.
format_desc
->
format
==
WINED3DFMT_P8_UINT
||
This
->
resource
.
format_desc
->
format
==
WINED3DFMT_P8_UINT_A8_UNORM
)
if
(
surface
->
resource
.
format_desc
->
format
==
WINED3DFMT_P8_UINT
||
surface
->
resource
.
format_desc
->
format
==
WINED3DFMT_P8_UINT_A8_UNORM
)
{
if
(
palette9_changed
(
This
))
{
if
(
palette9_changed
(
surface
))
{
TRACE
(
"Reloading surface because the d3d8/9 palette was changed
\n
"
);
/* TODO: This is not necessarily needed with hw palettized texture support */
IWineD3DSurface_LoadLocation
(
i
face
,
SFLAG_INSYSMEM
,
NULL
);
IWineD3DSurface_LoadLocation
(
(
IWineD3DSurface
*
)
sur
face
,
SFLAG_INSYSMEM
,
NULL
);
/* Make sure the texture is reloaded because of the palette change, this kills performance though :( */
IWineD3DSurface_ModifyLocation
(
i
face
,
SFLAG_INTEXTURE
,
FALSE
);
IWineD3DSurface_ModifyLocation
(
(
IWineD3DSurface
*
)
sur
face
,
SFLAG_INTEXTURE
,
FALSE
);
}
}
IWineD3DSurface_LoadTexture
(
i
face
,
srgb
==
SRGB_SRGB
?
TRUE
:
FALSE
);
IWineD3DSurface_LoadTexture
(
(
IWineD3DSurface
*
)
sur
face
,
srgb
==
SRGB_SRGB
?
TRUE
:
FALSE
);
if
(
This
->
resource
.
pool
==
WINED3DPOOL_DEFAULT
)
{
if
(
surface
->
resource
.
pool
==
WINED3DPOOL_DEFAULT
)
{
/* Tell opengl to try and keep this texture in video ram (well mostly) */
GLclampf
tmp
;
tmp
=
0
.
9
f
;
ENTER_GL
();
glPrioritizeTextures
(
1
,
&
This
->
texture_name
,
&
tmp
);
glPrioritizeTextures
(
1
,
&
surface
->
texture_name
,
&
tmp
);
LEAVE_GL
();
}
...
...
@@ -1118,8 +1121,9 @@ void surface_internal_preload(IWineD3DSurface *iface, enum WINED3DSRGB srgb)
}
}
static
void
WINAPI
IWineD3DSurfaceImpl_PreLoad
(
IWineD3DSurface
*
iface
)
{
surface_internal_preload
(
iface
,
SRGB_ANY
);
static
void
WINAPI
IWineD3DSurfaceImpl_PreLoad
(
IWineD3DSurface
*
iface
)
{
surface_internal_preload
((
IWineD3DSurfaceImpl
*
)
iface
,
SRGB_ANY
);
}
/* Context activation is done by the caller. */
...
...
@@ -2707,7 +2711,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_SaveSnapshot(IWineD3DSurface *iface, c
LEAVE_GL
();
}
else
{
/* bind the real texture, and make sure it up to date */
surface_internal_preload
(
iface
,
SRGB_RGB
);
surface_internal_preload
(
This
,
SRGB_RGB
);
surface_bind_and_dirtify
(
This
,
FALSE
);
}
allocatedMemory
=
HeapAlloc
(
GetProcessHeap
(),
0
,
width
*
height
*
4
);
...
...
@@ -3009,7 +3013,7 @@ static void fb_copy_to_texture_direct(IWineD3DSurfaceImpl *dst_surface, IWineD3D
}
context
=
context_acquire
(
device
,
src_surface
,
CTXUSAGE_BLIT
);
surface_internal_preload
(
(
IWineD3DSurface
*
)
dst_surface
,
SRGB_RGB
);
surface_internal_preload
(
dst_surface
,
SRGB_RGB
);
ENTER_GL
();
/* Bind the target texture */
...
...
@@ -3117,14 +3121,14 @@ static void fb_copy_to_texture_hwstretch(IWineD3DSurfaceImpl *dst_surface, IWine
TRACE
(
"Using hwstretch blit
\n
"
);
/* Activate the Proper context for reading from the source surface, set it up for blitting */
context
=
context_acquire
(
device
,
src_surface
,
CTXUSAGE_BLIT
);
surface_internal_preload
(
(
IWineD3DSurface
*
)
dst_surface
,
SRGB_RGB
);
surface_internal_preload
(
dst_surface
,
SRGB_RGB
);
src_offscreen
=
surface_is_offscreen
(
src_surface
);
noBackBufferBackup
=
src_offscreen
&&
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
;
if
(
!
noBackBufferBackup
&&
!
src_surface
->
texture_name
)
{
/* Get it a description */
surface_internal_preload
(
(
IWineD3DSurface
*
)
src_surface
,
SRGB_RGB
);
surface_internal_preload
(
src_surface
,
SRGB_RGB
);
}
ENTER_GL
();
...
...
@@ -3657,7 +3661,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
}
/* Now load the surface */
surface_internal_preload
(
(
IWineD3DSurface
*
)
Src
,
SRGB_RGB
);
surface_internal_preload
(
Src
,
SRGB_RGB
);
/* Activate the destination context, set it up for blitting */
context
=
context_acquire
(
device
,
This
,
CTXUSAGE_BLIT
);
...
...
dlls/wined3d/wined3d_private.h
View file @
d1ea48b9
...
...
@@ -1872,7 +1872,7 @@ typedef struct IWineD3DBaseTextureClass
void
(
*
internal_preload
)(
IWineD3DBaseTexture
*
iface
,
enum
WINED3DSRGB
srgb
);
}
IWineD3DBaseTextureClass
;
void
surface_internal_preload
(
IWineD3DSurface
*
i
face
,
enum
WINED3DSRGB
srgb
)
DECLSPEC_HIDDEN
;
void
surface_internal_preload
(
IWineD3DSurface
Impl
*
sur
face
,
enum
WINED3DSRGB
srgb
)
DECLSPEC_HIDDEN
;
BOOL
surface_init_sysmem
(
IWineD3DSurface
*
iface
)
DECLSPEC_HIDDEN
;
BOOL
surface_is_offscreen
(
IWineD3DSurfaceImpl
*
iface
)
DECLSPEC_HIDDEN
;
void
surface_prepare_texture
(
IWineD3DSurfaceImpl
*
surface
,
...
...
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