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
9cafbd6d
Commit
9cafbd6d
authored
Sep 24, 2006
by
Stefan Dösinger
Committed by
Alexandre Julliard
Sep 25, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Surface data is 32 bit aligned.
parent
96bce8d6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
3 deletions
+30
-3
surface.c
dlls/d3d9/tests/surface.c
+22
-0
device.c
dlls/wined3d/device.c
+3
-1
surface.c
dlls/wined3d/surface.c
+4
-1
surface_gdi.c
dlls/wined3d/surface_gdi.c
+1
-1
No files found.
dlls/d3d9/tests/surface.c
View file @
9cafbd6d
...
...
@@ -113,6 +113,27 @@ cleanup:
if
(
surface_ptr
)
IDirect3DSurface9_Release
(
surface_ptr
);
}
static
void
test_surface_alignment
(
IDirect3DDevice9
*
device_ptr
)
{
IDirect3DSurface9
*
surface_ptr
=
0
;
HRESULT
hr
;
/* Test a sysmem surface as those aren't affected by the hardware's np2 restrictions */
hr
=
IDirect3DDevice9_CreateOffscreenPlainSurface
(
device_ptr
,
5
,
5
,
D3DFMT_R5G6B5
,
D3DPOOL_SYSTEMMEM
,
&
surface_ptr
,
0
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_CreateOffscreenPlainSurface returned %08lx
\n
"
,
hr
);
if
(
surface_ptr
)
{
D3DLOCKED_RECT
lockedRect
;
hr
=
IDirect3DSurface9_LockRect
(
surface_ptr
,
&
lockedRect
,
NULL
,
0
);
ok
(
hr
==
D3D_OK
,
"IDirect3DSurface9_LockRect returned %08lx
\n
"
,
hr
);
/* test is deactivated until out np2 support doesn't report the full power of 2 pitch to the app */
todo_wine
ok
(
lockedRect
.
Pitch
==
12
,
"Got pitch %d, expected 12
\n
"
,
lockedRect
.
Pitch
);
hr
=
IDirect3DSurface9_UnlockRect
(
surface_ptr
);
IDirect3DSurface9_Release
(
surface_ptr
);
}
}
START_TEST
(
surface
)
{
HMODULE
d3d9_handle
;
...
...
@@ -129,4 +150,5 @@ START_TEST(surface)
if
(
!
device_ptr
)
return
;
test_surface_get_container
(
device_ptr
);
test_surface_alignment
(
device_ptr
);
}
dlls/wined3d/device.c
View file @
9cafbd6d
...
...
@@ -1001,7 +1001,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, U
Format
==
WINED3DFMT_DXT4
||
Format
==
WINED3DFMT_DXT5
)
{
Size
=
((
max
(
pow2Width
,
4
)
*
tableEntry
->
bpp
)
*
max
(
pow2Height
,
4
));
}
else
{
Size
=
(
pow2Width
*
tableEntry
->
bpp
)
*
pow2Height
;
/* The pitch is a multiple of 4 bytes */
Size
=
((
pow2Width
*
tableEntry
->
bpp
)
+
3
)
&
~
3
;
Size
*=
pow2Height
;
}
/** Create and initialise the surface resource **/
...
...
dlls/wined3d/surface.c
View file @
9cafbd6d
...
...
@@ -2170,7 +2170,8 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3DFORM
format
==
WINED3DFMT_DXT4
||
format
==
WINED3DFMT_DXT5
)
{
This
->
resource
.
size
=
((
max
(
This
->
pow2Width
,
4
)
*
formatEntry
->
bpp
)
*
max
(
This
->
pow2Height
,
4
));
}
else
{
This
->
resource
.
size
=
(
This
->
pow2Width
*
formatEntry
->
bpp
)
*
This
->
pow2Height
;
This
->
resource
.
size
=
((
This
->
pow2Width
*
formatEntry
->
bpp
)
+
3
)
&
~
3
;
This
->
resource
.
size
*=
This
->
pow2Height
;
}
...
...
@@ -3063,6 +3064,8 @@ DWORD WINAPI IWineD3DSurfaceImpl_GetPitch(IWineD3DSurface *iface) {
}
else
{
ret
=
This
->
bytesPerPixel
*
This
->
pow2Width
;
}
/* Surfaces are 32 bit aligned */
ret
=
(
ret
+
3
)
&
~
3
;
}
TRACE
(
"(%p) Returning %ld
\n
"
,
This
,
ret
);
return
ret
;
...
...
dlls/wined3d/surface_gdi.c
View file @
9cafbd6d
...
...
@@ -1516,7 +1516,7 @@ IWineGDISurfaceImpl_PrivateSetup(IWineD3DSurface *iface)
This
->
resource
.
allocatedMemory
=
NULL
;
/* We don't mind the nonpow2 stuff in GDI */
This
->
resource
.
size
=
This
->
currentDesc
.
Width
*
getFormatDescEntry
(
This
->
resource
.
format
)
->
bpp
*
This
->
currentDesc
.
Height
;
This
->
resource
.
size
=
IWineD3DSurface_GetPitch
(
iface
)
*
This
->
currentDesc
.
Height
;
This
->
pow2Size
=
This
->
resource
.
size
;
This
->
pow2Width
=
This
->
currentDesc
.
Width
;
This
->
pow2Height
=
This
->
currentDesc
.
Height
;
...
...
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