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
c3f0eb48
Commit
c3f0eb48
authored
Feb 13, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Feb 14, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Remove pow2Size from the surfaces.
parent
e16d08f0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
29 deletions
+13
-29
device.c
dlls/wined3d/device.c
+0
-3
surface.c
dlls/wined3d/surface.c
+2
-11
surface_gdi.c
dlls/wined3d/surface_gdi.c
+0
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+11
-14
No files found.
dlls/wined3d/device.c
View file @
c3f0eb48
...
...
@@ -832,11 +832,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, U
if
(
WINED3DFMT_UNKNOWN
!=
Format
)
{
object
->
bytesPerPixel
=
tableEntry
->
bpp
;
object
->
pow2Size
=
((
pow2Width
*
object
->
bytesPerPixel
)
+
SURFACE_ALIGNMENT
-
1
)
&
~
(
SURFACE_ALIGNMENT
-
1
);
object
->
pow2Size
*=
pow2Height
;
}
else
{
object
->
bytesPerPixel
=
0
;
object
->
pow2Size
=
0
;
}
/** TODO: change this into a texture transform matrix so that it's processed in hardware **/
...
...
dlls/wined3d/surface.c
View file @
c3f0eb48
...
...
@@ -628,12 +628,10 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED
/*Surface has no memory currently allocated to it!*/
TRACE
(
"(%p) Locking rect
\n
"
,
This
);
if
(
!
This
->
resource
.
allocatedMemory
)
{
This
->
resource
.
allocatedMemory
=
HeapAlloc
(
GetProcessHeap
()
,
0
,
This
->
pow2Size
);
This
->
resource
.
allocatedMemory
=
HeapAlloc
(
GetProcessHeap
()
,
0
,
This
->
resource
.
size
+
4
);
}
if
(
0
!=
This
->
glDescription
.
textureName
)
{
/* Now I have to copy thing bits back */
This
->
Flags
|=
SFLAG_ACTIVELOCK
;
/* When this flag is set to true, loading the surface again won't free THis->resource.allocatedMemory */
/* TODO: make activeLock a bit more intelligent, maybe implement a method to purge the texture memory. */
/* Make sure that a proper texture unit is selected, bind the texture and dirtify the sampler to restore the texture on the next draw */
if
(
GL_SUPPORT
(
ARB_MULTITEXTURE
))
{
...
...
@@ -681,7 +679,6 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED
if
(
This
->
resource
.
allocatedMemory
==
NULL
)
This
->
resource
.
allocatedMemory
=
HeapAlloc
(
GetProcessHeap
()
,
0
,
This
->
resource
.
size
);
This
->
Flags
|=
SFLAG_ACTIVELOCK
;
/*When this flag is set to true, loading the surface again won't free THis->resource.allocatedMemory*/
pLockedRect
->
pBits
=
This
->
resource
.
allocatedMemory
;
glFlush
();
...
...
@@ -1243,10 +1240,6 @@ HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHDC) {
int
extraline
=
0
;
SYSTEM_INFO
sysInfo
;
if
(
This
->
Flags
&
SFLAG_ACTIVELOCK
)
{
ERR
(
"Creating a DIB section while a lock is active. Uncertain consequences
\n
"
);
}
switch
(
This
->
bytesPerPixel
)
{
case
2
:
case
4
:
...
...
@@ -2092,17 +2085,15 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3DFORM
if
(
format
!=
WINED3DFMT_UNKNOWN
)
{
This
->
bytesPerPixel
=
formatEntry
->
bpp
;
This
->
pow2Size
=
(
This
->
pow2Width
*
This
->
bytesPerPixel
)
*
This
->
pow2Height
;
}
else
{
This
->
bytesPerPixel
=
0
;
This
->
pow2Size
=
0
;
}
This
->
Flags
|=
(
WINED3DFMT_D16_LOCKABLE
==
format
)
?
SFLAG_LOCKABLE
:
0
;
This
->
resource
.
format
=
format
;
TRACE
(
"(%p) : Size %d,
pow2Size %d, bytesPerPixel %d, glFormat %d, glFotmatInternal %d, glType %d
\n
"
,
This
,
This
->
resource
.
size
,
This
->
pow2S
ize
,
This
->
bytesPerPixel
,
This
->
glDescription
.
glFormat
,
This
->
glDescription
.
glFormatInternal
,
This
->
glDescription
.
glType
);
TRACE
(
"(%p) : Size %d,
bytesPerPixel %d, glFormat %d, glFotmatInternal %d, glType %d
\n
"
,
This
,
This
->
resource
.
s
ize
,
This
->
bytesPerPixel
,
This
->
glDescription
.
glFormat
,
This
->
glDescription
.
glFormatInternal
,
This
->
glDescription
.
glType
);
return
WINED3D_OK
;
}
...
...
dlls/wined3d/surface_gdi.c
View file @
c3f0eb48
...
...
@@ -1522,7 +1522,6 @@ IWineGDISurfaceImpl_PrivateSetup(IWineD3DSurface *iface)
/* We don't mind the nonpow2 stuff in GDI */
This
->
resource
.
size
=
IWineD3DSurface_GetPitch
(
iface
)
*
This
->
currentDesc
.
Height
;
This
->
pow2Size
=
This
->
resource
.
size
;
This
->
pow2Width
=
This
->
currentDesc
.
Width
;
This
->
pow2Height
=
This
->
currentDesc
.
Height
;
This
->
Flags
&=
~
SFLAG_NONPOW2
;
...
...
dlls/wined3d/wined3d_private.h
View file @
c3f0eb48
...
...
@@ -1069,18 +1069,17 @@ HRESULT WINAPI IWineD3DSurfaceImpl_UpdateOverlay(IWineD3DSurface *iface, RECT *S
#define SFLAG_LOCKABLE 0x00000010
/* Surface can be locked */
#define SFLAG_DISCARD 0x00000020
/* ??? */
#define SFLAG_LOCKED 0x00000040
/* Surface is locked atm */
#define SFLAG_ACTIVELOCK 0x00000080
/* Not locked, but surface memory is needed */
#define SFLAG_INTEXTURE 0x00000100
/* ??? */
#define SFLAG_INPBUFFER 0x00000200
/* ??? */
#define SFLAG_NONPOW2 0x00000400
/* Surface sizes are not a power of 2 */
#define SFLAG_DYNLOCK 0x00000800
/* Surface is often locked by the app */
#define SFLAG_DYNCHANGE 0x00001800
/* Surface contents are changed very often, implies DYNLOCK */
#define SFLAG_DCINUSE 0x00002000
/* Set between GetDC and ReleaseDC calls */
#define SFLAG_GLDIRTY 0x00004000
/* The opengl texture is more up to date than the surface mem */
#define SFLAG_LOST 0x00008000
/* Surface lost flag for DDraw */
#define SFLAG_FORCELOAD 0x00010000
/* To force PreLoading of a scratch cursor */
#define SFLAG_USERPTR 0x00020000
/* The application allocated the memory for this surface */
#define SFLAG_GLCKEY 0x00040000
/* The gl texture was created with a color key */
#define SFLAG_INTEXTURE 0x00000080
/* ??? */
#define SFLAG_INPBUFFER 0x00000100
/* ??? */
#define SFLAG_NONPOW2 0x00000200
/* Surface sizes are not a power of 2 */
#define SFLAG_DYNLOCK 0x00000400
/* Surface is often locked by the app */
#define SFLAG_DYNCHANGE 0x00000C00
/* Surface contents are changed very often, implies DYNLOCK */
#define SFLAG_DCINUSE 0x00001000
/* Set between GetDC and ReleaseDC calls */
#define SFLAG_GLDIRTY 0x00002000
/* The opengl texture is more up to date than the surface mem */
#define SFLAG_LOST 0x00004000
/* Surface lost flag for DDraw */
#define SFLAG_FORCELOAD 0x00008000
/* To force PreLoading of a scratch cursor */
#define SFLAG_USERPTR 0x00010000
/* The application allocated the memory for this surface */
#define SFLAG_GLCKEY 0x00020000
/* The gl texture was created with a color key */
/* In some conditions the surface memory must not be freed:
* SFLAG_OVERSIZE: Not all data can be kept in GL
...
...
@@ -1088,7 +1087,6 @@ HRESULT WINAPI IWineD3DSurfaceImpl_UpdateOverlay(IWineD3DSurface *iface, RECT *S
* SFLAG_DIBSECTION: The dib code manages the memory
* SFLAG_DIRTY: GL surface isn't up to date
* SFLAG_LOCKED: The app requires access to the surface data
* SFLAG_ACTIVELOCK: Some wined3d code needs the memory
* SFLAG_DYNLOCK: Avoid freeing the data for performance
* SFLAG_DYNCHANGE: Same reason as DYNLOCK
*/
...
...
@@ -1097,7 +1095,6 @@ HRESULT WINAPI IWineD3DSurfaceImpl_UpdateOverlay(IWineD3DSurface *iface, RECT *S
SFLAG_DIBSECTION | \
SFLAG_DIRTY | \
SFLAG_LOCKED | \
SFLAG_ACTIVELOCK | \
SFLAG_DYNLOCK | \
SFLAG_DYNCHANGE | \
SFLAG_USERPTR)
...
...
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