[PATCH 2/5] wined3d: Get rid of some leftover comments referring to the GL lock.
Henri Verbeet
hverbeet at codeweavers.com
Mon Sep 2 02:45:41 CDT 2013
---
dlls/wined3d/arb_program_shader.c | 2 --
dlls/wined3d/buffer.c | 3 ---
dlls/wined3d/context.c | 5 -----
dlls/wined3d/device.c | 10 ----------
dlls/wined3d/directx.c | 3 ---
dlls/wined3d/nvidia_texture_shader.c | 1 -
dlls/wined3d/shader.c | 1 -
dlls/wined3d/state.c | 23 +++++++++++------------
dlls/wined3d/surface.c | 11 -----------
dlls/wined3d/swapchain.c | 5 -----
dlls/wined3d/texture.c | 6 ------
dlls/wined3d/volume.c | 2 --
dlls/wined3d/wined3d_main.c | 1 -
13 files changed, 11 insertions(+), 62 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 2ec9de0..aad30e9 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -7487,7 +7487,6 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
return WINED3D_OK;
}
-/* Do not call while under the GL lock. */
static HRESULT arbfp_blit_color_fill(struct wined3d_device *device, struct wined3d_surface *dst_surface,
const RECT *dst_rect, const struct wined3d_color *color)
{
@@ -7495,7 +7494,6 @@ static HRESULT arbfp_blit_color_fill(struct wined3d_device *device, struct wined
return WINED3DERR_INVALIDCALL;
}
-/* Do not call while under the GL lock. */
static HRESULT arbfp_blit_depth_fill(struct wined3d_device *device,
struct wined3d_surface *surface, const RECT *rect, float depth)
{
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 921111c..00e4dae 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -513,7 +513,6 @@ BYTE *buffer_get_sysmem(struct wined3d_buffer *This, const struct wined3d_gl_inf
return This->resource.allocatedMemory;
}
-/* Do not call while under the GL lock. */
static void buffer_unload(struct wined3d_resource *resource)
{
struct wined3d_buffer *buffer = buffer_from_resource(resource);
@@ -550,7 +549,6 @@ static void buffer_unload(struct wined3d_resource *resource)
resource_unload(resource);
}
-/* Do not call while under the GL lock. */
ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer)
{
ULONG refcount = InterlockedDecrement(&buffer->resource.ref);
@@ -729,7 +727,6 @@ static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined
checkGLcall("glUnmapBufferARB");
}
-/* Do not call while under the GL lock. */
void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer)
{
DWORD flags = buffer->flags & (WINED3D_BUFFER_NOSYNC | WINED3D_BUFFER_DISCARD);
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index e8a5a83..bb3b06b 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -887,7 +887,6 @@ err:
context->valid = 0;
}
-/* Do not call while under the GL lock. */
static void context_destroy_gl_resources(struct wined3d_context *context)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
@@ -1012,7 +1011,6 @@ struct wined3d_context *context_get_current(void)
return TlsGetValue(wined3d_context_tls_idx);
}
-/* Do not call while under the GL lock. */
BOOL context_set_current(struct wined3d_context *ctx)
{
struct wined3d_context *old = context_get_current();
@@ -1297,7 +1295,6 @@ static void WINE_GLAPI wined3d_debug_callback(GLenum source, GLenum type, GLuint
}
}
-/* Do not call while under the GL lock. */
struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
struct wined3d_surface *target, const struct wined3d_format *ds_format)
{
@@ -1656,7 +1653,6 @@ out:
return NULL;
}
-/* Do not call while under the GL lock. */
void context_destroy(struct wined3d_device *device, struct wined3d_context *context)
{
BOOL destroy;
@@ -2465,7 +2461,6 @@ static void context_setup_target(struct wined3d_context *context, struct wined3d
context_set_render_offscreen(context, render_offscreen);
}
-/* Do not call while under the GL lock. */
struct wined3d_context *context_acquire(const struct wined3d_device *device, struct wined3d_surface *target)
{
struct wined3d_context *current_context = context_get_current();
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 44393e7..65209e3 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -449,7 +449,6 @@ void device_context_remove(struct wined3d_device *device, struct wined3d_context
device->contexts = new_array;
}
-/* Do not call while under the GL lock. */
void device_switch_onscreen_ds(struct wined3d_device *device,
struct wined3d_context *context, struct wined3d_surface *depth_stencil)
{
@@ -536,7 +535,6 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context
SetRect(out_rect, 0, 0, ds->ds_current_size.cx, ds->ds_current_size.cy);
}
-/* Do not call while under the GL lock. */
void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, const struct wined3d_fb_state *fb,
UINT rect_count, const RECT *rects, const RECT *draw_rect, DWORD flags, const struct wined3d_color *color,
float depth, DWORD stencil)
@@ -3245,7 +3243,6 @@ struct wined3d_sampler * CDECL wined3d_device_get_gs_sampler(const struct wined3
}
/* Context activation is done by the caller. */
-/* Do not call while under the GL lock. */
#define copy_and_next(dest, src, size) memcpy(dest, src, size); dest += (size)
static HRESULT process_vertices_strided(const struct wined3d_device *device, DWORD dwDestIndex, DWORD dwCount,
const struct wined3d_stream_info *stream_info, struct wined3d_buffer *dest, DWORD flags,
@@ -3512,7 +3509,6 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO
}
#undef copy_and_next
-/* Do not call while under the GL lock. */
HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device,
UINT src_start_idx, UINT dst_idx, UINT vertex_count, struct wined3d_buffer *dst_buffer,
const struct wined3d_vertex_declaration *declaration, DWORD flags, DWORD dst_fvf)
@@ -3946,7 +3942,6 @@ HRESULT CDECL wined3d_device_present(const struct wined3d_device *device, const
return WINED3D_OK;
}
-/* Do not call while under the GL lock. */
HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_count,
const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil)
{
@@ -4404,7 +4399,6 @@ HRESULT CDECL wined3d_device_update_surface(struct wined3d_device *device,
return surface_upload_from_surface(dst_surface, dst_point, src_surface, src_rect);
}
-/* Do not call while under the GL lock. */
HRESULT CDECL wined3d_device_color_fill(struct wined3d_device *device,
struct wined3d_surface *surface, const RECT *rect, const struct wined3d_color *color)
{
@@ -4429,7 +4423,6 @@ HRESULT CDECL wined3d_device_color_fill(struct wined3d_device *device,
return surface_color_fill(surface, rect, color);
}
-/* Do not call while under the GL lock. */
void CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device,
struct wined3d_rendertarget_view *rendertarget_view, const struct wined3d_color *color)
{
@@ -4807,7 +4800,6 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device)
device_invalidate_state(device, STATE_STREAMSRC);
}
-/* Do not call while under the GL lock. */
static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d_swapchain *swapchain)
{
struct wined3d_resource *resource, *cursor;
@@ -4856,7 +4848,6 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d
swapchain->context = NULL;
}
-/* Do not call while under the GL lock. */
static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain)
{
struct wined3d_context *context;
@@ -4905,7 +4896,6 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru
return WINED3D_OK;
}
-/* Do not call while under the GL lock. */
HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
const struct wined3d_swapchain_desc *swapchain_desc, const struct wined3d_display_mode *mode,
wined3d_device_reset_cb callback, BOOL reset_state)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 570299b3..4545ed0 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -313,7 +313,6 @@ static void wined3d_create_fake_gl_context_attribs(struct wined3d_fake_gl_ctx *f
fake_gl_ctx->gl_ctx = new_ctx;
}
-/* Do not call while under the GL lock. */
static BOOL WineD3D_CreateFakeGLContext(struct wined3d_fake_gl_ctx *ctx)
{
PIXELFORMATDESCRIPTOR pfd;
@@ -5031,7 +5030,6 @@ static void wined3d_adapter_init_fb_cfgs(struct wined3d_adapter *adapter, HDC dc
}
}
-/* Do not call while under the GL lock. */
static BOOL wined3d_adapter_init(struct wined3d_adapter *adapter, UINT ordinal)
{
struct wined3d_gl_info *gl_info = &adapter->gl_info;
@@ -5170,7 +5168,6 @@ const struct wined3d_parent_ops wined3d_null_parent_ops =
wined3d_null_wined3d_object_destroyed,
};
-/* Do not call while under the GL lock. */
HRESULT wined3d_init(struct wined3d *wined3d, UINT version, DWORD flags)
{
wined3d->dxVersion = version;
diff --git a/dlls/wined3d/nvidia_texture_shader.c b/dlls/wined3d/nvidia_texture_shader.c
index 648b1e3..7d4817e 100644
--- a/dlls/wined3d/nvidia_texture_shader.c
+++ b/dlls/wined3d/nvidia_texture_shader.c
@@ -172,7 +172,6 @@ void set_tex_op_nvrc(const struct wined3d_gl_info *gl_info, const struct wined3d
output = GL_SPARE0_NV;
}
- /* This is called by a state handler which has the gl lock held and a context for the thread */
switch (op)
{
case WINED3D_TOP_DISABLE:
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index 624d091..1d98f27 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -1727,7 +1727,6 @@ ULONG CDECL wined3d_shader_incref(struct wined3d_shader *shader)
return refcount;
}
-/* Do not call while under the GL lock. */
ULONG CDECL wined3d_shader_decref(struct wined3d_shader *shader)
{
ULONG refcount = InterlockedDecrement(&shader->ref);
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 59debd5..1866761 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -2091,18 +2091,17 @@ static void set_tex_op(const struct wined3d_gl_info *gl_info, const struct wined
TRACE("Alpha?(%d), Stage:%d Op(%s), a1(%d), a2(%d), a3(%d)\n", isAlpha, Stage, debug_d3dtop(op), arg1, arg2, arg3);
- /* This is called by a state handler which has the gl lock held and a context for the thread */
-
- /* Note: Operations usually involve two ars, src0 and src1 and are operations of
- the form (a1 <operation> a2). However, some of the more complex operations
- take 3 parameters. Instead of the (sensible) addition of a3, Microsoft added
- in a third parameter called a0. Therefore these are operations of the form
- a0 <operation> a1 <operation> a2, i.e., the new parameter goes to the front.
-
- However, below we treat the new (a0) parameter as src2/opr2, so in the actual
- functions below, expect their syntax to differ slightly to those listed in the
- manuals, i.e., replace arg1 with arg3, arg2 with arg1 and arg3 with arg2
- This affects WINED3DTOP_MULTIPLYADD and WINED3DTOP_LERP */
+ /* Operations usually involve two args, src0 and src1 and are operations
+ * of the form (a1 <operation> a2). However, some of the more complex
+ * operations take 3 parameters. Instead of the (sensible) addition of a3,
+ * Microsoft added in a third parameter called a0. Therefore these are
+ * operations of the form a0 <operation> a1 <operation> a2. I.e., the new
+ * parameter goes to the front.
+ *
+ * However, below we treat the new (a0) parameter as src2/opr2, so in the
+ * actual functions below, expect their syntax to differ slightly to those
+ * listed in the manuals. I.e., replace arg1 with arg3, arg2 with arg1 and
+ * arg3 with arg2. This affects WINED3DTOP_MULTIPLYADD and WINED3DTOP_LERP. */
if (isAlpha)
{
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 970985d..c2c14b5 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1393,7 +1393,6 @@ static BOOL surface_convert_depth_to_float(const struct wined3d_surface *surface
return TRUE;
}
-/* Do not call while under the GL lock. */
static HRESULT wined3d_surface_depth_fill(struct wined3d_surface *surface, const RECT *rect, float depth)
{
const struct wined3d_resource *resource = &surface->resource;
@@ -1429,7 +1428,6 @@ static HRESULT wined3d_surface_depth_blt(struct wined3d_surface *src_surface, DW
return WINED3D_OK;
}
-/* Do not call while under the GL lock. */
HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect_in,
struct wined3d_surface *src_surface, const RECT *src_rect_in, DWORD flags,
const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter)
@@ -1813,7 +1811,6 @@ static BOOL surface_init_sysmem(struct wined3d_surface *surface)
return TRUE;
}
-/* Do not call while under the GL lock. */
static void surface_unload(struct wined3d_resource *resource)
{
struct wined3d_surface *surface = surface_from_resource(resource);
@@ -2966,7 +2963,6 @@ ULONG CDECL wined3d_surface_incref(struct wined3d_surface *surface)
return refcount;
}
-/* Do not call while under the GL lock. */
ULONG CDECL wined3d_surface_decref(struct wined3d_surface *surface)
{
ULONG refcount;
@@ -4060,7 +4056,6 @@ HRESULT CDECL wined3d_surface_flip(struct wined3d_surface *surface, struct wined
return WINED3D_OK;
}
-/* Do not call while under the GL lock. */
void surface_internal_preload(struct wined3d_surface *surface, enum WINED3DSRGB srgb)
{
struct wined3d_device *device = surface->resource.device;
@@ -5222,7 +5217,6 @@ static void surface_blt_to_drawable(const struct wined3d_device *device,
context_release(context);
}
-/* Do not call while under the GL lock. */
HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const struct wined3d_color *color)
{
struct wined3d_device *device = s->resource.device;
@@ -5239,7 +5233,6 @@ HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const st
return blitter->color_fill(device, s, rect, color);
}
-/* Do not call while under the GL lock. */
static HRESULT IWineD3DSurfaceImpl_BltOverride(struct wined3d_surface *dst_surface, const RECT *dst_rect,
struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const WINEDDBLTFX *DDBltFx,
enum wined3d_texture_filter_type filter)
@@ -6197,7 +6190,6 @@ static BOOL ffp_blit_supported(const struct wined3d_gl_info *gl_info, enum wined
}
}
-/* Do not call while under the GL lock. */
static HRESULT ffp_blit_color_fill(struct wined3d_device *device, struct wined3d_surface *dst_surface,
const RECT *dst_rect, const struct wined3d_color *color)
{
@@ -6209,7 +6201,6 @@ static HRESULT ffp_blit_color_fill(struct wined3d_device *device, struct wined3d
return WINED3D_OK;
}
-/* Do not call while under the GL lock. */
static HRESULT ffp_blit_depth_fill(struct wined3d_device *device,
struct wined3d_surface *surface, const RECT *rect, float depth)
{
@@ -6864,7 +6855,6 @@ release:
return hr;
}
-/* Do not call while under the GL lock. */
static HRESULT cpu_blit_color_fill(struct wined3d_device *device, struct wined3d_surface *dst_surface,
const RECT *dst_rect, const struct wined3d_color *color)
{
@@ -6878,7 +6868,6 @@ static HRESULT cpu_blit_color_fill(struct wined3d_device *device, struct wined3d
WINEDDBLT_COLORFILL, &BltFx, WINED3D_TEXF_POINT);
}
-/* Do not call while under the GL lock. */
static HRESULT cpu_blit_depth_fill(struct wined3d_device *device,
struct wined3d_surface *surface, const RECT *rect, float depth)
{
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 970dcdb..d1cb2f5 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -27,7 +27,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
WINE_DECLARE_DEBUG_CHANNEL(fps);
-/* Do not call while under the GL lock. */
static void swapchain_cleanup(struct wined3d_swapchain *swapchain)
{
HRESULT hr;
@@ -98,7 +97,6 @@ ULONG CDECL wined3d_swapchain_incref(struct wined3d_swapchain *swapchain)
return refcount;
}
-/* Do not call while under the GL lock. */
ULONG CDECL wined3d_swapchain_decref(struct wined3d_swapchain *swapchain)
{
ULONG refcount = InterlockedDecrement(&swapchain->ref);
@@ -806,7 +804,6 @@ void swapchain_update_render_to_fbo(struct wined3d_swapchain *swapchain)
swapchain->render_to_fbo = TRUE;
}
-/* Do not call while under the GL lock. */
static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3d_device *device,
struct wined3d_swapchain_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops)
{
@@ -1072,7 +1069,6 @@ err:
return hr;
}
-/* Do not call while under the GL lock. */
HRESULT CDECL wined3d_swapchain_create(struct wined3d_device *device, struct wined3d_swapchain_desc *desc,
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_swapchain **swapchain)
{
@@ -1100,7 +1096,6 @@ HRESULT CDECL wined3d_swapchain_create(struct wined3d_device *device, struct win
return WINED3D_OK;
}
-/* Do not call while under the GL lock. */
static struct wined3d_context *swapchain_create_context(struct wined3d_swapchain *swapchain)
{
struct wined3d_context **newArray;
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index c7d5de8..75ae8af 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -437,7 +437,6 @@ ULONG CDECL wined3d_texture_incref(struct wined3d_texture *texture)
return refcount;
}
-/* Do not call while under the GL lock. */
ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
{
ULONG refcount = InterlockedDecrement(&texture->resource.ref);
@@ -471,7 +470,6 @@ DWORD CDECL wined3d_texture_get_priority(const struct wined3d_texture *texture)
return resource_get_priority(&texture->resource);
}
-/* Do not call while under the GL lock. */
void CDECL wined3d_texture_preload(struct wined3d_texture *texture)
{
texture->texture_ops->texture_preload(texture, SRGB_ANY);
@@ -665,7 +663,6 @@ static BOOL texture_srgb_mode(const struct wined3d_texture *texture, enum WINED3
}
}
-/* Do not call while under the GL lock. */
static void texture2d_preload(struct wined3d_texture *texture, enum WINED3DSRGB srgb)
{
UINT sub_count = texture->level_count * texture->layer_count;
@@ -726,7 +723,6 @@ static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource
wined3d_surface_decref(surface);
}
-/* Do not call while under the GL lock. */
static void texture2d_unload(struct wined3d_resource *resource)
{
struct wined3d_texture *texture = wined3d_texture_from_resource(resource);
@@ -1049,7 +1045,6 @@ static HRESULT texture3d_bind(struct wined3d_texture *texture,
return wined3d_texture_bind(texture, context, srgb, &dummy);
}
-/* Do not call while under the GL lock. */
static void texture3d_preload(struct wined3d_texture *texture, enum WINED3DSRGB srgb)
{
UINT sub_count = texture->level_count * texture->layer_count;
@@ -1101,7 +1096,6 @@ static void texture3d_sub_resource_cleanup(struct wined3d_resource *sub_resource
wined3d_volume_decref(volume);
}
-/* Do not call while under the GL lock. */
static void texture3d_unload(struct wined3d_resource *resource)
{
struct wined3d_texture *texture = wined3d_texture_from_resource(resource);
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index c472b3c..a1c7876 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -456,7 +456,6 @@ ULONG CDECL wined3d_volume_incref(struct wined3d_volume *volume)
return refcount;
}
-/* Do not call while under the GL lock. */
ULONG CDECL wined3d_volume_decref(struct wined3d_volume *volume)
{
ULONG refcount;
@@ -501,7 +500,6 @@ DWORD CDECL wined3d_volume_get_priority(const struct wined3d_volume *volume)
return resource_get_priority(&volume->resource);
}
-/* Do not call while under the GL lock. */
void CDECL wined3d_volume_preload(struct wined3d_volume *volume)
{
FIXME("volume %p stub!\n", volume);
diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c
index a897bdc..65597fa 100644
--- a/dlls/wined3d/wined3d_main.c
+++ b/dlls/wined3d/wined3d_main.c
@@ -87,7 +87,6 @@ struct wined3d_settings wined3d_settings =
FALSE, /* 3D support enabled by default. */
};
-/* Do not call while under the GL lock. */
struct wined3d * CDECL wined3d_create(UINT version, DWORD flags)
{
struct wined3d *object;
--
1.8.1.5
More information about the wine-patches
mailing list