Rebase against upstream changes.

This commit is contained in:
Sebastian Lackner 2015-03-20 17:01:00 +01:00
parent a526f3eb07
commit 0958d303e9
4 changed files with 112 additions and 112 deletions

View File

@ -1,4 +1,4 @@
From a28b86b048950e7f1bc93168bc3313eae44f82fa Mon Sep 17 00:00:00 2001
From ba3b68f58c3e4a9b1cd20ebf8aea087e1adb0bf0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 2 Apr 2013 17:25:19 +0200
Subject: wined3d: Pass the state to draw_primitive
@ -15,7 +15,7 @@ Subject: wined3d: Pass the state to draw_primitive
8 files changed, 28 insertions(+), 27 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index abad8b8..8165d6b 100644
index 00aae2a..5b39e40 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -423,7 +423,7 @@ static inline void fixup_d3dcolor(DWORD *dst_color)
@ -42,10 +42,10 @@ index abad8b8..8165d6b 100644
*/
if (!gl_info->supported[ARB_VERTEX_BUFFER_OBJECT])
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index ffb1c43..7ba4086 100644
index a5d6478..d63dc6f 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -2896,7 +2896,7 @@ static void context_update_stream_info(struct wined3d_context *context, const st
@@ -2898,7 +2898,7 @@ static void context_update_stream_info(struct wined3d_context *context, const st
{
if (state->vertex_declaration->half_float_conv_needed && !stream_info->all_vbo)
{
@ -54,7 +54,7 @@ index ffb1c43..7ba4086 100644
context->use_immediate_mode_draw = TRUE;
}
else
@@ -2968,9 +2968,9 @@ static void context_preload_textures(struct wined3d_context *context, const stru
@@ -3038,9 +3038,9 @@ static void context_bind_shader_resources(struct wined3d_context *context, const
}
/* Context activation is done by the caller. */
@ -67,7 +67,7 @@ index ffb1c43..7ba4086 100644
const struct wined3d_fb_state *fb = &state->fb;
unsigned int i, j;
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index fa1ee3a..eac7739 100644
index 520fcbf..3a0067e 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -482,7 +482,7 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
@ -80,10 +80,10 @@ index fa1ee3a..eac7739 100644
return sizeof(*op);
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 794496b..f7b5562 100644
index 3667840..b45aea5 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -4732,7 +4732,7 @@ static void WINE_GLAPI invalid_texcoord_func(GLenum unit, const void *data)
@@ -5341,7 +5341,7 @@ static void WINE_GLAPI invalid_texcoord_func(GLenum unit, const void *data)
}
/* Helper functions for providing vertex data to opengl. The arrays are initialized based on
@ -93,7 +93,7 @@ index 794496b..f7b5562 100644
static void WINE_GLAPI position_d3dcolor(const void *data)
{
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index d3a9e03..1627cfa 100644
index 00ada90..d6319ba 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -36,7 +36,7 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_perf);
@ -105,7 +105,7 @@ index d3a9e03..1627cfa 100644
const void *idx_data, UINT start_idx, INT base_vertex_index, UINT start_instance, UINT instance_count)
{
if (idx_size)
@@ -92,7 +92,7 @@ static void drawStridedFast(const struct wined3d_gl_info *gl_info, GLenum primit
@@ -85,7 +85,7 @@ static void drawStridedFast(const struct wined3d_gl_info *gl_info, GLenum primit
*/
/* Context activation is done by the caller. */
@ -114,7 +114,7 @@ index d3a9e03..1627cfa 100644
const struct wined3d_stream_info *si, UINT NumVertexes, GLenum glPrimType,
const void *idxData, UINT idxSize, UINT startIdx)
{
@@ -100,7 +100,6 @@ static void drawStridedSlow(const struct wined3d_device *device, struct wined3d_
@@ -93,7 +93,6 @@ static void drawStridedSlow(const struct wined3d_device *device, struct wined3d_
const WORD *pIdxBufS = NULL;
const DWORD *pIdxBufL = NULL;
UINT vx_index;
@ -122,7 +122,7 @@ index d3a9e03..1627cfa 100644
LONG SkipnStrides = startIdx;
BOOL pixelShader = use_ps(state);
BOOL specular_fog = FALSE;
@@ -450,7 +449,7 @@ static inline void send_attribute(const struct wined3d_gl_info *gl_info,
@@ -443,7 +442,7 @@ static inline void send_attribute(const struct wined3d_gl_info *gl_info,
}
/* Context activation is done by the caller. */
@ -131,7 +131,7 @@ index d3a9e03..1627cfa 100644
const struct wined3d_stream_info *si, UINT numberOfVertices, GLenum glPrimitiveType,
const void *idxData, UINT idxSize, UINT startIdx)
{
@@ -507,7 +506,7 @@ static void drawStridedSlowVs(struct wined3d_context *context, const struct wine
@@ -500,7 +499,7 @@ static void drawStridedSlowVs(struct wined3d_context *context, const struct wine
}
/* Context activation is done by the caller. */
@ -140,7 +140,7 @@ index d3a9e03..1627cfa 100644
const struct wined3d_stream_info *si, UINT numberOfVertices, GLenum glPrimitiveType,
const void *idxData, UINT idxSize, UINT startIdx, UINT base_vertex_index, UINT instance_count)
{
@@ -592,10 +591,10 @@ static void remove_vbos(struct wined3d_context *context,
@@ -585,10 +584,10 @@ static void remove_vbos(struct wined3d_context *context,
}
/* Routine common to the draw primitive and draw indexed primitive routines */
@ -154,7 +154,7 @@ index d3a9e03..1627cfa 100644
const struct wined3d_stream_info *stream_info;
struct wined3d_event_query *ib_query = NULL;
struct wined3d_stream_info si_emulated;
@@ -661,7 +660,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
@@ -654,7 +653,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
}
}
@ -163,7 +163,7 @@ index d3a9e03..1627cfa 100644
{
context_release(context);
WARN("Unable to apply draw state, skipping draw.\n");
@@ -753,24 +752,24 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
@@ -746,24 +745,24 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
else
WARN_(d3d_perf)("Using immediate mode with vertex shaders for half float emulation.\n");
@ -193,10 +193,10 @@ index d3a9e03..1627cfa 100644
}
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 20f00d6..ba5c127 100644
index af26308..4b73613 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -1168,7 +1168,7 @@ void state_fog_fragpart(struct wined3d_context *context, const struct wined3d_st
@@ -1164,7 +1164,7 @@ void state_fog_fragpart(struct wined3d_context *context, const struct wined3d_st
case WINED3D_FOG_NONE:
/* Both are none? According to msdn the alpha channel of the specular
@ -205,7 +205,7 @@ index 20f00d6..ba5c127 100644
* Same happens with Vertexfog on transformed vertices
*/
new_source = FOGSOURCE_COORD;
@@ -4296,7 +4296,7 @@ static void load_vertex_data(struct wined3d_context *context,
@@ -4408,7 +4408,7 @@ static void load_vertex_data(struct wined3d_context *context,
}
}
} else {
@ -215,10 +215,10 @@ index 20f00d6..ba5c127 100644
*/
WARN("unsupported blending in openGl\n");
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 8ff4e3e..389f31a 100644
index 248fac8..a981575 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -3160,7 +3160,7 @@ void set_texture_matrix(const struct wined3d_gl_info *gl_info, const float *smat
@@ -3242,7 +3242,7 @@ void set_texture_matrix(const struct wined3d_gl_info *gl_info, const struct wine
* check for pixel shaders, and the shader has to undo the default gl divide.
*
* A more serious problem occurs if the app passes 4 coordinates in, and the
@ -226,12 +226,12 @@ index 8ff4e3e..389f31a 100644
+ * 4th is != 1.0(opengl default). This would have to be fixed in draw_strided_slow
* or a replacement shader. */
default:
mat[3] = mat[7] = mat[11] = 0; mat[15] = 1;
mat._14 = mat._24 = mat._34 = 0.0f; mat._44 = 1.0f;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 5c5d52c..a48cc7d 100644
index f2fb5a6..09893ea 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -966,8 +966,9 @@ struct wined3d_stream_info
@@ -994,8 +994,9 @@ struct wined3d_stream_info
WORD use_map; /* MAX_ATTRIBS, 16 */
};
@ -243,7 +243,7 @@ index 5c5d52c..a48cc7d 100644
DWORD get_flexible_vertex_size(DWORD d3dvtVertexType) DECLSPEC_HIDDEN;
#define eps 1e-8f
@@ -1358,7 +1359,8 @@ void context_alloc_occlusion_query(struct wined3d_context *context,
@@ -1390,7 +1391,8 @@ void context_alloc_occlusion_query(struct wined3d_context *context,
void context_apply_blit_state(struct wined3d_context *context, const struct wined3d_device *device) DECLSPEC_HIDDEN;
BOOL context_apply_clear_state(struct wined3d_context *context, const struct wined3d_device *device,
UINT rt_count, const struct wined3d_fb_state *fb) DECLSPEC_HIDDEN;
@ -254,5 +254,5 @@ index 5c5d52c..a48cc7d 100644
struct wined3d_surface *render_target, struct wined3d_surface *depth_stencil, DWORD location) DECLSPEC_HIDDEN;
void context_active_texture(struct wined3d_context *context, const struct wined3d_gl_info *gl_info,
--
2.1.3
2.3.2

View File

@ -1,4 +1,4 @@
From d2d8473f40a3cd357c33b4804d3b2489eaf6d979 Mon Sep 17 00:00:00 2001
From 0f3dbbb7464b63565408e3d2914fcada665785c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 1 Oct 2013 15:30:26 +0200
Subject: wined3d: Give the cs its own state
@ -10,7 +10,7 @@ Subject: wined3d: Give the cs its own state
3 files changed, 99 insertions(+), 16 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 8823c9a..d252773 100644
index b68f252..3b83616 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -62,6 +62,7 @@ enum wined3d_cs_op
@ -126,7 +126,7 @@ index 8823c9a..d252773 100644
cs->ops->submit(cs);
}
@@ -1158,6 +1232,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1161,6 +1235,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_SET_CLIP_PLANE */ wined3d_cs_exec_set_clip_plane,
/* WINED3D_CS_OP_SET_MATERIAL */ wined3d_cs_exec_set_material,
/* WINED3D_CS_OP_RESET_STATE */ wined3d_cs_exec_reset_state,
@ -134,7 +134,7 @@ index 8823c9a..d252773 100644
};
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
@@ -1247,7 +1322,7 @@ done:
@@ -1250,7 +1325,7 @@ done:
struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
@ -143,7 +143,7 @@ index 8823c9a..d252773 100644
if (!(cs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cs))))
return NULL;
@@ -1255,8 +1330,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -1258,8 +1333,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
if (FAILED(state_init(&cs->state, gl_info, &device->adapter->d3d_info,
WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT)))
{
@ -153,7 +153,7 @@ index 8823c9a..d252773 100644
}
cs->ops = &wined3d_cs_st_ops;
@@ -1265,16 +1339,13 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -1268,16 +1342,13 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
cs->data_size = WINED3D_INITIAL_CS_SIZE;
if (!(cs->data = HeapAlloc(GetProcessHeap(), 0, cs->data_size)))
{
@ -172,7 +172,7 @@ index 8823c9a..d252773 100644
}
if (wined3d_settings.cs_multithreaded)
@@ -1287,15 +1358,22 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -1290,15 +1361,22 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, NULL)))
{
ERR("Failed to create wined3d command stream thread.\n");
@ -201,10 +201,10 @@ index 8823c9a..d252773 100644
void wined3d_cs_destroy(struct wined3d_cs *cs)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 3bb3cf0..6ea0b9a 100644
index 419148e..1c2f9de 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3391,6 +3391,7 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT
@@ -3409,6 +3409,7 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT
device_invalidate_state(device, STATE_BASEVERTEXINDEX);
}
@ -212,7 +212,7 @@ index 3bb3cf0..6ea0b9a 100644
wined3d_cs_emit_draw(device->cs, start_vertex, vertex_count, 0, 0, FALSE);
return WINED3D_OK;
@@ -3425,6 +3426,7 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic
@@ -3443,6 +3444,7 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic
device_invalidate_state(device, STATE_BASEVERTEXINDEX);
}
@ -220,19 +220,19 @@ index 3bb3cf0..6ea0b9a 100644
wined3d_cs_emit_draw(device->cs, start_idx, index_count, 0, 0, TRUE);
return WINED3D_OK;
@@ -3435,6 +3437,7 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
{
TRACE("device %p, start_idx %u, index_count %u.\n", device, start_idx, index_count);
@@ -3454,6 +3456,7 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
TRACE("device %p, start_idx %u, index_count %u, start_instance %u, instance_count %u.\n",
device, start_idx, index_count, start_instance, instance_count);
+ wined3d_cs_emit_transfer_stateblock(device->cs, &device->state);
wined3d_cs_emit_draw(device->cs, start_idx, index_count, start_instance, instance_count, TRUE);
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index b856b6f..02104ce 100644
index d8c6d63..8fcfa12 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2537,7 +2537,7 @@ struct wined3d_cs_block
@@ -2561,7 +2561,7 @@ struct wined3d_cs_block
{
struct list entry;
UINT pos;
@ -241,7 +241,7 @@ index b856b6f..02104ce 100644
};
struct wined3d_cs_ops
@@ -2577,6 +2577,8 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx,
@@ -2601,6 +2601,8 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx,
const struct wined3d_vec4 *plane) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type,
UINT cb_idx, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN;
@ -251,5 +251,5 @@ index b856b6f..02104ce 100644
struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer,
--
2.1.3
2.3.2

View File

@ -1,4 +1,4 @@
From 8ca77cbd15b2c770395d2f8d4dfc7d1eb05fc131 Mon Sep 17 00:00:00 2001
From 79d2e9e1c883ecb8c755fd1eafec7c1be1f85e71 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Wed, 10 Apr 2013 17:16:02 +0200
Subject: wined3d: Send light updates through the command stream
@ -10,7 +10,7 @@ Subject: wined3d: Send light updates through the command stream
3 files changed, 174 insertions(+), 65 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index cf3a523..f48d14a 100644
index 8dc5ce8..1660380 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -62,7 +62,6 @@ enum wined3d_cs_op
@ -99,7 +99,7 @@ index cf3a523..f48d14a 100644
static UINT wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data)
{
const struct wined3d_cs_set_shader_resource_view *op = data;
@@ -1471,6 +1450,152 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
@@ -1474,6 +1453,152 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
cs->ops->submit(cs);
}
@ -252,7 +252,7 @@ index cf3a523..f48d14a 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence,
@@ -1499,7 +1624,6 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1502,7 +1627,6 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_SET_CLIP_PLANE */ wined3d_cs_exec_set_clip_plane,
/* WINED3D_CS_OP_SET_MATERIAL */ wined3d_cs_exec_set_material,
/* WINED3D_CS_OP_RESET_STATE */ wined3d_cs_exec_reset_state,
@ -260,7 +260,7 @@ index cf3a523..f48d14a 100644
/* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f,
/* WINED3D_CS_OP_SET_VS_CONSTS_B */ wined3d_cs_exec_set_vs_consts_b,
/* WINED3D_CS_OP_SET_VS_CONSTS_I */ wined3d_cs_exec_set_vs_consts_i,
@@ -1509,6 +1633,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1512,6 +1636,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish,
/* WINED3D_CS_OP_SET_BASE_VERTEX_INDEX */ wined3d_cs_exec_set_base_vertex_index,
/* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type,
@ -270,10 +270,10 @@ index cf3a523..f48d14a 100644
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 9ba40df..05a353c 100644
index 403a2f4..1629ee2 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1448,14 +1448,6 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
@@ -1466,14 +1466,6 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
TRACE("... Range(%f), Falloff(%f), Theta(%f), Phi(%f)\n",
light->range, light->falloff, light->theta, light->phi);
@ -288,7 +288,7 @@ index 9ba40df..05a353c 100644
/* Save away the information. */
object->OriginalParms = *light;
@@ -1528,6 +1520,9 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
@@ -1546,6 +1538,9 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
FIXME("Unrecognized light type %#x.\n", light->type);
}
@ -298,7 +298,7 @@ index 9ba40df..05a353c 100644
return WINED3D_OK;
}
@@ -1600,12 +1595,6 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN
@@ -1618,12 +1613,6 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN
{
if (light_info->glIndex != -1)
{
@ -311,7 +311,7 @@ index 9ba40df..05a353c 100644
device->update_state->lights[light_info->glIndex] = NULL;
light_info->glIndex = -1;
}
@@ -1647,16 +1636,12 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN
@@ -1665,16 +1654,12 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN
WARN("Too many concurrently active lights\n");
return WINED3D_OK;
}
@ -331,7 +331,7 @@ index 9ba40df..05a353c 100644
return WINED3D_OK;
}
@@ -3383,7 +3368,6 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT
@@ -3401,7 +3386,6 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT
return WINED3DERR_INVALIDCALL;
}
@ -339,7 +339,7 @@ index 9ba40df..05a353c 100644
wined3d_cs_emit_draw(device->cs, start_vertex, vertex_count, 0, 0, FALSE);
return WINED3D_OK;
@@ -3409,8 +3393,6 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic
@@ -3427,8 +3411,6 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic
return WINED3DERR_INVALIDCALL;
}
@ -348,19 +348,19 @@ index 9ba40df..05a353c 100644
wined3d_cs_emit_draw(device->cs, start_idx, index_count, 0, 0, TRUE);
return WINED3D_OK;
@@ -3421,7 +3403,6 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
{
TRACE("device %p, start_idx %u, index_count %u.\n", device, start_idx, index_count);
@@ -3440,7 +3422,6 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
TRACE("device %p, start_idx %u, index_count %u, start_instance %u, instance_count %u.\n",
device, start_idx, index_count, start_instance, instance_count);
- wined3d_cs_emit_transfer_stateblock(device->cs, &device->state);
wined3d_cs_emit_draw(device->cs, start_idx, index_count, start_instance, instance_count, TRUE);
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 59149bd..54cf7b5 100644
index 1447a60..d30f19f 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2535,7 +2535,9 @@ struct wined3d_cs_block
@@ -2559,7 +2559,9 @@ struct wined3d_cs_block
{
struct list entry;
UINT pos;
@ -371,7 +371,7 @@ index 59149bd..54cf7b5 100644
};
struct wined3d_cs_ops
@@ -2578,8 +2580,6 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx,
@@ -2602,8 +2604,6 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx,
const struct wined3d_vec4 *plane) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type,
UINT cb_idx, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN;
@ -380,7 +380,7 @@ index 59149bd..54cf7b5 100644
void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs,
struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer,
@@ -2625,6 +2625,8 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs,
@@ -2649,6 +2649,8 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs,
UINT base_vertex_index) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs,
GLenum primitive_type) DECLSPEC_HIDDEN;
@ -390,5 +390,5 @@ index 59149bd..54cf7b5 100644
/* Direct3D terminology with little modifications. We do not have an issued state
* because only the driver knows about it, but we have a created state because d3d
--
2.1.3
2.3.2

View File

@ -1104,15 +1104,15 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -3227,6 +3227,7 @@
@@ -3232,6 +3232,7 @@
/* case WINED3D_TTFF_COUNT1: Won't ever get here. */
case WINED3D_TTFF_COUNT2:
mat[2] = mat[6] = mat[10] = mat[14] = 0;
mat._13 = mat._23 = mat._33 = mat._43 = 0.0f;
+#if defined(STAGING_CSMT)
/* OpenGL divides the first 3 vertex coord by the 4th by default,
* which is essentially the same as D3DTTFF_PROJECTED. Make sure that
* the 4th coord evaluates to 1.0 to eliminate that.
@@ -3239,6 +3240,20 @@
@@ -3244,6 +3245,20 @@
* A more serious problem occurs if the app passes 4 coordinates in, and the
* 4th is != 1.0(opengl default). This would have to be fixed in draw_strided_slow
* or a replacement shader. */
@ -1131,9 +1131,9 @@ diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
+ * or a replacement shader. */
+#endif /* STAGING_CSMT */
default:
mat[3] = mat[7] = mat[11] = 0; mat[15] = 1;
mat._14 = mat._24 = mat._34 = 0.0f; mat._44 = 1.0f;
}
@@ -3505,7 +3520,11 @@
@@ -3508,7 +3523,11 @@
unsigned int i;
DWORD ttff;
DWORD cop, aop, carg0, carg1, carg2, aarg0, aarg1, aarg2;
@ -3753,7 +3753,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
wined3d_cs_emit_draw(device->cs, start_idx, index_count, 0, 0, TRUE);
return WINED3D_OK;
@@ -3383,6 +3688,7 @@
@@ -3384,6 +3689,7 @@
}
/* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */
@ -3761,7 +3761,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
static void device_update_volume(struct wined3d_context *context,
struct wined3d_volume *src_volume, struct wined3d_volume *dst_volume)
{
@@ -3422,6 +3728,101 @@
@@ -3423,6 +3729,101 @@
/* Make sure that the destination texture is loaded. */
wined3d_texture_load(dst_texture, context, FALSE);
@ -3863,7 +3863,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
/* Update every surface level of the texture. */
switch (type)
@@ -3435,7 +3836,16 @@
@@ -3436,7 +3837,16 @@
{
src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, i));
dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i));
@ -3880,7 +3880,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
break;
}
@@ -3449,7 +3859,16 @@
@@ -3450,7 +3860,16 @@
{
src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, i));
dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i));
@ -3897,7 +3897,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
break;
}
@@ -3458,6 +3877,7 @@
@@ -3459,6 +3878,7 @@
{
for (i = 0; i < level_count; ++i)
{
@ -3905,7 +3905,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
device_update_volume(context,
volume_from_resource(wined3d_texture_get_sub_resource(src_texture, i)),
volume_from_resource(wined3d_texture_get_sub_resource(dst_texture, i)));
@@ -3514,6 +3934,24 @@
@@ -3515,6 +3935,24 @@
}
wined3d_cs_emit_update_texture(device->cs, src_texture, dst_texture);
@ -3930,7 +3930,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return WINED3D_OK;
}
@@ -3576,8 +4014,13 @@
@@ -3577,8 +4015,13 @@
if (state->render_states[WINED3D_RS_ZENABLE] || state->render_states[WINED3D_RS_ZWRITEENABLE]
|| state->render_states[WINED3D_RS_STENCILENABLE])
{
@ -3944,7 +3944,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (ds && rt && (ds->width < rt->width || ds->height < rt->height))
{
@@ -3674,6 +4117,7 @@
@@ -3675,6 +4118,7 @@
struct wined3d_surface *src_surface, const RECT *src_rect,
struct wined3d_surface *dst_surface, const POINT *dst_point)
{
@ -3952,7 +3952,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
const struct wined3d_format *src_format = src_surface->resource.format;
const struct wined3d_format *dst_format = dst_surface->resource.format;
UINT update_w, update_h;
@@ -3681,6 +4125,7 @@
@@ -3682,6 +4126,7 @@
RECT r, dst_rect;
POINT p;
@ -3960,7 +3960,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
TRACE("device %p, src_surface %p, src_rect %s, dst_surface %p, dst_point %s.\n",
device, src_surface, wine_dbgstr_rect(src_rect),
dst_surface, wine_dbgstr_point(dst_point));
@@ -3692,6 +4137,7 @@
@@ -3693,6 +4138,7 @@
return WINED3DERR_INVALIDCALL;
}
@ -3968,7 +3968,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (src_format->id != dst_format->id)
{
WARN("Source and destination surfaces should have the same format.\n");
@@ -3754,6 +4200,9 @@
@@ -3755,6 +4201,9 @@
wined3d_cs_emit_update_surface(device->cs, src_surface, src_rect, dst_surface, dst_point);
return WINED3D_OK;
@ -3978,7 +3978,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
void CDECL wined3d_device_copy_resource(struct wined3d_device *device,
@@ -3855,8 +4304,14 @@
@@ -3856,8 +4305,14 @@
rect = &r;
}
@ -3993,7 +3993,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device,
@@ -3870,6 +4325,7 @@
@@ -3871,6 +4326,7 @@
return NULL;
}
@ -4001,7 +4001,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return device->state.fb.render_targets[view_idx];
}
@@ -3885,6 +4341,22 @@
@@ -3886,6 +4342,22 @@
{
struct wined3d_rendertarget_view *prev;
struct wined3d_fb_state *fb = &device->state.fb;
@ -4024,7 +4024,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
TRACE("device %p, view_idx %u, view %p, set_viewport %#x.\n",
device, view_idx, view, set_viewport);
@@ -3924,6 +4396,7 @@
@@ -3925,6 +4397,7 @@
}
@ -4032,7 +4032,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
prev = fb->render_targets[view_idx];
if (view == prev)
return WINED3D_OK;
@@ -3931,6 +4404,15 @@
@@ -3932,6 +4405,15 @@
if (view)
wined3d_rendertarget_view_incref(view);
fb->render_targets[view_idx] = view;
@ -4048,7 +4048,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
wined3d_cs_emit_set_rendertarget_view(device->cs, view_idx, view);
/* Release after the assignment, to prevent device_resource_released()
* from seeing the surface as still in use. */
@@ -3942,6 +4424,7 @@
@@ -3943,6 +4425,7 @@
void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view)
{
@ -4056,7 +4056,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
struct wined3d_fb_state *fb = &device->state.fb;
struct wined3d_rendertarget_view *prev;
@@ -3966,6 +4449,79 @@
@@ -3967,6 +4450,79 @@
{
TRACE("device %p, x_hotspot %u, y_hotspot %u, cursor_image %p.\n",
device, x_hotspot, y_hotspot, cursor_image);
@ -4136,7 +4136,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (cursor_image)
{
@@ -4001,8 +4557,16 @@
@@ -4002,8 +4558,16 @@
* release it after setting the cursor image. Windows doesn't
* addref the set surface, so we can't do this either without
* creating circular refcount dependencies. */
@ -4153,7 +4153,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
device->cursorWidth = cursor_image->resource.width;
device->cursorHeight = cursor_image->resource.height;
@@ -4102,6 +4666,12 @@
@@ -4103,6 +4667,12 @@
else
SetCursor(NULL);
}
@ -4166,7 +4166,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return oldVisible;
}
@@ -4112,8 +4682,10 @@
@@ -4113,8 +4683,10 @@
TRACE("device %p.\n", device);
@ -4177,7 +4177,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry)
{
TRACE("Checking resource %p for eviction.\n", resource);
@@ -4121,6 +4693,7 @@
@@ -4122,6 +4694,7 @@
if (resource->pool == WINED3D_POOL_MANAGED && !resource->map_count)
{
TRACE("Evicting %p.\n", resource);
@ -4185,7 +4185,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
wined3d_cs_emit_evict_resource(device->cs, resource);
}
}
@@ -4141,6 +4714,37 @@
@@ -4142,6 +4715,37 @@
gl_info = context->gl_info;
wine_rb_clear(&device->samplers, device_free_sampler, NULL);
@ -4223,7 +4223,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (device->depth_blt_texture)
{
@@ -4161,6 +4765,7 @@
@@ -4162,6 +4766,7 @@
HeapFree(GetProcessHeap(), 0, swapchain->context);
swapchain->context = NULL;
@ -4231,7 +4231,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
swapchain->num_contexts = 0;
}
@@ -4180,6 +4785,14 @@
@@ -4181,6 +4786,14 @@
static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain)
{
@ -4246,7 +4246,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
HRESULT hr;
if (FAILED(hr = device->shader_backend->shader_alloc_private(device,
@@ -4196,6 +4809,7 @@
@@ -4197,6 +4810,7 @@
return hr;
}
@ -4254,7 +4254,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain);
if (FAILED(hr))
{
@@ -4206,6 +4820,34 @@
@@ -4207,6 +4821,34 @@
}
wined3d_cs_emit_create_dummy_textures(device->cs);
@ -4289,7 +4289,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return WINED3D_OK;
}
@@ -4225,8 +4867,10 @@
@@ -4226,8 +4868,10 @@
unsigned int i;
TRACE("device %p, swapchain_desc %p, mode %p, callback %p.\n", device, swapchain_desc, mode, callback);
@ -4300,7 +4300,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (!(swapchain = wined3d_device_get_swapchain(device, 0)))
{
@@ -4242,9 +4886,21 @@
@@ -4243,9 +4887,21 @@
wined3d_texture_decref(device->logo_texture);
device->logo_texture = NULL;
}
@ -4322,7 +4322,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
{
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
@@ -4253,6 +4909,7 @@
@@ -4254,6 +4910,7 @@
}
wined3d_device_set_depth_stencil_view(device, NULL);
@ -4330,7 +4330,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (reset_state)
{
state_unbind_resources(&device->state);
@@ -4262,6 +4919,12 @@
@@ -4263,6 +4920,12 @@
{
wined3d_surface_decref(device->cs->onscreen_depth_stencil);
device->cs->onscreen_depth_stencil = NULL;
@ -4343,7 +4343,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
if (reset_state)
@@ -4274,6 +4937,7 @@
@@ -4275,6 +4938,7 @@
}
}
@ -4351,7 +4351,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
/* Free implicit resources and wait for the command stream before modifying
* swapchain parameters. After modifying the swapchain parameters a new GL
* context may be acquired by the worker thread. This causes problems in the
@@ -4295,6 +4959,7 @@
@@ -4296,6 +4960,7 @@
}
device->cs->ops->finish(device->cs);
@ -4359,7 +4359,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
/* Is it necessary to recreate the gl context? Actually every setting can be changed
* on an existing gl context, so there's no real need for recreation.
*
@@ -4430,6 +5095,13 @@
@@ -4431,6 +5096,13 @@
}
}
@ -4373,7 +4373,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (swapchain->desc.enable_auto_depth_stencil)
{
struct wined3d_resource_desc surface_desc;
@@ -4467,6 +5139,13 @@
@@ -4468,6 +5140,13 @@
wined3d_device_set_depth_stencil_view(device, device->auto_depth_stencil_view);
}
@ -4387,7 +4387,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (swapchain->desc.backbuffer_count && FAILED(hr = wined3d_rendertarget_view_create_from_surface(
surface_from_resource(wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)),
NULL, &wined3d_null_parent_ops, &device->back_buffer_view)))
@@ -4549,12 +5228,20 @@
@@ -4550,12 +5229,20 @@
}
wined3d_cs_emit_reset_state(device->cs);
state_cleanup(&device->state);
@ -4408,7 +4408,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
&device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT)))
ERR("Failed to initialize device state, hr %#x.\n", hr);
device->update_state = &device->state;
@@ -4563,6 +5250,7 @@
@@ -4564,6 +5251,7 @@
}
else if (device->back_buffer_view)
{
@ -4416,7 +4416,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
struct wined3d_state *state = &device->state;
wined3d_device_set_rendertarget_view(device, 0, device->back_buffer_view, FALSE);
@@ -4578,6 +5266,24 @@
@@ -4579,6 +5267,24 @@
state->scissor_rect.left = 0;
state->scissor_rect.right = swapchain->desc.backbuffer_width;
state->scissor_rect.bottom = swapchain->desc.backbuffer_height;
@ -4441,7 +4441,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect);
}
@@ -4656,6 +5362,10 @@
@@ -4657,6 +5363,10 @@
TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type));
@ -4452,7 +4452,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
switch (type)
{
case WINED3D_RTYPE_SURFACE:
@@ -4666,6 +5376,7 @@
@@ -4667,6 +5377,7 @@
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
@ -4460,7 +4460,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (wined3d_rendertarget_view_get_surface(device->state.fb.render_targets[i]) == surface)
{
ERR("Surface %p is still in use as render target %u.\n", surface, i);
@@ -4677,6 +5388,19 @@
@@ -4678,6 +5389,19 @@
{
ERR("Surface %p is still in use as depth/stencil buffer.\n", surface);
device->state.fb.depth_stencil = NULL;
@ -4480,7 +4480,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
}
break;
@@ -4839,7 +5563,11 @@
@@ -4840,7 +5564,11 @@
device->blitter = adapter->blitter;
@ -4492,7 +4492,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
&adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT)))
{
ERR("Failed to initialize device state, hr %#x.\n", hr);
@@ -4938,6 +5666,7 @@
@@ -4939,6 +5667,7 @@
else
return CallWindowProcA(proc, window, message, wparam, lparam);
}
@ -4500,7 +4500,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
/* Context activation is done by the caller */
struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT size, GLenum gl_usage,
@@ -4991,3 +5720,4 @@
@@ -4992,3 +5721,4 @@
wined3d_device_destroy_bo(device, context, bo);
}