wined3d: Recreate buffer textures when renaming the existing buffer storage.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56438
This commit is contained in:
Zebediah Figura 2024-03-15 16:33:18 -05:00 committed by Alexandre Julliard
parent 4e13c72f70
commit 58c680bace
2 changed files with 11 additions and 1 deletions

View file

@ -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);

View file

@ -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])