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
efb185dc
Commit
efb185dc
authored
Nov 12, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 12, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Rename the wined3d_format "Flags" field to "flags".
parent
027fdb31
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
67 additions
and
67 deletions
+67
-67
basetexture.c
dlls/wined3d/basetexture.c
+4
-4
context.c
dlls/wined3d/context.c
+6
-6
device.c
dlls/wined3d/device.c
+3
-3
directx.c
dlls/wined3d/directx.c
+16
-16
shader.c
dlls/wined3d/shader.c
+3
-3
state.c
dlls/wined3d/state.c
+1
-1
surface.c
dlls/wined3d/surface.c
+8
-8
surface_base.c
dlls/wined3d/surface_base.c
+6
-6
texture.c
dlls/wined3d/texture.c
+1
-1
utils.c
dlls/wined3d/utils.c
+18
-18
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/basetexture.c
View file @
efb185dc
...
...
@@ -5,7 +5,7 @@
* Copyright 2002-2004 Raphael Junqueira
* Copyright 2005 Oliver Stieber
* Copyright 2007-2008 Stefan Dösinger for CodeWeavers
* Copyright 2009 Henri Verbeet for CodeWeavers
* Copyright 2009
-2010
Henri Verbeet for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -60,7 +60,7 @@ HRESULT basetexture_init(IWineD3DBaseTextureImpl *texture, UINT layer_count, UIN
texture
->
baseTexture
.
is_srgb
=
FALSE
;
texture
->
baseTexture
.
pow2Matrix_identity
=
TRUE
;
if
(
texture
->
resource
.
format
->
F
lags
&
WINED3DFMT_FLAG_FILTERING
)
if
(
texture
->
resource
.
format
->
f
lags
&
WINED3DFMT_FLAG_FILTERING
)
{
texture
->
baseTexture
.
minMipLookup
=
minMipLookup
;
texture
->
baseTexture
.
magLookup
=
magLookup
;
...
...
@@ -517,10 +517,10 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface,
gl_tex
->
states
[
WINED3DTEXSTA_MAXANISOTROPY
]
=
aniso
;
}
if
(
!
(
This
->
resource
.
format
->
F
lags
&
WINED3DFMT_FLAG_SHADOW
)
if
(
!
(
This
->
resource
.
format
->
f
lags
&
WINED3DFMT_FLAG_SHADOW
)
!=
!
gl_tex
->
states
[
WINED3DTEXSTA_SHADOW
])
{
if
(
This
->
resource
.
format
->
F
lags
&
WINED3DFMT_FLAG_SHADOW
)
if
(
This
->
resource
.
format
->
f
lags
&
WINED3DFMT_FLAG_SHADOW
)
{
glTexParameteri
(
textureDimensions
,
GL_DEPTH_TEXTURE_MODE_ARB
,
GL_LUMINANCE
);
glTexParameteri
(
textureDimensions
,
GL_TEXTURE_COMPARE_MODE_ARB
,
GL_COMPARE_R_TO_TEXTURE_ARB
);
...
...
dlls/wined3d/context.c
View file @
efb185dc
...
...
@@ -2,7 +2,7 @@
* Context and render target management in wined3d
*
* Copyright 2007-2008 Stefan Dösinger for CodeWeavers
* Copyright 2009 Henri Verbeet for CodeWeavers
* Copyright 2009
-2010
Henri Verbeet for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -201,7 +201,7 @@ void context_attach_depth_stencil_fbo(struct wined3d_context *context,
if
(
depth_stencil
)
{
DWORD
format_flags
=
depth_stencil
->
resource
.
format
->
F
lags
;
DWORD
format_flags
=
depth_stencil
->
resource
.
format
->
f
lags
;
if
(
use_render_buffer
&&
depth_stencil
->
current_renderbuffer
)
{
...
...
@@ -2023,8 +2023,8 @@ static BOOL match_depth_stencil_format(const struct wined3d_format *existing,
{
short
existing_depth
,
existing_stencil
,
required_depth
,
required_stencil
;
if
(
existing
==
required
)
return
TRUE
;
if
((
existing
->
Flags
&
WINED3DFMT_FLAG_FLOAT
)
!=
(
required
->
F
lags
&
WINED3DFMT_FLAG_FLOAT
))
return
FALSE
;
if
(
existing
==
required
)
return
TRUE
;
if
((
existing
->
flags
&
WINED3DFMT_FLAG_FLOAT
)
!=
(
required
->
f
lags
&
WINED3DFMT_FLAG_FLOAT
))
return
FALSE
;
getDepthStencilBits
(
existing
,
&
existing_depth
,
&
existing_stencil
);
getDepthStencilBits
(
required
,
&
required_depth
,
&
required_stencil
);
...
...
@@ -2231,12 +2231,12 @@ static void context_setup_target(IWineD3DDeviceImpl *device,
{
/* Disable blending when the alpha mask has changed and when a format doesn't support blending. */
if
((
old
->
alpha_mask
&&
!
new
->
alpha_mask
)
||
(
!
old
->
alpha_mask
&&
new
->
alpha_mask
)
||
!
(
new
->
F
lags
&
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
))
||
!
(
new
->
f
lags
&
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
))
{
Context_MarkStateDirty
(
context
,
STATE_RENDER
(
WINED3DRS_ALPHABLENDENABLE
),
StateTable
);
}
/* Update sRGB writing when switching between formats that do/do not support sRGB writing */
if
((
old
->
Flags
&
WINED3DFMT_FLAG_SRGB_WRITE
)
!=
(
new
->
F
lags
&
WINED3DFMT_FLAG_SRGB_WRITE
))
if
((
old
->
flags
&
WINED3DFMT_FLAG_SRGB_WRITE
)
!=
(
new
->
f
lags
&
WINED3DFMT_FLAG_SRGB_WRITE
))
{
Context_MarkStateDirty
(
context
,
STATE_RENDER
(
WINED3DRS_SRGBWRITEENABLE
),
StateTable
);
}
...
...
dlls/wined3d/device.c
View file @
efb185dc
...
...
@@ -9,7 +9,7 @@
* Copyright 2006-2008 Stefan Dösinger for CodeWeavers
* Copyright 2006-2008 Henri Verbeet
* Copyright 2007 Andrew Riedi
* Copyright 2009 Henri Verbeet for CodeWeavers
* Copyright 2009
-2010
Henri Verbeet for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -5178,7 +5178,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ValidateDevice(IWineD3DDevice *iface,
}
texture
=
This
->
stateBlock
->
state
.
textures
[
i
];
if
(
!
texture
||
texture
->
resource
.
format
->
F
lags
&
WINED3DFMT_FLAG_FILTERING
)
continue
;
if
(
!
texture
||
texture
->
resource
.
format
->
f
lags
&
WINED3DFMT_FLAG_FILTERING
)
continue
;
if
(
This
->
stateBlock
->
state
.
sampler_states
[
i
][
WINED3DSAMP_MAGFILTER
]
!=
WINED3DTEXF_POINT
)
{
...
...
@@ -5466,7 +5466,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface,
ENTER_GL
();
if
(
dst_format
->
F
lags
&
WINED3DFMT_FLAG_COMPRESSED
)
if
(
dst_format
->
f
lags
&
WINED3DFMT_FLAG_COMPRESSED
)
{
UINT
row_length
=
wined3d_format_calculate_size
(
src_format
,
1
,
update_w
,
1
);
UINT
row_count
=
(
update_h
+
src_format
->
block_height
-
1
)
/
src_format
->
block_height
;
...
...
dlls/wined3d/directx.c
View file @
efb185dc
...
...
@@ -6,7 +6,7 @@
* Copyright 2004 Christian Costa
* Copyright 2005 Oliver Stieber
* Copyright 2007-2008 Stefan Dösinger for CodeWeavers
* Copyright 2009 Henri Verbeet for CodeWeavers
* Copyright 2009
-2010
Henri Verbeet for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -2854,7 +2854,7 @@ static BOOL IWineD3DImpl_IsPixelFormatCompatibleWithRenderFmt(const struct wined
return
FALSE
;
/* Float formats need FBOs. If FBOs are used this function isn't called */
if
(
format
->
F
lags
&
WINED3DFMT_FLAG_FLOAT
)
return
FALSE
;
if
(
format
->
f
lags
&
WINED3DFMT_FLAG_FLOAT
)
return
FALSE
;
if
(
cfg
->
iPixelType
==
WGL_TYPE_RGBA_ARB
)
{
/* Integer RGBA formats */
if
(
!
getColorBits
(
format
,
&
redSize
,
&
greenSize
,
&
blueSize
,
&
alphaSize
,
&
colorBits
))
...
...
@@ -2898,7 +2898,7 @@ static BOOL IWineD3DImpl_IsPixelFormatCompatibleWithDepthFmt(const struct wined3
}
/* Float formats need FBOs. If FBOs are used this function isn't called */
if
(
format
->
F
lags
&
WINED3DFMT_FLAG_FLOAT
)
return
FALSE
;
if
(
format
->
f
lags
&
WINED3DFMT_FLAG_FLOAT
)
return
FALSE
;
if
((
format
->
id
==
WINED3DFMT_D16_LOCKABLE
)
||
(
format
->
id
==
WINED3DFMT_D32_FLOAT
))
lockable
=
TRUE
;
...
...
@@ -2946,8 +2946,8 @@ static HRESULT WINAPI IWineD3DImpl_CheckDepthStencilMatch(IWineD3D *iface,
ds_format
=
wined3d_get_format
(
&
adapter
->
gl_info
,
DepthStencilFormat
);
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
)
{
if
((
rt_format
->
F
lags
&
WINED3DFMT_FLAG_RENDERTARGET
)
&&
(
ds_format
->
F
lags
&
(
WINED3DFMT_FLAG_DEPTH
|
WINED3DFMT_FLAG_STENCIL
)))
if
((
rt_format
->
f
lags
&
WINED3DFMT_FLAG_RENDERTARGET
)
&&
(
ds_format
->
f
lags
&
(
WINED3DFMT_FLAG_DEPTH
|
WINED3DFMT_FLAG_STENCIL
)))
{
TRACE_
(
d3d_caps
)(
"(%p) : Formats matched
\n
"
,
This
);
return
WINED3D_OK
;
...
...
@@ -3012,7 +3012,7 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceMultiSampleType(IWineD3D *iface, U
format
=
wined3d_get_format
(
&
adapter
->
gl_info
,
SurfaceFormat
);
if
(
!
format
)
return
WINED3DERR_INVALIDCALL
;
if
(
format
->
F
lags
&
(
WINED3DFMT_FLAG_DEPTH
|
WINED3DFMT_FLAG_STENCIL
))
if
(
format
->
f
lags
&
(
WINED3DFMT_FLAG_DEPTH
|
WINED3DFMT_FLAG_STENCIL
))
{
int
i
,
nCfgs
;
const
WineD3D_PixelFormat
*
cfgs
;
...
...
@@ -3033,7 +3033,7 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceMultiSampleType(IWineD3D *iface, U
return
WINED3D_OK
;
}
}
else
if
(
format
->
F
lags
&
WINED3DFMT_FLAG_RENDERTARGET
)
else
if
(
format
->
f
lags
&
WINED3DFMT_FLAG_RENDERTARGET
)
{
short
redSize
,
greenSize
,
blueSize
,
alphaSize
,
colorBits
;
int
i
,
nCfgs
;
...
...
@@ -3078,7 +3078,7 @@ static BOOL CheckBumpMapCapability(struct wined3d_adapter *adapter, const struct
/* Ask the fixed function pipeline implementation if it can deal
* with the conversion. If we've got a GL extension giving native
* support this will be an identity conversion. */
return
(
format
->
F
lags
&
WINED3DFMT_FLAG_BUMPMAP
)
return
(
format
->
f
lags
&
WINED3DFMT_FLAG_BUMPMAP
)
&&
adapter
->
fragment_pipe
->
color_fixup_supported
(
format
->
color_fixup
);
}
...
...
@@ -3094,7 +3094,7 @@ static BOOL CheckDepthStencilCapability(struct wined3d_adapter *adapter,
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
)
{
/* With FBOs WGL limitations do not apply, but the format needs to be FBO attachable */
if
(
ds_format
->
F
lags
&
(
WINED3DFMT_FLAG_DEPTH
|
WINED3DFMT_FLAG_STENCIL
))
return
TRUE
;
if
(
ds_format
->
f
lags
&
(
WINED3DFMT_FLAG_DEPTH
|
WINED3DFMT_FLAG_STENCIL
))
return
TRUE
;
}
else
{
...
...
@@ -3118,7 +3118,7 @@ static BOOL CheckDepthStencilCapability(struct wined3d_adapter *adapter,
static
BOOL
CheckFilterCapability
(
struct
wined3d_adapter
*
adapter
,
const
struct
wined3d_format
*
format
)
{
/* The flags entry of a format contains the filtering capability */
if
(
format
->
F
lags
&
WINED3DFMT_FLAG_FILTERING
)
return
TRUE
;
if
(
format
->
f
lags
&
WINED3DFMT_FLAG_FILTERING
)
return
TRUE
;
return
FALSE
;
}
...
...
@@ -3128,7 +3128,7 @@ static BOOL CheckRenderTargetCapability(struct wined3d_adapter *adapter,
const
struct
wined3d_format
*
adapter_format
,
const
struct
wined3d_format
*
check_format
)
{
/* Filter out non-RT formats */
if
(
!
(
check_format
->
F
lags
&
WINED3DFMT_FLAG_RENDERTARGET
))
return
FALSE
;
if
(
!
(
check_format
->
f
lags
&
WINED3DFMT_FLAG_RENDERTARGET
))
return
FALSE
;
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_BACKBUFFER
)
{
WineD3D_PixelFormat
*
cfgs
=
adapter
->
cfgs
;
...
...
@@ -3170,7 +3170,7 @@ static BOOL CheckRenderTargetCapability(struct wined3d_adapter *adapter,
static
BOOL
CheckSrgbReadCapability
(
struct
wined3d_adapter
*
adapter
,
const
struct
wined3d_format
*
format
)
{
return
adapter
->
gl_info
.
supported
[
EXT_TEXTURE_SRGB
]
&&
(
format
->
F
lags
&
WINED3DFMT_FLAG_SRGB_READ
);
return
adapter
->
gl_info
.
supported
[
EXT_TEXTURE_SRGB
]
&&
(
format
->
f
lags
&
WINED3DFMT_FLAG_SRGB_READ
);
}
static
BOOL
CheckSrgbWriteCapability
(
struct
wined3d_adapter
*
adapter
,
const
struct
wined3d_format
*
format
)
...
...
@@ -3178,7 +3178,7 @@ static BOOL CheckSrgbWriteCapability(struct wined3d_adapter *adapter, const stru
/* Only offer SRGB writing on X8R8G8B8/A8R8G8B8 when we use ARB or GLSL shaders as we are
* doing the color fixup in shaders.
* Note Windows drivers (at least on the Geforce 8800) also offer this on R5G6B5. */
if
(
format
->
F
lags
&
WINED3DFMT_FLAG_SRGB_WRITE
)
if
(
format
->
f
lags
&
WINED3DFMT_FLAG_SRGB_WRITE
)
{
int
vs_selected_mode
;
int
ps_selected_mode
;
...
...
@@ -3199,7 +3199,7 @@ static BOOL CheckPostPixelShaderBlendingCapability(struct wined3d_adapter *adapt
const
struct
wined3d_format
*
format
)
{
/* The flags entry of a format contains the post pixel shader blending capability */
if
(
format
->
F
lags
&
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
)
return
TRUE
;
if
(
format
->
f
lags
&
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
)
return
TRUE
;
return
FALSE
;
}
...
...
@@ -3527,7 +3527,7 @@ static BOOL CheckSurfaceCapability(struct wined3d_adapter *adapter,
static
BOOL
CheckVertexTextureCapability
(
struct
wined3d_adapter
*
adapter
,
const
struct
wined3d_format
*
format
)
{
return
adapter
->
gl_info
.
limits
.
vertex_samplers
&&
(
format
->
F
lags
&
WINED3DFMT_FLAG_VTF
);
return
adapter
->
gl_info
.
limits
.
vertex_samplers
&&
(
format
->
f
lags
&
WINED3DFMT_FLAG_VTF
);
}
static
HRESULT
WINAPI
IWineD3DImpl_CheckDeviceFormat
(
IWineD3D
*
iface
,
UINT
Adapter
,
WINED3DDEVTYPE
DeviceType
,
...
...
@@ -3845,7 +3845,7 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
TRACE_
(
d3d_caps
)(
"[FAILED] - No depth stencil support
\n
"
);
return
WINED3DERR_NOTAVAILABLE
;
}
if
((
format
->
F
lags
&
WINED3DFMT_FLAG_SHADOW
)
&&
!
gl_info
->
supported
[
ARB_SHADOW
])
if
((
format
->
f
lags
&
WINED3DFMT_FLAG_SHADOW
)
&&
!
gl_info
->
supported
[
ARB_SHADOW
])
{
TRACE_
(
d3d_caps
)(
"[FAILED] - No shadow sampler support.
\n
"
);
return
WINED3DERR_NOTAVAILABLE
;
...
...
dlls/wined3d/shader.c
View file @
efb185dc
...
...
@@ -5,7 +5,7 @@
* Copyright 2005 Oliver Stieber
* Copyright 2006 Ivan Gyurdiev
* Copyright 2007-2008 Stefan Dösinger for CodeWeavers
* Copyright 2009 Henri Verbeet for CodeWeavers
* Copyright 2009
-2010
Henri Verbeet for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -2113,7 +2113,7 @@ void find_ps_compile_args(const struct wined3d_state *state,
if
(
state
->
render_states
[
WINED3DRS_SRGBWRITEENABLE
])
{
IWineD3DSurfaceImpl
*
rt
=
device
->
render_targets
[
0
];
if
(
rt
->
resource
.
format
->
F
lags
&
WINED3DFMT_FLAG_SRGB_WRITE
)
args
->
srgb_correction
=
1
;
if
(
rt
->
resource
.
format
->
f
lags
&
WINED3DFMT_FLAG_SRGB_WRITE
)
args
->
srgb_correction
=
1
;
}
if
(
shader
->
baseShader
.
reg_maps
.
shader_version
.
major
==
1
...
...
@@ -2140,7 +2140,7 @@ void find_ps_compile_args(const struct wined3d_state *state,
}
args
->
color_fixup
[
i
]
=
texture
->
resource
.
format
->
color_fixup
;
if
(
texture
->
resource
.
format
->
F
lags
&
WINED3DFMT_FLAG_SHADOW
)
if
(
texture
->
resource
.
format
->
f
lags
&
WINED3DFMT_FLAG_SHADOW
)
args
->
shadow
|=
1
<<
i
;
/* Flag samplers that need NP2 texcoord fixup. */
...
...
dlls/wined3d/state.c
View file @
efb185dc
...
...
@@ -257,7 +257,7 @@ static void state_blend(DWORD state, IWineD3DStateBlockImpl *stateblock, struct
* With blending on we could face a big performance penalty.
* The d3d9 visual test confirms the behavior. */
if
(
context
->
render_offscreen
&&
!
(
target
->
resource
.
format
->
F
lags
&
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
))
&&
!
(
target
->
resource
.
format
->
f
lags
&
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
))
{
glDisable
(
GL_BLEND
);
checkGLcall
(
"glDisable GL_BLEND"
);
...
...
dlls/wined3d/surface.c
View file @
efb185dc
...
...
@@ -565,7 +565,7 @@ static void surface_download_data(IWineD3DSurfaceImpl *This, const struct wined3
ENTER_GL
();
if
(
format
->
F
lags
&
WINED3DFMT_FLAG_COMPRESSED
)
if
(
format
->
f
lags
&
WINED3DFMT_FLAG_COMPRESSED
)
{
TRACE
(
"(%p) : Calling glGetCompressedTexImageARB level %d, format %#x, type %#x, data %p.
\n
"
,
This
,
This
->
texture_level
,
format
->
glFormat
,
format
->
glType
,
...
...
@@ -746,7 +746,7 @@ static void surface_upload_data(IWineD3DSurfaceImpl *This, const struct wined3d_
data
=
NULL
;
}
if
(
format
->
F
lags
&
WINED3DFMT_FLAG_COMPRESSED
)
if
(
format
->
f
lags
&
WINED3DFMT_FLAG_COMPRESSED
)
{
TRACE
(
"Calling glCompressedTexSubImage2DARB.
\n
"
);
...
...
@@ -843,7 +843,7 @@ static void surface_allocate_surface(IWineD3DSurfaceImpl *This, const struct win
}
}
if
(
format
->
F
lags
&
WINED3DFMT_FLAG_COMPRESSED
&&
mem
)
if
(
format
->
f
lags
&
WINED3DFMT_FLAG_COMPRESSED
&&
mem
)
{
GL_EXTCALL
(
glCompressedTexImage2DARB
(
This
->
texture_target
,
This
->
texture_level
,
internal
,
width
,
height
,
0
,
This
->
resource
.
size
,
mem
));
...
...
@@ -1914,7 +1914,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_Unmap(IWineD3DSurface *iface)
This
->
dirtyRect
.
right
=
0
;
This
->
dirtyRect
.
bottom
=
0
;
}
else
if
(
This
->
resource
.
format
->
F
lags
&
(
WINED3DFMT_FLAG_DEPTH
|
WINED3DFMT_FLAG_STENCIL
))
else
if
(
This
->
resource
.
format
->
f
lags
&
(
WINED3DFMT_FLAG_DEPTH
|
WINED3DFMT_FLAG_STENCIL
))
{
FIXME
(
"Depth Stencil buffer locking is not implemented
\n
"
);
}
...
...
@@ -3985,7 +3985,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_PrivateSetup(IWineD3DSurface *iface) {
if
(
pow2Width
>
This
->
currentDesc
.
Width
||
pow2Height
>
This
->
currentDesc
.
Height
)
{
/* TODO: Add support for non power two compressed textures. */
if
(
This
->
resource
.
format
->
F
lags
&
WINED3DFMT_FLAG_COMPRESSED
)
if
(
This
->
resource
.
format
->
f
lags
&
WINED3DFMT_FLAG_COMPRESSED
)
{
FIXME
(
"(%p) Compressed non-power-two textures are not supported w(%d) h(%d)
\n
"
,
This
,
This
->
currentDesc
.
Width
,
This
->
currentDesc
.
Height
);
...
...
@@ -4497,7 +4497,7 @@ HRESULT surface_load_location(IWineD3DSurfaceImpl *surface, DWORD flag, const RE
read_from_framebuffer_texture
(
surface
,
flag
==
SFLAG_INSRGBTEX
);
}
else
if
(
surface
->
flags
&
(
SFLAG_INSRGBTEX
|
SFLAG_INTEXTURE
)
&&
(
surface
->
resource
.
format
->
F
lags
&
attach_flags
)
==
attach_flags
&&
(
surface
->
resource
.
format
->
f
lags
&
attach_flags
)
==
attach_flags
&&
fbo_blit_supported
(
gl_info
,
BLIT_OP_BLIT
,
NULL
,
surface
->
resource
.
usage
,
surface
->
resource
.
pool
,
surface
->
resource
.
format
,
NULL
,
surface
->
resource
.
usage
,
surface
->
resource
.
pool
,
surface
->
resource
.
format
))
...
...
@@ -4934,8 +4934,8 @@ static BOOL fbo_blit_supported(const struct wined3d_gl_info *gl_info, enum blit_
if
(
src_pool
==
WINED3DPOOL_SYSTEMMEM
||
dst_pool
==
WINED3DPOOL_SYSTEMMEM
)
return
FALSE
;
if
(
!
((
src_format
->
F
lags
&
WINED3DFMT_FLAG_FBO_ATTACHABLE
)
||
(
src_usage
&
WINED3DUSAGE_RENDERTARGET
))
&&
((
dst_format
->
F
lags
&
WINED3DFMT_FLAG_FBO_ATTACHABLE
)
||
(
dst_usage
&
WINED3DUSAGE_RENDERTARGET
)))
if
(
!
((
src_format
->
f
lags
&
WINED3DFMT_FLAG_FBO_ATTACHABLE
)
||
(
src_usage
&
WINED3DUSAGE_RENDERTARGET
))
&&
((
dst_format
->
f
lags
&
WINED3DFMT_FLAG_FBO_ATTACHABLE
)
||
(
dst_usage
&
WINED3DUSAGE_RENDERTARGET
)))
return
FALSE
;
if
(
!
(
src_format
->
id
==
dst_format
->
id
...
...
dlls/wined3d/surface_base.c
View file @
efb185dc
...
...
@@ -308,7 +308,7 @@ DWORD WINAPI IWineD3DBaseSurfaceImpl_GetPitch(IWineD3DSurface *iface)
DWORD
ret
;
TRACE
(
"(%p)
\n
"
,
This
);
if
((
format
->
F
lags
&
(
WINED3DFMT_FLAG_COMPRESSED
|
WINED3DFMT_FLAG_BROKEN_PITCH
))
==
WINED3DFMT_FLAG_COMPRESSED
)
if
((
format
->
f
lags
&
(
WINED3DFMT_FLAG_COMPRESSED
|
WINED3DFMT_FLAG_BROKEN_PITCH
))
==
WINED3DFMT_FLAG_COMPRESSED
)
{
/* Since compressed formats are block based, pitch means the amount of
* bytes to the next row of block rather than the next row of pixels. */
...
...
@@ -503,7 +503,7 @@ HRESULT IWineD3DBaseSurfaceImpl_CreateDIBSection(IWineD3DSurface *iface)
DWORD
*
masks
;
UINT
usage
;
if
(
!
(
format
->
F
lags
&
WINED3DFMT_FLAG_GETDC
))
if
(
!
(
format
->
f
lags
&
WINED3DFMT_FLAG_GETDC
))
{
WARN
(
"Cannot use GetDC on a %s surface
\n
"
,
debug_d3dformat
(
format
->
id
));
return
WINED3DERR_INVALIDCALL
;
...
...
@@ -1125,7 +1125,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_Blt(IWineD3DSurface *iface, const RECT *D
if
(
!
DDBltFx
||
!
(
DDBltFx
->
dwDDFX
))
Flags
&=
~
WINEDDBLT_DDFX
;
if
(
sEntry
->
Flags
&
dEntry
->
F
lags
&
WINED3DFMT_FLAG_FOURCC
)
if
(
sEntry
->
flags
&
dEntry
->
f
lags
&
WINED3DFMT_FLAG_FOURCC
)
{
if
(
!
DestRect
||
src
==
This
)
{
...
...
@@ -1657,7 +1657,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD dst
}
/* Handle compressed surfaces first... */
if
(
sEntry
->
Flags
&
dEntry
->
F
lags
&
WINED3DFMT_FLAG_COMPRESSED
)
if
(
sEntry
->
flags
&
dEntry
->
f
lags
&
WINED3DFMT_FLAG_COMPRESSED
)
{
UINT
row_block_count
;
...
...
@@ -1683,7 +1683,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD dst
goto
error
;
}
if
((
sEntry
->
Flags
&
WINED3DFMT_FLAG_COMPRESSED
)
&&
!
(
dEntry
->
F
lags
&
WINED3DFMT_FLAG_COMPRESSED
))
if
((
sEntry
->
flags
&
WINED3DFMT_FLAG_COMPRESSED
)
&&
!
(
dEntry
->
f
lags
&
WINED3DFMT_FLAG_COMPRESSED
))
{
/* TODO: Use the libtxc_dxtn.so shared library to do
* software decompression
...
...
@@ -1840,7 +1840,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_Map(IWineD3DSurface *iface,
TRACE
(
"Lock Rect (%p) = l %d, t %d, r %d, b %d
\n
"
,
pRect
,
pRect
->
left
,
pRect
->
top
,
pRect
->
right
,
pRect
->
bottom
);
if
((
format
->
F
lags
&
(
WINED3DFMT_FLAG_COMPRESSED
|
WINED3DFMT_FLAG_BROKEN_PITCH
))
==
WINED3DFMT_FLAG_COMPRESSED
)
if
((
format
->
f
lags
&
(
WINED3DFMT_FLAG_COMPRESSED
|
WINED3DFMT_FLAG_BROKEN_PITCH
))
==
WINED3DFMT_FLAG_COMPRESSED
)
{
/* Compressed textures are block based, so calculate the offset of
* the block that contains the top-left pixel of the locked rectangle. */
...
...
dlls/wined3d/texture.c
View file @
efb185dc
...
...
@@ -566,7 +566,7 @@ HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT
texture
->
baseTexture
.
target
=
GL_TEXTURE_RECTANGLE_ARB
;
texture
->
cond_np2
=
TRUE
;
if
(
texture
->
resource
.
format
->
F
lags
&
WINED3DFMT_FLAG_FILTERING
)
if
(
texture
->
resource
.
format
->
f
lags
&
WINED3DFMT_FLAG_FILTERING
)
{
texture
->
baseTexture
.
minMipLookup
=
minMipLookup_noMip
;
}
...
...
dlls/wined3d/utils.c
View file @
efb185dc
...
...
@@ -7,7 +7,7 @@
* Copyright 2005 Oliver Stieber
* Copyright 2006-2008 Henri Verbeet
* Copyright 2007-2008 Stefan Dösinger for CodeWeavers
* Copyright 2009 Henri Verbeet for CodeWeavers
* Copyright 2009
-2010
Henri Verbeet for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -927,7 +927,7 @@ static BOOL init_format_base_info(struct wined3d_gl_info *gl_info)
return
FALSE
;
}
gl_info
->
formats
[
fmt_idx
].
F
lags
|=
format_base_flags
[
i
].
flags
;
gl_info
->
formats
[
fmt_idx
].
f
lags
|=
format_base_flags
[
i
].
flags
;
}
return
TRUE
;
...
...
@@ -953,7 +953,7 @@ static BOOL init_format_compression_info(struct wined3d_gl_info *gl_info)
format
->
block_width
=
format_compression_info
[
i
].
block_width
;
format
->
block_height
=
format_compression_info
[
i
].
block_height
;
format
->
block_byte_count
=
format_compression_info
[
i
].
block_byte_count
;
format
->
F
lags
|=
WINED3DFMT_FLAG_COMPRESSED
;
format
->
f
lags
|=
WINED3DFMT_FLAG_COMPRESSED
;
}
return
TRUE
;
...
...
@@ -989,18 +989,18 @@ static void check_fbo_compat(const struct wined3d_gl_info *gl_info, struct wined
if
(
status
==
GL_FRAMEBUFFER_COMPLETE
)
{
TRACE
(
"Format %s is supported as FBO color attachment.
\n
"
,
debug_d3dformat
(
format
->
id
));
format
->
F
lags
|=
WINED3DFMT_FLAG_FBO_ATTACHABLE
;
format
->
f
lags
|=
WINED3DFMT_FLAG_FBO_ATTACHABLE
;
format
->
rtInternal
=
format
->
glInternal
;
}
else
{
if
(
!
format
->
rtInternal
)
{
if
(
format
->
F
lags
&
WINED3DFMT_FLAG_RENDERTARGET
)
if
(
format
->
f
lags
&
WINED3DFMT_FLAG_RENDERTARGET
)
{
FIXME
(
"Format %s with rendertarget flag is not supported as FBO color attachment,"
" and no fallback specified.
\n
"
,
debug_d3dformat
(
format
->
id
));
format
->
F
lags
&=
~
WINED3DFMT_FLAG_RENDERTARGET
;
format
->
f
lags
&=
~
WINED3DFMT_FLAG_RENDERTARGET
;
}
else
{
...
...
@@ -1035,12 +1035,12 @@ static void check_fbo_compat(const struct wined3d_gl_info *gl_info, struct wined
{
FIXME
(
"Format %s rtInternal format is not supported as FBO color attachment.
\n
"
,
debug_d3dformat
(
format
->
id
));
format
->
F
lags
&=
~
WINED3DFMT_FLAG_RENDERTARGET
;
format
->
f
lags
&=
~
WINED3DFMT_FLAG_RENDERTARGET
;
}
}
}
if
(
status
==
GL_FRAMEBUFFER_COMPLETE
&&
format
->
F
lags
&
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
)
if
(
status
==
GL_FRAMEBUFFER_COMPLETE
&&
format
->
f
lags
&
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
)
{
GLuint
rb
;
...
...
@@ -1061,7 +1061,7 @@ static void check_fbo_compat(const struct wined3d_gl_info *gl_info, struct wined
{
while
(
glGetError
());
TRACE
(
"Format doesn't support post-pixelshader blending.
\n
"
);
format
->
F
lags
&=
~
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
;
format
->
f
lags
&=
~
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
;
}
if
(
gl_info
->
supported
[
ARB_FRAMEBUFFER_OBJECT
]
...
...
@@ -1085,7 +1085,7 @@ static void check_fbo_compat(const struct wined3d_gl_info *gl_info, struct wined
if
(
status
==
GL_FRAMEBUFFER_COMPLETE
)
{
TRACE
(
"Format %s's sRGB format is FBO attachable.
\n
"
,
debug_d3dformat
(
format
->
id
));
format
->
F
lags
|=
WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB
;
format
->
f
lags
|=
WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB
;
}
else
{
...
...
@@ -1120,14 +1120,14 @@ static void init_format_fbo_compat_info(struct wined3d_gl_info *gl_info)
if
(
!
format
->
glInternal
)
continue
;
if
(
format
->
F
lags
&
(
WINED3DFMT_FLAG_DEPTH
|
WINED3DFMT_FLAG_STENCIL
))
if
(
format
->
f
lags
&
(
WINED3DFMT_FLAG_DEPTH
|
WINED3DFMT_FLAG_STENCIL
))
{
TRACE
(
"Skipping format %s because it's a depth/stencil format.
\n
"
,
debug_d3dformat
(
format
->
id
));
continue
;
}
if
(
format
->
F
lags
&
WINED3DFMT_FLAG_COMPRESSED
)
if
(
format
->
f
lags
&
WINED3DFMT_FLAG_COMPRESSED
)
{
TRACE
(
"Skipping format %s because it's a compressed format.
\n
"
,
debug_d3dformat
(
format
->
id
));
...
...
@@ -1178,7 +1178,7 @@ static BOOL init_format_texture_info(struct wined3d_gl_info *gl_info)
/* ARB_texture_rg defines floating point formats, but only if
* ARB_texture_float is also supported. */
if
(
!
gl_info
->
supported
[
ARB_TEXTURE_FLOAT
]
&&
(
format
->
F
lags
&
WINED3DFMT_FLAG_FLOAT
))
&&
(
format
->
f
lags
&
WINED3DFMT_FLAG_FLOAT
))
continue
;
format
->
glInternal
=
format_texture_info
[
i
].
gl_internal
;
...
...
@@ -1187,7 +1187,7 @@ static BOOL init_format_texture_info(struct wined3d_gl_info *gl_info)
format
->
glFormat
=
format_texture_info
[
i
].
gl_format
;
format
->
glType
=
format_texture_info
[
i
].
gl_type
;
format
->
color_fixup
=
COLOR_FIXUP_IDENTITY
;
format
->
F
lags
|=
format_texture_info
[
i
].
flags
;
format
->
f
lags
|=
format_texture_info
[
i
].
flags
;
format
->
heightscale
=
1
.
0
f
;
/* Texture conversion stuff */
...
...
@@ -1344,7 +1344,7 @@ static void init_format_filter_info(struct wined3d_gl_info *gl_info, enum wined3
for
(
i
=
0
;
i
<
(
sizeof
(
fmts16
)
/
sizeof
(
*
fmts16
));
i
++
)
{
fmt_idx
=
getFmtIdx
(
fmts16
[
i
]);
gl_info
->
formats
[
fmt_idx
].
F
lags
|=
WINED3DFMT_FLAG_FILTERING
;
gl_info
->
formats
[
fmt_idx
].
f
lags
|=
WINED3DFMT_FLAG_FILTERING
;
}
}
return
;
...
...
@@ -1360,7 +1360,7 @@ static void init_format_filter_info(struct wined3d_gl_info *gl_info, enum wined3
if
(
filtered
)
{
TRACE
(
"Format %s supports filtering
\n
"
,
debug_d3dformat
(
fmts16
[
i
]));
format
->
F
lags
|=
WINED3DFMT_FLAG_FILTERING
;
format
->
f
lags
|=
WINED3DFMT_FLAG_FILTERING
;
}
else
{
...
...
@@ -1583,7 +1583,7 @@ UINT wined3d_format_calculate_size(const struct wined3d_format *format, UINT ali
{
size
=
0
;
}
else
if
(
format
->
F
lags
&
WINED3DFMT_FLAG_COMPRESSED
)
else
if
(
format
->
f
lags
&
WINED3DFMT_FLAG_COMPRESSED
)
{
UINT
row_block_count
=
(
width
+
format
->
block_width
-
1
)
/
format
->
block_width
;
UINT
row_count
=
(
height
+
format
->
block_height
-
1
)
/
format
->
block_height
;
...
...
@@ -2959,7 +2959,7 @@ void gen_ffp_frag_op(IWineD3DStateBlockImpl *stateblock, struct ffp_frag_setting
}
}
if
(
stateblock
->
state
.
render_states
[
WINED3DRS_SRGBWRITEENABLE
]
&&
rt
->
resource
.
format
->
F
lags
&
WINED3DFMT_FLAG_SRGB_WRITE
)
&&
rt
->
resource
.
format
->
f
lags
&
WINED3DFMT_FLAG_SRGB_WRITE
)
{
settings
->
sRGB_write
=
1
;
}
else
{
...
...
dlls/wined3d/wined3d_private.h
View file @
efb185dc
...
...
@@ -3039,7 +3039,7 @@ struct wined3d_format
GLint
glFormat
;
GLint
glType
;
UINT
conv_byte_count
;
unsigned
int
F
lags
;
unsigned
int
f
lags
;
float
heightscale
;
struct
color_fixup_desc
color_fixup
;
void
(
*
convert
)(
const
BYTE
*
src
,
BYTE
*
dst
,
UINT
pitch
,
UINT
width
,
UINT
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