From: Chip Davis cdavis5x@gmail.com
--- dlls/wined3d/adapter_gl.c | 4 +-- dlls/wined3d/arb_program_shader.c | 4 +-- dlls/wined3d/context_gl.c | 2 +- dlls/wined3d/device.c | 12 +++---- dlls/wined3d/directx.c | 10 +++--- dlls/wined3d/glsl_shader.c | 4 +-- dlls/wined3d/resource.c | 10 +++--- dlls/wined3d/surface.c | 12 +++---- dlls/wined3d/texture.c | 40 ++++++++++----------- dlls/wined3d/utils.c | 60 +++++++++++++++---------------- dlls/wined3d/view.c | 4 +-- dlls/wined3d/wined3d_private.h | 6 ++-- 12 files changed, 82 insertions(+), 86 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index 547c2f67709..6124e8aab92 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -4474,7 +4474,7 @@ static BOOL wined3d_check_pixel_format_color(const struct wined3d_pixel_format * const struct wined3d_format *format) { /* Float formats need FBOs. If FBOs are used this function isn't called */ - if (format->base_flags & WINED3DFMT_FLAG_FLOAT) + if (format->flags & WINED3DFMT_FLAG_FLOAT) return FALSE;
/* Probably a RGBA_float or color index mode. */ @@ -4496,7 +4496,7 @@ static BOOL wined3d_check_pixel_format_depth(const struct wined3d_pixel_format * BOOL lockable = FALSE;
/* Float formats need FBOs. If FBOs are used this function isn't called */ - if (format->base_flags & WINED3DFMT_FLAG_FLOAT) + if (format->flags & WINED3DFMT_FLAG_FLOAT) return FALSE;
if ((format->id == WINED3DFMT_D16_LOCKABLE) || (format->id == WINED3DFMT_D32_FLOAT)) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 7522b566c23..fec5270c055 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -7744,8 +7744,8 @@ static BOOL arbfp_blit_supported(enum wined3d_blit_op blit_op, const struct wine return FALSE; }
- decompress = (src_format->base_flags & WINED3DFMT_FLAG_COMPRESSED) - && !(dst_format->base_flags & WINED3DFMT_FLAG_COMPRESSED); + decompress = (src_format->flags & WINED3DFMT_FLAG_COMPRESSED) + && !(dst_format->flags & WINED3DFMT_FLAG_COMPRESSED); if (!decompress && !(src_resource->access & dst_resource->access & WINED3D_RESOURCE_ACCESS_GPU)) return FALSE;
diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index aeda3019c5e..d9f4520b00b 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -5733,7 +5733,7 @@ static void wined3d_context_gl_load_numbered_arrays(struct wined3d_context_gl *c
if (element->stride) { - unsigned int format_flags = format_gl->f.base_flags; + unsigned int format_flags = format_gl->f.flags;
bo = wined3d_bo_gl_id(element->data.buffer_object); if (current_bo != bo) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 2a4e361a070..f557445e12c 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4723,11 +4723,11 @@ static bool resources_format_compatible(const struct wined3d_resource *src_resou return true; if (src_resource->device->cs->c.state->feature_level < WINED3D_FEATURE_LEVEL_10_1) return false; - if ((src_resource->format_base_flags & WINED3DFMT_FLAG_BLOCKS) - && (dst_resource->format_base_flags & WINED3DFMT_FLAG_CAST_TO_BLOCK)) + if ((src_resource->format_flags & WINED3DFMT_FLAG_BLOCKS) + && (dst_resource->format_flags & WINED3DFMT_FLAG_CAST_TO_BLOCK)) return src_resource->format->block_byte_count == dst_resource->format->byte_count; - if ((src_resource->format_base_flags & WINED3DFMT_FLAG_CAST_TO_BLOCK) - && (dst_resource->format_base_flags & WINED3DFMT_FLAG_BLOCKS)) + if ((src_resource->format_flags & WINED3DFMT_FLAG_CAST_TO_BLOCK) + && (dst_resource->format_flags & WINED3DFMT_FLAG_BLOCKS)) return src_resource->format->byte_count == dst_resource->format->block_byte_count; return false; } @@ -5121,7 +5121,7 @@ void CDECL wined3d_device_context_clear_uav_float(struct wined3d_device_context { TRACE("context %p, view %p, clear_value %s.\n", context, view, debug_vec4(clear_value));
- if (!(view->format->base_flags & (WINED3DFMT_FLAG_FLOAT | WINED3DFMT_FLAG_NORMALISED))) + if (!(view->format->flags & (WINED3DFMT_FLAG_FLOAT | WINED3DFMT_FLAG_NORMALISED))) { WARN("Not supported for view format %s.\n", debug_d3dformat(view->format->id)); return; @@ -5223,7 +5223,7 @@ HRESULT CDECL wined3d_device_context_map(struct wined3d_device_context *context, if (resource->type != WINED3D_RTYPE_BUFFER && resource->type != WINED3D_RTYPE_TEXTURE_2D) return WINED3DERR_INVALIDCALL;
- if ((resource->format_base_flags & WINED3DFMT_FLAG_BLOCKS) && !(resource->access & WINED3D_RESOURCE_ACCESS_CPU)) + if ((resource->format_flags & WINED3DFMT_FLAG_BLOCKS) && !(resource->access & WINED3D_RESOURCE_ACCESS_CPU)) return WINED3DERR_INVALIDCALL; }
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 2411ce843cf..464627cf42a 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1707,7 +1707,7 @@ static BOOL wined3d_check_surface_format(const struct wined3d_format *format) & WINED3DFMT_CAP_BLIT) return TRUE;
- if ((format->base_flags & WINED3DFMT_FLAG_EXTENSION) + if ((format->flags & WINED3DFMT_FLAG_EXTENSION) && (format->caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_CAP_TEXTURE)) return TRUE;
@@ -1728,7 +1728,7 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, enum wined3d_resource_type resource_type, enum wined3d_format_id check_format_id) { const struct wined3d_format *adapter_format, *format; - unsigned int format_caps = 0, format_base_flags = 0; + unsigned int format_caps = 0, format_flags = 0; enum wined3d_gl_resource_type gl_type, gl_type_end; BOOL mipmap_gen_supported = TRUE; unsigned int allowed_bind_flags; @@ -1880,7 +1880,7 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, if (usage & WINED3DUSAGE_QUERY_VERTEXTEXTURE) format_caps |= WINED3DFMT_CAP_VTF; if (usage & WINED3DUSAGE_QUERY_LEGACYBUMPMAP) - format_base_flags |= WINED3DFMT_FLAG_BUMPMAP; + format_flags |= WINED3DFMT_FLAG_BUMPMAP;
if ((format_caps & WINED3DFMT_CAP_TEXTURE) && (wined3d->flags & WINED3D_NO3D)) { @@ -1888,10 +1888,10 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, return WINED3DERR_NOTAVAILABLE; }
- if ((format->base_flags & format_base_flags) != format_base_flags) + if ((format->flags & format_flags) != format_flags) { TRACE("Requested format flags %#x, but format %s only has %#x.\n", - format_base_flags, debug_d3dformat(check_format_id), format->base_flags); + format_flags, debug_d3dformat(check_format_id), format->flags); return WINED3DERR_NOTAVAILABLE; }
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index b7d73a7271d..0bf4daeaf47 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -13060,8 +13060,8 @@ static BOOL glsl_blitter_supported(enum wined3d_blit_op blit_op, const struct wi /* We don't necessarily want to blit from resources without * WINED3D_RESOURCE_ACCESS_GPU, but that may be the only way to decompress * compressed textures. */ - decompress = (src_format->base_flags & WINED3DFMT_FLAG_COMPRESSED) - && !(dst_format->base_flags & WINED3DFMT_FLAG_COMPRESSED); + decompress = (src_format->flags & WINED3DFMT_FLAG_COMPRESSED) + && !(dst_format->flags & WINED3DFMT_FLAG_COMPRESSED); if (!decompress && !(src_resource->access & WINED3D_RESOURCE_ACCESS_GPU)) { TRACE("Source resource does not have GPU access.\n"); diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 47e75f73cf9..21c28604faf 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -174,7 +174,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * }
if (base_type != WINED3D_GL_RES_TYPE_COUNT - && (format->base_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BLOCKS_NO_VERIFY)) + && (format->flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BLOCKS_NO_VERIFY)) == WINED3DFMT_FLAG_BLOCKS) { UINT width_mask = format->block_width - 1; @@ -188,14 +188,14 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * resource->type = type; resource->gl_type = gl_type; resource->format = format; - resource->format_base_flags = format->base_flags; + resource->format_flags = format->flags; if (gl_type < WINED3D_GL_RES_TYPE_COUNT) resource->format_caps = format->caps[gl_type]; resource->multisample_type = multisample_type; resource->multisample_quality = multisample_quality; resource->usage = usage; resource->bind_flags = bind_flags; - if (resource->format_base_flags & WINED3DFMT_FLAG_MAPPABLE) + if (resource->format_flags & WINED3DFMT_FLAG_MAPPABLE) access |= WINED3D_RESOURCE_ACCESS_MAP_R | WINED3D_RESOURCE_ACCESS_MAP_W; resource->access = access; resource->width = width; @@ -520,7 +520,7 @@ HRESULT wined3d_resource_check_box_dimensions(struct wined3d_resource *resource, return WINEDDERR_INVALIDRECT; }
- if (resource->format_base_flags & WINED3DFMT_FLAG_BLOCKS) + if (resource->format_flags & WINED3DFMT_FLAG_BLOCKS) { /* This assumes power of two block sizes, but NPOT block sizes would * be silly anyway. @@ -597,7 +597,7 @@ void *resource_offset_map_pointer(struct wined3d_resource *resource, unsigned in
wined3d_resource_get_sub_resource_map_pitch(resource, sub_resource_idx, &row_pitch, &slice_pitch);
- if ((resource->format_base_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS) + if ((resource->format_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS) { /* Compressed textures are block based, so calculate the offset of * the block that contains the top-left pixel of the mapped box. */ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 90d21abd552..4e3f660d415 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -255,7 +255,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr if (!(conv = find_converter(src_format->id, dst_format->id)) && ((device->wined3d->flags & WINED3D_NO3D) || !is_identity_fixup(src_format->color_fixup) || src_format->conv_byte_count || !is_identity_fixup(dst_format->color_fixup) || dst_format->conv_byte_count - || ((src_format->base_flags & WINED3DFMT_FLAG_COMPRESSED) + || ((src_format->flags & WINED3DFMT_FLAG_COMPRESSED) && !src_format->decompress))) { FIXME("Cannot find a conversion function from format %s to %s.\n", @@ -707,12 +707,12 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int else { same_sub_resource = FALSE; - upload = dst_format->base_flags & WINED3DFMT_FLAG_BLOCKS + upload = dst_format->flags & WINED3DFMT_FLAG_BLOCKS && (dst_width != src_width || dst_height != src_height);
if (upload) { - dst_format = src_format->base_flags & WINED3DFMT_FLAG_BLOCKS + dst_format = src_format->flags & WINED3DFMT_FLAG_BLOCKS ? wined3d_get_format(device->adapter, WINED3DFMT_B8G8R8A8_UNORM, 0) : src_format; }
@@ -759,8 +759,8 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int dst_texture->sub_resources[dst_sub_resource_idx].size, WINED3D_MAP_WRITE); } } - src_fmt_flags = src_format->base_flags; - dst_fmt_flags = dst_format->base_flags; + src_fmt_flags = src_format->flags; + dst_fmt_flags = dst_format->flags; flags &= ~WINED3D_BLT_RAW;
bpp = dst_format->byte_count; @@ -1188,7 +1188,7 @@ static void surface_cpu_blt_colour_fill(struct wined3d_rendertarget_view *view,
TRACE("view %p, box %s, colour %s.\n", view, debug_box(box), debug_color(colour));
- if (view->format_base_flags & WINED3DFMT_FLAG_BLOCKS) + if (view->format_flags & WINED3DFMT_FLAG_BLOCKS) { FIXME("Not implemented for format %s.\n", debug_d3dformat(view->format->id)); return; diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 515eb1adbe4..b230fc05f00 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -71,7 +71,7 @@ static BOOL wined3d_texture_use_immutable_storage(const struct wined3d_texture * /* We don't expect to create texture views for textures with height-scaled formats. * Besides, ARB_texture_storage doesn't allow specifying exact sizes for all levels. */ return gl_info->supported[ARB_TEXTURE_STORAGE] - && !(texture->resource.format_base_flags & WINED3DFMT_FLAG_HEIGHT_SCALE); + && !(texture->resource.format_flags & WINED3DFMT_FLAG_HEIGHT_SCALE); }
/* Front buffer coordinates are always full screen coordinates, but our GL @@ -279,8 +279,7 @@ static bool fbo_blitter_supported(enum wined3d_blit_op blit_op, const struct win if ((wined3d_settings.offscreen_rendering_mode != ORM_FBO) || !gl_info->fbo_ops.glBlitFramebuffer) return false;
- if ((src_resource->format_base_flags | dst_resource->format_base_flags) - & WINED3DFMT_FLAG_HEIGHT_SCALE) + if ((src_resource->format_flags | dst_resource->format_flags) & WINED3DFMT_FLAG_HEIGHT_SCALE) return false;
/* Source and/or destination need to be on the GL side. */ @@ -979,7 +978,7 @@ static void wined3d_texture_gl_allocate_mutable_storage(struct wined3d_texture_g { width = wined3d_texture_get_level_pow2_width(&texture_gl->t, level); height = wined3d_texture_get_level_pow2_height(&texture_gl->t, level); - if (texture_gl->t.resource.format_base_flags & WINED3DFMT_FLAG_HEIGHT_SCALE) + if (texture_gl->t.resource.format_flags & WINED3DFMT_FLAG_HEIGHT_SCALE) { height *= format->f.height_scale.numerator; height /= format->f.height_scale.denominator; @@ -2269,7 +2268,7 @@ static void wined3d_texture_gl_upload_bo(const struct wined3d_format *src_format { const struct wined3d_format_gl *format_gl = wined3d_format_gl(src_format);
- if (src_format->base_flags & WINED3DFMT_FLAG_COMPRESSED) + if (src_format->flags & WINED3DFMT_FLAG_COMPRESSED) { GLenum internal = wined3d_gl_get_internal_format(&dst_texture->resource, format_gl, srgb); unsigned int dst_row_pitch, dst_slice_pitch; @@ -2412,7 +2411,7 @@ static enum wined3d_format_id wined3d_get_alpha_fixup_format(enum wined3d_format { unsigned int i;
- if (!(dst_format->base_flags & WINED3DFMT_FLAG_COMPRESSED) && !dst_format->alpha_size) + if (!(dst_format->flags & WINED3DFMT_FLAG_COMPRESSED) && !dst_format->alpha_size) return WINED3DFMT_UNKNOWN;
for (i = 0; i < ARRAY_SIZE(formats_src_alpha_fixup); ++i) @@ -2510,7 +2509,7 @@ static void wined3d_texture_gl_upload_data(struct wined3d_context *context, dst_texture->resource.pin_sysmem = 1; }
- if (src_format->base_flags & WINED3DFMT_FLAG_HEIGHT_SCALE) + if (src_format->flags & WINED3DFMT_FLAG_HEIGHT_SCALE) { update_h *= src_format->height_scale.numerator; update_h /= src_format->height_scale.denominator; @@ -2537,7 +2536,7 @@ static void wined3d_texture_gl_upload_data(struct wined3d_context *context,
bo.buffer_object = src_bo_addr->buffer_object; bo.addr = (BYTE *)src_bo_addr->addr + src_box->front * src_slice_pitch; - if (dst_texture->resource.format_base_flags & WINED3DFMT_FLAG_BLOCKS) + if (dst_texture->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) { bo.addr += (src_box->top / src_format->block_height) * src_row_pitch; bo.addr += (src_box->left / src_format->block_width) * src_format->block_byte_count; @@ -2573,7 +2572,7 @@ static void wined3d_texture_gl_upload_data(struct wined3d_context *context, } else { - if (dst_texture->resource.format_base_flags & WINED3DFMT_FLAG_BLOCKS) + if (dst_texture->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) ERR("Converting a block-based format.\n");
f = *wined3d_format_gl(src_format); @@ -2723,7 +2722,7 @@ static void wined3d_texture_gl_download_data_slow_path(struct wined3d_texture_gl
if (bo) ERR("NP2 emulated texture uses PBO unexpectedly.\n"); - if (texture_gl->t.resource.format_base_flags & WINED3DFMT_FLAG_COMPRESSED) + if (texture_gl->t.resource.format_flags & WINED3DFMT_FLAG_COMPRESSED) ERR("Unexpected compressed format for NP2 emulated texture.\n"); }
@@ -2771,7 +2770,7 @@ static void wined3d_texture_gl_download_data_slow_path(struct wined3d_texture_gl mem = data->addr; }
- if (texture_gl->t.resource.format_base_flags & WINED3DFMT_FLAG_COMPRESSED) + if (texture_gl->t.resource.format_flags & WINED3DFMT_FLAG_COMPRESSED) { TRACE("Downloading compressed texture %p, %u, level %u, format %#x, type %#x, data %p.\n", texture_gl, sub_resource_idx, level, format_gl->format, format_gl->type, mem); @@ -2987,7 +2986,7 @@ static void wined3d_texture_gl_download_data(struct wined3d_context *context, checkGLcall("glBindBuffer"); }
- if (src_texture->resource.format_base_flags & WINED3DFMT_FLAG_COMPRESSED) + if (src_texture->resource.format_flags & WINED3DFMT_FLAG_COMPRESSED) { TRACE("Downloading compressed texture %p, %u, level %u, format %#x, type %#x, data %p.\n", src_texture, src_sub_resource_idx, src_level, format_gl->format, format_gl->type, offset); @@ -3635,7 +3634,7 @@ static void texture_resource_sub_resource_get_map_pitch(struct wined3d_resource const struct wined3d_texture *texture = texture_from_resource(resource); unsigned int level = sub_resource_idx % texture->level_count;
- if (resource->format_base_flags & WINED3DFMT_FLAG_BROKEN_PITCH) + if (resource->format_flags & WINED3DFMT_FLAG_BROKEN_PITCH) { *row_pitch = wined3d_texture_get_level_width(texture, level) * resource->format->byte_count; *slice_pitch = wined3d_texture_get_level_height(texture, level) * (*row_pitch); @@ -3862,7 +3861,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc if (desc->resource_type != WINED3D_RTYPE_TEXTURE_3D && !d3d_info->texture_npot_conditional) { /* TODO: Add support for non-power-of-two compressed textures. */ - if (format->base_flags & (WINED3DFMT_FLAG_COMPRESSED | WINED3DFMT_FLAG_HEIGHT_SCALE)) + if (format->flags & (WINED3DFMT_FLAG_COMPRESSED | WINED3DFMT_FLAG_HEIGHT_SCALE)) { FIXME("Compressed or height scaled non-power-of-two (%ux%u) textures are not supported.\n", desc->width, desc->height); @@ -3926,7 +3925,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc * compressed block. It is questionable how useful these mip-levels are to * the application with "broken pitch" formats, but we want to avoid * memory corruption when loading textures into WINED3D_LOCATION_SYSMEM. */ - if (format->base_flags & WINED3DFMT_FLAG_BROKEN_PITCH) + if (format->flags & WINED3DFMT_FLAG_BROKEN_PITCH) { unsigned int min_size;
@@ -5279,7 +5278,7 @@ static bool wined3d_texture_vk_clear(struct wined3d_texture_vk *texture_vk, VkImageAspectFlags aspect_mask; VkImage vk_image;
- if (texture_vk->t.resource.format_base_flags & WINED3DFMT_FLAG_COMPRESSED) + if (texture_vk->t.resource.format_flags & WINED3DFMT_FLAG_COMPRESSED) { struct wined3d_bo_address addr;
@@ -5713,8 +5712,8 @@ static bool ffp_blit_supported(enum wined3d_blit_op blit_op, const struct wined3 if (src_resource->type != WINED3D_RTYPE_TEXTURE_2D) return false;
- decompress = (src_format->base_flags & WINED3DFMT_FLAG_COMPRESSED) - && !(dst_format->base_flags & WINED3DFMT_FLAG_COMPRESSED); + decompress = (src_format->flags & WINED3DFMT_FLAG_COMPRESSED) + && !(dst_format->flags & WINED3DFMT_FLAG_COMPRESSED); if (!decompress && !(src_resource->access & dst_resource->access & WINED3D_RESOURCE_ACCESS_GPU)) { TRACE("Source or destination resource is not GPU accessible.\n"); @@ -6485,8 +6484,7 @@ static DWORD raw_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit * We also can't copy between depth/stencil and colour resources, since * the formats are considered incompatible in OpenGL. */ if (op != WINED3D_BLIT_OP_RAW_BLIT || !gl_formats_compatible(src_texture, src_location, dst_texture, dst_location) - || ((src_texture->resource.format_base_flags | dst_texture->resource.format_base_flags) - & WINED3DFMT_FLAG_HEIGHT_SCALE) + || ((src_texture->resource.format_flags | dst_texture->resource.format_flags) & WINED3DFMT_FLAG_HEIGHT_SCALE) || (src_texture->resource.format->id == dst_texture->resource.format->id && (!(src_location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) || !(dst_location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))))) @@ -6652,7 +6650,7 @@ static void vk_blitter_clear_rendertargets(struct wined3d_context_vk *context_vk wined3d_rendertarget_view_vk_barrier(rtv_vk, context_vk, WINED3D_BIND_RENDER_TARGET);
c = &clear_values[attachment_count].color; - if (view->format_base_flags & WINED3DFMT_FLAG_INTEGER) + if (view->format_flags & WINED3DFMT_FLAG_INTEGER) { c->int32[0] = colour->r; c->int32[1] = colour->g; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 28e2d069133..b3427f801f3 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -306,7 +306,7 @@ static const struct wined3d_format_ddi_info ddi_formats[] = struct wined3d_format_base_flags { enum wined3d_format_id id; - unsigned int base_flags; + unsigned int flags; unsigned int caps; };
@@ -670,7 +670,7 @@ struct wined3d_format_block_info UINT block_width; UINT block_height; UINT block_byte_count; - unsigned int base_flags; + unsigned int flags; };
static const struct wined3d_format_block_info format_block_info[] = @@ -761,7 +761,7 @@ struct wined3d_format_texture_info GLint gl_format; GLint gl_type; unsigned int conv_byte_count; - unsigned int base_flags; + unsigned int flags; unsigned int caps; enum wined3d_gl_extension extension; void (*upload)(const BYTE *src, BYTE *dst, unsigned int src_row_pitch, unsigned int src_slice_pitch, @@ -1358,7 +1358,7 @@ static const struct wined3d_format_texture_info format_texture_info[] = { /* format id gl_internal gl_srgb_internal gl_rt_internal gl_format gl_type conv_byte_count - base_flags + flags caps extension upload download */ /* FourCC formats */ @@ -2201,7 +2201,7 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter) { struct wined3d_format *typeless_format; unsigned int component_count = 0; - unsigned int base_flags = 0; + unsigned int flags = 0;
if (!(format = get_format_internal(adapter, typed_formats[i].id))) return FALSE; @@ -2233,11 +2233,11 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter) enum wined3d_channel_type channel_type = map_channel_type(typed_formats[i].channels[j]);
if (channel_type == WINED3D_CHANNEL_TYPE_UNORM || channel_type == WINED3D_CHANNEL_TYPE_SNORM) - base_flags |= WINED3DFMT_FLAG_NORMALISED; + flags |= WINED3DFMT_FLAG_NORMALISED; if (channel_type == WINED3D_CHANNEL_TYPE_UINT || channel_type == WINED3D_CHANNEL_TYPE_SINT) - base_flags |= WINED3DFMT_FLAG_INTEGER; + flags |= WINED3DFMT_FLAG_INTEGER; if (channel_type == WINED3D_CHANNEL_TYPE_FLOAT) - base_flags |= WINED3DFMT_FLAG_FLOAT; + flags |= WINED3DFMT_FLAG_FLOAT; if (channel_type != WINED3D_CHANNEL_TYPE_UNUSED) ++component_count;
@@ -2255,7 +2255,7 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter) }
format->component_count = component_count; - format->base_flags |= base_flags; + format->flags |= flags; }
for (i = 0; i < ARRAY_SIZE(ddi_formats); ++i) @@ -2271,7 +2271,7 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter) if (!(format = get_format_internal(adapter, format_base_flags[i].id))) return FALSE;
- format->base_flags |= format_base_flags[i].base_flags; + format->flags |= format_base_flags[i].flags; format_set_caps(format, format_base_flags[i].caps); }
@@ -2291,7 +2291,7 @@ static BOOL init_format_block_info(struct wined3d_adapter *adapter) format->block_width = format_block_info[i].block_width; format->block_height = format_block_info[i].block_height; format->block_byte_count = format_block_info[i].block_byte_count; - format->base_flags |= WINED3DFMT_FLAG_BLOCKS | format_block_info[i].base_flags; + format->flags |= WINED3DFMT_FLAG_BLOCKS | format_block_info[i].flags; }
return TRUE; @@ -2715,7 +2715,7 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for if (status == GL_FRAMEBUFFER_COMPLETE && ((format->f.caps[type] & WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING) || !(gl_info->quirks & WINED3D_QUIRK_LIMITED_TEX_FILTERING)) - && !(format->f.base_flags & WINED3DFMT_FLAG_INTEGER) + && !(format->f.flags & WINED3DFMT_FLAG_INTEGER) && format->f.id != WINED3DFMT_NULL && format->f.id != WINED3DFMT_P8_UINT && format->format != GL_LUMINANCE && format->format != GL_LUMINANCE_ALPHA && (format->f.red_size || format->f.alpha_size)) @@ -3039,7 +3039,7 @@ static void init_format_fbo_compat_info(const struct wined3d_adapter *adapter, if (!format->internal) continue;
- if (format->f.base_flags & WINED3DFMT_FLAG_COMPRESSED) + if (format->f.flags & WINED3DFMT_FLAG_COMPRESSED) { TRACE("Skipping format %s because it's a compressed format.\n", debug_d3dformat(format->f.id)); @@ -3325,13 +3325,11 @@ static BOOL init_format_texture_info(struct wined3d_adapter *adapter, struct win
/* 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.base_flags & WINED3DFMT_FLAG_FLOAT)) + if (!gl_info->supported[ARB_TEXTURE_FLOAT] && (format->f.flags & WINED3DFMT_FLAG_FLOAT)) continue;
/* ARB_texture_rg defines integer formats if EXT_texture_integer is also supported. */ - if (!gl_info->supported[EXT_TEXTURE_INTEGER] - && (format->f.base_flags & WINED3DFMT_FLAG_INTEGER)) + if (!gl_info->supported[EXT_TEXTURE_INTEGER] && (format->f.flags & WINED3DFMT_FLAG_INTEGER)) continue;
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO @@ -3347,7 +3345,7 @@ static BOOL init_format_texture_info(struct wined3d_adapter *adapter, struct win format->f.height_scale.numerator = 1; format->f.height_scale.denominator = 1;
- format->f.base_flags |= format_texture_info[i].base_flags; + format->f.flags |= format_texture_info[i].flags; format->f.caps[WINED3D_GL_RES_TYPE_TEX_1D] |= format_texture_info[i].caps | WINED3DFMT_CAP_BLIT; format->f.caps[WINED3D_GL_RES_TYPE_TEX_2D] |= format_texture_info[i].caps | WINED3DFMT_CAP_BLIT; format->f.caps[WINED3D_GL_RES_TYPE_BUFFER] |= format_texture_info[i].caps | WINED3DFMT_CAP_BLIT; @@ -3759,13 +3757,13 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_ || (gl_info->supported[ARB_FRAGMENT_SHADER] && gl_info->supported[ARB_VERTEX_SHADER])) { format = get_format_gl_internal(adapter, WINED3DFMT_YV12); - format->f.base_flags |= WINED3DFMT_FLAG_HEIGHT_SCALE; + format->f.flags |= WINED3DFMT_FLAG_HEIGHT_SCALE; format->f.height_scale.numerator = 3; format->f.height_scale.denominator = 2; format->f.color_fixup = create_complex_fixup_desc(COMPLEX_FIXUP_YV12);
format = get_format_gl_internal(adapter, WINED3DFMT_NV12); - format->f.base_flags |= WINED3DFMT_FLAG_HEIGHT_SCALE; + format->f.flags |= WINED3DFMT_FLAG_HEIGHT_SCALE; format->f.height_scale.numerator = 3; format->f.height_scale.denominator = 2; format->f.color_fixup = create_complex_fixup_desc(COMPLEX_FIXUP_NV12); @@ -3921,7 +3919,7 @@ static BOOL init_format_vertex_info(const struct wined3d_adapter *adapter, static BOOL init_typeless_formats(const struct wined3d_adapter *adapter) { unsigned int caps[WINED3D_GL_RES_TYPE_COUNT]; - unsigned int base_flags, i, j; + unsigned int flags, i, j;
for (i = 0; i < ARRAY_SIZE(typed_formats); ++i) { @@ -3932,10 +3930,10 @@ static BOOL init_typeless_formats(const struct wined3d_adapter *adapter) if (!(typeless_format = get_format_internal(adapter, typed_formats[i].typeless_id))) return FALSE;
- base_flags = typeless_format->base_flags; + flags = typeless_format->flags; memcpy(caps, typeless_format->caps, sizeof(caps)); copy_format(adapter, typeless_format, format); - typeless_format->base_flags = base_flags; + typeless_format->flags = flags; for (j = 0; j < ARRAY_SIZE(typeless_format->caps); ++j) typeless_format->caps[j] |= caps[j]; } @@ -3954,7 +3952,7 @@ static BOOL init_typeless_formats(const struct wined3d_adapter *adapter) typeless_ds_format = get_format_by_idx(adapter, WINED3D_FORMAT_COUNT + i); typeless_ds_format->id = typeless_depth_stencil_formats[i].typeless_id; copy_format(adapter, typeless_ds_format, ds_format); - typeless_ds_format->base_flags = typeless_format->base_flags; + typeless_ds_format->flags = typeless_format->flags; for (j = 0; j < ARRAY_SIZE(typeless_ds_format->caps); ++j) { typeless_ds_format->caps[j] = typeless_format->caps[j]; @@ -4258,7 +4256,7 @@ static void init_format_depth_bias_scale(struct wined3d_adapter *adapter, /* The single-precision binary floating-point format has * a significand precision of 24 bits. */ - if (format->f.base_flags & WINED3DFMT_FLAG_FLOAT) + if (format->f.flags & WINED3DFMT_FLAG_FLOAT) format->f.depth_bias_scale /= 1u << 24; else format->f.depth_bias_scale /= 1u << format->f.depth_size; @@ -4646,7 +4644,7 @@ void wined3d_format_calculate_pitch(const struct wined3d_format *format, unsigne { /* For block based formats, pitch means the amount of bytes to the next * row of blocks rather than the next row of pixels. */ - if (format->base_flags & WINED3DFMT_FLAG_BLOCKS) + if (format->flags & WINED3DFMT_FLAG_BLOCKS) { unsigned int row_block_count = (width + format->block_width - 1) / format->block_width; unsigned int slice_block_count = (height + format->block_height - 1) / format->block_height; @@ -4661,7 +4659,7 @@ void wined3d_format_calculate_pitch(const struct wined3d_format *format, unsigne *slice_pitch = *row_pitch * height; }
- if (format->base_flags & WINED3DFMT_FLAG_HEIGHT_SCALE) + if (format->flags & WINED3DFMT_FLAG_HEIGHT_SCALE) { /* The D3D format requirements make sure that the resulting format is an integer again */ *slice_pitch *= format->height_scale.numerator; @@ -4679,7 +4677,7 @@ UINT wined3d_format_calculate_size(const struct wined3d_format *format, UINT ali if (format->id == WINED3DFMT_UNKNOWN) return 0;
- if (format->base_flags & WINED3DFMT_FLAG_BROKEN_PITCH) + if (format->flags & WINED3DFMT_FLAG_BROKEN_PITCH) return width * height * depth * format->byte_count;
wined3d_format_calculate_pitch(format, alignment, width, height, &row_pitch, &slice_pitch); @@ -6235,7 +6233,7 @@ void wined3d_format_convert_from_float(const struct wined3d_format *format, return; }
- if (format->base_flags & WINED3DFMT_FLAG_NORMALISED) + if (format->flags & WINED3DFMT_FLAG_NORMALISED) { uint32_t *ret_i = ret;
@@ -6257,7 +6255,7 @@ void wined3d_format_convert_from_float(const struct wined3d_format *format, }
/* 32 bit float formats. We don't handle D32_FLOAT and D32_FLOAT_S8X24_UINT for now. */ - if ((format->base_flags & WINED3DFMT_FLAG_FLOAT) && format->red_size == 32) + if ((format->flags & WINED3DFMT_FLAG_FLOAT) && format->red_size == 32) { float *ret_f = ret;
@@ -6277,7 +6275,7 @@ void wined3d_format_convert_from_float(const struct wined3d_format *format, return; }
- if ((format->base_flags & WINED3DFMT_FLAG_FLOAT) && format->red_size == 16) + if ((format->flags & WINED3DFMT_FLAG_FLOAT) && format->red_size == 16) { uint16_t *ret_s = ret;
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index 748d1810634..82a62591a9d 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -613,7 +613,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_base_flags = view->format->base_flags; + view->format_flags = view->format->flags; view->format_caps = view->format->caps[resource->gl_type]; view->desc = *desc;
@@ -1561,7 +1561,7 @@ void wined3d_unordered_access_view_gl_clear(struct wined3d_unordered_access_view packed = wined3d_format_pack(&format_gl->f, clear_value); data = &packed; } - else if (resource->format_base_flags & WINED3DFMT_FLAG_INTEGER) + else if (resource->format_flags & WINED3DFMT_FLAG_INTEGER) { gl_format = GL_RGBA_INTEGER; gl_type = GL_UNSIGNED_INT; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 4db66611669..a444dc6620e 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4353,7 +4353,7 @@ struct wined3d_resource enum wined3d_resource_type type; enum wined3d_gl_resource_type gl_type; const struct wined3d_format *format; - unsigned int format_base_flags; + unsigned int format_flags; unsigned int format_caps; enum wined3d_multisample_type multisample_type; UINT multisample_quality; @@ -5338,7 +5338,7 @@ struct wined3d_rendertarget_view const struct wined3d_parent_ops *parent_ops;
const struct wined3d_format *format; - unsigned int format_base_flags; + unsigned int format_flags; unsigned int format_caps; unsigned int sub_resource_idx; unsigned int layer_count; @@ -6190,7 +6190,7 @@ struct wined3d_format
UINT conv_byte_count; DWORD multisample_types; - unsigned int base_flags; + unsigned int flags; unsigned int caps[WINED3D_GL_RES_TYPE_COUNT]; float depth_bias_scale; struct wined3d_rational height_scale;