From 6a314e5994fd5701ef1142030071ea6e4cdc9b40 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Thu, 14 Mar 2024 17:50:23 -0500 Subject: [PATCH] Rebase against 65864f92f22f6d4668c1c06ed6ef3fe49bfdcfa7. --- ...exe-when-registry-lookup-fails-first.patch | 28 - .../shell32-registry-lookup-app/definition | 1 - ...e-bindless-textures-for-GLSL-shaders.patch | 497 ------------------ patches/wined3d-bindless-texture/definition | 12 - staging/upstream-commit | 2 +- 5 files changed, 1 insertion(+), 539 deletions(-) delete mode 100644 patches/shell32-registry-lookup-app/0001-shell32-Append-.exe-when-registry-lookup-fails-first.patch delete mode 100644 patches/shell32-registry-lookup-app/definition delete mode 100644 patches/wined3d-bindless-texture/0001-wined3d-Use-bindless-textures-for-GLSL-shaders.patch delete mode 100644 patches/wined3d-bindless-texture/definition diff --git a/patches/shell32-registry-lookup-app/0001-shell32-Append-.exe-when-registry-lookup-fails-first.patch b/patches/shell32-registry-lookup-app/0001-shell32-Append-.exe-when-registry-lookup-fails-first.patch deleted file mode 100644 index d4c422e1..00000000 --- a/patches/shell32-registry-lookup-app/0001-shell32-Append-.exe-when-registry-lookup-fails-first.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 79fbd3342a3e5c7cb2198bf2f0412db1df4b1fce Mon Sep 17 00:00:00 2001 -From: Louis Lenders -Date: Thu, 4 Nov 2021 21:01:24 +1100 -Subject: [PATCH] shell32: Append .exe when registry lookup fails first time - ---- - dlls/shell32/shlexec.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c -index 069b96a51a1..5033330b60c 100644 ---- a/dlls/shell32/shlexec.c -+++ b/dlls/shell32/shlexec.c -@@ -459,7 +459,10 @@ static BOOL SHELL_TryAppPathW( LPCWSTR szName, LPWSTR lpResult, WCHAR **env) - - wcscat(buffer, szName); - res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, buffer, 0, KEY_READ, &hkApp); -- if (res) goto end; -+ if (res) -+ res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, lstrcatW(buffer, L".exe"), 0, KEY_READ, &hkApp); -+ if (res) -+ goto end; - - len = MAX_PATH*sizeof(WCHAR); - res = RegQueryValueW(hkApp, NULL, lpResult, &len); --- -2.42.0 - diff --git a/patches/shell32-registry-lookup-app/definition b/patches/shell32-registry-lookup-app/definition deleted file mode 100644 index e01eea19..00000000 --- a/patches/shell32-registry-lookup-app/definition +++ /dev/null @@ -1 +0,0 @@ -Fixes: [51957] Append .exe, if registry lookup fails first. diff --git a/patches/wined3d-bindless-texture/0001-wined3d-Use-bindless-textures-for-GLSL-shaders.patch b/patches/wined3d-bindless-texture/0001-wined3d-Use-bindless-textures-for-GLSL-shaders.patch deleted file mode 100644 index 162ff820..00000000 --- a/patches/wined3d-bindless-texture/0001-wined3d-Use-bindless-textures-for-GLSL-shaders.patch +++ /dev/null @@ -1,497 +0,0 @@ -From 6885ae6e479fa615c583266b38a5fc36fb293a32 Mon Sep 17 00:00:00 2001 -From: Andrew Wesie -Date: Tue, 2 Oct 2018 23:28:01 -0500 -Subject: [PATCH] wined3d: Use bindless textures for GLSL shaders. - -Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=44514 -Signed-off-by: Andrew Wesie ---- - dlls/wined3d/adapter_gl.c | 6 ++ - dlls/wined3d/arb_program_shader.c | 7 ++ - dlls/wined3d/context_gl.c | 6 ++ - dlls/wined3d/device.c | 54 ++++++++++++++ - dlls/wined3d/glsl_shader.c | 114 +++++++++++++++++++++++++++++- - dlls/wined3d/shader.c | 7 ++ - dlls/wined3d/texture.c | 18 +++-- - dlls/wined3d/view.c | 29 ++++++++ - dlls/wined3d/wined3d_gl.h | 23 ++++++ - dlls/wined3d/wined3d_private.h | 2 + - 10 files changed, 259 insertions(+), 7 deletions(-) - -diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c -index 7ae3143a891..6c5618f5ca1 100644 ---- a/dlls/wined3d/adapter_gl.c -+++ b/dlls/wined3d/adapter_gl.c -@@ -57,6 +57,7 @@ static const struct wined3d_extension_map gl_extension_map[] = - - /* ARB */ - {"GL_ARB_base_instance", ARB_BASE_INSTANCE }, -+ {"GL_ARB_bindless_texture", ARB_BINDLESS_TEXTURE }, - {"GL_ARB_blend_func_extended", ARB_BLEND_FUNC_EXTENDED }, - {"GL_ARB_buffer_storage", ARB_BUFFER_STORAGE }, - {"GL_ARB_clear_buffer_object", ARB_CLEAR_BUFFER_OBJECT }, -@@ -2114,6 +2115,11 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info) - /* GL_ARB_base_instance */ - USE_GL_FUNC(glDrawArraysInstancedBaseInstance) - USE_GL_FUNC(glDrawElementsInstancedBaseVertexBaseInstance) -+ /* GL_ARB_bindless_texture */ -+ USE_GL_FUNC(glGetTextureSamplerHandleARB) -+ USE_GL_FUNC(glMakeTextureHandleNonResidentARB) -+ USE_GL_FUNC(glMakeTextureHandleResidentARB) -+ USE_GL_FUNC(glUniformHandleui64ARB) - /* GL_ARB_blend_func_extended */ - USE_GL_FUNC(glBindFragDataLocationIndexed) - USE_GL_FUNC(glGetFragDataIndex) -diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c -index ee693924a24..46fb221b344 100644 ---- a/dlls/wined3d/arb_program_shader.c -+++ b/dlls/wined3d/arb_program_shader.c -@@ -5691,6 +5691,12 @@ static void shader_arb_handle_instruction(const struct wined3d_shader_instructio - shader_arb_add_instruction_modifiers(ins); - } - -+void shader_arb_resource_view_handle(void *shader_priv, struct wined3d_context *context, -+ const struct wined3d_state *state, const struct wined3d_shader *shader) -+{ -+ ERR("Not implemented.\n"); -+} -+ - static void shader_arb_precompile(void *shader_priv, struct wined3d_shader *shader) {} - - static uint64_t shader_arb_shader_compile(struct wined3d_context *context, const struct wined3d_shader_desc *shader_desc, -@@ -5718,6 +5724,7 @@ const struct wined3d_shader_backend_ops arb_program_shader_backend = - shader_arb_init_context_state, - shader_arb_get_caps, - shader_arb_color_fixup_supported, -+ shader_arb_resource_view_handle, - shader_arb_shader_compile, - }; - -diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c -index 2c319132164..dd58ba12286 100644 ---- a/dlls/wined3d/context_gl.c -+++ b/dlls/wined3d/context_gl.c -@@ -4027,6 +4027,12 @@ static void wined3d_context_gl_bind_shader_resources(struct wined3d_context_gl * - return; - } - -+ if (device->shader_backend->shader_load_sampler_handles) -+ { -+ device->shader_backend->shader_load_sampler_handles(device->shader_priv, &context_gl->c, state, shader); -+ return; -+ } -+ - tex_unit_map = wined3d_context_gl_get_tex_unit_mapping(context_gl, - &shader->reg_maps.shader_version, &base, &count); - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index aad112d5b9d..d6345ac59e0 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -580,6 +580,59 @@ void wined3d_device_destroy_default_samplers(struct wined3d_device *device) - device->null_sampler = NULL; - } - -+static GLuint64 create_dummy_sampler_handle(struct wined3d_device *device, struct wined3d_context_gl *context_gl, -+ GLuint texture) -+{ -+ const struct wined3d_gl_info *gl_info = context_gl->gl_info; -+ GLuint64 handle; -+ -+ handle = GL_EXTCALL(glGetTextureSamplerHandleARB(texture, wined3d_sampler_gl(device->default_sampler)->name)); -+ GL_EXTCALL(glMakeTextureHandleResidentARB(handle)); -+ checkGLcall("glMakeTextureHandleResidentARB"); -+ return handle; -+} -+ -+/* Context activation is done by the caller. */ -+static void create_dummy_sampler_handles(struct wined3d_device *device, struct wined3d_context_gl *context_gl) -+{ -+ const struct wined3d_gl_info *gl_info = context_gl->gl_info; -+ const struct wined3d_dummy_textures *textures = &wined3d_device_gl(device)->dummy_textures; -+ struct wined3d_dummy_sampler_handles *handles = &wined3d_device_gl(device)->dummy_sampler_handles; -+ -+ if (!gl_info->supported[ARB_BINDLESS_TEXTURE]) -+ return; -+ -+ if (gl_info->supported[ARB_TEXTURE_MULTISAMPLE]) -+ { -+ handles->tex_2d_ms = create_dummy_sampler_handle(device, context_gl, textures->tex_2d_ms); -+ handles->tex_2d_ms_array = create_dummy_sampler_handle(device, context_gl, textures->tex_2d_ms_array); -+ } -+ -+ if (gl_info->supported[ARB_TEXTURE_BUFFER_OBJECT]) -+ handles->tex_buffer = create_dummy_sampler_handle(device, context_gl, textures->tex_buffer); -+ -+ if (gl_info->supported[EXT_TEXTURE_ARRAY]) -+ { -+ handles->tex_2d_array = create_dummy_sampler_handle(device, context_gl, textures->tex_2d_array); -+ handles->tex_1d_array = create_dummy_sampler_handle(device, context_gl, textures->tex_1d_array); -+ } -+ -+ if (gl_info->supported[ARB_TEXTURE_CUBE_MAP_ARRAY]) -+ handles->tex_cube_array = create_dummy_sampler_handle(device, context_gl, textures->tex_cube_array); -+ -+ if (gl_info->supported[ARB_TEXTURE_CUBE_MAP]) -+ handles->tex_cube = create_dummy_sampler_handle(device, context_gl, textures->tex_cube); -+ -+ if (gl_info->supported[EXT_TEXTURE3D]) -+ handles->tex_3d = create_dummy_sampler_handle(device, context_gl, textures->tex_3d); -+ -+ if (gl_info->supported[ARB_TEXTURE_RECTANGLE]) -+ handles->tex_rect = create_dummy_sampler_handle(device, context_gl, textures->tex_rect); -+ -+ handles->tex_2d = create_dummy_sampler_handle(device, context_gl, textures->tex_2d); -+ handles->tex_1d = create_dummy_sampler_handle(device, context_gl, textures->tex_1d); -+} -+ - static bool wined3d_null_image_vk_init(struct wined3d_image_vk *image, struct wined3d_context_vk *context_vk, - VkCommandBuffer vk_command_buffer, VkImageType type, unsigned int layer_count, unsigned int sample_count) - { -@@ -1323,6 +1376,7 @@ void wined3d_device_gl_create_primary_opengl_context_cs(void *object) - - wined3d_device_gl_create_dummy_textures(device_gl, context_gl); - wined3d_device_create_default_samplers(device, context); -+ create_dummy_sampler_handles(device, context_gl); - context_release(context); - } - -diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c -index 4141a39b00f..60fb4e18706 100644 ---- a/dlls/wined3d/glsl_shader.c -+++ b/dlls/wined3d/glsl_shader.c -@@ -730,6 +730,113 @@ static void shader_glsl_append_sampler_binding_qualifier(struct wined3d_string_b - ERR("Unmapped sampler %u.\n", sampler_idx); - } - -+static BOOL shader_glsl_use_bindless_texture(const struct wined3d_gl_info *gl_info, -+ unsigned int sampler_idx, const struct wined3d_shader_resource_info *resource_info) -+{ -+ return gl_info->supported[ARB_BINDLESS_TEXTURE] -+ && shader_glsl_use_layout_binding_qualifier(gl_info) -+ && sampler_idx >= 16 -+ && resource_info->type != WINED3D_SHADER_RESOURCE_BUFFER; -+} -+ -+static GLuint64 shader_glsl_dummy_sampler_handle(const struct wined3d_context *context, -+ enum wined3d_shader_resource_type type) -+{ -+ const struct wined3d_device_gl *device = wined3d_device_gl(context->device); -+ -+ switch (type) -+ { -+ case WINED3D_SHADER_RESOURCE_BUFFER: -+ return device->dummy_sampler_handles.tex_buffer; -+ case WINED3D_SHADER_RESOURCE_TEXTURE_1D: -+ return device->dummy_sampler_handles.tex_1d; -+ case WINED3D_SHADER_RESOURCE_TEXTURE_2D: -+ return device->dummy_sampler_handles.tex_2d; -+ case WINED3D_SHADER_RESOURCE_TEXTURE_3D: -+ return device->dummy_sampler_handles.tex_3d; -+ case WINED3D_SHADER_RESOURCE_TEXTURE_CUBE: -+ return device->dummy_sampler_handles.tex_cube; -+ case WINED3D_SHADER_RESOURCE_TEXTURE_1DARRAY: -+ return device->dummy_sampler_handles.tex_1d_array; -+ case WINED3D_SHADER_RESOURCE_TEXTURE_2DARRAY: -+ return device->dummy_sampler_handles.tex_2d_array; -+ case WINED3D_SHADER_RESOURCE_TEXTURE_CUBEARRAY: -+ return device->dummy_sampler_handles.tex_cube_array; -+ case WINED3D_SHADER_RESOURCE_TEXTURE_2DMS: -+ return device->dummy_sampler_handles.tex_2d_ms; -+ case WINED3D_SHADER_RESOURCE_TEXTURE_2DMSARRAY: -+ return device->dummy_sampler_handles.tex_2d_array; -+ default: -+ FIXME("Unhandled resource type %#x.\n", type); -+ return 0; -+ } -+} -+ -+static void shader_glsl_load_sampler_handles(void *shader_priv, struct wined3d_context *context, -+ const struct wined3d_state *state, const struct wined3d_shader *shader) -+{ -+ struct wined3d_context_gl *context_gl = wined3d_context_gl(context); -+ const struct glsl_context_data *ctx_data = context->shader_backend_data; -+ const struct wined3d_device *device = context->device; -+ const struct wined3d_gl_info *gl_info = context_gl->gl_info; -+ struct shader_glsl_priv *priv = shader_priv; -+ struct wined3d_string_buffer *sampler_name = string_buffer_get(&priv->string_buffers); -+ enum wined3d_shader_type shader_type = shader->reg_maps.shader_version.type; -+ const char *prefix = shader_glsl_get_prefix(shader_type); -+ -+ struct wined3d_shader_sampler_map_entry *entry; -+ struct wined3d_shader_resource_view *view; -+ struct wined3d_sampler *sampler; -+ unsigned int bind_idx, i; -+ GLint name_loc; -+ -+ for (i = 0; i < shader->reg_maps.sampler_map.count; ++i) -+ { -+ entry = &shader->reg_maps.sampler_map.entries[i]; -+ bind_idx = shader_glsl_map_tex_unit(context, &shader->reg_maps.shader_version, entry->bind_idx); -+ if (entry->sampler_idx == WINED3D_SAMPLER_DEFAULT) -+ sampler = device->default_sampler; -+ else if (!(sampler = state->sampler[shader_type][entry->sampler_idx])) -+ sampler = device->null_sampler; -+ -+ string_buffer_sprintf(sampler_name, "%s_sampler%u", prefix, entry->bind_idx); -+ name_loc = GL_EXTCALL(glGetUniformLocation(ctx_data->glsl_program ? ctx_data->glsl_program->id : 0, sampler_name->buffer)); -+ if (name_loc == -1) -+ { -+ ERR("No uniform location at %u, %s\n", i, sampler_name->buffer); -+ continue; -+ } -+ -+ if (!(view = state->shader_resource_view[shader_type][entry->resource_idx])) -+ WARN("No resource view bound at index %u, %u.\n", shader_type, entry->resource_idx); -+ -+ if (shader_glsl_use_bindless_texture(gl_info, i, &shader->reg_maps.resource_info[entry->resource_idx])) -+ { -+ GLuint64 handle; -+ if (view) -+ { -+ handle = wined3d_shader_resource_view_gl_handle(wined3d_shader_resource_view_gl(view), sampler, context_gl); -+ } -+ else -+ { -+ handle = shader_glsl_dummy_sampler_handle(context, -+ shader->reg_maps.resource_info[entry->resource_idx].type); -+ } -+ GL_EXTCALL(glUniformHandleui64ARB(name_loc, handle)); -+ checkGLcall("glUniformHandleui64ARB"); -+ } -+ else if (bind_idx == WINED3D_UNMAPPED_STAGE || bind_idx >= gl_info->limits.combined_samplers) -+ { -+ ERR("Trying to load sampler %s on unsupported unit %u.\n", sampler_name->buffer, bind_idx); -+ } -+ else if (view) -+ { -+ wined3d_shader_resource_view_gl_bind(wined3d_shader_resource_view_gl(view), bind_idx, wined3d_sampler_gl(sampler), context_gl); -+ } -+ } -+ string_buffer_release(&priv->string_buffers, sampler_name); -+} -+ - /* Context activation is done by the caller. */ - static void shader_glsl_load_samplers(const struct wined3d_context *context, - struct shader_glsl_priv *priv, GLuint program_id, const struct wined3d_shader_reg_maps *reg_maps) -@@ -2412,7 +2519,9 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c - break; - } - -- if (shader_glsl_use_layout_binding_qualifier(gl_info)) -+ if (shader_glsl_use_bindless_texture(gl_info, i, ®_maps->resource_info[entry->resource_idx])) -+ shader_addline(buffer, "layout(bindless_sampler)\n"); -+ else if (shader_glsl_use_layout_binding_qualifier(gl_info)) - shader_glsl_append_sampler_binding_qualifier(buffer, &context_gl->c, version, entry->bind_idx); - shader_addline(buffer, "uniform %s%s %s_sampler%u;\n", - sampler_type_prefix, sampler_type, prefix, entry->bind_idx); -@@ -7546,6 +7655,8 @@ static void shader_glsl_generate_colour_key_test(struct wined3d_string_buffer *b - static void shader_glsl_enable_extensions(struct wined3d_string_buffer *buffer, - const struct wined3d_gl_info *gl_info) - { -+ if (gl_info->supported[ARB_BINDLESS_TEXTURE]) -+ shader_addline(buffer, "#extension GL_ARB_bindless_texture : enable\n"); - if (gl_info->supported[ARB_CULL_DISTANCE]) - shader_addline(buffer, "#extension GL_ARB_cull_distance : enable\n"); - if (gl_info->supported[ARB_GPU_SHADER5]) -@@ -11557,6 +11668,7 @@ const struct wined3d_shader_backend_ops glsl_shader_backend = - shader_glsl_init_context_state, - shader_glsl_get_caps, - shader_glsl_color_fixup_supported, -+ shader_glsl_load_sampler_handles, - shader_glsl_shader_compile, - }; - -diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c -index 91105a43a91..6b973531bde 100644 ---- a/dlls/wined3d/shader.c -+++ b/dlls/wined3d/shader.c -@@ -2026,6 +2026,12 @@ static BOOL shader_none_color_fixup_supported(struct color_fixup_desc fixup) - return TRUE; - } - -+void shader_none_resource_view_handle(void *shader_priv, struct wined3d_context *context, -+ const struct wined3d_state *state, const struct wined3d_shader *shader) -+{ -+ ERR("Not implemented.\n"); -+} -+ - static uint64_t shader_none_shader_compile(struct wined3d_context *context, const struct wined3d_shader_desc *shader_desc, - enum wined3d_shader_type shader_type) - { -@@ -2050,6 +2056,7 @@ const struct wined3d_shader_backend_ops none_shader_backend = - shader_none_init_context_state, - shader_none_get_caps, - shader_none_color_fixup_supported, -+ shader_none_resource_view_handle, - shader_none_shader_compile, - }; - -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 8a7f9455bb0..56b134af838 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -1296,7 +1296,7 @@ void wined3d_gl_texture_swizzle_from_color_fixup(GLint swizzle[4], struct color_ - } - - /* Context activation is done by the caller. */ --void wined3d_texture_gl_bind(struct wined3d_texture_gl *texture_gl, -+GLuint wined3d_texture_gl_get_bindless_name(struct wined3d_texture_gl *texture_gl, - struct wined3d_context_gl *context_gl, BOOL srgb) - { - const struct wined3d_format *format = texture_gl->t.resource.format; -@@ -1320,10 +1320,7 @@ void wined3d_texture_gl_bind(struct wined3d_texture_gl *texture_gl, - target = texture_gl->target; - - if (gl_tex->name) -- { -- wined3d_context_gl_bind_texture(context_gl, target, gl_tex->name); -- return; -- } -+ return gl_tex->name; - - gl_info->gl_ops.gl.p_glGenTextures(1, &gl_tex->name); - checkGLcall("glGenTextures"); -@@ -1332,7 +1329,7 @@ void wined3d_texture_gl_bind(struct wined3d_texture_gl *texture_gl, - if (!gl_tex->name) - { - ERR("Failed to generate a texture name.\n"); -- return; -+ return 0; - } - - /* Initialise the state of the texture object to the OpenGL defaults, not -@@ -1416,6 +1413,15 @@ void wined3d_texture_gl_bind(struct wined3d_texture_gl *texture_gl, - gl_info->gl_ops.gl.p_glTexParameteriv(target, GL_TEXTURE_SWIZZLE_RGBA, swizzle); - checkGLcall("set format swizzle"); - } -+ -+ return gl_tex->name; -+} -+ -+/* Context activation is done by the caller. */ -+void wined3d_texture_gl_bind(struct wined3d_texture_gl *texture_gl, -+ struct wined3d_context_gl *context_gl, BOOL srgb) -+{ -+ wined3d_context_gl_bind_texture(context_gl, texture_gl->target, wined3d_texture_gl_get_bindless_name(texture_gl, context_gl, srgb)); - } - - /* Context activation is done by the caller. */ -diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c -index c86501c118a..4a46654a09e 100644 ---- a/dlls/wined3d/view.c -+++ b/dlls/wined3d/view.c -@@ -1311,6 +1311,35 @@ void wined3d_shader_resource_view_gl_bind(struct wined3d_shader_resource_view_gl - context_gl->c.constant_update_mask |= WINED3D_SHADER_CONST_PS_NP2_FIXUP; - } - -+GLuint64 wined3d_shader_resource_view_gl_handle(struct wined3d_shader_resource_view_gl *view_gl, -+ struct wined3d_sampler *sampler, struct wined3d_context_gl *context_gl) -+{ -+ const struct wined3d_gl_info *gl_info = context_gl->gl_info; -+ GLuint name; -+ GLuint64 handle; -+ -+ if (view_gl->gl_view.name) -+ { -+ name = view_gl->gl_view.name; -+ } -+ else if (view_gl->v.resource->type == WINED3D_RTYPE_BUFFER) -+ { -+ FIXME("Buffer shader resources not supported.\n"); -+ return 0; -+ } -+ else -+ { -+ struct wined3d_texture_gl *texture_gl = wined3d_texture_gl(wined3d_texture_from_resource(view_gl->v.resource)); -+ name = wined3d_texture_gl_get_bindless_name(texture_gl, context_gl, FALSE); -+ } -+ -+ handle = GL_EXTCALL(glGetTextureSamplerHandleARB(name, wined3d_sampler_gl(sampler)->name)); -+ checkGLcall("glGetTextureSamplerHandleARB"); -+ GL_EXTCALL(glMakeTextureHandleResidentARB(handle)); -+ checkGLcall("glMakeTextureHandleResidentARB"); -+ return handle; -+} -+ - /* Context activation is done by the caller. */ - static void shader_resource_view_gl_bind_and_dirtify(struct wined3d_shader_resource_view_gl *view_gl, - struct wined3d_context_gl *context_gl) -diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h -index dc6901b8da1..ee9f8601bdc 100644 ---- a/dlls/wined3d/wined3d_gl.h -+++ b/dlls/wined3d/wined3d_gl.h -@@ -51,6 +51,7 @@ enum wined3d_gl_extension - APPLE_YCBCR_422, - /* ARB */ - ARB_BASE_INSTANCE, -+ ARB_BINDLESS_TEXTURE, - ARB_BLEND_FUNC_EXTENDED, - ARB_BUFFER_STORAGE, - ARB_CLEAR_BUFFER_OBJECT, -@@ -861,6 +862,21 @@ struct wined3d_dummy_textures - GLuint tex_2d_ms_array; - }; - -+struct wined3d_dummy_sampler_handles -+{ -+ GLuint64 tex_1d; -+ GLuint64 tex_2d; -+ GLuint64 tex_rect; -+ GLuint64 tex_3d; -+ GLuint64 tex_cube; -+ GLuint64 tex_cube_array; -+ GLuint64 tex_1d_array; -+ GLuint64 tex_2d_array; -+ GLuint64 tex_buffer; -+ GLuint64 tex_2d_ms; -+ GLuint64 tex_2d_ms_array; -+}; -+ - struct wined3d_device_gl - { - struct wined3d_device d; -@@ -868,6 +884,9 @@ struct wined3d_device_gl - /* Textures for when no other textures are bound. */ - struct wined3d_dummy_textures dummy_textures; - -+ /* Texture sampler handles for when no texture is mapped */ -+ struct wined3d_dummy_sampler_handles dummy_sampler_handles; -+ - CRITICAL_SECTION allocator_cs; - struct wined3d_allocator allocator; - uint64_t completed_fence_id; -@@ -1037,6 +1056,8 @@ void wined3d_texture_gl_apply_sampler_desc(struct wined3d_texture_gl *texture_gl - void wined3d_texture_gl_bind(struct wined3d_texture_gl *texture_gl, struct wined3d_context_gl *context_gl, BOOL srgb); - void wined3d_texture_gl_bind_and_dirtify(struct wined3d_texture_gl *texture_gl, - struct wined3d_context_gl *context_gl, BOOL srgb); -+GLuint wined3d_texture_gl_get_bindless_name(struct wined3d_texture_gl *texture_gl, -+ struct wined3d_context_gl *context_gl, BOOL srgb); - HRESULT wined3d_texture_gl_init(struct wined3d_texture_gl *texture_gl, struct wined3d_device *device, - const struct wined3d_resource_desc *desc, unsigned int layer_count, unsigned int level_count, - uint32_t flags, void *parent, const struct wined3d_parent_ops *parent_ops); -@@ -1114,6 +1135,8 @@ void wined3d_shader_resource_view_gl_bind(struct wined3d_shader_resource_view_gl - struct wined3d_sampler_gl *sampler_gl, struct wined3d_context_gl *context_gl); - void wined3d_shader_resource_view_gl_generate_mipmap(struct wined3d_shader_resource_view_gl *srv_gl, - struct wined3d_context_gl *context_gl); -+GLuint64 wined3d_shader_resource_view_gl_handle(struct wined3d_shader_resource_view_gl *view_gl, -+ struct wined3d_sampler *sampler, struct wined3d_context_gl *context_gl); - HRESULT wined3d_shader_resource_view_gl_init(struct wined3d_shader_resource_view_gl *view_gl, - const struct wined3d_view_desc *desc, struct wined3d_resource *resource, - void *parent, const struct wined3d_parent_ops *parent_ops); -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 549a2aa7a7a..7573ad46b79 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -1560,6 +1560,8 @@ struct wined3d_shader_backend_ops - void (*shader_init_context_state)(struct wined3d_context *context); - void (*shader_get_caps)(const struct wined3d_adapter *adapter, struct shader_caps *caps); - BOOL (*shader_color_fixup_supported)(struct color_fixup_desc fixup); -+ void (*shader_load_sampler_handles)(void *shader_priv, struct wined3d_context *context, -+ const struct wined3d_state *state, const struct wined3d_shader *shader); - uint64_t (*shader_compile)(struct wined3d_context *context, const struct wined3d_shader_desc *shader_desc, - enum wined3d_shader_type shader_type); - }; --- -2.43.0 - diff --git a/patches/wined3d-bindless-texture/definition b/patches/wined3d-bindless-texture/definition deleted file mode 100644 index 0d846aa9..00000000 --- a/patches/wined3d-bindless-texture/definition +++ /dev/null @@ -1,12 +0,0 @@ -Fixes: [44514] - wined3d: Use bindless textures for GLSL shaders. - -# Games that possible require this -# Elder Scrolls Online -# - -# Games that have reported with issue. -# Deus Ex Invisible War (Reported missing texture) -# Driftmoon (Crash - currntly fixed) -# Airborne Kingdom (Missing textures). -# Crysis 3 -# Assassin's Creed Black Flag diff --git a/staging/upstream-commit b/staging/upstream-commit index f19d3787..e3e6699c 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -174bb7776d3971e1ed91d57a47a7599b14c6eb45 +65864f92f22f6d4668c1c06ed6ef3fe49bfdcfa7