You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Rebase against 9855fbe252ff3664d879e8cd9f5d1ea879af47dd.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From d200ec2393f74ab97b9e6b4aedc4d9960dfa2e9d Mon Sep 17 00:00:00 2001
|
||||
From 34dbd141b6e22e7ffd29ae1b04a20060b3990265 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
|
||||
@@ -17,7 +17,7 @@ Signed-off-by: Paul Gofman <gofmanp@gmail.com>
|
||||
8 files changed, 148 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d8/directx.c b/dlls/d3d8/directx.c
|
||||
index c5239844c3d..274d5e14dee 100644
|
||||
index c5239844c..274d5e14d 100644
|
||||
--- a/dlls/d3d8/directx.c
|
||||
+++ b/dlls/d3d8/directx.c
|
||||
@@ -416,7 +416,7 @@ BOOL d3d8_init(struct d3d8 *d3d8)
|
||||
@@ -30,7 +30,7 @@ index c5239844c3d..274d5e14dee 100644
|
||||
d3d8->IDirect3D8_iface.lpVtbl = &d3d8_vtbl;
|
||||
d3d8->refcount = 1;
|
||||
diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c
|
||||
index 1d3754adf82..f42c5ea6229 100644
|
||||
index 1d3754adf..f42c5ea62 100644
|
||||
--- a/dlls/d3d9/directx.c
|
||||
+++ b/dlls/d3d9/directx.c
|
||||
@@ -583,7 +583,7 @@ BOOL d3d9_init(struct d3d9 *d3d9, BOOL extended)
|
||||
@@ -43,10 +43,10 @@ index 1d3754adf82..f42c5ea6229 100644
|
||||
if (!extended)
|
||||
flags |= WINED3D_VIDMEM_ACCOUNTING;
|
||||
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c
|
||||
index d76bf96be0f..3a4e427ef81 100644
|
||||
index 86e347d85..a843706a5 100644
|
||||
--- a/dlls/wined3d/adapter_gl.c
|
||||
+++ b/dlls/wined3d/adapter_gl.c
|
||||
@@ -3140,6 +3140,9 @@ static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info, struct
|
||||
@@ -3124,6 +3124,9 @@ static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info, struct
|
||||
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);
|
||||
@@ -57,7 +57,7 @@ index d76bf96be0f..3a4e427ef81 100644
|
||||
}
|
||||
if (gl_info->supported[ARB_TESSELLATION_SHADER])
|
||||
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
|
||||
index 662b6078bf7..d266c70766e 100644
|
||||
index e5f51925c..564afbf15 100644
|
||||
--- a/dlls/wined3d/glsl_shader.c
|
||||
+++ b/dlls/wined3d/glsl_shader.c
|
||||
@@ -138,6 +138,10 @@ struct shader_glsl_priv
|
||||
@@ -87,7 +87,7 @@ index 662b6078bf7..d266c70766e 100644
|
||||
};
|
||||
|
||||
struct glsl_ps_compiled_shader
|
||||
@@ -1175,12 +1181,54 @@ static inline void walk_constant_heap_clamped(const struct wined3d_gl_info *gl_i
|
||||
@@ -1184,12 +1190,54 @@ static inline void walk_constant_heap_clamped(const struct wined3d_gl_info *gl_i
|
||||
checkGLcall("walk_constant_heap_clamped()");
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ index 662b6078bf7..d266c70766e 100644
|
||||
|
||||
/* 1.X pshaders have the constants clamped to [-1;1] implicitly. */
|
||||
if (shader->reg_maps.shader_version.major == 1
|
||||
@@ -1515,7 +1563,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
|
||||
@@ -1524,7 +1572,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,8 +151,8 @@ index 662b6078bf7..d266c70766e 100644
|
||||
+ struct glsl_context_data *ctx_data = context->shader_backend_data;
|
||||
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_info;
|
||||
@@ -1532,9 +1580,32 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
|
||||
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||
@@ -1541,9 +1589,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;
|
||||
|
||||
@@ -186,7 +186,7 @@ index 662b6078bf7..d266c70766e 100644
|
||||
|
||||
if (update_mask & WINED3D_SHADER_CONST_VS_I)
|
||||
shader_glsl_load_constants_i(vshader, gl_info, state->vs_consts_i,
|
||||
@@ -1687,7 +1758,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
|
||||
@@ -1696,7 +1767,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,
|
||||
@@ -195,7 +195,7 @@ index 662b6078bf7..d266c70766e 100644
|
||||
|
||||
if (update_mask & WINED3D_SHADER_CONST_PS_I)
|
||||
shader_glsl_load_constants_i(pshader, gl_info, state->ps_consts_i,
|
||||
@@ -1826,6 +1897,12 @@ static void shader_glsl_update_float_vertex_constants(struct wined3d_device *dev
|
||||
@@ -1835,6 +1906,12 @@ static void shader_glsl_update_float_vertex_constants(struct wined3d_device *dev
|
||||
struct constant_heap *heap = &priv->vconst_heap;
|
||||
UINT i;
|
||||
|
||||
@@ -208,7 +208,7 @@ index 662b6078bf7..d266c70766e 100644
|
||||
for (i = start; i < count + start; ++i)
|
||||
{
|
||||
update_heap_entry(heap, i, priv->next_constant_version);
|
||||
@@ -1838,6 +1915,9 @@ static void shader_glsl_update_float_pixel_constants(struct wined3d_device *devi
|
||||
@@ -1847,6 +1924,9 @@ static void shader_glsl_update_float_pixel_constants(struct wined3d_device *devi
|
||||
struct constant_heap *heap = &priv->pconst_heap;
|
||||
UINT i;
|
||||
|
||||
@@ -218,15 +218,15 @@ index 662b6078bf7..d266c70766e 100644
|
||||
for (i = start; i < count + start; ++i)
|
||||
{
|
||||
update_heap_entry(heap, i, priv->next_constant_version);
|
||||
@@ -2141,6 +2221,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c
|
||||
@@ -2156,6 +2236,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;
|
||||
+ struct shader_glsl_priv *priv = context_gl->c.device->shader_priv;
|
||||
const struct vs_compile_args *vs_args = ctx_priv->cur_vs_args;
|
||||
const struct ps_compile_args *ps_args = ctx_priv->cur_ps_args;
|
||||
+ struct shader_glsl_priv *priv = context_gl->c.device->shader_priv;
|
||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
||||
const struct wined3d_shader_indexable_temp *idx_temp_reg;
|
||||
unsigned int uniform_block_base, uniform_block_count;
|
||||
@@ -2162,7 +2243,15 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c
|
||||
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||
@@ -2179,7 +2260,15 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c
|
||||
}
|
||||
|
||||
/* Declare the constants (aka uniforms) */
|
||||
@@ -243,7 +243,7 @@ index 662b6078bf7..d266c70766e 100644
|
||||
{
|
||||
unsigned max_constantsF;
|
||||
|
||||
@@ -2227,11 +2316,12 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c
|
||||
@@ -2244,11 +2333,12 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -258,7 +258,7 @@ index 662b6078bf7..d266c70766e 100644
|
||||
}
|
||||
|
||||
/* Always declare the full set of constants, the compiler can remove the
|
||||
@@ -9843,17 +9933,36 @@ static struct glsl_ffp_fragment_shader *shader_glsl_find_ffp_fragment_shader(str
|
||||
@@ -9850,17 +9940,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,
|
||||
@@ -300,7 +300,7 @@ index 662b6078bf7..d266c70766e 100644
|
||||
|
||||
for (i = 0; i < WINED3D_MAX_CONSTS_I; ++i)
|
||||
{
|
||||
@@ -10928,6 +11037,7 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
|
||||
@@ -10936,6 +11045,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;
|
||||
@@ -308,7 +308,7 @@ index 662b6078bf7..d266c70766e 100644
|
||||
struct fragment_caps fragment_caps;
|
||||
void *vertex_priv, *fragment_priv;
|
||||
struct shader_glsl_priv *priv;
|
||||
@@ -10935,6 +11045,8 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
|
||||
@@ -10943,6 +11053,8 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
|
||||
if (!(priv = heap_alloc_zero(sizeof(*priv))))
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
@@ -317,7 +317,7 @@ index 662b6078bf7..d266c70766e 100644
|
||||
string_buffer_list_init(&priv->string_buffers);
|
||||
|
||||
if (!(vertex_priv = vertex_pipe->vp_alloc(&glsl_shader_backend, priv)))
|
||||
@@ -10989,6 +11101,8 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
|
||||
@@ -10997,6 +11109,8 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
|
||||
device->fragment_priv = fragment_priv;
|
||||
device->shader_priv = priv;
|
||||
|
||||
@@ -326,7 +326,7 @@ index 662b6078bf7..d266c70766e 100644
|
||||
return WINED3D_OK;
|
||||
|
||||
fail:
|
||||
@@ -11016,6 +11130,13 @@ static void shader_glsl_free(struct wined3d_device *device, struct wined3d_conte
|
||||
@@ -11024,6 +11138,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);
|
||||
|
||||
@@ -341,7 +341,7 @@ index 662b6078bf7..d266c70766e 100644
|
||||
device->shader_priv = NULL;
|
||||
}
|
||||
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
|
||||
index 871683e6987..8477f3de5d1 100644
|
||||
index 870899502..2bb9c366c 100644
|
||||
--- a/dlls/wined3d/shader.c
|
||||
+++ b/dlls/wined3d/shader.c
|
||||
@@ -764,6 +764,8 @@ static BOOL shader_record_register_usage(struct wined3d_shader *shader, struct w
|
||||
@@ -354,10 +354,10 @@ index 871683e6987..8477f3de5d1 100644
|
||||
}
|
||||
}
|
||||
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
|
||||
index b2c7d3ff6b4..b6f50ef4a7f 100644
|
||||
index d860d13bd..25eeab3d9 100644
|
||||
--- a/dlls/wined3d/state.c
|
||||
+++ b/dlls/wined3d/state.c
|
||||
@@ -4399,6 +4399,11 @@ static void state_cb(struct wined3d_context *context, const struct wined3d_state
|
||||
@@ -4390,6 +4390,11 @@ static void state_cb(struct wined3d_context *context, const struct wined3d_state
|
||||
unsigned int i, base, count;
|
||||
|
||||
TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id);
|
||||
@@ -370,10 +370,10 @@ index b2c7d3ff6b4..b6f50ef4a7f 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 290f1c6c659..b99a55c4ed4 100644
|
||||
index c628b2fa8..3cd0e9728 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -1066,6 +1066,7 @@ struct wined3d_shader_reg_maps
|
||||
@@ -1071,6 +1071,7 @@ struct wined3d_shader_reg_maps
|
||||
struct wined3d_shader_tgsm *tgsm;
|
||||
SIZE_T tgsm_capacity;
|
||||
unsigned int tgsm_count;
|
||||
@@ -390,10 +390,10 @@ index 290f1c6c659..b99a55c4ed4 100644
|
||||
UINT arb_vs_float_constants;
|
||||
UINT arb_vs_native_constants;
|
||||
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
|
||||
index 59ae3447742..031e4bd99e9 100644
|
||||
index 3e46c23c1..ab9c123d7 100644
|
||||
--- a/include/wine/wined3d.h
|
||||
+++ b/include/wine/wined3d.h
|
||||
@@ -1333,6 +1333,7 @@ enum wined3d_shader_type
|
||||
@@ -1331,6 +1331,7 @@ enum wined3d_shader_type
|
||||
#define WINED3D_NO_PRIMITIVE_RESTART 0x00000800
|
||||
#define WINED3D_LEGACY_CUBEMAP_FILTERING 0x00001000
|
||||
#define WINED3D_NORMALIZED_DEPTH_BIAS 0x00002000
|
||||
@@ -402,5 +402,5 @@ index 59ae3447742..031e4bd99e9 100644
|
||||
#define WINED3D_RESZ_CODE 0x7fa05000
|
||||
|
||||
--
|
||||
2.17.1
|
||||
2.22.0
|
||||
|
||||
|
@@ -1,8 +1,8 @@
|
||||
From 61bec7b8c33b6dd1119821135e74d8045d76d635 Mon Sep 17 00:00:00 2001
|
||||
From 77ea40ff3762a598abd30edeee292c0275e73f4d Mon Sep 17 00:00:00 2001
|
||||
From: Paul Gofman <gofmanp@gmail.com>
|
||||
Date: Mon, 25 Feb 2019 14:47:28 +0300
|
||||
Subject: [PATCH 3/5] wined3d: Report actual vertex shader float constants
|
||||
limit for SWVP device.
|
||||
Subject: [PATCH] wined3d: Report actual vertex shader float constants limit
|
||||
for SWVP device.
|
||||
|
||||
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
|
||||
---
|
||||
@@ -13,10 +13,10 @@ Signed-off-by: Paul Gofman <gofmanp@gmail.com>
|
||||
4 files changed, 20 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c
|
||||
index 4071ed0f82..382ba2c71c 100644
|
||||
index a843706a5..630360286 100644
|
||||
--- a/dlls/wined3d/adapter_gl.c
|
||||
+++ b/dlls/wined3d/adapter_gl.c
|
||||
@@ -3768,7 +3768,8 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter,
|
||||
@@ -3770,7 +3770,8 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter,
|
||||
d3d_info->limits.gs_version = shader_caps.gs_version;
|
||||
d3d_info->limits.ps_version = shader_caps.ps_version;
|
||||
d3d_info->limits.cs_version = shader_caps.cs_version;
|
||||
@@ -25,12 +25,12 @@ index 4071ed0f82..382ba2c71c 100644
|
||||
+ d3d_info->limits.vs_uniform_count = min(WINED3D_MAX_VS_CONSTS_F, shader_caps.vs_uniform_count);
|
||||
d3d_info->limits.ps_uniform_count = shader_caps.ps_uniform_count;
|
||||
d3d_info->limits.varying_count = shader_caps.varying_count;
|
||||
d3d_info->shader_double_precision = !!(shader_caps.wined3d_caps & WINED3D_SHADER_CAP_DOUBLE_PRECISION);
|
||||
d3d_info->limits.max_compat_varying_count = shader_caps.max_compat_varying_count;
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index 4ec4022dce..29c7f09c5e 100644
|
||||
index c37f386f9..760ba5166 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -4074,10 +4074,21 @@ struct wined3d_texture * CDECL wined3d_device_get_texture(const struct wined3d_d
|
||||
@@ -4064,10 +4064,21 @@ struct wined3d_texture * CDECL wined3d_device_get_texture(const struct wined3d_d
|
||||
|
||||
HRESULT CDECL wined3d_device_get_device_caps(const struct wined3d_device *device, struct wined3d_caps *caps)
|
||||
{
|
||||
@@ -54,10 +54,10 @@ index 4ec4022dce..29c7f09c5e 100644
|
||||
|
||||
HRESULT CDECL wined3d_device_get_display_mode(const struct wined3d_device *device, UINT swapchain_idx,
|
||||
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
|
||||
index fc3093f4d1..78e9070e9e 100644
|
||||
index 564afbf15..71e05af57 100644
|
||||
--- a/dlls/wined3d/glsl_shader.c
|
||||
+++ b/dlls/wined3d/glsl_shader.c
|
||||
@@ -11185,7 +11185,10 @@ static void shader_glsl_get_caps(const struct wined3d_adapter *adapter, struct s
|
||||
@@ -11222,7 +11222,10 @@ static void shader_glsl_get_caps(const struct wined3d_adapter *adapter, struct s
|
||||
caps->vs_version = gl_info->supported[ARB_VERTEX_SHADER] ? caps->vs_version : 0;
|
||||
caps->ps_version = gl_info->supported[ARB_FRAGMENT_SHADER] ? caps->ps_version : 0;
|
||||
|
||||
@@ -68,9 +68,9 @@ index fc3093f4d1..78e9070e9e 100644
|
||||
+ : gl_info->limits.glsl_vs_float_constants);
|
||||
caps->ps_uniform_count = min(WINED3D_MAX_PS_CONSTS_F, gl_info->limits.glsl_ps_float_constants);
|
||||
caps->varying_count = gl_info->limits.glsl_varyings;
|
||||
|
||||
caps->max_compat_varying_count = shader_glsl_max_compat_varyings(gl_info);
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 444ffdba1e..aa3152aee5 100644
|
||||
index 3cd0e9728..24eaf1bee 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -166,6 +166,7 @@ struct wined3d_d3d_limits
|
||||
@@ -81,7 +81,7 @@ index 444ffdba1e..aa3152aee5 100644
|
||||
DWORD ps_uniform_count;
|
||||
unsigned int varying_count;
|
||||
unsigned int ffp_textures;
|
||||
@@ -695,6 +696,7 @@ enum wined3d_shader_conditional_op
|
||||
@@ -701,6 +702,7 @@ enum wined3d_shader_conditional_op
|
||||
#define WINED3D_MAX_CONSTS_B 16
|
||||
#define WINED3D_MAX_CONSTS_I 16
|
||||
#define WINED3D_MAX_VS_CONSTS_F 256
|
||||
@@ -90,5 +90,5 @@ index 444ffdba1e..aa3152aee5 100644
|
||||
|
||||
/* FIXME: This needs to go up to 2048 for
|
||||
--
|
||||
2.21.0
|
||||
2.22.0
|
||||
|
||||
|
Reference in New Issue
Block a user