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
f0a0714e
Commit
f0a0714e
authored
Oct 25, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 25, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Pass a sub-resource index instead of a miplevel to 2D texture methods.
parent
ae0a4849
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
21 deletions
+32
-21
texture.c
dlls/wined3d/texture.c
+28
-17
wined3d.idl
include/wine/wined3d.idl
+4
-4
No files found.
dlls/wined3d/texture.c
View file @
f0a0714e
...
...
@@ -333,17 +333,28 @@ static BOOL WINAPI IWineD3DTextureImpl_IsCondNP2(IWineD3DTexture *iface) {
return
This
->
cond_np2
;
}
/* *******************************************
IWineD3DTexture IWineD3DTexture parts follow
******************************************* */
static
HRESULT
WINAPI
IWineD3DTextureImpl_GetLevelDesc
(
IWineD3DTexture
*
iface
,
UINT
level
,
WINED3DSURFACE_DESC
*
desc
)
static
IWineD3DResourceImpl
*
texture_get_sub_resource
(
IWineD3DBaseTextureImpl
*
texture
,
UINT
sub_resource_idx
)
{
UINT
sub_count
=
texture
->
baseTexture
.
level_count
*
texture
->
baseTexture
.
layer_count
;
if
(
sub_resource_idx
>=
sub_count
)
{
WARN
(
"sub_resource_idx %u >= sub_count %u.
\n
"
,
sub_resource_idx
,
sub_count
);
return
NULL
;
}
return
texture
->
baseTexture
.
sub_resources
[
sub_resource_idx
];
}
static
HRESULT
WINAPI
IWineD3DTextureImpl_GetLevelDesc
(
IWineD3DTexture
*
iface
,
UINT
sub_resource_idx
,
WINED3DSURFACE_DESC
*
desc
)
{
IWineD3DBaseTextureImpl
*
texture
=
(
IWineD3DBaseTextureImpl
*
)
iface
;
IWineD3DSurface
*
surface
;
TRACE
(
"iface %p,
level %u, desc %p.
\n
"
,
iface
,
level
,
desc
);
TRACE
(
"iface %p,
sub_resource_idx %u, desc %p.
\n
"
,
iface
,
sub_resource_idx
,
desc
);
if
(
!
(
surface
=
(
IWineD3DSurface
*
)
basetexture_get_sub_resource
(
texture
,
0
,
level
)))
if
(
!
(
surface
=
(
IWineD3DSurface
*
)
texture_get_sub_resource
(
texture
,
sub_resource_idx
)))
{
WARN
(
"Failed to get sub-resource.
\n
"
);
return
WINED3DERR_INVALIDCALL
;
...
...
@@ -355,14 +366,14 @@ static HRESULT WINAPI IWineD3DTextureImpl_GetLevelDesc(IWineD3DTexture *iface, U
}
static
HRESULT
WINAPI
IWineD3DTextureImpl_GetSurfaceLevel
(
IWineD3DTexture
*
iface
,
UINT
level
,
IWineD3DSurface
**
surface
)
UINT
sub_resource_idx
,
IWineD3DSurface
**
surface
)
{
IWineD3DBaseTextureImpl
*
texture
=
(
IWineD3DBaseTextureImpl
*
)
iface
;
IWineD3DSurface
*
s
;
TRACE
(
"iface %p,
level %u, surface %p.
\n
"
,
iface
,
level
,
surface
);
TRACE
(
"iface %p,
sub_resource_idx %u, surface %p.
\n
"
,
iface
,
sub_resource_idx
,
surface
);
if
(
!
(
s
=
(
IWineD3DSurface
*
)
basetexture_get_sub_resource
(
texture
,
0
,
level
)))
if
(
!
(
s
=
(
IWineD3DSurface
*
)
texture_get_sub_resource
(
texture
,
sub_resource_idx
)))
{
WARN
(
"Failed to get sub-resource.
\n
"
);
return
WINED3DERR_INVALIDCALL
;
...
...
@@ -377,15 +388,15 @@ static HRESULT WINAPI IWineD3DTextureImpl_GetSurfaceLevel(IWineD3DTexture *iface
}
static
HRESULT
WINAPI
IWineD3DTextureImpl_Map
(
IWineD3DTexture
*
iface
,
UINT
level
,
WINED3DLOCKED_RECT
*
locked_rect
,
const
RECT
*
rect
,
DWORD
flags
)
UINT
sub_resource_idx
,
WINED3DLOCKED_RECT
*
locked_rect
,
const
RECT
*
rect
,
DWORD
flags
)
{
IWineD3DBaseTextureImpl
*
texture
=
(
IWineD3DBaseTextureImpl
*
)
iface
;
IWineD3DSurface
*
surface
;
TRACE
(
"iface %p,
level
%u, locked_rect %p, rect %s, flags %#x.
\n
"
,
iface
,
level
,
locked_rect
,
wine_dbgstr_rect
(
rect
),
flags
);
TRACE
(
"iface %p,
sub_resource_idx
%u, locked_rect %p, rect %s, flags %#x.
\n
"
,
iface
,
sub_resource_idx
,
locked_rect
,
wine_dbgstr_rect
(
rect
),
flags
);
if
(
!
(
surface
=
(
IWineD3DSurface
*
)
basetexture_get_sub_resource
(
texture
,
0
,
level
)))
if
(
!
(
surface
=
(
IWineD3DSurface
*
)
texture_get_sub_resource
(
texture
,
sub_resource_idx
)))
{
WARN
(
"Failed to get sub-resource.
\n
"
);
return
WINED3DERR_INVALIDCALL
;
...
...
@@ -394,14 +405,14 @@ static HRESULT WINAPI IWineD3DTextureImpl_Map(IWineD3DTexture *iface,
return
IWineD3DSurface_Map
(
surface
,
locked_rect
,
rect
,
flags
);
}
static
HRESULT
WINAPI
IWineD3DTextureImpl_Unmap
(
IWineD3DTexture
*
iface
,
UINT
level
)
static
HRESULT
WINAPI
IWineD3DTextureImpl_Unmap
(
IWineD3DTexture
*
iface
,
UINT
sub_resource_idx
)
{
IWineD3DBaseTextureImpl
*
texture
=
(
IWineD3DBaseTextureImpl
*
)
iface
;
IWineD3DSurface
*
surface
;
TRACE
(
"iface %p,
level %u.
\n
"
,
iface
,
level
);
TRACE
(
"iface %p,
sub_resource_idx %u.
\n
"
,
iface
,
sub_resource_idx
);
if
(
!
(
surface
=
(
IWineD3DSurface
*
)
basetexture_get_sub_resource
(
texture
,
0
,
level
)))
if
(
!
(
surface
=
(
IWineD3DSurface
*
)
texture_get_sub_resource
(
texture
,
sub_resource_idx
)))
{
WARN
(
"Failed to get sub-resource.
\n
"
);
return
WINED3DERR_INVALIDCALL
;
...
...
@@ -417,7 +428,7 @@ static HRESULT WINAPI IWineD3DTextureImpl_AddDirtyRect(IWineD3DTexture *iface, c
TRACE
(
"iface %p, dirty_rect %s.
\n
"
,
iface
,
wine_dbgstr_rect
(
dirty_rect
));
if
(
!
(
surface
=
(
IWineD3DSurfaceImpl
*
)
basetexture_get_sub_resource
(
texture
,
0
,
0
)))
if
(
!
(
surface
=
(
IWineD3DSurfaceImpl
*
)
texture_get_sub_resource
(
texture
,
0
)))
{
WARN
(
"Failed to get sub-resource.
\n
"
);
return
WINED3DERR_INVALIDCALL
;
...
...
include/wine/wined3d.idl
View file @
f0a0714e
...
...
@@ -2544,21 +2544,21 @@ interface IWineD3DBaseTexture : IWineD3DResource
interface
IWineD3DTexture
:
IWineD3DBaseTexture
{
HRESULT
GetLevelDesc
(
[
in
]
UINT
level
,
[
in
]
UINT
sub_resource_idx
,
[
out
]
WINED3DSURFACE_DESC
*
desc
)
;
HRESULT
GetSurfaceLevel
(
[
in
]
UINT
level
,
[
in
]
UINT
sub_resource_idx
,
[
out
]
IWineD3DSurface
**
surface
)
;
HRESULT
Map
(
[
in
]
UINT
level
,
[
in
]
UINT
sub_resource_idx
,
[
out
]
WINED3DLOCKED_RECT
*
locked_rect
,
[
in
]
const
RECT
*
rect
,
[
in
]
DWORD
flags
)
;
HRESULT
Unmap
(
[
in
]
UINT
level
[
in
]
UINT
sub_resource_idx
)
;
HRESULT
AddDirtyRect
(
[
in
]
const
RECT
*
dirty_rect
...
...
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