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
1dcf222a
Commit
1dcf222a
authored
Mar 12, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 12, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Get rid of some calls to getFormatDescEntry().
Use the format description stored in the resource instead.
parent
38178541
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
30 deletions
+17
-30
device.c
dlls/wined3d/device.c
+10
-17
state.c
dlls/wined3d/state.c
+2
-3
surface.c
dlls/wined3d/surface.c
+4
-8
volume.c
dlls/wined3d/volume.c
+1
-2
No files found.
dlls/wined3d/device.c
View file @
1dcf222a
...
@@ -911,8 +911,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface,
...
@@ -911,8 +911,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface,
HRESULT
hr
;
HRESULT
hr
;
unsigned
int
pow2Width
;
unsigned
int
pow2Width
;
unsigned
int
pow2Height
;
unsigned
int
pow2Height
;
const
struct
GlPixelFormatDesc
*
glDesc
;
getFormatDescEntry
(
Format
,
&
GLINFO_LOCATION
,
&
glDesc
);
TRACE
(
"(%p) : Width %d, Height %d, Levels %d, Usage %#x
\n
"
,
This
,
Width
,
Height
,
Levels
,
Usage
);
TRACE
(
"(%p) : Width %d, Height %d, Levels %d, Usage %#x
\n
"
,
This
,
Width
,
Height
,
Levels
,
Usage
);
TRACE
(
"Format %#x (%s), Pool %#x, ppTexture %p, pSharedHandle %p, parent %p
\n
"
,
TRACE
(
"Format %#x (%s), Pool %#x, ppTexture %p, pSharedHandle %p, parent %p
\n
"
,
...
@@ -1000,7 +998,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface,
...
@@ -1000,7 +998,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface,
object
->
width
=
Width
;
object
->
width
=
Width
;
object
->
height
=
Height
;
object
->
height
=
Height
;
if
(
glDesc
->
Flags
&
WINED3DFMT_FLAG_FILTERING
)
{
if
(
object
->
resource
.
format_desc
->
Flags
&
WINED3DFMT_FLAG_FILTERING
)
{
object
->
baseTexture
.
minMipLookup
=
minMipLookup
;
object
->
baseTexture
.
minMipLookup
=
minMipLookup
;
object
->
baseTexture
.
magLookup
=
magLookup
;
object
->
baseTexture
.
magLookup
=
magLookup
;
}
else
{
}
else
{
...
@@ -1068,7 +1067,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface,
...
@@ -1068,7 +1067,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface,
tmpW
=
max
(
1
,
tmpW
>>
1
);
tmpW
=
max
(
1
,
tmpW
>>
1
);
tmpH
=
max
(
1
,
tmpH
>>
1
);
tmpH
=
max
(
1
,
tmpH
>>
1
);
}
}
object
->
baseTexture
.
shader_color_fixup
=
glD
esc
->
color_fixup
;
object
->
baseTexture
.
shader_color_fixup
=
object
->
resource
.
format_d
esc
->
color_fixup
;
object
->
baseTexture
.
internal_preload
=
texture_internal_preload
;
object
->
baseTexture
.
internal_preload
=
texture_internal_preload
;
TRACE
(
"(%p) : Created texture %p
\n
"
,
This
,
object
);
TRACE
(
"(%p) : Created texture %p
\n
"
,
This
,
object
);
...
@@ -1085,11 +1084,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa
...
@@ -1085,11 +1084,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa
UINT
tmpW
;
UINT
tmpW
;
UINT
tmpH
;
UINT
tmpH
;
UINT
tmpD
;
UINT
tmpD
;
const
struct
GlPixelFormatDesc
*
glDesc
;
HRESULT
hr
;
HRESULT
hr
;
getFormatDescEntry
(
Format
,
&
GLINFO_LOCATION
,
&
glDesc
);
/* TODO: It should only be possible to create textures for formats
/* TODO: It should only be possible to create textures for formats
that are reported as supported */
that are reported as supported */
if
(
WINED3DFMT_UNKNOWN
>=
Format
)
{
if
(
WINED3DFMT_UNKNOWN
>=
Format
)
{
...
@@ -1157,7 +1153,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa
...
@@ -1157,7 +1153,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa
object
->
baseTexture
.
pow2Matrix
[
10
]
=
1
.
0
;
object
->
baseTexture
.
pow2Matrix
[
10
]
=
1
.
0
;
object
->
baseTexture
.
pow2Matrix
[
15
]
=
1
.
0
;
object
->
baseTexture
.
pow2Matrix
[
15
]
=
1
.
0
;
if
(
glDesc
->
Flags
&
WINED3DFMT_FLAG_FILTERING
)
{
if
(
object
->
resource
.
format_desc
->
Flags
&
WINED3DFMT_FLAG_FILTERING
)
{
object
->
baseTexture
.
minMipLookup
=
minMipLookup
;
object
->
baseTexture
.
minMipLookup
=
minMipLookup
;
object
->
baseTexture
.
magLookup
=
magLookup
;
object
->
baseTexture
.
magLookup
=
magLookup
;
}
else
{
}
else
{
...
@@ -1191,7 +1188,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa
...
@@ -1191,7 +1188,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa
tmpH
=
max
(
1
,
tmpH
>>
1
);
tmpH
=
max
(
1
,
tmpH
>>
1
);
tmpD
=
max
(
1
,
tmpD
>>
1
);
tmpD
=
max
(
1
,
tmpD
>>
1
);
}
}
object
->
baseTexture
.
shader_color_fixup
=
glD
esc
->
color_fixup
;
object
->
baseTexture
.
shader_color_fixup
=
object
->
resource
.
format_d
esc
->
color_fixup
;
object
->
baseTexture
.
internal_preload
=
volumetexture_internal_preload
;
object
->
baseTexture
.
internal_preload
=
volumetexture_internal_preload
;
*
ppVolumeTexture
=
(
IWineD3DVolumeTexture
*
)
object
;
*
ppVolumeTexture
=
(
IWineD3DVolumeTexture
*
)
object
;
...
@@ -1270,8 +1267,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface
...
@@ -1270,8 +1267,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface
UINT
tmpW
;
UINT
tmpW
;
HRESULT
hr
;
HRESULT
hr
;
unsigned
int
pow2EdgeLength
;
unsigned
int
pow2EdgeLength
;
const
struct
GlPixelFormatDesc
*
glDesc
;
getFormatDescEntry
(
Format
,
&
GLINFO_LOCATION
,
&
glDesc
);
/* TODO: It should only be possible to create textures for formats
/* TODO: It should only be possible to create textures for formats
that are reported as supported */
that are reported as supported */
...
@@ -1352,7 +1347,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface
...
@@ -1352,7 +1347,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface
object
->
baseTexture
.
pow2Matrix
[
15
]
=
1
.
0
;
object
->
baseTexture
.
pow2Matrix
[
15
]
=
1
.
0
;
}
}
if
(
glDesc
->
Flags
&
WINED3DFMT_FLAG_FILTERING
)
{
if
(
object
->
resource
.
format_desc
->
Flags
&
WINED3DFMT_FLAG_FILTERING
)
{
object
->
baseTexture
.
minMipLookup
=
minMipLookup
;
object
->
baseTexture
.
minMipLookup
=
minMipLookup
;
object
->
baseTexture
.
magLookup
=
magLookup
;
object
->
baseTexture
.
magLookup
=
magLookup
;
}
else
{
}
else
{
...
@@ -1390,7 +1386,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface
...
@@ -1390,7 +1386,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface
}
}
tmpW
=
max
(
1
,
tmpW
>>
1
);
tmpW
=
max
(
1
,
tmpW
>>
1
);
}
}
object
->
baseTexture
.
shader_color_fixup
=
glD
esc
->
color_fixup
;
object
->
baseTexture
.
shader_color_fixup
=
object
->
resource
.
format_d
esc
->
color_fixup
;
object
->
baseTexture
.
internal_preload
=
cubetexture_internal_preload
;
object
->
baseTexture
.
internal_preload
=
cubetexture_internal_preload
;
TRACE
(
"(%p) : Created Cube Texture %p
\n
"
,
This
,
object
);
TRACE
(
"(%p) : Created Cube Texture %p
\n
"
,
This
,
object
);
...
@@ -5806,7 +5802,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetFrontBufferData(IWineD3DDevice *if
...
@@ -5806,7 +5802,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetFrontBufferData(IWineD3DDevice *if
static
HRESULT
WINAPI
IWineD3DDeviceImpl_ValidateDevice
(
IWineD3DDevice
*
iface
,
DWORD
*
pNumPasses
)
{
static
HRESULT
WINAPI
IWineD3DDeviceImpl_ValidateDevice
(
IWineD3DDevice
*
iface
,
DWORD
*
pNumPasses
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DBaseTextureImpl
*
texture
;
IWineD3DBaseTextureImpl
*
texture
;
const
struct
GlPixelFormatDesc
*
gl_info
;
DWORD
i
;
DWORD
i
;
TRACE
(
"(%p) : %p
\n
"
,
This
,
pNumPasses
);
TRACE
(
"(%p) : %p
\n
"
,
This
,
pNumPasses
);
...
@@ -5822,9 +5817,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ValidateDevice(IWineD3DDevice *iface,
...
@@ -5822,9 +5817,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ValidateDevice(IWineD3DDevice *iface,
}
}
texture
=
(
IWineD3DBaseTextureImpl
*
)
This
->
stateBlock
->
textures
[
i
];
texture
=
(
IWineD3DBaseTextureImpl
*
)
This
->
stateBlock
->
textures
[
i
];
if
(
!
texture
)
continue
;
if
(
!
texture
||
texture
->
resource
.
format_desc
->
Flags
&
WINED3DFMT_FLAG_FILTERING
)
continue
;
getFormatDescEntry
(
texture
->
resource
.
format
,
&
GLINFO_LOCATION
,
&
gl_info
);
if
(
gl_info
->
Flags
&
WINED3DFMT_FLAG_FILTERING
)
continue
;
if
(
This
->
stateBlock
->
samplerState
[
i
][
WINED3DSAMP_MAGFILTER
]
!=
WINED3DTEXF_POINT
)
{
if
(
This
->
stateBlock
->
samplerState
[
i
][
WINED3DSAMP_MAGFILTER
]
!=
WINED3DTEXF_POINT
)
{
WARN
(
"Non-filterable texture and mag filter enabled on samper %u, returning E_FAIL
\n
"
,
i
);
WARN
(
"Non-filterable texture and mag filter enabled on samper %u, returning E_FAIL
\n
"
,
i
);
...
...
dlls/wined3d/state.c
View file @
1dcf222a
...
@@ -243,12 +243,11 @@ static void state_blend(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
...
@@ -243,12 +243,11 @@ static void state_blend(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
if
(
stateblock
->
renderState
[
WINED3DRS_ALPHABLENDENABLE
]
||
if
(
stateblock
->
renderState
[
WINED3DRS_ALPHABLENDENABLE
]
||
stateblock
->
renderState
[
WINED3DRS_EDGEANTIALIAS
]
||
stateblock
->
renderState
[
WINED3DRS_EDGEANTIALIAS
]
||
stateblock
->
renderState
[
WINED3DRS_ANTIALIASEDLINEENABLE
])
{
stateblock
->
renderState
[
WINED3DRS_ANTIALIASEDLINEENABLE
])
{
const
struct
GlPixelFormatDesc
*
glDesc
;
getFormatDescEntry
(
target
->
resource
.
format
,
&
GLINFO_LOCATION
,
&
glDesc
);
/* Disable blending in all cases even without pixelshaders. With blending on we could face a big performance penalty.
/* Disable blending in all cases even without pixelshaders. With blending on we could face a big performance penalty.
* The d3d9 visual test confirms the behavior. */
* The d3d9 visual test confirms the behavior. */
if
(
!
(
glDesc
->
Flags
&
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
))
{
if
(
!
(
target
->
resource
.
format_desc
->
Flags
&
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
))
{
glDisable
(
GL_BLEND
);
glDisable
(
GL_BLEND
);
checkGLcall
(
"glDisable GL_BLEND"
);
checkGLcall
(
"glDisable GL_BLEND"
);
return
;
return
;
...
...
dlls/wined3d/surface.c
View file @
1dcf222a
...
@@ -445,12 +445,10 @@ void surface_set_compatible_renderbuffer(IWineD3DSurface *iface, unsigned int wi
...
@@ -445,12 +445,10 @@ void surface_set_compatible_renderbuffer(IWineD3DSurface *iface, unsigned int wi
}
}
if
(
!
renderbuffer
)
{
if
(
!
renderbuffer
)
{
const
struct
GlPixelFormatDesc
*
glDesc
;
getFormatDescEntry
(
This
->
resource
.
format
,
&
GLINFO_LOCATION
,
&
glDesc
);
GL_EXTCALL
(
glGenRenderbuffersEXT
(
1
,
&
renderbuffer
));
GL_EXTCALL
(
glGenRenderbuffersEXT
(
1
,
&
renderbuffer
));
GL_EXTCALL
(
glBindRenderbufferEXT
(
GL_RENDERBUFFER_EXT
,
renderbuffer
));
GL_EXTCALL
(
glBindRenderbufferEXT
(
GL_RENDERBUFFER_EXT
,
renderbuffer
));
GL_EXTCALL
(
glRenderbufferStorageEXT
(
GL_RENDERBUFFER_EXT
,
glDesc
->
glInternal
,
width
,
height
));
GL_EXTCALL
(
glRenderbufferStorageEXT
(
GL_RENDERBUFFER_EXT
,
This
->
resource
.
format_desc
->
glInternal
,
width
,
height
));
entry
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
renderbuffer_entry_t
));
entry
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
renderbuffer_entry_t
));
entry
->
width
=
width
;
entry
->
width
=
width
;
...
@@ -1604,9 +1602,8 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC
...
@@ -1604,9 +1602,8 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC
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
)
{
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
);
BOOL
colorkey_active
=
need_alpha_ck
&&
(
This
->
CKeyFlags
&
WINEDDSD_CKSRCBLT
);
const
struct
GlPixelFormatDesc
*
glDesc
;
const
struct
GlPixelFormatDesc
*
glDesc
=
This
->
resource
.
format_desc
;
IWineD3DDeviceImpl
*
device
=
This
->
resource
.
wineD3DDevice
;
IWineD3DDeviceImpl
*
device
=
This
->
resource
.
wineD3DDevice
;
getFormatDescEntry
(
This
->
resource
.
format
,
&
GLINFO_LOCATION
,
&
glDesc
);
/* Default values: From the surface */
/* Default values: From the surface */
*
format
=
glDesc
->
glFormat
;
*
format
=
glDesc
->
glFormat
;
...
@@ -3838,10 +3835,9 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_RealizePalette(IWineD3DSurface *iface)
...
@@ -3838,10 +3835,9 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_RealizePalette(IWineD3DSurface *iface)
static
HRESULT
WINAPI
IWineD3DSurfaceImpl_PrivateSetup
(
IWineD3DSurface
*
iface
)
{
static
HRESULT
WINAPI
IWineD3DSurfaceImpl_PrivateSetup
(
IWineD3DSurface
*
iface
)
{
/** Check against the maximum texture sizes supported by the video card **/
/** Check against the maximum texture sizes supported by the video card **/
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
const
struct
GlPixelFormatDesc
*
glDesc
=
This
->
resource
.
format_desc
;
unsigned
int
pow2Width
,
pow2Height
;
unsigned
int
pow2Width
,
pow2Height
;
const
struct
GlPixelFormatDesc
*
glDesc
;
getFormatDescEntry
(
This
->
resource
.
format
,
&
GLINFO_LOCATION
,
&
glDesc
);
/* Setup some glformat defaults */
/* Setup some glformat defaults */
This
->
glDescription
.
glFormat
=
glDesc
->
glFormat
;
This
->
glDescription
.
glFormat
=
glDesc
->
glFormat
;
This
->
glDescription
.
glFormatInternal
=
glDesc
->
glInternal
;
This
->
glDescription
.
glFormatInternal
=
glDesc
->
glInternal
;
...
...
dlls/wined3d/volume.c
View file @
1dcf222a
...
@@ -301,9 +301,8 @@ static HRESULT WINAPI IWineD3DVolumeImpl_SetContainer(IWineD3DVolume *iface, IWi
...
@@ -301,9 +301,8 @@ static HRESULT WINAPI IWineD3DVolumeImpl_SetContainer(IWineD3DVolume *iface, IWi
static
HRESULT
WINAPI
IWineD3DVolumeImpl_LoadTexture
(
IWineD3DVolume
*
iface
,
int
gl_level
,
BOOL
srgb_mode
)
{
static
HRESULT
WINAPI
IWineD3DVolumeImpl_LoadTexture
(
IWineD3DVolume
*
iface
,
int
gl_level
,
BOOL
srgb_mode
)
{
IWineD3DVolumeImpl
*
This
=
(
IWineD3DVolumeImpl
*
)
iface
;
IWineD3DVolumeImpl
*
This
=
(
IWineD3DVolumeImpl
*
)
iface
;
const
struct
GlPixelFormatDesc
*
glDesc
=
This
->
resource
.
format_desc
;
WINED3DFORMAT
format
=
This
->
resource
.
format
;
WINED3DFORMAT
format
=
This
->
resource
.
format
;
const
struct
GlPixelFormatDesc
*
glDesc
;
getFormatDescEntry
(
format
,
&
GLINFO_LOCATION
,
&
glDesc
);
TRACE
(
"(%p) : level %u, format %s (0x%08x)
\n
"
,
This
,
gl_level
,
debug_d3dformat
(
format
),
format
);
TRACE
(
"(%p) : level %u, format %s (0x%08x)
\n
"
,
This
,
gl_level
,
debug_d3dformat
(
format
),
format
);
...
...
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