Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/wined3d/directx.c | 1 - dlls/wined3d/utils.c | 13 ++++++------- dlls/wined3d/wined3d_private.h | 1 - 3 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index ab6a452a2e8..36005064284 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -2513,7 +2513,6 @@ static BOOL wined3d_adapter_init(struct wined3d_adapter *adapter, unsigned int o adapter->luid.HighPart, adapter->luid.LowPart, adapter);
adapter->formats = NULL; - adapter->format_count = 0;
if (wined3d_creation_flags & WINED3D_NO3D) return wined3d_adapter_no3d_init(adapter); diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index db27270ba8a..9ffce6cc602 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -1993,8 +1993,7 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter) struct wined3d_format *format; unsigned int i, j;
- adapter->format_count = WINED3D_FORMAT_COUNT; - if (!(adapter->formats = heap_calloc(adapter->format_count + if (!(adapter->formats = heap_calloc(WINED3D_FORMAT_COUNT + ARRAY_SIZE(typeless_depth_stencil_formats), sizeof(*adapter->formats)))) { ERR("Failed to allocate memory.\n"); @@ -2728,7 +2727,7 @@ static void init_format_fbo_compat_info(const struct wined3d_adapter *adapter,
if (gl_info->supported[ARB_INTERNALFORMAT_QUERY2]) { - for (i = 0; i < adapter->format_count; ++i) + for (i = 0; i < WINED3D_FORMAT_COUNT; ++i) { BOOL fallback_fmt_used = FALSE, regular_fmt_used = FALSE; struct wined3d_format *format = &adapter->formats[i]; @@ -2842,7 +2841,7 @@ static void init_format_fbo_compat_info(const struct wined3d_adapter *adapter, gl_info->gl_ops.gl.p_glReadBuffer(GL_COLOR_ATTACHMENT0); }
- for (i = 0; i < adapter->format_count; ++i) + for (i = 0; i < WINED3D_FORMAT_COUNT; ++i) { struct wined3d_format *format = &adapter->formats[i];
@@ -3621,7 +3620,7 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_ format_set_flag(format, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET); }
- for (i = 0; i < adapter->format_count; ++i) + for (i = 0; i < WINED3D_FORMAT_COUNT; ++i) { struct wined3d_format *format = &adapter->formats[i];
@@ -3756,7 +3755,7 @@ static void init_format_gen_mipmap_info(const struct wined3d_adapter *adapter, if (!gl_info->fbo_ops.glGenerateMipmap) return;
- for (i = 0; i < adapter->format_count; ++i) + for (i = 0; i < WINED3D_FORMAT_COUNT; ++i) { struct wined3d_format *format = &adapter->formats[i];
@@ -3913,7 +3912,7 @@ static void init_format_depth_bias_scale(struct wined3d_adapter *adapter, const struct wined3d_d3d_info *d3d_info = &adapter->d3d_info; unsigned int i;
- for (i = 0; i < adapter->format_count; ++i) + for (i = 0; i < WINED3D_FORMAT_COUNT; ++i) { struct wined3d_format *format = &adapter->formats[i];
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index b96d3a53c09..69eda3ebb64 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2665,7 +2665,6 @@ struct wined3d_adapter LUID luid;
struct wined3d_format *formats; - unsigned int format_count;
const struct wined3d_vertex_pipe_ops *vertex_pipe; const struct fragment_pipeline *fragment_pipe;