mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
Updated wined3d-SWVP-shaders patchset.
This commit is contained in:
parent
b24b3a88cc
commit
84a644848c
@ -1,7 +1,7 @@
|
||||
From 34dbd141b6e22e7ffd29ae1b04a20060b3990265 Mon Sep 17 00:00:00 2001
|
||||
From 8c237bdc4de7217318f57024df5e0f88c44f42ed 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
|
||||
Subject: [PATCH 1/5] wined3d: Use UBO for vertex shader float constants if
|
||||
supported.
|
||||
|
||||
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
|
||||
@ -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 c5239844c..274d5e14d 100644
|
||||
index c5239844c3..274d5e14de 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 c5239844c..274d5e14d 100644
|
||||
d3d8->IDirect3D8_iface.lpVtbl = &d3d8_vtbl;
|
||||
d3d8->refcount = 1;
|
||||
diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c
|
||||
index 1d3754adf..f42c5ea62 100644
|
||||
index 1d3754adf8..f42c5ea622 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 1d3754adf..f42c5ea62 100644
|
||||
if (!extended)
|
||||
flags |= WINED3D_VIDMEM_ACCOUNTING;
|
||||
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c
|
||||
index 86e347d85..a843706a5 100644
|
||||
index ed1022030b..57eb73a121 100644
|
||||
--- a/dlls/wined3d/adapter_gl.c
|
||||
+++ b/dlls/wined3d/adapter_gl.c
|
||||
@@ -3124,6 +3124,9 @@ static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info, struct
|
||||
@@ -3117,6 +3117,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);
|
||||
@ -57,7 +57,7 @@ index 86e347d85..a843706a5 100644
|
||||
}
|
||||
if (gl_info->supported[ARB_TESSELLATION_SHADER])
|
||||
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
|
||||
index e5f51925c..564afbf15 100644
|
||||
index 0e0977e1d4..3c705e0730 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 e5f51925c..564afbf15 100644
|
||||
};
|
||||
|
||||
struct glsl_ps_compiled_shader
|
||||
@@ -1184,12 +1190,54 @@ static inline void walk_constant_heap_clamped(const struct wined3d_gl_info *gl_i
|
||||
@@ -1183,12 +1189,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 e5f51925c..564afbf15 100644
|
||||
|
||||
/* 1.X pshaders have the constants clamped to [-1;1] implicitly. */
|
||||
if (shader->reg_maps.shader_version.major == 1
|
||||
@@ -1524,7 +1572,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
|
||||
@@ -1523,7 +1571,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];
|
||||
@ -152,7 +152,7 @@ index e5f51925c..564afbf15 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;
|
||||
@@ -1541,9 +1589,32 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
|
||||
@@ -1540,9 +1588,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 e5f51925c..564afbf15 100644
|
||||
|
||||
if (update_mask & WINED3D_SHADER_CONST_VS_I)
|
||||
shader_glsl_load_constants_i(vshader, gl_info, state->vs_consts_i,
|
||||
@@ -1696,7 +1767,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
|
||||
@@ -1695,7 +1766,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 e5f51925c..564afbf15 100644
|
||||
|
||||
if (update_mask & WINED3D_SHADER_CONST_PS_I)
|
||||
shader_glsl_load_constants_i(pshader, gl_info, state->ps_consts_i,
|
||||
@@ -1835,6 +1906,12 @@ static void shader_glsl_update_float_vertex_constants(struct wined3d_device *dev
|
||||
@@ -1834,6 +1905,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 e5f51925c..564afbf15 100644
|
||||
for (i = start; i < count + start; ++i)
|
||||
{
|
||||
update_heap_entry(heap, i, priv->next_constant_version);
|
||||
@@ -1847,6 +1924,9 @@ static void shader_glsl_update_float_pixel_constants(struct wined3d_device *devi
|
||||
@@ -1846,6 +1923,9 @@ static void shader_glsl_update_float_pixel_constants(struct wined3d_device *devi
|
||||
struct constant_heap *heap = &priv->pconst_heap;
|
||||
UINT i;
|
||||
|
||||
@ -218,7 +218,7 @@ index e5f51925c..564afbf15 100644
|
||||
for (i = start; i < count + start; ++i)
|
||||
{
|
||||
update_heap_entry(heap, i, priv->next_constant_version);
|
||||
@@ -2156,6 +2236,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c
|
||||
@@ -2155,6 +2235,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;
|
||||
@ -226,7 +226,7 @@ index e5f51925c..564afbf15 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;
|
||||
@@ -2179,7 +2260,15 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c
|
||||
@@ -2178,7 +2259,15 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c
|
||||
}
|
||||
|
||||
/* Declare the constants (aka uniforms) */
|
||||
@ -243,7 +243,7 @@ index e5f51925c..564afbf15 100644
|
||||
{
|
||||
unsigned max_constantsF;
|
||||
|
||||
@@ -2244,11 +2333,12 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c
|
||||
@@ -2243,11 +2332,12 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -258,7 +258,7 @@ index e5f51925c..564afbf15 100644
|
||||
}
|
||||
|
||||
/* Always declare the full set of constants, the compiler can remove the
|
||||
@@ -9850,17 +9940,36 @@ static struct glsl_ffp_fragment_shader *shader_glsl_find_ffp_fragment_shader(str
|
||||
@@ -9848,17 +9938,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 e5f51925c..564afbf15 100644
|
||||
|
||||
for (i = 0; i < WINED3D_MAX_CONSTS_I; ++i)
|
||||
{
|
||||
@@ -10936,6 +11045,7 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
|
||||
@@ -10933,6 +11042,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 e5f51925c..564afbf15 100644
|
||||
struct fragment_caps fragment_caps;
|
||||
void *vertex_priv, *fragment_priv;
|
||||
struct shader_glsl_priv *priv;
|
||||
@@ -10943,6 +11053,8 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
|
||||
@@ -10940,6 +11050,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 e5f51925c..564afbf15 100644
|
||||
string_buffer_list_init(&priv->string_buffers);
|
||||
|
||||
if (!(vertex_priv = vertex_pipe->vp_alloc(&glsl_shader_backend, priv)))
|
||||
@@ -10997,6 +11109,8 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
|
||||
@@ -10994,6 +11106,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 e5f51925c..564afbf15 100644
|
||||
return WINED3D_OK;
|
||||
|
||||
fail:
|
||||
@@ -11024,6 +11138,13 @@ static void shader_glsl_free(struct wined3d_device *device, struct wined3d_conte
|
||||
@@ -11021,6 +11135,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,10 +341,10 @@ index e5f51925c..564afbf15 100644
|
||||
device->shader_priv = NULL;
|
||||
}
|
||||
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
|
||||
index 870899502..2bb9c366c 100644
|
||||
index 3b9a96abc6..bf8e1c204f 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
|
||||
@@ -767,6 +767,8 @@ static BOOL shader_record_register_usage(struct wined3d_shader *shader, struct w
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -354,10 +354,10 @@ index 870899502..2bb9c366c 100644
|
||||
}
|
||||
}
|
||||
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
|
||||
index d860d13bd..25eeab3d9 100644
|
||||
index 4bc371b8e7..72d42ef446 100644
|
||||
--- a/dlls/wined3d/state.c
|
||||
+++ b/dlls/wined3d/state.c
|
||||
@@ -4390,6 +4390,11 @@ static void state_cb(struct wined3d_context *context, const struct wined3d_state
|
||||
@@ -4386,6 +4386,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 d860d13bd..25eeab3d9 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 c628b2fa8..3cd0e9728 100644
|
||||
index 5ce23f85f6..a76103f6df 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -1071,6 +1071,7 @@ struct wined3d_shader_reg_maps
|
||||
@@ -1072,6 +1072,7 @@ struct wined3d_shader_reg_maps
|
||||
struct wined3d_shader_tgsm *tgsm;
|
||||
SIZE_T tgsm_capacity;
|
||||
unsigned int tgsm_count;
|
||||
@ -381,7 +381,7 @@ index c628b2fa8..3cd0e9728 100644
|
||||
};
|
||||
|
||||
/* Keeps track of details for TEX_M#x# instructions which need to maintain
|
||||
@@ -2662,6 +2663,7 @@ struct wined3d_gl_limits
|
||||
@@ -2704,6 +2705,7 @@ struct wined3d_gl_limits
|
||||
UINT glsl_varyings;
|
||||
UINT glsl_vs_float_constants;
|
||||
UINT glsl_ps_float_constants;
|
||||
@ -390,10 +390,10 @@ index c628b2fa8..3cd0e9728 100644
|
||||
UINT arb_vs_float_constants;
|
||||
UINT arb_vs_native_constants;
|
||||
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
|
||||
index 3e46c23c1..ab9c123d7 100644
|
||||
index 4543b882ac..8b6827ea95 100644
|
||||
--- a/include/wine/wined3d.h
|
||||
+++ b/include/wine/wined3d.h
|
||||
@@ -1331,6 +1331,7 @@ enum wined3d_shader_type
|
||||
@@ -1332,6 +1332,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 3e46c23c1..ab9c123d7 100644
|
||||
#define WINED3D_RESZ_CODE 0x7fa05000
|
||||
|
||||
--
|
||||
2.22.0
|
||||
2.21.0
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From b1847ff5d7fad8558dc0be7ef67dc496b8c7725a Mon Sep 17 00:00:00 2001
|
||||
From b64f226c152dce05a999631de84678c629d95218 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Gofman <gofmanp@gmail.com>
|
||||
Date: Mon, 25 Feb 2019 14:24:50 +0300
|
||||
Subject: [PATCH 2/5] d3d9: Support SWVP vertex shader float constants limits.
|
||||
@ -11,10 +11,10 @@ Signed-off-by: Paul Gofman <gofmanp@gmail.com>
|
||||
3 files changed, 28 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h
|
||||
index 8ee521b14b..971c0748e7 100644
|
||||
index 03e2aa7f8a..03d804a61c 100644
|
||||
--- a/dlls/d3d9/d3d9_private.h
|
||||
+++ b/dlls/d3d9/d3d9_private.h
|
||||
@@ -41,6 +41,7 @@
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "wine/wined3d.h"
|
||||
|
||||
#define D3D9_MAX_VERTEX_SHADER_CONSTANTF 256
|
||||
@ -22,7 +22,7 @@ index 8ee521b14b..971c0748e7 100644
|
||||
#define D3D9_MAX_TEXTURE_UNITS 20
|
||||
#define D3D9_MAX_STREAMS 16
|
||||
|
||||
@@ -57,7 +58,7 @@ enum wined3d_format_id wined3dformat_from_d3dformat(D3DFORMAT format) DECLSPEC_H
|
||||
@@ -56,7 +57,7 @@ enum wined3d_format_id wined3dformat_from_d3dformat(D3DFORMAT format) DECLSPEC_H
|
||||
unsigned int wined3dmapflags_from_d3dmapflags(unsigned int flags, unsigned int usage) DECLSPEC_HIDDEN;
|
||||
void present_parameters_from_wined3d_swapchain_desc(D3DPRESENT_PARAMETERS *present_parameters,
|
||||
const struct wined3d_swapchain_desc *swapchain_desc, DWORD presentation_interval) DECLSPEC_HIDDEN;
|
||||
@ -32,10 +32,10 @@ index 8ee521b14b..971c0748e7 100644
|
||||
struct d3d9
|
||||
{
|
||||
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
|
||||
index 9fbdcebf07..21f286ff38 100644
|
||||
index 8436967ddd..3e49a0a022 100644
|
||||
--- a/dlls/d3d9/device.c
|
||||
+++ b/dlls/d3d9/device.c
|
||||
@@ -362,7 +362,7 @@ static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapch
|
||||
@@ -360,7 +360,7 @@ static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapch
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ index 9fbdcebf07..21f286ff38 100644
|
||||
{
|
||||
static const DWORD ps_minor_version[] = {0, 4, 0, 0};
|
||||
static const DWORD vs_minor_version[] = {0, 1, 0, 0};
|
||||
@@ -500,7 +500,10 @@ void d3dcaps_from_wined3dcaps(D3DCAPS9 *caps, const struct wined3d_caps *wined3d
|
||||
@@ -498,7 +498,10 @@ void d3dcaps_from_wined3dcaps(D3DCAPS9 *caps, const struct wined3d_caps *wined3d
|
||||
D3DPTEXTURECAPS_MIPMAP | D3DPTEXTURECAPS_MIPVOLUMEMAP | D3DPTEXTURECAPS_MIPCUBEMAP |
|
||||
D3DPTEXTURECAPS_CUBEMAP_POW2 | D3DPTEXTURECAPS_VOLUMEMAP_POW2| D3DPTEXTURECAPS_NOPROJECTEDBUMPENV;
|
||||
|
||||
@ -56,7 +56,7 @@ index 9fbdcebf07..21f286ff38 100644
|
||||
caps->NumSimultaneousRTs = min(D3D_MAX_SIMULTANEOUS_RENDERTARGETS, caps->NumSimultaneousRTs);
|
||||
|
||||
if (caps->PixelShaderVersion > 3)
|
||||
@@ -682,6 +685,7 @@ static HRESULT WINAPI d3d9_device_GetDirect3D(IDirect3DDevice9Ex *iface, IDirect
|
||||
@@ -684,6 +687,7 @@ static HRESULT WINAPI d3d9_device_GetDirect3D(IDirect3DDevice9Ex *iface, IDirect
|
||||
static HRESULT WINAPI d3d9_device_GetDeviceCaps(IDirect3DDevice9Ex *iface, D3DCAPS9 *caps)
|
||||
{
|
||||
struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
|
||||
@ -64,7 +64,7 @@ index 9fbdcebf07..21f286ff38 100644
|
||||
struct wined3d_caps wined3d_caps;
|
||||
HRESULT hr;
|
||||
|
||||
@@ -690,13 +694,15 @@ static HRESULT WINAPI d3d9_device_GetDeviceCaps(IDirect3DDevice9Ex *iface, D3DCA
|
||||
@@ -692,13 +696,15 @@ static HRESULT WINAPI d3d9_device_GetDeviceCaps(IDirect3DDevice9Ex *iface, D3DCA
|
||||
if (!caps)
|
||||
return D3DERR_INVALIDCALL;
|
||||
|
||||
@ -81,7 +81,7 @@ index 9fbdcebf07..21f286ff38 100644
|
||||
|
||||
return hr;
|
||||
}
|
||||
@@ -3450,14 +3456,20 @@ static HRESULT WINAPI d3d9_device_SetVertexShaderConstantF(IDirect3DDevice9Ex *i
|
||||
@@ -3459,14 +3465,20 @@ static HRESULT WINAPI d3d9_device_SetVertexShaderConstantF(IDirect3DDevice9Ex *i
|
||||
UINT reg_idx, const float *data, UINT count)
|
||||
{
|
||||
struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
|
||||
@ -104,7 +104,7 @@ index 9fbdcebf07..21f286ff38 100644
|
||||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
@@ -3473,14 +3485,20 @@ static HRESULT WINAPI d3d9_device_GetVertexShaderConstantF(IDirect3DDevice9Ex *i
|
||||
@@ -3487,14 +3499,20 @@ static HRESULT WINAPI d3d9_device_GetVertexShaderConstantF(IDirect3DDevice9Ex *i
|
||||
UINT reg_idx, float *data, UINT count)
|
||||
{
|
||||
struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
|
||||
@ -128,10 +128,10 @@ index 9fbdcebf07..21f286ff38 100644
|
||||
}
|
||||
|
||||
diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c
|
||||
index 7cdf5ddbb9..1d37e900c2 100644
|
||||
index f42c5ea622..da80033892 100644
|
||||
--- a/dlls/d3d9/directx.c
|
||||
+++ b/dlls/d3d9/directx.c
|
||||
@@ -372,7 +372,7 @@ static HRESULT WINAPI d3d9_GetDeviceCaps(IDirect3D9Ex *iface, UINT adapter, D3DD
|
||||
@@ -370,7 +370,7 @@ static HRESULT WINAPI d3d9_GetDeviceCaps(IDirect3D9Ex *iface, UINT adapter, D3DD
|
||||
hr = wined3d_get_device_caps(d3d9->wined3d, adapter, device_type, &wined3d_caps);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
From ac40dcacea3cbe9a41f25b368af126362cffa771 Mon Sep 17 00:00:00 2001
|
||||
From e8d51b8f26794008482b614e48f3af1816d2e827 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Gofman <gofmanp@gmail.com>
|
||||
Date: Mon, 25 Feb 2019 14:47:28 +0300
|
||||
Subject: [PATCH] wined3d: Report actual vertex shader float constants limit
|
||||
for SWVP device.
|
||||
Subject: [PATCH 3/5] 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 ca2b4126bca..6a7a1ec12fe 100644
|
||||
index 57eb73a121..b1308f662b 100644
|
||||
--- a/dlls/wined3d/adapter_gl.c
|
||||
+++ b/dlls/wined3d/adapter_gl.c
|
||||
@@ -5133,7 +5133,8 @@ static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *adapter_
|
||||
@@ -5152,7 +5152,8 @@ static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *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;
|
||||
@ -27,10 +27,10 @@ index ca2b4126bca..6a7a1ec12fe 100644
|
||||
d3d_info->limits.varying_count = shader_caps.varying_count;
|
||||
d3d_info->limits.ffp_textures = fragment_caps.MaxSimultaneousTextures;
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index c6b3b9e46ed..e8a654763ae 100644
|
||||
index 9b1b630014..cd078435c8 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
|
||||
@@ -4050,10 +4050,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 c6b3b9e46ed..e8a654763ae 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 013a38efc47..96fe2b66e3f 100644
|
||||
index 3c705e0730..021b275fbc 100644
|
||||
--- a/dlls/wined3d/glsl_shader.c
|
||||
+++ b/dlls/wined3d/glsl_shader.c
|
||||
@@ -11234,7 +11234,10 @@ static void shader_glsl_get_caps(const struct wined3d_adapter *adapter, struct s
|
||||
@@ -11219,7 +11219,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;
|
||||
|
||||
@ -70,7 +70,7 @@ index 013a38efc47..96fe2b66e3f 100644
|
||||
caps->varying_count = gl_info->limits.glsl_varyings;
|
||||
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index dd9a1b48014..128e308abd3 100644
|
||||
index a76103f6df..769040ea20 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -167,6 +167,7 @@ struct wined3d_d3d_limits
|
||||
@ -81,7 +81,7 @@ index dd9a1b48014..128e308abd3 100644
|
||||
DWORD ps_uniform_count;
|
||||
unsigned int varying_count;
|
||||
unsigned int ffp_textures;
|
||||
@@ -703,6 +704,7 @@ enum wined3d_shader_conditional_op
|
||||
@@ -702,6 +703,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 dd9a1b48014..128e308abd3 100644
|
||||
|
||||
/* FIXME: This needs to go up to 2048 for
|
||||
--
|
||||
2.17.1
|
||||
2.21.0
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 5c7a094ac9505e402d8590b58066ff38181ccd0d Mon Sep 17 00:00:00 2001
|
||||
From 04043842592ec64faf47bbd4f49f8e6ffcfebbc6 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Gofman <gofmanp@gmail.com>
|
||||
Date: Mon, 25 Feb 2019 15:05:12 +0300
|
||||
Subject: [PATCH 4/5] wined3d: Support SWVP vertex shader constants limit in
|
||||
@ -10,12 +10,12 @@ Signed-off-by: Paul Gofman <gofmanp@gmail.com>
|
||||
dlls/d3d9/tests/visual.c | 1 -
|
||||
dlls/wined3d/device.c | 16 ++++++++++++----
|
||||
dlls/wined3d/glsl_shader.c | 2 +-
|
||||
dlls/wined3d/stateblock.c | 6 +++---
|
||||
dlls/wined3d/stateblock.c | 15 +++++++++++----
|
||||
dlls/wined3d/wined3d_private.h | 8 ++++----
|
||||
6 files changed, 20 insertions(+), 18 deletions(-)
|
||||
6 files changed, 28 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c
|
||||
index f5c89723cb..6b56073d13 100644
|
||||
index 1e8133b0c8..70b6ce01c0 100644
|
||||
--- a/dlls/d3d9/tests/device.c
|
||||
+++ b/dlls/d3d9/tests/device.c
|
||||
@@ -6455,13 +6455,10 @@ static void test_vertex_shader_constant(void)
|
||||
@ -49,10 +49,10 @@ index f5c89723cb..6b56073d13 100644
|
||||
hr = IDirect3DDevice9_SetVertexShaderConstantF(device, consts_swvp - 1, c, 1);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
|
||||
index 89571a126b..4be22728ae 100644
|
||||
index e7076aeed6..2128331ca6 100644
|
||||
--- a/dlls/d3d9/tests/visual.c
|
||||
+++ b/dlls/d3d9/tests/visual.c
|
||||
@@ -24708,7 +24708,6 @@ static void test_mvp_software_vertex_shaders(void)
|
||||
@@ -24767,7 +24767,6 @@ static void test_mvp_software_vertex_shaders(void)
|
||||
hr = IDirect3DDevice9_SetVertexShaderConstantF(device, 0, c_index, 1);
|
||||
ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetVertexShaderConstantF(device, (unsigned int)c_index[0], c_color, 1);
|
||||
@ -61,10 +61,10 @@ index 89571a126b..4be22728ae 100644
|
||||
|
||||
hr = IDirect3DDevice9_BeginScene(device);
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index 29c7f09c5e..0056097ecc 100644
|
||||
index cd078435c8..ed95996ef3 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -2515,13 +2515,17 @@ HRESULT CDECL wined3d_device_set_vs_consts_f(struct wined3d_device *device,
|
||||
@@ -2427,13 +2427,17 @@ HRESULT CDECL wined3d_device_set_vs_consts_f(struct wined3d_device *device,
|
||||
unsigned int start_idx, unsigned int count, const struct wined3d_vec4 *constants)
|
||||
{
|
||||
const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info;
|
||||
@ -84,7 +84,7 @@ index 29c7f09c5e..0056097ecc 100644
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
|
||||
memcpy(&device->update_stateblock_state->vs_consts_f[start_idx], constants, count * sizeof(*constants));
|
||||
@@ -2548,12 +2552,16 @@ HRESULT CDECL wined3d_device_get_vs_consts_f(const struct wined3d_device *device
|
||||
@@ -2460,12 +2464,16 @@ HRESULT CDECL wined3d_device_get_vs_consts_f(const struct wined3d_device *device
|
||||
unsigned int start_idx, unsigned int count, struct wined3d_vec4 *constants)
|
||||
{
|
||||
const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info;
|
||||
@ -104,10 +104,10 @@ index 29c7f09c5e..0056097ecc 100644
|
||||
|
||||
memcpy(constants, &device->state.vs_consts_f[start_idx], count * sizeof(*constants));
|
||||
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
|
||||
index 78e9070e9e..bdf5e221ca 100644
|
||||
index 021b275fbc..cee3621e0d 100644
|
||||
--- a/dlls/wined3d/glsl_shader.c
|
||||
+++ b/dlls/wined3d/glsl_shader.c
|
||||
@@ -1902,7 +1902,7 @@ static void shader_glsl_update_float_vertex_constants(struct wined3d_device *dev
|
||||
@@ -1911,7 +1911,7 @@ static void shader_glsl_update_float_vertex_constants(struct wined3d_device *dev
|
||||
if (priv->consts_ubo)
|
||||
return;
|
||||
|
||||
@ -117,7 +117,7 @@ index 78e9070e9e..bdf5e221ca 100644
|
||||
update_heap_entry(heap, i, priv->next_constant_version);
|
||||
}
|
||||
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
|
||||
index 80e58114c1..05149ad1af 100644
|
||||
index 97ef422f5a..986832bb34 100644
|
||||
--- a/dlls/wined3d/stateblock.c
|
||||
+++ b/dlls/wined3d/stateblock.c
|
||||
@@ -312,7 +312,7 @@ void stateblock_init_contained_states(struct wined3d_stateblock *stateblock)
|
||||
@ -129,7 +129,26 @@ index 80e58114c1..05149ad1af 100644
|
||||
{
|
||||
if (stateblock->changed.vs_consts_f[i])
|
||||
{
|
||||
@@ -1588,7 +1588,7 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock,
|
||||
@@ -1277,10 +1277,17 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock)
|
||||
HRESULT CDECL wined3d_stateblock_set_vs_consts_f(struct wined3d_stateblock *stateblock,
|
||||
unsigned int start_idx, unsigned int count, const struct wined3d_vec4 *constants)
|
||||
{
|
||||
+ const struct wined3d_d3d_info *d3d_info = &stateblock->device->adapter->d3d_info;
|
||||
+ unsigned int constants_count;
|
||||
+
|
||||
TRACE("stateblock %p, start_idx %u, count %u, constants %p.\n",
|
||||
stateblock, start_idx, count, constants);
|
||||
|
||||
- if (!constants || start_idx >= WINED3D_MAX_VS_CONSTS_F || count > WINED3D_MAX_VS_CONSTS_F - start_idx)
|
||||
+ constants_count = stateblock->device->create_parms.flags
|
||||
+ & (WINED3DCREATE_SOFTWARE_VERTEXPROCESSING | WINED3DCREATE_MIXED_VERTEXPROCESSING)
|
||||
+ ? d3d_info->limits.vs_uniform_count_swvp : d3d_info->limits.vs_uniform_count;
|
||||
+
|
||||
+ if (!constants || start_idx >= constants_count || count > constants_count - start_idx)
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
|
||||
memcpy(&stateblock->stateblock_state.vs_consts_f[start_idx], constants, count * sizeof(*constants));
|
||||
@@ -1603,7 +1610,7 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock,
|
||||
stateblock_init_lights(stateblock->stateblock_state.light_state.light_map,
|
||||
device->stateblock_state.light_state.light_map);
|
||||
stateblock_savedstates_set_all(&stateblock->changed,
|
||||
@ -138,7 +157,7 @@ index 80e58114c1..05149ad1af 100644
|
||||
break;
|
||||
|
||||
case WINED3D_SBT_PIXEL_STATE:
|
||||
@@ -1600,7 +1600,7 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock,
|
||||
@@ -1615,7 +1622,7 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock,
|
||||
stateblock_init_lights(stateblock->stateblock_state.light_state.light_map,
|
||||
device->stateblock_state.light_state.light_map);
|
||||
stateblock_savedstates_set_vertex(&stateblock->changed,
|
||||
@ -148,10 +167,10 @@ index 80e58114c1..05149ad1af 100644
|
||||
|
||||
default:
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index aa3152aee5..ccafddde39 100644
|
||||
index 769040ea20..cfda378cc0 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -3059,7 +3059,7 @@ struct wined3d_state
|
||||
@@ -3162,7 +3162,7 @@ struct wined3d_state
|
||||
|
||||
BOOL vs_consts_b[WINED3D_MAX_CONSTS_B];
|
||||
struct wined3d_ivec4 vs_consts_i[WINED3D_MAX_CONSTS_I];
|
||||
@ -160,7 +179,7 @@ index aa3152aee5..ccafddde39 100644
|
||||
|
||||
BOOL ps_consts_b[WINED3D_MAX_CONSTS_B];
|
||||
struct wined3d_ivec4 ps_consts_i[WINED3D_MAX_CONSTS_I];
|
||||
@@ -3115,7 +3115,7 @@ struct wined3d_stateblock_state
|
||||
@@ -3218,7 +3218,7 @@ struct wined3d_stateblock_state
|
||||
int base_vertex_index;
|
||||
|
||||
struct wined3d_shader *vs;
|
||||
@ -169,7 +188,7 @@ index aa3152aee5..ccafddde39 100644
|
||||
struct wined3d_ivec4 vs_consts_i[WINED3D_MAX_CONSTS_I];
|
||||
BOOL vs_consts_b[WINED3D_MAX_CONSTS_B];
|
||||
|
||||
@@ -3728,7 +3728,7 @@ struct wined3d_saved_states
|
||||
@@ -3915,7 +3915,7 @@ struct wined3d_saved_states
|
||||
BOOL ps_consts_f[WINED3D_MAX_PS_CONSTS_F];
|
||||
WORD vertexShaderConstantsB; /* WINED3D_MAX_CONSTS_B, 16 */
|
||||
WORD vertexShaderConstantsI; /* WINED3D_MAX_CONSTS_I, 16 */
|
||||
@ -178,7 +197,7 @@ index aa3152aee5..ccafddde39 100644
|
||||
DWORD textures : 20; /* WINED3D_MAX_COMBINED_SAMPLERS, 20 */
|
||||
DWORD indices : 1;
|
||||
DWORD material : 1;
|
||||
@@ -3765,7 +3765,7 @@ struct wined3d_stateblock
|
||||
@@ -3952,7 +3952,7 @@ struct wined3d_stateblock
|
||||
unsigned int num_contained_vs_consts_i;
|
||||
DWORD contained_vs_consts_b[WINED3D_MAX_CONSTS_B];
|
||||
unsigned int num_contained_vs_consts_b;
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 84e017b65146dad4a4d945118a583aa1f86abc37 Mon Sep 17 00:00:00 2001
|
||||
From 6f3d474a66928b4ceb1656db0823de8d47f9aa78 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Gofman <gofmanp@gmail.com>
|
||||
Date: Mon, 25 Feb 2019 15:23:33 +0300
|
||||
Subject: [PATCH] wined3d: Support SWVP mode vertex shaders.
|
||||
Subject: [PATCH 5/5] wined3d: Support SWVP mode vertex shaders.
|
||||
|
||||
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
|
||||
---
|
||||
@ -15,7 +15,7 @@ Signed-off-by: Paul Gofman <gofmanp@gmail.com>
|
||||
7 files changed, 104 insertions(+), 49 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c
|
||||
index 206bc273350..5679d496f51 100644
|
||||
index 70b6ce01c0..05ba25f077 100644
|
||||
--- a/dlls/d3d9/tests/device.c
|
||||
+++ b/dlls/d3d9/tests/device.c
|
||||
@@ -6943,15 +6943,11 @@ float4 main(const float4 color : COLOR) : SV_TARGET
|
||||
@ -60,10 +60,10 @@ index 206bc273350..5679d496f51 100644
|
||||
cleanup:
|
||||
refcount = IDirect3DDevice9_Release(device);
|
||||
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
|
||||
index df1c373d04a..b090b173ec9 100644
|
||||
index 2128331ca6..e5298ee3d1 100644
|
||||
--- a/dlls/d3d9/tests/visual.c
|
||||
+++ b/dlls/d3d9/tests/visual.c
|
||||
@@ -24637,7 +24637,6 @@ static void test_mvp_software_vertex_shaders(void)
|
||||
@@ -24693,7 +24693,6 @@ static void test_mvp_software_vertex_shaders(void)
|
||||
hr = IDirect3DDevice9_CreateVertexShader(device, reladdr_shader_code, &reladdr_shader);
|
||||
ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_CreateVertexShader(device, pure_sw_shader_code, &pure_sw_shader);
|
||||
@ -71,7 +71,7 @@ index df1c373d04a..b090b173ec9 100644
|
||||
ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements, &vertex_declaration);
|
||||
ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr);
|
||||
@@ -24675,7 +24674,7 @@ static void test_mvp_software_vertex_shaders(void)
|
||||
@@ -24731,7 +24730,7 @@ static void test_mvp_software_vertex_shaders(void)
|
||||
|
||||
expected_color = 0x00ff0000; /* Color from vertex data and not from the shader. */
|
||||
color = getPixelColor(device, 5, 5);
|
||||
@ -80,7 +80,7 @@ index df1c373d04a..b090b173ec9 100644
|
||||
expected_color, color);
|
||||
|
||||
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
|
||||
@@ -24694,7 +24693,6 @@ static void test_mvp_software_vertex_shaders(void)
|
||||
@@ -24750,7 +24749,6 @@ static void test_mvp_software_vertex_shaders(void)
|
||||
|
||||
expected_color = 0x00ffffff;
|
||||
color = getPixelColor(device, 5, 5);
|
||||
@ -88,7 +88,7 @@ index df1c373d04a..b090b173ec9 100644
|
||||
ok(color == expected_color, "Expected color 0x%08x, got 0x%08x (sw shader in sw mode).\n",
|
||||
expected_color, color);
|
||||
|
||||
@@ -24744,7 +24742,6 @@ static void test_mvp_software_vertex_shaders(void)
|
||||
@@ -24800,7 +24798,6 @@ static void test_mvp_software_vertex_shaders(void)
|
||||
|
||||
expected_color = 0x0000ffff; /* c[256] is c_color for SW shader. */
|
||||
color = getPixelColor(device, 5, 5);
|
||||
@ -97,10 +97,10 @@ index df1c373d04a..b090b173ec9 100644
|
||||
expected_color, color);
|
||||
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index d2c4d256ea6..88233de0a6a 100644
|
||||
index ed95996ef3..98aaddd589 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -4529,6 +4529,14 @@ void CDECL wined3d_device_set_software_vertex_processing(struct wined3d_device *
|
||||
@@ -4506,6 +4506,14 @@ void CDECL wined3d_device_set_software_vertex_processing(struct wined3d_device *
|
||||
warned = TRUE;
|
||||
}
|
||||
|
||||
@ -116,7 +116,7 @@ index d2c4d256ea6..88233de0a6a 100644
|
||||
}
|
||||
|
||||
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
|
||||
index b1a3c6bfcef..dbbe47dcab0 100644
|
||||
index cee3621e0d..3d0e69b807 100644
|
||||
--- a/dlls/wined3d/glsl_shader.c
|
||||
+++ b/dlls/wined3d/glsl_shader.c
|
||||
@@ -140,7 +140,9 @@ struct shader_glsl_priv
|
||||
@ -139,7 +139,7 @@ index b1a3c6bfcef..dbbe47dcab0 100644
|
||||
GLint uniform_i_locations[WINED3D_MAX_CONSTS_I];
|
||||
GLint uniform_b_locations[WINED3D_MAX_CONSTS_B];
|
||||
GLint pos_fixup_location;
|
||||
@@ -1185,7 +1187,7 @@ static void bind_and_orphan_consts_ubo(const struct wined3d_gl_info *gl_info, st
|
||||
@@ -1193,7 +1195,7 @@ static void bind_and_orphan_consts_ubo(const struct wined3d_gl_info *gl_info, st
|
||||
{
|
||||
GL_EXTCALL(glBindBuffer(GL_UNIFORM_BUFFER, priv->ubo_vs_c));
|
||||
checkGLcall("glBindBuffer");
|
||||
@ -148,7 +148,7 @@ index b1a3c6bfcef..dbbe47dcab0 100644
|
||||
NULL, GL_STREAM_DRAW));
|
||||
checkGLcall("glBufferData");
|
||||
}
|
||||
@@ -1193,14 +1195,16 @@ static void bind_and_orphan_consts_ubo(const struct wined3d_gl_info *gl_info, st
|
||||
@@ -1201,14 +1203,16 @@ static void bind_and_orphan_consts_ubo(const struct wined3d_gl_info *gl_info, st
|
||||
/* Context activation is done by the caller. */
|
||||
static void shader_glsl_load_constants_f(const struct wined3d_shader *shader, const struct wined3d_gl_info *gl_info,
|
||||
const struct wined3d_vec4 *constants, const GLint *constant_locations, const struct constant_heap *heap,
|
||||
@ -166,7 +166,7 @@ index b1a3c6bfcef..dbbe47dcab0 100644
|
||||
unsigned max_const_used;
|
||||
|
||||
if (priv->ubo_vs_c == -1)
|
||||
@@ -1210,22 +1214,32 @@ static void shader_glsl_load_constants_f(const struct wined3d_shader *shader, co
|
||||
@@ -1218,22 +1222,32 @@ static void shader_glsl_load_constants_f(const struct wined3d_shader *shader, co
|
||||
}
|
||||
|
||||
bind_and_orphan_consts_ubo(gl_info, priv);
|
||||
@ -205,7 +205,7 @@ index b1a3c6bfcef..dbbe47dcab0 100644
|
||||
checkGLcall("glBufferSubData");
|
||||
return;
|
||||
}
|
||||
@@ -1593,7 +1607,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
|
||||
@@ -1601,7 +1615,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
|
||||
GL_EXTCALL(glGenBuffers(1, &priv->ubo_vs_c));
|
||||
GL_EXTCALL(glBindBuffer(GL_UNIFORM_BUFFER, priv->ubo_vs_c));
|
||||
checkGLcall("glBindBuffer (UBO)");
|
||||
@ -214,7 +214,7 @@ index b1a3c6bfcef..dbbe47dcab0 100644
|
||||
NULL, GL_STREAM_DRAW));
|
||||
checkGLcall("glBufferData");
|
||||
}
|
||||
@@ -1605,7 +1619,8 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
|
||||
@@ -1613,7 +1627,8 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
|
||||
|
||||
if (update_mask & WINED3D_SHADER_CONST_VS_F)
|
||||
shader_glsl_load_constants_f(vshader, gl_info, state->vs_consts_f,
|
||||
@ -224,7 +224,7 @@ index b1a3c6bfcef..dbbe47dcab0 100644
|
||||
|
||||
if (update_mask & WINED3D_SHADER_CONST_VS_I)
|
||||
shader_glsl_load_constants_i(vshader, gl_info, state->vs_consts_i,
|
||||
@@ -1758,7 +1773,8 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
|
||||
@@ -1766,7 +1781,8 @@ 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,
|
||||
@ -234,7 +234,7 @@ index b1a3c6bfcef..dbbe47dcab0 100644
|
||||
|
||||
if (update_mask & WINED3D_SHADER_CONST_PS_I)
|
||||
shader_glsl_load_constants_i(pshader, gl_info, state->ps_consts_i,
|
||||
@@ -1903,7 +1919,7 @@ static void shader_glsl_update_float_vertex_constants(struct wined3d_device *dev
|
||||
@@ -1911,7 +1927,7 @@ static void shader_glsl_update_float_vertex_constants(struct wined3d_device *dev
|
||||
if (priv->consts_ubo)
|
||||
return;
|
||||
|
||||
@ -243,7 +243,7 @@ index b1a3c6bfcef..dbbe47dcab0 100644
|
||||
{
|
||||
update_heap_entry(heap, i, priv->next_constant_version);
|
||||
}
|
||||
@@ -2249,7 +2265,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c
|
||||
@@ -2265,7 +2281,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c
|
||||
shader_addline(buffer,"layout(std140) uniform vs_c_ubo\n"
|
||||
"{ \n"
|
||||
" vec4 %s_c[%u];\n"
|
||||
@ -252,7 +252,7 @@ index b1a3c6bfcef..dbbe47dcab0 100644
|
||||
}
|
||||
else if (shader->limits->constant_float > 0)
|
||||
{
|
||||
@@ -9956,12 +9972,13 @@ static void shader_glsl_init_vs_uniform_locations(const struct wined3d_gl_info *
|
||||
@@ -9961,12 +9977,13 @@ static void shader_glsl_init_vs_uniform_locations(const struct wined3d_gl_info *
|
||||
}
|
||||
else if (!priv->consts_ubo)
|
||||
{
|
||||
@ -268,7 +268,7 @@ index b1a3c6bfcef..dbbe47dcab0 100644
|
||||
}
|
||||
|
||||
for (i = 0; i < WINED3D_MAX_CONSTS_I; ++i)
|
||||
@@ -10280,6 +10297,10 @@ static void set_glsl_shader_program(const struct wined3d_context_gl *context_gl,
|
||||
@@ -10284,6 +10301,10 @@ static void set_glsl_shader_program(const struct wined3d_context_gl *context_gl,
|
||||
vs_list = &ffp_shader->linked_programs;
|
||||
}
|
||||
|
||||
@ -279,7 +279,7 @@ index b1a3c6bfcef..dbbe47dcab0 100644
|
||||
hshader = state->shader[WINED3D_SHADER_TYPE_HULL];
|
||||
if (!(context_gl->c.shader_update_mask & (1u << WINED3D_SHADER_TYPE_HULL)) && ctx_data->glsl_program)
|
||||
hs_id = ctx_data->glsl_program->hs.id;
|
||||
@@ -11036,7 +11057,7 @@ static void constant_heap_free(struct constant_heap *heap)
|
||||
@@ -11041,7 +11062,7 @@ static void constant_heap_free(struct constant_heap *heap)
|
||||
static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct wined3d_vertex_pipe_ops *vertex_pipe,
|
||||
const struct wined3d_fragment_pipe_ops *fragment_pipe)
|
||||
{
|
||||
@ -288,7 +288,7 @@ index b1a3c6bfcef..dbbe47dcab0 100644
|
||||
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
struct fragment_caps fragment_caps;
|
||||
void *vertex_priv, *fragment_priv;
|
||||
@@ -11047,6 +11068,18 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
|
||||
@@ -11052,6 +11073,18 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
|
||||
|
||||
priv->consts_ubo = (device->adapter->d3d_info.wined3d_creation_flags & WINED3D_LEGACY_SHADER_CONSTANTS)
|
||||
&& gl_info->supported[ARB_UNIFORM_BUFFER_OBJECT];
|
||||
@ -307,7 +307,7 @@ index b1a3c6bfcef..dbbe47dcab0 100644
|
||||
string_buffer_list_init(&priv->string_buffers);
|
||||
|
||||
if (!(vertex_priv = vertex_pipe->vp_alloc(&glsl_shader_backend, priv)))
|
||||
@@ -11076,7 +11109,7 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
|
||||
@@ -11081,7 +11114,7 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@ -317,10 +317,10 @@ index b1a3c6bfcef..dbbe47dcab0 100644
|
||||
ERR("Failed to initialize vertex shader constant heap\n");
|
||||
goto fail;
|
||||
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
|
||||
index 8477f3de5d1..777e1c548e9 100644
|
||||
index bf8e1c204f..59d5a451cf 100644
|
||||
--- a/dlls/wined3d/shader.c
|
||||
+++ b/dlls/wined3d/shader.c
|
||||
@@ -589,7 +589,7 @@ static void shader_delete_constant_list(struct list *clist)
|
||||
@@ -592,7 +592,7 @@ static void shader_delete_constant_list(struct list *clist)
|
||||
list_init(clist);
|
||||
}
|
||||
|
||||
@ -329,7 +329,7 @@ index 8477f3de5d1..777e1c548e9 100644
|
||||
{
|
||||
static const struct limits_entry
|
||||
{
|
||||
@@ -612,6 +612,19 @@ static void shader_set_limits(struct wined3d_shader *shader)
|
||||
@@ -615,6 +615,19 @@ static void shader_set_limits(struct wined3d_shader *shader)
|
||||
{WINED3D_SHADER_VERSION(4, 1), WINED3D_SHADER_VERSION(5, 0), {16, 0, 0, 0, 32, 0}},
|
||||
{0}
|
||||
},
|
||||
@ -349,7 +349,7 @@ index 8477f3de5d1..777e1c548e9 100644
|
||||
hs_limits[] =
|
||||
{
|
||||
/* min_version, max_version, sampler, constant_int, constant_float, constant_bool, packed_output, packet_input */
|
||||
@@ -656,7 +669,7 @@ static void shader_set_limits(struct wined3d_shader *shader)
|
||||
@@ -659,7 +672,7 @@ static void shader_set_limits(struct wined3d_shader *shader)
|
||||
FIXME("Unexpected shader type %u found.\n", shader->reg_maps.shader_version.type);
|
||||
/* Fall-through. */
|
||||
case WINED3D_SHADER_TYPE_VERTEX:
|
||||
@ -358,7 +358,7 @@ index 8477f3de5d1..777e1c548e9 100644
|
||||
break;
|
||||
case WINED3D_SHADER_TYPE_HULL:
|
||||
limits_array = hs_limits;
|
||||
@@ -1024,7 +1037,7 @@ static HRESULT shader_scan_output_signature(struct wined3d_shader *shader)
|
||||
@@ -1027,7 +1040,7 @@ static HRESULT shader_scan_output_signature(struct wined3d_shader *shader)
|
||||
}
|
||||
|
||||
/* Note that this does not count the loop register as an address register. */
|
||||
@ -367,7 +367,7 @@ index 8477f3de5d1..777e1c548e9 100644
|
||||
{
|
||||
struct wined3d_shader_signature_element input_signature_elements[max(MAX_ATTRIBS, MAX_REG_INPUT)];
|
||||
struct wined3d_shader_signature_element output_signature_elements[MAX_REG_OUTPUT];
|
||||
@@ -1050,7 +1063,7 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, DWORD co
|
||||
@@ -1053,7 +1066,7 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, DWORD co
|
||||
prev_ins = current_ins = ptr;
|
||||
reg_maps->shader_version = shader_version;
|
||||
|
||||
@ -376,7 +376,7 @@ index 8477f3de5d1..777e1c548e9 100644
|
||||
|
||||
if (!(reg_maps->constf = heap_calloc(((min(shader->limits->constant_float, constf_size) + 31) / 32),
|
||||
sizeof(*reg_maps->constf))))
|
||||
@@ -3322,7 +3335,7 @@ static unsigned int shader_max_version_from_feature_level(enum wined3d_feature_l
|
||||
@@ -3325,7 +3338,7 @@ static unsigned int shader_max_version_from_feature_level(enum wined3d_feature_l
|
||||
}
|
||||
|
||||
static HRESULT shader_set_function(struct wined3d_shader *shader, struct wined3d_device *device,
|
||||
@ -385,7 +385,7 @@ index 8477f3de5d1..777e1c548e9 100644
|
||||
{
|
||||
const struct wined3d_d3d_info *d3d_info = &shader->device->adapter->d3d_info;
|
||||
struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps;
|
||||
@@ -3347,7 +3360,7 @@ static HRESULT shader_set_function(struct wined3d_shader *shader, struct wined3d
|
||||
@@ -3350,7 +3363,7 @@ static HRESULT shader_set_function(struct wined3d_shader *shader, struct wined3d
|
||||
shader_trace_init(fe, shader->frontend_data);
|
||||
|
||||
/* Second pass: figure out which registers are used, what the semantics are, etc. */
|
||||
@ -394,7 +394,7 @@ index 8477f3de5d1..777e1c548e9 100644
|
||||
return hr;
|
||||
|
||||
if (version->type != type)
|
||||
@@ -3687,14 +3700,19 @@ static HRESULT vertex_shader_init(struct wined3d_shader *shader, struct wined3d_
|
||||
@@ -3689,14 +3702,19 @@ static HRESULT vertex_shader_init(struct wined3d_shader *shader, struct wined3d_
|
||||
const struct wined3d_shader_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps;
|
||||
@ -415,7 +415,7 @@ index 8477f3de5d1..777e1c548e9 100644
|
||||
{
|
||||
shader_cleanup(shader);
|
||||
return hr;
|
||||
@@ -3798,7 +3816,7 @@ static HRESULT geometry_shader_init_stream_output(struct wined3d_shader *shader,
|
||||
@@ -3800,7 +3818,7 @@ static HRESULT geometry_shader_init_stream_output(struct wined3d_shader *shader,
|
||||
{
|
||||
shader->reg_maps.shader_version = shader_version;
|
||||
shader->reg_maps.shader_version.type = WINED3D_SHADER_TYPE_GEOMETRY;
|
||||
@ -424,7 +424,7 @@ index 8477f3de5d1..777e1c548e9 100644
|
||||
if (FAILED(hr = shader_scan_output_signature(shader)))
|
||||
return hr;
|
||||
}
|
||||
@@ -3851,7 +3869,7 @@ static HRESULT geometry_shader_init(struct wined3d_shader *shader, struct wined3
|
||||
@@ -3853,7 +3871,7 @@ static HRESULT geometry_shader_init(struct wined3d_shader *shader, struct wined3
|
||||
goto fail;
|
||||
|
||||
if (shader->function
|
||||
@ -433,7 +433,7 @@ index 8477f3de5d1..777e1c548e9 100644
|
||||
goto fail;
|
||||
|
||||
return WINED3D_OK;
|
||||
@@ -4188,7 +4206,7 @@ static HRESULT pixel_shader_init(struct wined3d_shader *shader, struct wined3d_d
|
||||
@@ -4183,7 +4201,7 @@ static HRESULT pixel_shader_init(struct wined3d_shader *shader, struct wined3d_d
|
||||
return hr;
|
||||
|
||||
if (FAILED(hr = shader_set_function(shader, device,
|
||||
@ -442,7 +442,7 @@ index 8477f3de5d1..777e1c548e9 100644
|
||||
{
|
||||
shader_cleanup(shader);
|
||||
return hr;
|
||||
@@ -4280,7 +4298,7 @@ HRESULT CDECL wined3d_shader_create_cs(struct wined3d_device *device, const stru
|
||||
@@ -4275,7 +4293,7 @@ HRESULT CDECL wined3d_shader_create_cs(struct wined3d_device *device, const stru
|
||||
return hr;
|
||||
}
|
||||
|
||||
@ -451,7 +451,7 @@ index 8477f3de5d1..777e1c548e9 100644
|
||||
{
|
||||
shader_cleanup(object);
|
||||
heap_free(object);
|
||||
@@ -4314,7 +4332,7 @@ HRESULT CDECL wined3d_shader_create_ds(struct wined3d_device *device, const stru
|
||||
@@ -4309,7 +4327,7 @@ HRESULT CDECL wined3d_shader_create_ds(struct wined3d_device *device, const stru
|
||||
return hr;
|
||||
}
|
||||
|
||||
@ -460,7 +460,7 @@ index 8477f3de5d1..777e1c548e9 100644
|
||||
{
|
||||
shader_cleanup(object);
|
||||
heap_free(object);
|
||||
@@ -4376,7 +4394,7 @@ HRESULT CDECL wined3d_shader_create_hs(struct wined3d_device *device, const stru
|
||||
@@ -4371,7 +4389,7 @@ HRESULT CDECL wined3d_shader_create_hs(struct wined3d_device *device, const stru
|
||||
return hr;
|
||||
}
|
||||
|
||||
@ -470,7 +470,7 @@ index 8477f3de5d1..777e1c548e9 100644
|
||||
shader_cleanup(object);
|
||||
heap_free(object);
|
||||
diff --git a/dlls/wined3d/shader_sm1.c b/dlls/wined3d/shader_sm1.c
|
||||
index 0c6bb933174..1051307e88c 100644
|
||||
index 0c6bb93317..1051307e88 100644
|
||||
--- a/dlls/wined3d/shader_sm1.c
|
||||
+++ b/dlls/wined3d/shader_sm1.c
|
||||
@@ -543,7 +543,7 @@ static void *shader_sm1_init(const DWORD *byte_code, size_t byte_code_size,
|
||||
@ -483,10 +483,10 @@ index 0c6bb933174..1051307e88c 100644
|
||||
WARN("Invalid shader version %u.%u (%#x).\n", major, minor, *byte_code);
|
||||
return NULL;
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 5568297bcf6..aba465c05e6 100644
|
||||
index cfda378cc0..bc9e8a2aa4 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -4609,6 +4609,13 @@ static inline BOOL shader_constant_is_local(const struct wined3d_shader *shader,
|
||||
@@ -4860,6 +4860,13 @@ static inline BOOL shader_constant_is_local(const struct wined3d_shader *shader,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -501,5 +501,5 @@ index 5568297bcf6..aba465c05e6 100644
|
||||
void get_modelview_matrix(const struct wined3d_context *context, const struct wined3d_state *state,
|
||||
unsigned int index, struct wined3d_matrix *mat) DECLSPEC_HIDDEN;
|
||||
--
|
||||
2.17.1
|
||||
2.21.0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user