Rebase against bd10252332491bc39100f230540b14d59f02255d.

This commit is contained in:
Alistair Leslie-Hughes 2023-08-25 08:28:32 +10:00
parent 520ac85b6f
commit cdcdde3d46
2 changed files with 23 additions and 29 deletions

View File

@ -1,4 +1,4 @@
From 83f5eda40173f8d4d782179449814f6eeb153f7b Mon Sep 17 00:00:00 2001
From b46740e4f8f629b7c07b711eb46d366ebc9614ce Mon Sep 17 00:00:00 2001
From: Andrew Wesie <awesie@gmail.com>
Date: Tue, 2 Oct 2018 23:28:01 -0500
Subject: [PATCH] wined3d: Use bindless textures for GLSL shaders.
@ -15,11 +15,11 @@ Signed-off-by: Andrew Wesie <awesie@gmail.com>
dlls/wined3d/texture.c | 18 +++--
dlls/wined3d/view.c | 30 ++++++++
dlls/wined3d/wined3d_gl.h | 19 +++++
dlls/wined3d/wined3d_private.h | 7 ++
10 files changed, 261 insertions(+), 7 deletions(-)
dlls/wined3d/wined3d_private.h | 8 +++
10 files changed, 262 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c
index 8adfabaa590..af543ee1219 100644
index 943a1484c0e..ea161e4a0cf 100644
--- a/dlls/wined3d/adapter_gl.c
+++ b/dlls/wined3d/adapter_gl.c
@@ -56,6 +56,7 @@ static const struct wined3d_extension_map gl_extension_map[] =
@ -30,7 +30,7 @@ index 8adfabaa590..af543ee1219 100644
{"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 },
@@ -2122,6 +2123,11 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info)
@@ -2121,6 +2122,11 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info)
/* GL_ARB_base_instance */
USE_GL_FUNC(glDrawArraysInstancedBaseInstance)
USE_GL_FUNC(glDrawElementsInstancedBaseVertexBaseInstance)
@ -157,7 +157,7 @@ index 8501fcbbaf5..330338f8597 100644
}
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index a1a9c5d387c..52ea047d762 100644
index 9908f68a151..594fa68b704 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
@ -274,7 +274,7 @@ index a1a9c5d387c..52ea047d762 100644
/* 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)
@@ -2443,7 +2550,9 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c
@@ -2430,7 +2537,9 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c
break;
}
@ -285,7 +285,7 @@ index a1a9c5d387c..52ea047d762 100644
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);
@@ -7620,6 +7729,8 @@ static void shader_glsl_generate_colour_key_test(struct wined3d_string_buffer *b
@@ -7512,6 +7621,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)
{
@ -294,7 +294,7 @@ index a1a9c5d387c..52ea047d762 100644
if (gl_info->supported[ARB_CULL_DISTANCE])
shader_addline(buffer, "#extension GL_ARB_cull_distance : enable\n");
if (gl_info->supported[ARB_GPU_SHADER5])
@@ -11631,6 +11742,7 @@ const struct wined3d_shader_backend_ops glsl_shader_backend =
@@ -11523,6 +11634,7 @@ const struct wined3d_shader_backend_ops glsl_shader_backend =
shader_glsl_get_caps,
shader_glsl_color_fixup_supported,
shader_glsl_has_ffp_proj_control,
@ -328,7 +328,7 @@ index 96b47db9ed6..3cb7feeddda 100644
};
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 664e012cfe5..9e81e4085b1 100644
index 6b5d9eaf510..97f8d7c7220 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1260,7 +1260,7 @@ void wined3d_gl_texture_swizzle_from_color_fixup(GLint swizzle[4], struct color_
@ -419,10 +419,10 @@ index 675cc186b36..4632b136c28 100644
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 4e62a456526..39af467d677 100644
index e794a85ef21..c38d0ab5411 100644
--- a/dlls/wined3d/wined3d_gl.h
+++ b/dlls/wined3d/wined3d_gl.h
@@ -48,6 +48,7 @@ enum wined3d_gl_extension
@@ -50,6 +50,7 @@ enum wined3d_gl_extension
APPLE_YCBCR_422,
/* ARB */
ARB_BASE_INSTANCE,
@ -430,7 +430,7 @@ index 4e62a456526..39af467d677 100644
ARB_BLEND_FUNC_EXTENDED,
ARB_BUFFER_STORAGE,
ARB_CLEAR_BUFFER_OBJECT,
@@ -828,6 +829,21 @@ struct wined3d_dummy_textures
@@ -854,6 +855,21 @@ struct wined3d_dummy_textures
GLuint tex_2d_ms_array;
};
@ -452,7 +452,7 @@ index 4e62a456526..39af467d677 100644
struct wined3d_device_gl
{
struct wined3d_device d;
@@ -835,6 +851,9 @@ struct wined3d_device_gl
@@ -861,6 +877,9 @@ struct wined3d_device_gl
/* Textures for when no other textures are bound. */
struct wined3d_dummy_textures dummy_textures;
@ -463,7 +463,7 @@ index 4e62a456526..39af467d677 100644
struct wined3d_allocator allocator;
uint64_t completed_fence_id;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index e52754f6625..fefd8753af3 100644
index 7a4766b5736..3c9eb82b2fd 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -95,6 +95,7 @@ static inline const char *wined3d_get_line(const char **ptr, const char *end)
@ -474,7 +474,7 @@ index e52754f6625..fefd8753af3 100644
struct wined3d_gl_info;
struct wined3d_state;
struct wined3d_swapchain_gl;
@@ -1553,6 +1554,8 @@ struct wined3d_shader_backend_ops
@@ -1551,6 +1552,8 @@ struct wined3d_shader_backend_ops
void (*shader_get_caps)(const struct wined3d_adapter *adapter, struct shader_caps *caps);
BOOL (*shader_color_fixup_supported)(struct color_fixup_desc fixup);
BOOL (*shader_has_ffp_proj_control)(void *shader_priv);
@ -483,24 +483,18 @@ index e52754f6625..fefd8753af3 100644
uint64_t (*shader_compile)(struct wined3d_context *context, const struct wined3d_shader_desc *shader_desc,
enum wined3d_shader_type shader_type);
};
@@ -3504,6 +3507,8 @@ void wined3d_texture_download_from_texture(struct wined3d_texture *dst_texture,
void wined3d_texture_get_bo_address(const struct wined3d_texture *texture,
unsigned int sub_resource_idx, struct wined3d_bo_address *data, uint32_t location) DECLSPEC_HIDDEN;
GLenum wined3d_texture_get_gl_buffer(const struct wined3d_texture *texture) DECLSPEC_HIDDEN;
@@ -4008,6 +4011,11 @@ void wined3d_shader_resource_view_cleanup(struct wined3d_shader_resource_view *v
#include "wined3d_gl.h"
+GLuint wined3d_texture_get_name(struct wined3d_texture_gl *texture_gl,
+ struct wined3d_context_gl *context_gl, BOOL srgb) DECLSPEC_HIDDEN;
void wined3d_texture_invalidate_location(struct wined3d_texture *texture,
unsigned int sub_resource_idx, uint32_t location) DECLSPEC_HIDDEN;
void wined3d_texture_load(struct wined3d_texture *texture,
@@ -4210,6 +4215,8 @@ HRESULT wined3d_shader_resource_view_gl_init(struct wined3d_shader_resource_view
void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
void wined3d_shader_resource_view_gl_update(struct wined3d_shader_resource_view_gl *srv_gl,
struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN;
+GLuint64 wined3d_shader_resource_view_handle(struct wined3d_shader_resource_view *view,
+ struct wined3d_sampler *sampler, struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN;
+
struct wined3d_unordered_access_view
{
LONG refcount;
--
2.40.1

View File

@ -1 +1 @@
707d299da62414e6582c5c0c8cfec0cd43c3ac97
bd10252332491bc39100f230540b14d59f02255d