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
a0131a32
Commit
a0131a32
authored
Jul 23, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jul 30, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Split up the format table.
parent
58080159
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
43 deletions
+52
-43
device.c
dlls/wined3d/device.c
+12
-12
state.c
dlls/wined3d/state.c
+2
-2
surface.c
dlls/wined3d/surface.c
+14
-11
surface_gdi.c
dlls/wined3d/surface_gdi.c
+9
-9
utils.c
dlls/wined3d/utils.c
+0
-0
volume.c
dlls/wined3d/volume.c
+8
-7
wined3d_private.h
dlls/wined3d/wined3d_private.h
+7
-2
No files found.
dlls/wined3d/device.c
View file @
a0131a32
...
...
@@ -576,7 +576,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, U
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DSurfaceImpl
*
object
;
/*NOTE: impl ref allowed since this is a create function */
unsigned
int
Size
=
1
;
const
PixelFormatDesc
*
tableEntry
=
getFormatDescEntry
(
Format
);
const
GlPixelFormatDesc
*
glDesc
;
const
StaticPixelFormatDesc
*
tableEntry
=
getFormatDescEntry
(
Format
,
&
glDesc
);
TRACE
(
"(%p) Create surface
\n
"
,
This
);
/** FIXME: Check ranges on the inputs are valid
...
...
@@ -645,9 +646,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, U
object
->
currentDesc
.
MultiSampleQuality
=
MultisampleQuality
;
/* Setup some glformat defaults */
object
->
glDescription
.
glFormat
=
tableEntry
->
glFormat
;
object
->
glDescription
.
glFormatInternal
=
tableEntry
->
glInternal
;
object
->
glDescription
.
glType
=
tableEntry
->
glType
;
object
->
glDescription
.
glFormat
=
glDesc
->
glFormat
;
object
->
glDescription
.
glFormatInternal
=
glDesc
->
glInternal
;
object
->
glDescription
.
glType
=
glDesc
->
glType
;
object
->
glDescription
.
textureName
=
0
;
object
->
glDescription
.
level
=
Level
;
...
...
@@ -922,7 +923,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolume(IWineD3DDevice *iface,
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DVolumeImpl
*
object
;
/** NOTE: impl ref allowed since this is a create function **/
const
PixelFormatDesc
*
formatDesc
=
getFormatDescEntry
(
Format
);
const
StaticPixelFormatDesc
*
formatDesc
=
getFormatDescEntry
(
Format
,
NULL
);
D3DCREATERESOURCEOBJECTINSTANCE
(
object
,
Volume
,
WINED3DRTYPE_VOLUME
,
((
Width
*
formatDesc
->
bpp
)
*
Height
*
Depth
))
...
...
@@ -2028,7 +2029,6 @@ static void WINAPI IWineD3DDeviceImpl_SetFullscreen(IWineD3DDevice *iface, BOOL
*/
static
void
WINAPI
IWineD3DDeviceImpl_SetMultithreaded
(
IWineD3DDevice
*
iface
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
FIXME
(
"No thread safety in wined3d yet
\n
"
);
/*For now just store the flag(needed in case of ddraw) */
This
->
createParms
.
BehaviorFlags
|=
WINED3DCREATE_MULTITHREADED
;
...
...
@@ -2040,7 +2040,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetDisplayMode(IWineD3DDevice *iface, U
DEVMODEW
devmode
;
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
LONG
ret
;
const
PixelFormatDesc
*
formatDesc
=
getFormatDescEntry
(
pMode
->
Format
);
const
StaticPixelFormatDesc
*
formatDesc
=
getFormatDescEntry
(
pMode
->
Format
,
NULL
);
RECT
clip_rc
;
TRACE
(
"(%p)->(%d,%p) Mode=%dx%dx@%d, %s
\n
"
,
This
,
iSwapChain
,
pMode
,
pMode
->
Width
,
pMode
->
Height
,
pMode
->
RefreshRate
,
debug_d3dformat
(
pMode
->
Format
));
...
...
@@ -5985,11 +5985,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice* i
This
->
cursorHeight
=
pSur
->
currentDesc
.
Height
;
if
(
SUCCEEDED
(
IWineD3DSurface_LockRect
(
pCursorBitmap
,
&
rect
,
NULL
,
WINED3DLOCK_READONLY
)))
{
const
PixelFormatDesc
*
tableEntry
=
getFormatDescEntry
(
WINED3DFMT_A8R8G8B8
);
const
GlPixelFormatDesc
*
glDesc
;
const
StaticPixelFormatDesc
*
tableEntry
=
getFormatDescEntry
(
WINED3DFMT_A8R8G8B8
,
&
glDesc
);
char
*
mem
,
*
bits
=
(
char
*
)
rect
.
pBits
;
GLint
intfmt
=
tableEntry
->
glInternal
;
GLint
format
=
tableEntry
->
glFormat
;
GLint
type
=
tableEntry
->
glType
;
GLint
intfmt
=
glDesc
->
glInternal
;
GLint
format
=
glDesc
->
glFormat
;
GLint
type
=
glDesc
->
glType
;
INT
height
=
This
->
cursorHeight
;
INT
width
=
This
->
cursorWidth
;
INT
bpp
=
tableEntry
->
bpp
;
...
...
@@ -6455,7 +6456,6 @@ static void WINAPI IWineD3DDeviceImpl_ResourceReleased(IWineD3DDevice *iface, IW
break
;
}
case
WINED3DRTYPE_TEXTURE
:
case
WINED3DRTYPE_CUBETEXTURE
:
case
WINED3DRTYPE_VOLUMETEXTURE
:
...
...
dlls/wined3d/state.c
View file @
a0131a32
...
...
@@ -347,7 +347,7 @@ static void state_alpha(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
surf
=
(
IWineD3DSurfaceImpl
*
)
((
IWineD3DTextureImpl
*
)
stateblock
->
textures
[
0
])
->
surfaces
[
0
];
if
(
surf
->
CKeyFlags
&
WINEDDSD_CKSRCBLT
)
{
const
PixelFormatDesc
*
fmt
=
getFormatDescEntry
(
surf
->
resource
.
format
);
const
StaticPixelFormatDesc
*
fmt
=
getFormatDescEntry
(
surf
->
resource
.
format
,
NULL
);
/* The surface conversion does not do color keying conversion for surfaces that have an alpha
* channel on their own. Likewise, the alpha test shouldn't be set up for color keying if the
* surface has alpha bits
...
...
@@ -1783,7 +1783,7 @@ static void tex_alphaop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
IWineD3DSurfaceImpl
*
surf
=
(
IWineD3DSurfaceImpl
*
)
((
IWineD3DTextureImpl
*
)
stateblock
->
textures
[
0
])
->
surfaces
[
0
];
if
(
surf
->
CKeyFlags
&
WINEDDSD_CKSRCBLT
&&
getFormatDescEntry
(
surf
->
resource
.
format
)
->
alphaMask
==
0x00000000
)
{
getFormatDescEntry
(
surf
->
resource
.
format
,
NULL
)
->
alphaMask
==
0x00000000
)
{
/* Color keying needs to pass alpha values from the texture through to have the alpha test work properly.
* On the other hand applications can still use texture combiners apparently. This code takes care that apps
...
...
dlls/wined3d/surface.c
View file @
a0131a32
...
...
@@ -275,11 +275,12 @@ void surface_set_compatible_renderbuffer(IWineD3DSurface *iface, unsigned int wi
}
if
(
!
renderbuffer
)
{
const
PixelFormatDesc
*
format_entry
=
getFormatDescEntry
(
This
->
resource
.
format
);
const
GlPixelFormatDesc
*
glDesc
;
getFormatDescEntry
(
This
->
resource
.
format
,
&
glDesc
);
GL_EXTCALL
(
glGenRenderbuffersEXT
(
1
,
&
renderbuffer
));
GL_EXTCALL
(
glBindRenderbufferEXT
(
GL_RENDERBUFFER_EXT
,
renderbuffer
));
GL_EXTCALL
(
glRenderbufferStorageEXT
(
GL_RENDERBUFFER_EXT
,
format_entry
->
glFormat
,
width
,
height
));
GL_EXTCALL
(
glRenderbufferStorageEXT
(
GL_RENDERBUFFER_EXT
,
glDesc
->
glFormat
,
width
,
height
));
entry
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
renderbuffer_entry_t
));
entry
->
width
=
width
;
...
...
@@ -1261,7 +1262,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHDC) {
DWORD
*
masks
;
HRESULT
hr
;
RGBQUAD
col
[
256
];
const
PixelFormatDesc
*
formatEntry
=
getFormatDescEntry
(
This
->
resource
.
format
);
const
StaticPixelFormatDesc
*
formatEntry
=
getFormatDescEntry
(
This
->
resource
.
format
,
NULL
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pHDC
);
...
...
@@ -1482,12 +1483,13 @@ HRESULT WINAPI IWineD3DSurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC hDC) {
static
HRESULT
d3dfmt_get_conv
(
IWineD3DSurfaceImpl
*
This
,
BOOL
need_alpha_ck
,
BOOL
use_texturing
,
GLenum
*
format
,
GLenum
*
internal
,
GLenum
*
type
,
CONVERT_TYPES
*
convert
,
int
*
target_bpp
,
BOOL
srgb_mode
)
{
BOOL
colorkey_active
=
need_alpha_ck
&&
(
This
->
CKeyFlags
&
WINEDDSD_CKSRCBLT
);
const
PixelFormatDesc
*
formatEntry
=
getFormatDescEntry
(
This
->
resource
.
format
);
const
GlPixelFormatDesc
*
glDesc
;
getFormatDescEntry
(
This
->
resource
.
format
,
&
glDesc
);
/* Default values: From the surface */
*
format
=
formatEntry
->
glFormat
;
*
internal
=
srgb_mode
?
formatEntry
->
glGammaInternal
:
formatEntry
->
glInternal
;
*
type
=
formatEntry
->
glType
;
*
format
=
glDesc
->
glFormat
;
*
internal
=
srgb_mode
?
glDesc
->
glGammaInternal
:
glDesc
->
glInternal
;
*
type
=
glDesc
->
glType
;
*
convert
=
NO_CONVERSION
;
*
target_bpp
=
This
->
bytesPerPixel
;
...
...
@@ -2248,7 +2250,8 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SetContainer(IWineD3DSurface *iface, IWineD3D
HRESULT
WINAPI
IWineD3DSurfaceImpl_SetFormat
(
IWineD3DSurface
*
iface
,
WINED3DFORMAT
format
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
const
PixelFormatDesc
*
formatEntry
=
getFormatDescEntry
(
format
);
const
GlPixelFormatDesc
*
glDesc
;
const
StaticPixelFormatDesc
*
formatEntry
=
getFormatDescEntry
(
format
,
&
glDesc
);
if
(
This
->
resource
.
format
!=
WINED3DFMT_UNKNOWN
)
{
FIXME
(
"(%p) : The format of the surface must be WINED3DFORMAT_UNKNOWN
\n
"
,
This
);
...
...
@@ -2273,9 +2276,9 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3DFORM
/* Setup some glformat defaults */
This
->
glDescription
.
glFormat
=
formatEntry
->
glFormat
;
This
->
glDescription
.
glFormatInternal
=
formatEntry
->
glInternal
;
This
->
glDescription
.
glType
=
formatEntry
->
glType
;
This
->
glDescription
.
glFormat
=
glDesc
->
glFormat
;
This
->
glDescription
.
glFormatInternal
=
glDesc
->
glInternal
;
This
->
glDescription
.
glType
=
glDesc
->
glType
;
if
(
format
!=
WINED3DFMT_UNKNOWN
)
{
This
->
bytesPerPixel
=
formatEntry
->
bpp
;
...
...
dlls/wined3d/surface_gdi.c
View file @
a0131a32
...
...
@@ -498,7 +498,7 @@ IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface,
WINED3DFORMAT
dfmt
=
WINED3DFMT_UNKNOWN
,
sfmt
=
WINED3DFMT_UNKNOWN
;
int
bpp
,
srcheight
,
srcwidth
,
dstheight
,
dstwidth
,
width
;
int
x
,
y
;
const
PixelFormatDesc
*
sEntry
,
*
dEntry
;
const
Static
PixelFormatDesc
*
sEntry
,
*
dEntry
;
LPBYTE
dbuf
,
sbuf
;
TRACE
(
"(%p)->(%p,%p,%p,%x,%p)
\n
"
,
This
,
DestRect
,
Src
,
SrcRect
,
Flags
,
DDBltFx
);
...
...
@@ -536,7 +536,7 @@ IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface,
dfmt
=
This
->
resource
.
format
;
slock
=
dlock
;
sfmt
=
dfmt
;
sEntry
=
getFormatDescEntry
(
sfmt
);
sEntry
=
getFormatDescEntry
(
sfmt
,
NULL
);
dEntry
=
sEntry
;
}
else
...
...
@@ -546,9 +546,9 @@ IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface,
IWineD3DSurface_LockRect
(
SrcSurface
,
&
slock
,
NULL
,
WINED3DLOCK_READONLY
);
sfmt
=
Src
->
resource
.
format
;
}
sEntry
=
getFormatDescEntry
(
sfmt
);
sEntry
=
getFormatDescEntry
(
sfmt
,
NULL
);
dfmt
=
This
->
resource
.
format
;
dEntry
=
getFormatDescEntry
(
dfmt
);
dEntry
=
getFormatDescEntry
(
dfmt
,
NULL
);
IWineD3DSurface_LockRect
(
iface
,
&
dlock
,
NULL
,
0
);
}
...
...
@@ -1135,7 +1135,7 @@ IWineGDISurfaceImpl_BltFast(IWineD3DSurface *iface,
RECT
rsrc2
;
RECT
lock_src
,
lock_dst
,
lock_union
;
BYTE
*
sbuf
,
*
dbuf
;
const
PixelFormatDesc
*
sEntry
,
*
dEntry
;
const
Static
PixelFormatDesc
*
sEntry
,
*
dEntry
;
if
(
TRACE_ON
(
d3d_surface
))
{
...
...
@@ -1221,7 +1221,7 @@ IWineGDISurfaceImpl_BltFast(IWineD3DSurface *iface,
assert
(
This
->
resource
.
allocatedMemory
!=
NULL
);
sbuf
=
(
BYTE
*
)
This
->
resource
.
allocatedMemory
+
lock_src
.
top
*
pitch
+
lock_src
.
left
*
bpp
;
dbuf
=
(
BYTE
*
)
This
->
resource
.
allocatedMemory
+
lock_dst
.
top
*
pitch
+
lock_dst
.
left
*
bpp
;
sEntry
=
getFormatDescEntry
(
Src
->
resource
.
format
);
sEntry
=
getFormatDescEntry
(
Src
->
resource
.
format
,
NULL
);
dEntry
=
sEntry
;
}
else
...
...
@@ -1235,8 +1235,8 @@ IWineGDISurfaceImpl_BltFast(IWineD3DSurface *iface,
dbuf
=
dlock
.
pBits
;
TRACE
(
"Dst is at %p, Src is at %p
\n
"
,
dbuf
,
sbuf
);
sEntry
=
getFormatDescEntry
(
Src
->
resource
.
format
);
dEntry
=
getFormatDescEntry
(
This
->
resource
.
format
);
sEntry
=
getFormatDescEntry
(
Src
->
resource
.
format
,
NULL
);
dEntry
=
getFormatDescEntry
(
This
->
resource
.
format
,
NULL
);
}
/* Handle first the FOURCC surfaces... */
...
...
@@ -1414,7 +1414,7 @@ const char* filename)
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
static
char
*
output
=
NULL
;
static
int
size
=
0
;
const
PixelFormatDesc
*
formatEntry
=
getFormatDescEntry
(
This
->
resource
.
format
);
const
StaticPixelFormatDesc
*
formatEntry
=
getFormatDescEntry
(
This
->
resource
.
format
,
NULL
);
if
(
This
->
pow2Width
>
size
)
{
output
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
This
->
pow2Width
*
3
);
...
...
dlls/wined3d/utils.c
View file @
a0131a32
This diff is collapsed.
Click to expand it.
dlls/wined3d/volume.c
View file @
a0131a32
...
...
@@ -265,7 +265,8 @@ static HRESULT WINAPI IWineD3DVolumeImpl_SetContainer(IWineD3DVolume *iface, IWi
static
HRESULT
WINAPI
IWineD3DVolumeImpl_LoadTexture
(
IWineD3DVolume
*
iface
,
int
gl_level
,
BOOL
srgb_mode
)
{
IWineD3DVolumeImpl
*
This
=
(
IWineD3DVolumeImpl
*
)
iface
;
WINED3DFORMAT
format
=
This
->
resource
.
format
;
const
PixelFormatDesc
*
formatEntry
=
getFormatDescEntry
(
format
);
const
GlPixelFormatDesc
*
glDesc
;
getFormatDescEntry
(
format
,
&
glDesc
);
TRACE
(
"(%p) : level %u, format %s (0x%08x)
\n
"
,
This
,
gl_level
,
debug_d3dformat
(
format
),
format
);
...
...
@@ -273,23 +274,23 @@ static HRESULT WINAPI IWineD3DVolumeImpl_LoadTexture(IWineD3DVolume *iface, int
TRACE
(
"Calling glTexImage3D %x level=%d, intfmt=%x, w=%d, h=%d,d=%d, 0=%d, glFmt=%x, glType=%x, Mem=%p
\n
"
,
GL_TEXTURE_3D
,
gl_level
,
formatEntry
->
glInternal
,
glDesc
->
glInternal
,
This
->
currentDesc
.
Width
,
This
->
currentDesc
.
Height
,
This
->
currentDesc
.
Depth
,
0
,
formatEntry
->
glFormat
,
formatEntry
->
glType
,
glDesc
->
glFormat
,
glDesc
->
glType
,
This
->
resource
.
allocatedMemory
);
GL_EXTCALL
(
glTexImage3DEXT
(
GL_TEXTURE_3D
,
gl_level
,
formatEntry
->
glInternal
,
glDesc
->
glInternal
,
This
->
currentDesc
.
Width
,
This
->
currentDesc
.
Height
,
This
->
currentDesc
.
Depth
,
0
,
formatEntry
->
glFormat
,
formatEntry
->
glType
,
glDesc
->
glFormat
,
glDesc
->
glType
,
This
->
resource
.
allocatedMemory
));
checkGLcall
(
"glTexImage3D"
);
}
else
...
...
dlls/wined3d/wined3d_private.h
View file @
a0131a32
...
...
@@ -2038,10 +2038,15 @@ typedef struct {
DWORD
alphaMask
,
redMask
,
greenMask
,
blueMask
;
UINT
bpp
;
BOOL
isFourcc
;
}
StaticPixelFormatDesc
;
typedef
struct
{
/* Array uses the same indices as the static pixelformat */
GLint
glInternal
,
glGammaInternal
,
glFormat
,
glType
;
}
PixelFormatDesc
;
}
Gl
PixelFormatDesc
;
const
PixelFormatDesc
*
getFormatDescEntry
(
WINED3DFORMAT
fmt
);
const
StaticPixelFormatDesc
*
getFormatDescEntry
(
WINED3DFORMAT
fmt
,
const
GlPixelFormatDesc
**
glDesc
);
static
inline
BOOL
use_vs
(
IWineD3DDeviceImpl
*
device
)
{
return
(
device
->
vs_selected_mode
!=
SHADER_NONE
...
...
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