From 52a0e36aee9a5648fe5bbdf33ab2d251806f4803 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Fri, 29 Dec 2023 19:09:15 -0600 Subject: [PATCH] wined3d: Avoid WARN() when failing to allocate a GL BO without a context. This is normal and expected, and only a concern for performance. Avoid polluting warn+d3d logs. --- dlls/wined3d/adapter_gl.c | 1 - dlls/wined3d/device.c | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index 1d622c298cb..de4729a56fc 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -4657,7 +4657,6 @@ static bool adapter_gl_alloc_bo(struct wined3d_device *device, struct wined3d_re if (!(wined3d_device_gl_create_bo(device_gl, NULL, size, binding, usage, coherent, flags, bo_gl))) { - WARN("Failed to create OpenGL buffer.\n"); heap_free(bo_gl); return false; } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 201b76eab28..e529a8fd2d0 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1130,6 +1130,8 @@ bool wined3d_device_gl_create_bo(struct wined3d_device_gl *device_gl, struct win { if ((memory = wined3d_device_gl_allocate_memory(device_gl, context_gl, memory_type_idx, size, &id))) buffer_offset = memory->offset; + else if (!context_gl) + WARN_(d3d_perf)("Failed to suballocate buffer from the client thread.\n"); } else if (context_gl) { @@ -1139,7 +1141,8 @@ bool wined3d_device_gl_create_bo(struct wined3d_device_gl *device_gl, struct win if (!id) { - WARN("Failed to allocate buffer.\n"); + if (context_gl) + WARN("Failed to allocate buffer.\n"); return false; } }