Module: wine Branch: master Commit: 58c680bacec189a46597d6f0b8f14f7061b423f2 URL: https://gitlab.winehq.org/wine/wine/-/commit/58c680bacec189a46597d6f0b8f14f7...
Author: Zebediah Figura zfigura@codeweavers.com Date: Fri Mar 15 16:33:18 2024 -0500
wined3d: Recreate buffer textures when renaming the existing buffer storage.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56438
---
dlls/d3d11/tests/d3d11.c | 2 +- dlls/wined3d/view.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 613dac57f5f..24fdb32b829 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -36148,7 +36148,7 @@ static void test_high_resource_count(void) ID3D11DeviceContext_Unmap(context, (ID3D11Resource *)buffers[1], 0); draw_quad(&test_context);
- todo_wine_if (!damavand) check_texture_vec4(rt, &expect2, 0); + check_texture_vec4(rt, &expect2, 0);
ID3D11Texture2D_Release(rt); ID3D11RenderTargetView_Release(rtv); diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index a829a3b5ca2..09d1bfd32a1 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -269,7 +269,17 @@ static void create_buffer_texture(struct wined3d_gl_view *view, struct wined3d_c
view->target = GL_TEXTURE_BUFFER; if (!view->name) + { gl_info->gl_ops.gl.p_glGenTextures(1, &view->name); + } + else if (gl_info->supported[ARB_BINDLESS_TEXTURE]) + { + /* If we already bound this view to a shader, we acquired a handle to + * it, and it's now immutable. This means we can't bind a new buffer + * storage to it, so recreate the texture. */ + gl_info->gl_ops.gl.p_glDeleteTextures(1, &view->name); + gl_info->gl_ops.gl.p_glGenTextures(1, &view->name); + }
wined3d_context_gl_bind_texture(context_gl, GL_TEXTURE_BUFFER, view->name); if (gl_info->supported[ARB_TEXTURE_BUFFER_RANGE])