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
06b19322
Commit
06b19322
authored
May 08, 2022
by
Chip Davis
Committed by
Alexandre Julliard
May 24, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Rename format flags to caps.
Signed-off-by:
Chip Davis
<
cdavis5x@gmail.com
>
parent
ea4de99f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
84 additions
and
82 deletions
+84
-82
context_gl.c
dlls/wined3d/context_gl.c
+1
-1
cs.c
dlls/wined3d/cs.c
+5
-5
device.c
dlls/wined3d/device.c
+2
-1
directx.c
dlls/wined3d/directx.c
+26
-25
glsl_shader.c
dlls/wined3d/glsl_shader.c
+1
-1
resource.c
dlls/wined3d/resource.c
+5
-5
shader.c
dlls/wined3d/shader.c
+1
-1
state.c
dlls/wined3d/state.c
+3
-3
texture.c
dlls/wined3d/texture.c
+14
-14
utils.c
dlls/wined3d/utils.c
+0
-0
vertexdeclaration.c
dlls/wined3d/vertexdeclaration.c
+1
-1
view.c
dlls/wined3d/view.c
+1
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+24
-24
No files found.
dlls/wined3d/context_gl.c
View file @
06b19322
...
...
@@ -4448,7 +4448,7 @@ static void wined3d_context_gl_setup_target(struct wined3d_context_gl *context_g
{
/* Disable blending when the alpha mask has changed and when a format doesn't support blending. */
if
((
old
->
alpha_size
&&
!
new
->
alpha_size
)
||
(
!
old
->
alpha_size
&&
new
->
alpha_size
)
||
!
(
texture
->
resource
.
format_
flags
&
WINED3DFMT_FLAG
_POSTPIXELSHADER_BLENDING
))
||
!
(
texture
->
resource
.
format_
caps
&
WINED3D_FORMAT_CAP
_POSTPIXELSHADER_BLENDING
))
context_invalidate_state
(
&
context_gl
->
c
,
STATE_BLEND
);
}
...
...
dlls/wined3d/cs.c
View file @
06b19322
...
...
@@ -1206,8 +1206,8 @@ static void wined3d_cs_exec_set_rendertarget_views(struct wined3d_cs *cs, const
if
(
!
(
device
->
adapter
->
d3d_info
.
wined3d_creation_flags
&
WINED3D_SRGB_READ_WRITE_CONTROL
)
||
cs
->
state
.
render_states
[
WINED3D_RS_SRGBWRITEENABLE
])
{
prev_srgb_write
=
prev
&&
prev
->
format_
flags
&
WINED3DFMT_FLAG
_SRGB_WRITE
;
curr_srgb_write
=
view
&&
view
->
format_
flags
&
WINED3DFMT_FLAG
_SRGB_WRITE
;
prev_srgb_write
=
prev
&&
prev
->
format_
caps
&
WINED3D_FORMAT_CAP
_SRGB_WRITE
;
curr_srgb_write
=
view
&&
view
->
format_
caps
&
WINED3D_FORMAT_CAP
_SRGB_WRITE
;
if
(
prev_srgb_write
!=
curr_srgb_write
)
device_invalidate_state
(
device
,
STATE_RENDER
(
WINED3D_RS_SRGBWRITEENABLE
));
}
...
...
@@ -1450,8 +1450,8 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data)
{
const
struct
wined3d_format
*
new_format
=
op
->
texture
->
resource
.
format
;
const
struct
wined3d_format
*
old_format
=
prev
?
prev
->
resource
.
format
:
NULL
;
unsigned
int
old_fmt_
flags
=
prev
?
prev
->
resource
.
format_flag
s
:
0
;
unsigned
int
new_fmt_
flags
=
op
->
texture
->
resource
.
format_flag
s
;
unsigned
int
old_fmt_
caps
=
prev
?
prev
->
resource
.
format_cap
s
:
0
;
unsigned
int
new_fmt_
caps
=
op
->
texture
->
resource
.
format_cap
s
;
if
(
InterlockedIncrement
(
&
op
->
texture
->
resource
.
bind_count
)
==
1
)
op
->
texture
->
sampler
=
op
->
stage
;
...
...
@@ -1459,7 +1459,7 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data)
if
(
!
prev
||
wined3d_texture_gl
(
op
->
texture
)
->
target
!=
wined3d_texture_gl
(
prev
)
->
target
||
(
!
is_same_fixup
(
new_format
->
color_fixup
,
old_format
->
color_fixup
)
&&
!
(
can_use_texture_swizzle
(
d3d_info
,
new_format
)
&&
can_use_texture_swizzle
(
d3d_info
,
old_format
)))
||
(
new_fmt_
flags
&
WINED3DFMT_FLAG_SHADOW
)
!=
(
old_fmt_flags
&
WINED3DFMT_FLAG
_SHADOW
))
||
(
new_fmt_
caps
&
WINED3D_FORMAT_CAP_SHADOW
)
!=
(
old_fmt_caps
&
WINED3D_FORMAT_CAP
_SHADOW
))
device_invalidate_state
(
cs
->
c
.
device
,
STATE_SHADER
(
WINED3D_SHADER_TYPE_PIXEL
));
if
(
!
prev
&&
op
->
stage
<
d3d_info
->
limits
.
ffp_blend_stages
)
...
...
dlls/wined3d/device.c
View file @
06b19322
...
...
@@ -4585,7 +4585,8 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device
}
texture
=
state
->
textures
[
i
];
if
(
!
texture
||
texture
->
resource
.
format_flags
&
WINED3DFMT_FLAG_FILTERING
)
continue
;
if
(
!
texture
||
texture
->
resource
.
format_caps
&
WINED3D_FORMAT_CAP_FILTERING
)
continue
;
if
(
state
->
sampler_states
[
i
][
WINED3D_SAMP_MAG_FILTER
]
!=
WINED3D_TEXF_POINT
)
{
...
...
dlls/wined3d/directx.c
View file @
06b19322
...
...
@@ -1819,12 +1819,12 @@ HRESULT CDECL wined3d_check_depth_stencil_match(const struct wined3d_adapter *ad
rt_format
=
wined3d_get_format
(
adapter
,
render_target_format_id
,
WINED3D_BIND_RENDER_TARGET
);
ds_format
=
wined3d_get_format
(
adapter
,
depth_stencil_format_id
,
WINED3D_BIND_DEPTH_STENCIL
);
if
(
!
(
rt_format
->
flags
[
WINED3D_GL_RES_TYPE_TEX_2D
]
&
WINED3DFMT_FLAG
_RENDERTARGET
))
if
(
!
(
rt_format
->
caps
[
WINED3D_GL_RES_TYPE_TEX_2D
]
&
WINED3D_FORMAT_CAP
_RENDERTARGET
))
{
WARN
(
"Format %s is not render target format.
\n
"
,
debug_d3dformat
(
rt_format
->
id
));
return
WINED3DERR_NOTAVAILABLE
;
}
if
(
!
(
ds_format
->
flags
[
WINED3D_GL_RES_TYPE_TEX_2D
]
&
WINED3DFMT_FLAG
_DEPTH_STENCIL
))
if
(
!
(
ds_format
->
caps
[
WINED3D_GL_RES_TYPE_TEX_2D
]
&
WINED3D_FORMAT_CAP
_DEPTH_STENCIL
))
{
WARN
(
"Format %s is not depth/stencil format.
\n
"
,
debug_d3dformat
(
ds_format
->
id
));
return
WINED3DERR_NOTAVAILABLE
;
...
...
@@ -1898,11 +1898,12 @@ static BOOL wined3d_check_depth_stencil_format(const struct wined3d_adapter *ada
static
BOOL
wined3d_check_surface_format
(
const
struct
wined3d_format
*
format
)
{
if
((
format
->
flags
[
WINED3D_GL_RES_TYPE_TEX_2D
]
|
format
->
flags
[
WINED3D_GL_RES_TYPE_RB
])
&
WINED3DFMT_FLAG_BLIT
)
if
((
format
->
caps
[
WINED3D_GL_RES_TYPE_TEX_2D
]
|
format
->
caps
[
WINED3D_GL_RES_TYPE_RB
])
&
WINED3D_FORMAT_CAP_BLIT
)
return
TRUE
;
if
((
format
->
attrs
&
WINED3D_FORMAT_ATTR_EXTENSION
)
&&
(
format
->
flags
[
WINED3D_GL_RES_TYPE_TEX_2D
]
&
WINED3DFMT_FLAG
_TEXTURE
))
&&
(
format
->
caps
[
WINED3D_GL_RES_TYPE_TEX_2D
]
&
WINED3D_FORMAT_CAP
_TEXTURE
))
return
TRUE
;
return
FALSE
;
...
...
@@ -1923,7 +1924,7 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d,
{
const
struct
wined3d_format
*
adapter_format
,
*
format
;
enum
wined3d_gl_resource_type
gl_type
,
gl_type_end
;
unsigned
int
format_
flag
s
=
0
,
format_attrs
=
0
;
unsigned
int
format_
cap
s
=
0
,
format_attrs
=
0
;
BOOL
mipmap_gen_supported
=
TRUE
;
unsigned
int
allowed_bind_flags
;
DWORD
allowed_usage
;
...
...
@@ -2051,32 +2052,32 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d,
}
if
(
bind_flags
&
WINED3D_BIND_SHADER_RESOURCE
)
format_
flags
|=
WINED3DFMT_FLAG
_TEXTURE
;
format_
caps
|=
WINED3D_FORMAT_CAP
_TEXTURE
;
if
(
bind_flags
&
WINED3D_BIND_RENDER_TARGET
)
format_
flags
|=
WINED3DFMT_FLAG
_RENDERTARGET
;
format_
caps
|=
WINED3D_FORMAT_CAP
_RENDERTARGET
;
if
(
bind_flags
&
WINED3D_BIND_DEPTH_STENCIL
)
format_
flags
|=
WINED3DFMT_FLAG
_DEPTH_STENCIL
;
format_
caps
|=
WINED3D_FORMAT_CAP
_DEPTH_STENCIL
;
if
(
bind_flags
&
WINED3D_BIND_UNORDERED_ACCESS
)
format_
flags
|=
WINED3DFMT_FLAG
_UNORDERED_ACCESS
;
format_
caps
|=
WINED3D_FORMAT_CAP
_UNORDERED_ACCESS
;
if
(
bind_flags
&
WINED3D_BIND_VERTEX_BUFFER
)
format_
flags
|=
WINED3DFMT_FLAG
_VERTEX_ATTRIBUTE
;
format_
caps
|=
WINED3D_FORMAT_CAP
_VERTEX_ATTRIBUTE
;
if
(
bind_flags
&
WINED3D_BIND_INDEX_BUFFER
)
format_
flags
|=
WINED3DFMT_FLAG
_INDEX_BUFFER
;
format_
caps
|=
WINED3D_FORMAT_CAP
_INDEX_BUFFER
;
if
(
usage
&
WINED3DUSAGE_QUERY_FILTER
)
format_
flags
|=
WINED3DFMT_FLAG
_FILTERING
;
format_
caps
|=
WINED3D_FORMAT_CAP
_FILTERING
;
if
(
usage
&
WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING
)
format_
flags
|=
WINED3DFMT_FLAG
_POSTPIXELSHADER_BLENDING
;
format_
caps
|=
WINED3D_FORMAT_CAP
_POSTPIXELSHADER_BLENDING
;
if
(
usage
&
WINED3DUSAGE_QUERY_SRGBREAD
)
format_
flags
|=
WINED3DFMT_FLAG
_SRGB_READ
;
format_
caps
|=
WINED3D_FORMAT_CAP
_SRGB_READ
;
if
(
usage
&
WINED3DUSAGE_QUERY_SRGBWRITE
)
format_
flags
|=
WINED3DFMT_FLAG
_SRGB_WRITE
;
format_
caps
|=
WINED3D_FORMAT_CAP
_SRGB_WRITE
;
if
(
usage
&
WINED3DUSAGE_QUERY_VERTEXTEXTURE
)
format_
flags
|=
WINED3DFMT_FLAG
_VTF
;
format_
caps
|=
WINED3D_FORMAT_CAP
_VTF
;
if
(
usage
&
WINED3DUSAGE_QUERY_LEGACYBUMPMAP
)
format_attrs
|=
WINED3D_FORMAT_ATTR_BUMPMAP
;
if
((
format_
flags
&
WINED3DFMT_FLAG
_TEXTURE
)
&&
(
wined3d
->
flags
&
WINED3D_NO3D
))
if
((
format_
caps
&
WINED3D_FORMAT_CAP
_TEXTURE
)
&&
(
wined3d
->
flags
&
WINED3D_NO3D
))
{
TRACE
(
"Requested texturing support, but wined3d was created with WINED3D_NO3D.
\n
"
);
return
WINED3DERR_NOTAVAILABLE
;
...
...
@@ -2091,6 +2092,13 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d,
for
(;
gl_type
<=
gl_type_end
;
++
gl_type
)
{
if
((
format
->
caps
[
gl_type
]
&
format_caps
)
!=
format_caps
)
{
TRACE
(
"Requested format caps %#x, but format %s only has %#x.
\n
"
,
format_caps
,
debug_d3dformat
(
check_format_id
),
format
->
caps
[
gl_type
]);
return
WINED3DERR_NOTAVAILABLE
;
}
if
((
bind_flags
&
WINED3D_BIND_RENDER_TARGET
)
&&
!
adapter
->
adapter_ops
->
adapter_check_format
(
adapter
,
adapter_format
,
format
,
NULL
))
{
...
...
@@ -2118,14 +2126,7 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d,
return
WINED3DERR_NOTAVAILABLE
;
}
if
((
format
->
flags
[
gl_type
]
&
format_flags
)
!=
format_flags
)
{
TRACE
(
"Requested format flags %#x, but format %s only has %#x.
\n
"
,
format_flags
,
debug_d3dformat
(
check_format_id
),
format
->
flags
[
gl_type
]);
return
WINED3DERR_NOTAVAILABLE
;
}
if
(
!
(
format
->
flags
[
gl_type
]
&
WINED3DFMT_FLAG_GEN_MIPMAP
))
if
(
!
(
format
->
caps
[
gl_type
]
&
WINED3D_FORMAT_CAP_GEN_MIPMAP
))
mipmap_gen_supported
=
FALSE
;
}
...
...
dlls/wined3d/glsl_shader.c
View file @
06b19322
...
...
@@ -13076,7 +13076,7 @@ static BOOL glsl_blitter_supported(enum wined3d_blit_op blit_op, const struct wi
}
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
&&
!
((
dst_format
->
flags
[
WINED3D_GL_RES_TYPE_TEX_2D
]
&
WINED3DFMT_FLAG
_FBO_ATTACHABLE
)
&&
!
((
dst_format
->
caps
[
WINED3D_GL_RES_TYPE_TEX_2D
]
&
WINED3D_FORMAT_CAP
_FBO_ATTACHABLE
)
||
(
dst_resource
->
bind_flags
&
WINED3D_BIND_RENDER_TARGET
)))
{
TRACE
(
"Destination texture is not FBO attachable.
\n
"
);
...
...
dlls/wined3d/resource.c
View file @
06b19322
...
...
@@ -123,19 +123,19 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
break
;
if
((
bind_flags
&
WINED3D_BIND_RENDER_TARGET
)
&&
!
(
format
->
flags
[
gl_type
]
&
WINED3DFMT_FLAG
_RENDERTARGET
))
&&
!
(
format
->
caps
[
gl_type
]
&
WINED3D_FORMAT_CAP
_RENDERTARGET
))
{
WARN
(
"Format %s cannot be used for render targets.
\n
"
,
debug_d3dformat
(
format
->
id
));
continue
;
}
if
((
bind_flags
&
WINED3D_BIND_DEPTH_STENCIL
)
&&
!
(
format
->
flags
[
gl_type
]
&
WINED3DFMT_FLAG
_DEPTH_STENCIL
))
&&
!
(
format
->
caps
[
gl_type
]
&
WINED3D_FORMAT_CAP
_DEPTH_STENCIL
))
{
WARN
(
"Format %s cannot be used for depth/stencil buffers.
\n
"
,
debug_d3dformat
(
format
->
id
));
continue
;
}
if
((
bind_flags
&
WINED3D_BIND_SHADER_RESOURCE
)
&&
!
(
format
->
flags
[
gl_type
]
&
WINED3DFMT_FLAG
_TEXTURE
))
&&
!
(
format
->
caps
[
gl_type
]
&
WINED3D_FORMAT_CAP
_TEXTURE
))
{
WARN
(
"Format %s cannot be used for texturing.
\n
"
,
debug_d3dformat
(
format
->
id
));
continue
;
...
...
@@ -190,7 +190,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
resource
->
format
=
format
;
resource
->
format_attrs
=
format
->
attrs
;
if
(
gl_type
<
WINED3D_GL_RES_TYPE_COUNT
)
resource
->
format_
flags
=
format
->
flag
s
[
gl_type
];
resource
->
format_
caps
=
format
->
cap
s
[
gl_type
];
resource
->
multisample_type
=
multisample_type
;
resource
->
multisample_quality
=
multisample_quality
;
resource
->
usage
=
usage
;
...
...
@@ -465,7 +465,7 @@ void wined3d_resource_update_draw_binding(struct wined3d_resource *resource)
const
struct
wined3d_format
*
wined3d_resource_get_decompress_format
(
const
struct
wined3d_resource
*
resource
)
{
const
struct
wined3d_adapter
*
adapter
=
resource
->
device
->
adapter
;
if
(
resource
->
format_
flags
&
(
WINED3DFMT_FLAG_SRGB_READ
|
WINED3DFMT_FLAG
_SRGB_WRITE
)
if
(
resource
->
format_
caps
&
(
WINED3D_FORMAT_CAP_SRGB_READ
|
WINED3D_FORMAT_CAP
_SRGB_WRITE
)
&&
!
(
adapter
->
d3d_info
.
wined3d_creation_flags
&
WINED3D_SRGB_READ_WRITE_CONTROL
))
return
wined3d_get_format
(
adapter
,
WINED3DFMT_B8G8R8A8_UNORM_SRGB
,
resource
->
bind_flags
);
return
wined3d_get_format
(
adapter
,
WINED3DFMT_B8G8R8A8_UNORM
,
resource
->
bind_flags
);
...
...
dlls/wined3d/shader.c
View file @
06b19322
...
...
@@ -4123,7 +4123,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3
else
args
->
color_fixup
[
i
]
=
texture
->
resource
.
format
->
color_fixup
;
if
(
texture
->
resource
.
format_
flags
&
WINED3DFMT_FLAG
_SHADOW
)
if
(
texture
->
resource
.
format_
caps
&
WINED3D_FORMAT_CAP
_SHADOW
)
args
->
shadow
|=
1u
<<
i
;
/* Flag samplers that need NP2 texcoord fixup. */
...
...
dlls/wined3d/state.c
View file @
06b19322
...
...
@@ -563,7 +563,7 @@ static BOOL is_blend_enabled(struct wined3d_context *context, const struct wined
* With blending on we could face a big performance penalty.
* The d3d9 visual test confirms the behavior. */
if
(
context
->
render_offscreen
&&
!
(
state
->
fb
.
render_targets
[
index
]
->
format_
flags
&
WINED3DFMT_FLAG
_POSTPIXELSHADER_BLENDING
))
&&
!
(
state
->
fb
.
render_targets
[
index
]
->
format_
caps
&
WINED3D_FORMAT_CAP
_POSTPIXELSHADER_BLENDING
))
return
FALSE
;
return
TRUE
;
...
...
@@ -3709,11 +3709,11 @@ static void wined3d_sampler_desc_from_sampler_states(struct wined3d_sampler_desc
&&
sampler_states
[
WINED3D_SAMP_MIP_FILTER
]
!=
WINED3D_TEXF_ANISOTROPIC
)
||
(
texture_gl
->
t
.
flags
&
WINED3D_TEXTURE_COND_NP2
))
desc
->
max_anisotropy
=
1
;
desc
->
compare
=
texture_gl
->
t
.
resource
.
format_
flags
&
WINED3DFMT_FLAG
_SHADOW
;
desc
->
compare
=
texture_gl
->
t
.
resource
.
format_
caps
&
WINED3D_FORMAT_CAP
_SHADOW
;
desc
->
comparison_func
=
WINED3D_CMP_LESSEQUAL
;
desc
->
srgb_decode
=
is_srgb_enabled
(
sampler_states
);
if
(
!
(
texture_gl
->
t
.
resource
.
format_
flags
&
WINED3DFMT_FLAG
_FILTERING
))
if
(
!
(
texture_gl
->
t
.
resource
.
format_
caps
&
WINED3D_FORMAT_CAP
_FILTERING
))
{
desc
->
mag_filter
=
WINED3D_TEXF_POINT
;
desc
->
min_filter
=
WINED3D_TEXF_POINT
;
...
...
dlls/wined3d/texture.c
View file @
06b19322
...
...
@@ -302,10 +302,10 @@ static bool fbo_blitter_supported(enum wined3d_blit_op blit_op, const struct win
switch
(
blit_op
)
{
case
WINED3D_BLIT_OP_COLOR_BLIT
:
if
(
!
((
src_format
->
flags
[
WINED3D_GL_RES_TYPE_TEX_2D
]
&
WINED3DFMT_FLAG
_FBO_ATTACHABLE
)
if
(
!
((
src_format
->
caps
[
WINED3D_GL_RES_TYPE_TEX_2D
]
&
WINED3D_FORMAT_CAP
_FBO_ATTACHABLE
)
||
(
src_resource
->
bind_flags
&
WINED3D_BIND_RENDER_TARGET
)))
return
false
;
if
(
!
((
dst_format
->
flags
[
WINED3D_GL_RES_TYPE_TEX_2D
]
&
WINED3DFMT_FLAG
_FBO_ATTACHABLE
)
if
(
!
((
dst_format
->
caps
[
WINED3D_GL_RES_TYPE_TEX_2D
]
&
WINED3D_FORMAT_CAP
_FBO_ATTACHABLE
)
||
(
dst_resource
->
bind_flags
&
WINED3D_BIND_RENDER_TARGET
)))
return
false
;
if
((
src_format
->
id
!=
dst_format
->
id
||
dst_location
==
WINED3D_LOCATION_DRAWABLE
)
...
...
@@ -314,9 +314,9 @@ static bool fbo_blitter_supported(enum wined3d_blit_op blit_op, const struct win
break
;
case
WINED3D_BLIT_OP_DEPTH_BLIT
:
if
(
!
(
src_format
->
flags
[
WINED3D_GL_RES_TYPE_TEX_2D
]
&
WINED3DFMT_FLAG
_DEPTH_STENCIL
))
if
(
!
(
src_format
->
caps
[
WINED3D_GL_RES_TYPE_TEX_2D
]
&
WINED3D_FORMAT_CAP
_DEPTH_STENCIL
))
return
false
;
if
(
!
(
dst_format
->
flags
[
WINED3D_GL_RES_TYPE_TEX_2D
]
&
WINED3DFMT_FLAG
_DEPTH_STENCIL
))
if
(
!
(
dst_format
->
caps
[
WINED3D_GL_RES_TYPE_TEX_2D
]
&
WINED3D_FORMAT_CAP
_DEPTH_STENCIL
))
return
false
;
/* Accept pure swizzle fixups for depth formats. In general we
* ignore the stencil component (if present) at the moment and the
...
...
@@ -2115,9 +2115,9 @@ void wined3d_texture_gl_prepare_texture(struct wined3d_texture_gl *texture_gl,
if
(
texture_gl
->
t
.
flags
&
alloc_flag
)
return
;
if
(
resource
->
format_
flags
&
WINED3DFMT_FLAG
_DECOMPRESS
)
if
(
resource
->
format_
caps
&
WINED3D_FORMAT_CAP
_DECOMPRESS
)
{
TRACE
(
"WINED3D
FMT_FLAG
_DECOMPRESS set.
\n
"
);
TRACE
(
"WINED3D
_FORMAT_CAP
_DECOMPRESS set.
\n
"
);
texture_gl
->
t
.
flags
|=
WINED3D_TEXTURE_CONVERTED
;
format
=
wined3d_resource_get_decompress_format
(
resource
);
}
...
...
@@ -2547,7 +2547,7 @@ static void wined3d_texture_gl_upload_data(struct wined3d_context *context,
bo
.
addr
+=
src_box
->
left
*
src_format
->
byte_count
;
}
decompress
=
(
dst_texture
->
resource
.
format_
flags
&
WINED3DFMT_FLAG
_DECOMPRESS
)
decompress
=
(
dst_texture
->
resource
.
format_
caps
&
WINED3D_FORMAT_CAP
_DECOMPRESS
)
||
(
src_format
->
decompress
&&
src_format
->
id
!=
dst_texture
->
resource
.
format
->
id
);
if
(
src_format
->
upload
||
decompress
...
...
@@ -3170,7 +3170,7 @@ static BOOL wined3d_texture_gl_load_texture(struct wined3d_texture_gl *texture_g
wined3d_texture_get_level_box
(
&
texture_gl
->
t
,
level
,
&
src_box
);
if
(
!
depth
&&
sub_resource
->
locations
&
(
WINED3D_LOCATION_TEXTURE_SRGB
|
WINED3D_LOCATION_TEXTURE_RGB
)
&&
(
texture_gl
->
t
.
resource
.
format_
flags
&
WINED3DFMT_FLAG
_FBO_ATTACHABLE_SRGB
)
&&
(
texture_gl
->
t
.
resource
.
format_
caps
&
WINED3D_FORMAT_CAP
_FBO_ATTACHABLE_SRGB
)
&&
fbo_blitter_supported
(
WINED3D_BLIT_OP_COLOR_BLIT
,
gl_info
,
&
texture_gl
->
t
.
resource
,
WINED3D_LOCATION_TEXTURE_RGB
,
&
texture_gl
->
t
.
resource
,
WINED3D_LOCATION_TEXTURE_SRGB
))
...
...
@@ -3191,7 +3191,7 @@ static BOOL wined3d_texture_gl_load_texture(struct wined3d_texture_gl *texture_g
}
if
(
!
depth
&&
sub_resource
->
locations
&
(
WINED3D_LOCATION_RB_MULTISAMPLE
|
WINED3D_LOCATION_RB_RESOLVED
)
&&
(
!
srgb
||
(
texture_gl
->
t
.
resource
.
format_
flags
&
WINED3DFMT_FLAG
_FBO_ATTACHABLE_SRGB
)))
&&
(
!
srgb
||
(
texture_gl
->
t
.
resource
.
format_
caps
&
WINED3D_FORMAT_CAP
_FBO_ATTACHABLE_SRGB
)))
{
DWORD
src_location
=
sub_resource
->
locations
&
WINED3D_LOCATION_RB_RESOLVED
?
WINED3D_LOCATION_RB_RESOLVED
:
WINED3D_LOCATION_RB_MULTISAMPLE
;
...
...
@@ -3343,10 +3343,10 @@ static bool use_ffp_clear(const struct wined3d_texture *texture, unsigned int lo
return
false
;
if
(
location
==
WINED3D_LOCATION_TEXTURE_RGB
&&
!
(
texture
->
resource
.
format_
flags
&
WINED3DFMT_FLAG
_FBO_ATTACHABLE
))
&&
!
(
texture
->
resource
.
format_
caps
&
WINED3D_FORMAT_CAP
_FBO_ATTACHABLE
))
return
false
;
if
(
location
==
WINED3D_LOCATION_TEXTURE_SRGB
&&
!
(
texture
->
resource
.
format_
flags
&
WINED3DFMT_FLAG
_FBO_ATTACHABLE_SRGB
))
&&
!
(
texture
->
resource
.
format_
caps
&
WINED3D_FORMAT_CAP
_FBO_ATTACHABLE_SRGB
))
return
false
;
return
location
&
(
WINED3D_LOCATION_RB_MULTISAMPLE
|
WINED3D_LOCATION_RB_RESOLVED
...
...
@@ -3944,7 +3944,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
/* DXTn 3D textures are not supported. Do not write the ERR for them. */
if
((
desc
->
format
==
WINED3DFMT_DXT1
||
desc
->
format
==
WINED3DFMT_DXT2
||
desc
->
format
==
WINED3DFMT_DXT3
||
desc
->
format
==
WINED3DFMT_DXT4
||
desc
->
format
==
WINED3DFMT_DXT5
)
&&
!
(
format
->
flags
[
WINED3D_GL_RES_TYPE_TEX_2D
]
&
WINED3DFMT_FLAG
_TEXTURE
)
&&
!
(
format
->
caps
[
WINED3D_GL_RES_TYPE_TEX_2D
]
&
WINED3D_FORMAT_CAP
_TEXTURE
)
&&
desc
->
resource_type
!=
WINED3D_RTYPE_TEXTURE_3D
&&
!
once
++
)
ERR_
(
winediag
)(
"The application tried to create a DXTn texture, but the driver does not support them.
\n
"
);
...
...
@@ -3971,7 +3971,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
texture
->
flags
|=
WINED3D_TEXTURE_DISCARD
;
if
(
flags
&
WINED3D_TEXTURE_CREATE_GENERATE_MIPMAPS
)
{
if
(
!
(
texture
->
resource
.
format_
flags
&
WINED3DFMT_FLAG
_GEN_MIPMAP
))
if
(
!
(
texture
->
resource
.
format_
caps
&
WINED3D_FORMAT_CAP
_GEN_MIPMAP
))
WARN
(
"Format doesn't support mipmaps generation, "
"ignoring WINED3D_TEXTURE_CREATE_GENERATE_MIPMAPS flag.
\n
"
);
else
...
...
@@ -6059,7 +6059,7 @@ static void ffp_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_de
if
(
blitter_use_cpu_clear
(
view
)
||
(
!
(
view
->
resource
->
bind_flags
&
WINED3D_BIND_RENDER_TARGET
)
&&
(
wined3d_settings
.
offscreen_rendering_mode
!=
ORM_FBO
||
!
(
view
->
format_
flags
&
WINED3DFMT_FLAG
_FBO_ATTACHABLE
))))
||
!
(
view
->
format_
caps
&
WINED3D_FORMAT_CAP
_FBO_ATTACHABLE
))))
{
next_flags
|=
WINED3DCLEAR_TARGET
;
flags
&=
~
WINED3DCLEAR_TARGET
;
...
...
dlls/wined3d/utils.c
View file @
06b19322
This diff is collapsed.
Click to expand it.
dlls/wined3d/vertexdeclaration.c
View file @
06b19322
...
...
@@ -226,7 +226,7 @@ static HRESULT vertexdeclaration_init(struct wined3d_vertex_declaration *declara
if
(
e
->
input_slot
>=
WINED3D_MAX_STREAMS
)
continue
;
if
(
!
(
e
->
format
->
flags
[
WINED3D_GL_RES_TYPE_BUFFER
]
&
WINED3DFMT_FLAG
_VERTEX_ATTRIBUTE
))
if
(
!
(
e
->
format
->
caps
[
WINED3D_GL_RES_TYPE_BUFFER
]
&
WINED3D_FORMAT_CAP
_VERTEX_ATTRIBUTE
))
{
FIXME
(
"The application tries to use an unsupported format (%s).
\n
"
,
debug_d3dformat
(
elements
[
i
].
format
));
...
...
dlls/wined3d/view.c
View file @
06b19322
...
...
@@ -623,7 +623,7 @@ static HRESULT wined3d_rendertarget_view_init(struct wined3d_rendertarget_view *
if
(
!
(
view
->
format
=
validate_resource_view
(
desc
,
resource
,
TRUE
,
allow_srgb_toggle
)))
return
E_INVALIDARG
;
view
->
format_attrs
=
view
->
format
->
attrs
;
view
->
format_
flags
=
view
->
format
->
flag
s
[
resource
->
gl_type
];
view
->
format_
caps
=
view
->
format
->
cap
s
[
resource
->
gl_type
];
view
->
desc
=
*
desc
;
if
(
resource
->
type
==
WINED3D_RTYPE_BUFFER
)
...
...
dlls/wined3d/wined3d_private.h
View file @
06b19322
...
...
@@ -4354,7 +4354,7 @@ struct wined3d_resource
enum
wined3d_gl_resource_type
gl_type
;
const
struct
wined3d_format
*
format
;
unsigned
int
format_attrs
;
unsigned
int
format_
flag
s
;
unsigned
int
format_
cap
s
;
enum
wined3d_multisample_type
multisample_type
;
UINT
multisample_quality
;
DWORD
usage
;
...
...
@@ -5341,7 +5341,7 @@ struct wined3d_rendertarget_view
const
struct
wined3d_format
*
format
;
unsigned
int
format_attrs
;
unsigned
int
format_
flag
s
;
unsigned
int
format_
cap
s
;
unsigned
int
sub_resource_idx
;
unsigned
int
layer_count
;
...
...
@@ -6121,24 +6121,24 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN
#define WINED3D_FORMAT_ATTR_MAPPABLE 0x00000400
#define WINED3D_FORMAT_ATTR_CAST_TO_BLOCK 0x00000800
/*
WineD3D pixel format flag
s */
#define WINED3D
FMT_FLAG_POSTPIXELSHADER_BLENDING
0x00000001
#define WINED3D
FMT_FLAG_FILTERING
0x00000002
#define WINED3D
FMT_FLAG_UNORDERED_ACCESS
0x00000004
#define WINED3D
FMT_FLAG_DEPTH_STENCIL
0x00000008
#define WINED3D
FMT_FLAG_RENDERTARGET
0x00000010
#define WINED3D
FMT_FLAG_FBO_ATTACHABLE 0x0000004
0
#define WINED3D
FMT_FLAG_FBO_ATTACHABLE_SRGB 0x0000008
0
#define WINED3D
FMT_FLAG_DECOMPRESS 0x0000010
0
#define WINED3D
FMT_FLAG_SRGB_READ 0x000008
00
#define WINED3D
FMT_FLAG_SRGB_WRITE 0x000010
00
#define WINED3D
FMT_FLAG_VTF 0x000020
00
#define WINED3D
FMT_FLAG_SHADOW 0x000040
00
#define WINED3D
FMT_FLAG_TEXTURE 0x00080
000
#define WINED3D
FMT_FLAG_GEN_MIPMAP 0x00400
000
#define WINED3D
FMT_FLAG_VERTEX_ATTRIBUTE 0x01000
000
#define WINED3D
FMT_FLAG_BLIT 0x02000
000
#define WINED3D
FMT_FLAG_INDEX_BUFFER 0x1000
0000
/*
Pixel format capabilitie
s */
#define WINED3D
_FORMAT_CAP_POSTPIXELSHADER_BLENDING
0x00000001
#define WINED3D
_FORMAT_CAP_FILTERING
0x00000002
#define WINED3D
_FORMAT_CAP_UNORDERED_ACCESS
0x00000004
#define WINED3D
_FORMAT_CAP_DEPTH_STENCIL
0x00000008
#define WINED3D
_FORMAT_CAP_RENDERTARGET
0x00000010
#define WINED3D
_FORMAT_CAP_FBO_ATTACHABLE 0x0000002
0
#define WINED3D
_FORMAT_CAP_FBO_ATTACHABLE_SRGB 0x0000004
0
#define WINED3D
_FORMAT_CAP_DECOMPRESS 0x0000008
0
#define WINED3D
_FORMAT_CAP_SRGB_READ 0x000001
00
#define WINED3D
_FORMAT_CAP_SRGB_WRITE 0x000002
00
#define WINED3D
_FORMAT_CAP_VTF 0x000004
00
#define WINED3D
_FORMAT_CAP_SHADOW 0x000008
00
#define WINED3D
_FORMAT_CAP_TEXTURE 0x00001
000
#define WINED3D
_FORMAT_CAP_GEN_MIPMAP 0x00002
000
#define WINED3D
_FORMAT_CAP_VERTEX_ATTRIBUTE 0x00004
000
#define WINED3D
_FORMAT_CAP_BLIT 0x00008
000
#define WINED3D
_FORMAT_CAP_INDEX_BUFFER 0x0001
0000
struct
wined3d_rational
{
...
...
@@ -6193,7 +6193,7 @@ struct wined3d_format
UINT
conv_byte_count
;
DWORD
multisample_types
;
unsigned
int
attrs
;
unsigned
int
flag
s
[
WINED3D_GL_RES_TYPE_COUNT
];
unsigned
int
cap
s
[
WINED3D_GL_RES_TYPE_COUNT
];
float
depth_bias_scale
;
struct
wined3d_rational
height_scale
;
struct
color_fixup_desc
color_fixup
;
...
...
@@ -6323,12 +6323,12 @@ static inline BOOL needs_separate_srgb_gl_texture(const struct wined3d_context *
if
(
!
context
->
d3d_info
->
srgb_read_control
&&
(
texture
->
resource
.
bind_flags
&
WINED3D_BIND_SHADER_RESOURCE
)
&&
(
texture
->
resource
.
format_
flags
&
WINED3DFMT_FLAG
_SRGB_READ
))
&&
(
texture
->
resource
.
format_
caps
&
WINED3D_FORMAT_CAP
_SRGB_READ
))
return
TRUE
;
if
(
!
context
->
d3d_info
->
srgb_write_control
&&
(
texture
->
resource
.
bind_flags
&
WINED3D_BIND_RENDER_TARGET
)
&&
(
texture
->
resource
.
format_
flags
&
WINED3DFMT_FLAG
_SRGB_WRITE
))
&&
(
texture
->
resource
.
format_
caps
&
WINED3D_FORMAT_CAP
_SRGB_WRITE
))
return
TRUE
;
return
FALSE
;
...
...
@@ -6339,7 +6339,7 @@ static inline BOOL needs_srgb_write(const struct wined3d_d3d_info *d3d_info,
{
return
(
!
(
d3d_info
->
wined3d_creation_flags
&
WINED3D_SRGB_READ_WRITE_CONTROL
)
||
state
->
render_states
[
WINED3D_RS_SRGBWRITEENABLE
])
&&
fb
->
render_targets
[
0
]
&&
fb
->
render_targets
[
0
]
->
format_
flags
&
WINED3DFMT_FLAG
_SRGB_WRITE
;
&&
fb
->
render_targets
[
0
]
&&
fb
->
render_targets
[
0
]
->
format_
caps
&
WINED3D_FORMAT_CAP
_SRGB_WRITE
;
}
static
inline
GLuint
wined3d_texture_gl_get_texture_name
(
const
struct
wined3d_texture_gl
*
texture_gl
,
...
...
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