mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
Rebase against 986254d6c17ee1e5fb3aed6effcf2766bf1e787e.
This commit is contained in:
parent
d3d93cfa0d
commit
643f96ec62
@ -51,7 +51,7 @@ usage()
|
||||
# Get the upstream commit sha
|
||||
upstream_commit()
|
||||
{
|
||||
echo "32fb017d4a22be38ca271bf387e466e958601355"
|
||||
echo "986254d6c17ee1e5fb3aed6effcf2766bf1e787e"
|
||||
}
|
||||
|
||||
# Show version information
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 34d8cd36334b26598b18d865a412cfa6ea8c2c37 Mon Sep 17 00:00:00 2001
|
||||
From 13edfeb4deb5766367080ff778d16d94b5afbabc Mon Sep 17 00:00:00 2001
|
||||
From: Paul Gofman <gofmanp@gmail.com>
|
||||
Date: Mon, 25 Feb 2019 13:17:01 +0300
|
||||
Subject: [PATCH] wined3d: Use UBO for vertex shader float constants if
|
||||
@ -16,10 +16,10 @@ Subject: [PATCH] wined3d: Use UBO for vertex shader float constants if
|
||||
8 files changed, 148 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d8/directx.c b/dlls/d3d8/directx.c
|
||||
index 343073f351..2154b49f49 100644
|
||||
index 3818cb79952..f5ae6af08ad 100644
|
||||
--- a/dlls/d3d8/directx.c
|
||||
+++ b/dlls/d3d8/directx.c
|
||||
@@ -470,7 +470,7 @@ BOOL d3d8_init(struct d3d8 *d3d8)
|
||||
@@ -476,7 +476,7 @@ BOOL d3d8_init(struct d3d8 *d3d8)
|
||||
DWORD flags = WINED3D_LEGACY_DEPTH_BIAS | WINED3D_VIDMEM_ACCOUNTING
|
||||
| WINED3D_HANDLE_RESTORE | WINED3D_PIXEL_CENTER_INTEGER
|
||||
| WINED3D_LEGACY_UNBOUND_RESOURCE_COLOR | WINED3D_NO_PRIMITIVE_RESTART
|
||||
@ -29,10 +29,10 @@ index 343073f351..2154b49f49 100644
|
||||
struct wined3d_adapter *wined3d_adapter;
|
||||
|
||||
diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c
|
||||
index d79b32515f..7766fa8b33 100644
|
||||
index a1ebc986226..7ac9e9010ec 100644
|
||||
--- a/dlls/d3d9/directx.c
|
||||
+++ b/dlls/d3d9/directx.c
|
||||
@@ -674,7 +674,7 @@ BOOL d3d9_init(struct d3d9 *d3d9, BOOL extended)
|
||||
@@ -686,7 +686,7 @@ BOOL d3d9_init(struct d3d9 *d3d9, BOOL extended)
|
||||
DWORD flags = WINED3D_PRESENT_CONVERSION | WINED3D_HANDLE_RESTORE | WINED3D_PIXEL_CENTER_INTEGER
|
||||
| WINED3D_SRGB_READ_WRITE_CONTROL | WINED3D_LEGACY_UNBOUND_RESOURCE_COLOR
|
||||
| WINED3D_NO_PRIMITIVE_RESTART | WINED3D_LEGACY_CUBEMAP_FILTERING
|
||||
@ -42,10 +42,10 @@ index d79b32515f..7766fa8b33 100644
|
||||
struct wined3d_adapter *wined3d_adapter;
|
||||
|
||||
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c
|
||||
index 2fd061b74a..078a874e1c 100644
|
||||
index 9328ae3d587..01a9cf990f9 100644
|
||||
--- a/dlls/wined3d/adapter_gl.c
|
||||
+++ b/dlls/wined3d/adapter_gl.c
|
||||
@@ -3144,6 +3144,9 @@ static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info)
|
||||
@@ -3113,6 +3113,9 @@ static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info)
|
||||
gl_info->limits.uniform_blocks[WINED3D_SHADER_TYPE_VERTEX] = min(gl_max, WINED3D_MAX_CBS);
|
||||
TRACE("Max vertex uniform blocks: %u (%d).\n",
|
||||
gl_info->limits.uniform_blocks[WINED3D_SHADER_TYPE_VERTEX], gl_max);
|
||||
@ -56,10 +56,10 @@ index 2fd061b74a..078a874e1c 100644
|
||||
}
|
||||
if (gl_info->supported[ARB_TESSELLATION_SHADER])
|
||||
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
|
||||
index 4a2fbce553..e306694533 100644
|
||||
index adfbf60e726..c68a3ad3d55 100644
|
||||
--- a/dlls/wined3d/glsl_shader.c
|
||||
+++ b/dlls/wined3d/glsl_shader.c
|
||||
@@ -138,6 +138,10 @@ struct shader_glsl_priv
|
||||
@@ -135,6 +135,10 @@ struct shader_glsl_priv
|
||||
unsigned char *stack;
|
||||
UINT next_constant_version;
|
||||
|
||||
@ -70,7 +70,7 @@ index 4a2fbce553..e306694533 100644
|
||||
const struct wined3d_vertex_pipe_ops *vertex_pipe;
|
||||
const struct wined3d_fragment_pipe_ops *fragment_pipe;
|
||||
struct wine_rb_tree ffp_vertex_shaders;
|
||||
@@ -189,6 +193,7 @@ struct glsl_vs_program
|
||||
@@ -186,6 +190,7 @@ struct glsl_vs_program
|
||||
GLint pointsize_l_att_location;
|
||||
GLint pointsize_q_att_location;
|
||||
GLint clip_planes_location;
|
||||
@ -78,7 +78,7 @@ index 4a2fbce553..e306694533 100644
|
||||
};
|
||||
|
||||
struct glsl_hs_program
|
||||
@@ -286,6 +291,7 @@ struct glsl_context_data
|
||||
@@ -283,6 +288,7 @@ struct glsl_context_data
|
||||
struct glsl_shader_prog_link *glsl_program;
|
||||
GLenum vertex_color_clamp;
|
||||
BOOL rasterization_disabled;
|
||||
@ -86,7 +86,7 @@ index 4a2fbce553..e306694533 100644
|
||||
};
|
||||
|
||||
struct glsl_ps_compiled_shader
|
||||
@@ -1185,12 +1191,54 @@ static inline void walk_constant_heap_clamped(const struct wined3d_gl_info *gl_i
|
||||
@@ -1182,12 +1188,54 @@ static void walk_constant_heap_clamped(const struct wined3d_gl_info *gl_info,
|
||||
checkGLcall("walk_constant_heap_clamped()");
|
||||
}
|
||||
|
||||
@ -142,7 +142,7 @@ index 4a2fbce553..e306694533 100644
|
||||
|
||||
/* 1.X pshaders have the constants clamped to [-1;1] implicitly. */
|
||||
if (shader->reg_maps.shader_version.major == 1
|
||||
@@ -1525,7 +1573,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
|
||||
@@ -1522,7 +1570,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
|
||||
{
|
||||
const struct wined3d_shader *vshader = state->shader[WINED3D_SHADER_TYPE_VERTEX];
|
||||
const struct wined3d_shader *pshader = state->shader[WINED3D_SHADER_TYPE_PIXEL];
|
||||
@ -151,7 +151,7 @@ index 4a2fbce553..e306694533 100644
|
||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||
struct glsl_shader_prog_link *prog = ctx_data->glsl_program;
|
||||
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||
@@ -1542,9 +1590,32 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
|
||||
@@ -1539,9 +1587,32 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
|
||||
constant_version = prog->constant_version;
|
||||
update_mask = context->constant_update_mask & prog->constant_update_mask;
|
||||
|
||||
@ -185,7 +185,7 @@ index 4a2fbce553..e306694533 100644
|
||||
|
||||
if (update_mask & WINED3D_SHADER_CONST_VS_I)
|
||||
shader_glsl_load_constants_i(vshader, gl_info, state->vs_consts_i,
|
||||
@@ -1697,7 +1768,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
|
||||
@@ -1694,7 +1765,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
|
||||
|
||||
if (update_mask & WINED3D_SHADER_CONST_PS_F)
|
||||
shader_glsl_load_constants_f(pshader, gl_info, state->ps_consts_f,
|
||||
@ -194,7 +194,7 @@ index 4a2fbce553..e306694533 100644
|
||||
|
||||
if (update_mask & WINED3D_SHADER_CONST_PS_I)
|
||||
shader_glsl_load_constants_i(pshader, gl_info, state->ps_consts_i,
|
||||
@@ -1836,6 +1907,12 @@ static void shader_glsl_update_float_vertex_constants(struct wined3d_device *dev
|
||||
@@ -1833,6 +1904,12 @@ static void shader_glsl_update_float_vertex_constants(struct wined3d_device *dev
|
||||
struct constant_heap *heap = &priv->vconst_heap;
|
||||
UINT i;
|
||||
|
||||
@ -207,7 +207,7 @@ index 4a2fbce553..e306694533 100644
|
||||
for (i = start; i < count + start; ++i)
|
||||
{
|
||||
update_heap_entry(heap, i, priv->next_constant_version);
|
||||
@@ -1848,6 +1925,9 @@ static void shader_glsl_update_float_pixel_constants(struct wined3d_device *devi
|
||||
@@ -1845,6 +1922,9 @@ static void shader_glsl_update_float_pixel_constants(struct wined3d_device *devi
|
||||
struct constant_heap *heap = &priv->pconst_heap;
|
||||
UINT i;
|
||||
|
||||
@ -217,7 +217,7 @@ index 4a2fbce553..e306694533 100644
|
||||
for (i = start; i < count + start; ++i)
|
||||
{
|
||||
update_heap_entry(heap, i, priv->next_constant_version);
|
||||
@@ -2165,6 +2245,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c
|
||||
@@ -2162,6 +2242,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c
|
||||
const struct wined3d_shader_reg_maps *reg_maps, const struct shader_glsl_ctx_priv *ctx_priv)
|
||||
{
|
||||
const struct wined3d_shader_version *version = ®_maps->shader_version;
|
||||
@ -225,7 +225,7 @@ index 4a2fbce553..e306694533 100644
|
||||
const struct vs_compile_args *vs_args = ctx_priv->cur_vs_args;
|
||||
const struct ps_compile_args *ps_args = ctx_priv->cur_ps_args;
|
||||
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||
@@ -2188,7 +2269,15 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c
|
||||
@@ -2185,7 +2266,15 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c
|
||||
}
|
||||
|
||||
/* Declare the constants (aka uniforms) */
|
||||
@ -242,7 +242,7 @@ index 4a2fbce553..e306694533 100644
|
||||
{
|
||||
unsigned max_constantsF;
|
||||
|
||||
@@ -2253,11 +2342,12 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c
|
||||
@@ -2250,11 +2339,12 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -257,7 +257,7 @@ index 4a2fbce553..e306694533 100644
|
||||
}
|
||||
|
||||
/* Always declare the full set of constants, the compiler can remove the
|
||||
@@ -9890,17 +9980,36 @@ static struct glsl_ffp_fragment_shader *shader_glsl_find_ffp_fragment_shader(str
|
||||
@@ -9933,17 +10023,36 @@ static struct glsl_ffp_fragment_shader *shader_glsl_find_ffp_fragment_shader(str
|
||||
|
||||
|
||||
static void shader_glsl_init_vs_uniform_locations(const struct wined3d_gl_info *gl_info,
|
||||
@ -299,7 +299,7 @@ index 4a2fbce553..e306694533 100644
|
||||
|
||||
for (i = 0; i < WINED3D_MAX_CONSTS_I; ++i)
|
||||
{
|
||||
@@ -10975,6 +11084,7 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
|
||||
@@ -11021,6 +11130,7 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
|
||||
const struct wined3d_fragment_pipe_ops *fragment_pipe)
|
||||
{
|
||||
SIZE_T stack_size = wined3d_log2i(max(WINED3D_MAX_VS_CONSTS_F, WINED3D_MAX_PS_CONSTS_F)) + 1;
|
||||
@ -307,7 +307,7 @@ index 4a2fbce553..e306694533 100644
|
||||
struct fragment_caps fragment_caps;
|
||||
void *vertex_priv, *fragment_priv;
|
||||
struct shader_glsl_priv *priv;
|
||||
@@ -10982,6 +11092,8 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
|
||||
@@ -11028,6 +11138,8 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
|
||||
if (!(priv = heap_alloc_zero(sizeof(*priv))))
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
@ -316,7 +316,7 @@ index 4a2fbce553..e306694533 100644
|
||||
string_buffer_list_init(&priv->string_buffers);
|
||||
|
||||
if (!(vertex_priv = vertex_pipe->vp_alloc(&glsl_shader_backend, priv)))
|
||||
@@ -11036,6 +11148,8 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
|
||||
@@ -11082,6 +11194,8 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
|
||||
device->fragment_priv = fragment_priv;
|
||||
device->shader_priv = priv;
|
||||
|
||||
@ -325,7 +325,7 @@ index 4a2fbce553..e306694533 100644
|
||||
return WINED3D_OK;
|
||||
|
||||
fail:
|
||||
@@ -11063,6 +11177,13 @@ static void shader_glsl_free(struct wined3d_device *device, struct wined3d_conte
|
||||
@@ -11109,6 +11223,13 @@ static void shader_glsl_free(struct wined3d_device *device, struct wined3d_conte
|
||||
priv->fragment_pipe->free_private(device, context);
|
||||
priv->vertex_pipe->vp_free(device, context);
|
||||
|
||||
@ -340,7 +340,7 @@ index 4a2fbce553..e306694533 100644
|
||||
device->shader_priv = NULL;
|
||||
}
|
||||
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
|
||||
index d9ef1a96e2..f29b49b902 100644
|
||||
index 957710dbd43..896e8d37690 100644
|
||||
--- a/dlls/wined3d/shader.c
|
||||
+++ b/dlls/wined3d/shader.c
|
||||
@@ -767,6 +767,8 @@ static BOOL shader_record_register_usage(struct wined3d_shader *shader, struct w
|
||||
@ -353,11 +353,11 @@ index d9ef1a96e2..f29b49b902 100644
|
||||
}
|
||||
}
|
||||
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
|
||||
index 6289317936..099a612d05 100644
|
||||
index a39eefa4387..566404d7887 100644
|
||||
--- a/dlls/wined3d/state.c
|
||||
+++ b/dlls/wined3d/state.c
|
||||
@@ -4461,6 +4461,11 @@ static void state_cb(struct wined3d_context *context, const struct wined3d_state
|
||||
unsigned int i, base, count;
|
||||
@@ -4569,6 +4569,11 @@ static void state_cb(struct wined3d_context *context, const struct wined3d_state
|
||||
struct wined3d_bo_gl *bo_gl;
|
||||
|
||||
TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id);
|
||||
+ if (context->d3d_info->wined3d_creation_flags & WINED3D_LEGACY_SHADER_CONSTANTS)
|
||||
@ -369,10 +369,10 @@ index 6289317936..099a612d05 100644
|
||||
if (STATE_IS_GRAPHICS_CONSTANT_BUFFER(state_id))
|
||||
shader_type = state_id - STATE_GRAPHICS_CONSTANT_BUFFER(0);
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 9240b0e455..b09811b845 100644
|
||||
index 08f5dc6b862..6503c6cd38a 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -1070,6 +1070,7 @@ struct wined3d_shader_reg_maps
|
||||
@@ -1138,6 +1138,7 @@ struct wined3d_shader_reg_maps
|
||||
struct wined3d_shader_tgsm *tgsm;
|
||||
SIZE_T tgsm_capacity;
|
||||
unsigned int tgsm_count;
|
||||
@ -380,7 +380,7 @@ index 9240b0e455..b09811b845 100644
|
||||
};
|
||||
|
||||
/* Keeps track of details for TEX_M#x# instructions which need to maintain
|
||||
@@ -2743,6 +2744,7 @@ struct wined3d_gl_limits
|
||||
@@ -3259,6 +3260,7 @@ struct wined3d_gl_limits
|
||||
UINT glsl_varyings;
|
||||
UINT glsl_vs_float_constants;
|
||||
UINT glsl_ps_float_constants;
|
||||
@ -389,10 +389,10 @@ index 9240b0e455..b09811b845 100644
|
||||
UINT arb_vs_float_constants;
|
||||
UINT arb_vs_native_constants;
|
||||
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
|
||||
index d192266583..1199408ec6 100644
|
||||
index 9c17135570c..6c865929836 100644
|
||||
--- a/include/wine/wined3d.h
|
||||
+++ b/include/wine/wined3d.h
|
||||
@@ -1335,6 +1335,7 @@ enum wined3d_shader_type
|
||||
@@ -1343,6 +1343,7 @@ enum wined3d_pipeline
|
||||
#define WINED3D_NO_PRIMITIVE_RESTART 0x00000800
|
||||
#define WINED3D_LEGACY_CUBEMAP_FILTERING 0x00001000
|
||||
#define WINED3D_NORMALIZED_DEPTH_BIAS 0x00002000
|
||||
@ -401,5 +401,5 @@ index d192266583..1199408ec6 100644
|
||||
#define WINED3D_RESZ_CODE 0x7fa05000
|
||||
|
||||
--
|
||||
2.25.1
|
||||
2.33.0
|
||||
|
||||
|
@ -1 +1 @@
|
||||
32fb017d4a22be38ca271bf387e466e958601355
|
||||
986254d6c17ee1e5fb3aed6effcf2766bf1e787e
|
||||
|
Loading…
Reference in New Issue
Block a user