-- v2: wined3d: Enable long types in texture.c. wined3d: Reduce usage of long integral types in texture.c. wined3d: Change stencil parameter type in blitter_clear() method. wined3d: Get/set texture's level_count and lod as unsigned int.
From: Eric Pouech eric.pouech@gmail.com
Signed-off-by: Eric Pouech eric.pouech@gmail.com --- dlls/wined3d/texture.c | 8 ++++---- dlls/wined3d/wined3d_private.h | 4 ++-- include/wine/wined3d.h | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 641bf0355eb..7fa3022635f 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -1734,10 +1734,10 @@ void CDECL wined3d_texture_get_pitch(const struct wined3d_texture *texture, width, height, row_pitch, slice_pitch); }
-DWORD CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod) +unsigned int CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, unsigned int lod) { struct wined3d_resource *resource; - DWORD old = texture->lod; + unsigned int old = texture->lod;
TRACE("texture %p, lod %u.\n", texture, lod);
@@ -1771,14 +1771,14 @@ DWORD CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod) return old; }
-DWORD CDECL wined3d_texture_get_lod(const struct wined3d_texture *texture) +unsigned int CDECL wined3d_texture_get_lod(const struct wined3d_texture *texture) { TRACE("texture %p, returning %u.\n", texture, texture->lod);
return texture->lod; }
-DWORD CDECL wined3d_texture_get_level_count(const struct wined3d_texture *texture) +UINT CDECL wined3d_texture_get_level_count(const struct wined3d_texture *texture) { TRACE("texture %p, returning %u.\n", texture, texture->level_count);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 12dc08da352..d21cefea211 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4557,11 +4557,11 @@ struct wined3d_texture unsigned int pow2_width; unsigned int pow2_height; UINT layer_count; - UINT level_count; + unsigned int level_count; unsigned int download_count; unsigned int sysmem_count; float pow2_matrix[16]; - UINT lod; + unsigned int lod; DWORD sampler; uint32_t flags; DWORD update_map_binding; diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 1660b424441..a59a4e5205d 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2841,13 +2841,13 @@ HRESULT __cdecl wined3d_swapchain_state_set_fullscreen(struct wined3d_swapchain_ HRESULT __cdecl wined3d_texture_add_dirty_region(struct wined3d_texture *texture, UINT layer, const struct wined3d_box *dirty_region); HRESULT __cdecl wined3d_texture_create(struct wined3d_device *device, const struct wined3d_resource_desc *desc, - UINT layer_count, UINT level_count, uint32_t flags, const struct wined3d_sub_resource_data *data, + UINT layer_count, unsigned int level_count, uint32_t flags, const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture); struct wined3d_texture * __cdecl wined3d_texture_from_resource(struct wined3d_resource *resource); ULONG __cdecl wined3d_texture_decref(struct wined3d_texture *texture); HRESULT __cdecl wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC *dc); -DWORD __cdecl wined3d_texture_get_level_count(const struct wined3d_texture *texture); -DWORD __cdecl wined3d_texture_get_lod(const struct wined3d_texture *texture); +unsigned int __cdecl wined3d_texture_get_level_count(const struct wined3d_texture *texture); +unsigned int __cdecl wined3d_texture_get_lod(const struct wined3d_texture *texture); HRESULT __cdecl wined3d_texture_get_overlay_position(const struct wined3d_texture *texture, unsigned int sub_resource_idx, LONG *x, LONG *y); void * __cdecl wined3d_texture_get_parent(const struct wined3d_texture *texture); @@ -2861,7 +2861,7 @@ ULONG __cdecl wined3d_texture_incref(struct wined3d_texture *texture); HRESULT __cdecl wined3d_texture_release_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC dc); HRESULT __cdecl wined3d_texture_set_color_key(struct wined3d_texture *texture, uint32_t flags, const struct wined3d_color_key *color_key); -DWORD __cdecl wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod); +unsigned int __cdecl wined3d_texture_set_lod(struct wined3d_texture *texture, unsigned int lod); HRESULT __cdecl wined3d_texture_set_overlay_position(struct wined3d_texture *texture, unsigned int sub_resource_idx, LONG x, LONG y); void __cdecl wined3d_texture_set_sub_resource_parent(struct wined3d_texture *texture,
From: Eric Pouech eric.pouech@gmail.com
Signed-off-by: Eric Pouech eric.pouech@gmail.com --- dlls/wined3d/arb_program_shader.c | 2 +- dlls/wined3d/glsl_shader.c | 2 +- dlls/wined3d/surface.c | 2 +- dlls/wined3d/texture.c | 8 ++++---- dlls/wined3d/wined3d_private.h | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index a3005a3cfe0..113279e0bb6 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -7940,7 +7940,7 @@ static DWORD arbfp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_bl
static void arbfp_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_device *device, unsigned int rt_count, const struct wined3d_fb_state *fb, unsigned int rect_count, const RECT *clear_rects, - const RECT *draw_rect, uint32_t flags, const struct wined3d_color *colour, float depth, DWORD stencil) + const RECT *draw_rect, uint32_t flags, const struct wined3d_color *colour, float depth, unsigned int stencil) { struct wined3d_blitter *next;
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index e0e35b60d7c..a56968b86e0 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -13272,7 +13272,7 @@ static DWORD glsl_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_bli
static void glsl_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_device *device, unsigned int rt_count, const struct wined3d_fb_state *fb, unsigned int rect_count, const RECT *clear_rects, - const RECT *draw_rect, uint32_t flags, const struct wined3d_color *color, float depth, DWORD stencil) + const RECT *draw_rect, uint32_t flags, const struct wined3d_color *color, float depth, unsigned int stencil) { struct wined3d_blitter *next;
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index ad854e7f790..dc2f857e127 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1242,7 +1242,7 @@ static bool wined3d_box_intersect(struct wined3d_box *ret, const struct wined3d_
static void cpu_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_device *device, unsigned int rt_count, const struct wined3d_fb_state *fb, unsigned int rect_count, const RECT *clear_rects, - const RECT *draw_rect, uint32_t flags, const struct wined3d_color *colour, float depth, DWORD stencil) + const RECT *draw_rect, uint32_t flags, const struct wined3d_color *colour, float depth, unsigned int stencil) { struct wined3d_color c = {depth, 0.0f, 0.0f, 0.0f}; struct wined3d_box box, box_clip, box_view; diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 7fa3022635f..d770a82caab 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -6068,7 +6068,7 @@ static bool blitter_use_cpu_clear(struct wined3d_rendertarget_view *view)
static void ffp_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_device *device, unsigned int rt_count, const struct wined3d_fb_state *fb, unsigned int rect_count, const RECT *clear_rects, - const RECT *draw_rect, uint32_t flags, const struct wined3d_color *colour, float depth, DWORD stencil) + const RECT *draw_rect, uint32_t flags, const struct wined3d_color *colour, float depth, unsigned int stencil) { struct wined3d_rendertarget_view *view, *previous = NULL; bool have_identical_size = TRUE; @@ -6345,7 +6345,7 @@ static void fbo_blitter_destroy(struct wined3d_blitter *blitter, struct wined3d_
static void fbo_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_device *device, unsigned int rt_count, const struct wined3d_fb_state *fb, unsigned int rect_count, const RECT *clear_rects, - const RECT *draw_rect, uint32_t flags, const struct wined3d_color *colour, float depth, DWORD stencil) + const RECT *draw_rect, uint32_t flags, const struct wined3d_color *colour, float depth, unsigned int stencil) { struct wined3d_blitter *next;
@@ -6458,7 +6458,7 @@ static void raw_blitter_destroy(struct wined3d_blitter *blitter, struct wined3d_
static void raw_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_device *device, unsigned int rt_count, const struct wined3d_fb_state *fb, unsigned int rect_count, const RECT *clear_rects, - const RECT *draw_rect, uint32_t flags, const struct wined3d_color *colour, float depth, DWORD stencil) + const RECT *draw_rect, uint32_t flags, const struct wined3d_color *colour, float depth, unsigned int stencil) { struct wined3d_blitter *next;
@@ -6826,7 +6826,7 @@ static void vk_blitter_clear_rendertargets(struct wined3d_context_vk *context_vk
static void vk_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_device *device, unsigned int rt_count, const struct wined3d_fb_state *fb, unsigned int rect_count, const RECT *clear_rects, - const RECT *draw_rect, uint32_t flags, const struct wined3d_color *colour, float depth, DWORD stencil) + const RECT *draw_rect, uint32_t flags, const struct wined3d_color *colour, float depth, unsigned int stencil) { struct wined3d_device_vk *device_vk = wined3d_device_vk(device); struct wined3d_rendertarget_view *view, *previous = NULL; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index d21cefea211..ef911c3322f 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2909,7 +2909,7 @@ struct wined3d_blitter_ops void (*blitter_destroy)(struct wined3d_blitter *blitter, struct wined3d_context *context); void (*blitter_clear)(struct wined3d_blitter *blitter, struct wined3d_device *device, unsigned int rt_count, const struct wined3d_fb_state *fb, unsigned int rect_count, const RECT *clear_rects, - const RECT *draw_rect, uint32_t flags, const struct wined3d_color *colour, float depth, DWORD stencil); + const RECT *draw_rect, uint32_t flags, const struct wined3d_color *colour, float depth, unsigned int stencil); DWORD (*blitter_blit)(struct wined3d_blitter *blitter, enum wined3d_blit_op op, struct wined3d_context *context, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, DWORD src_location, const RECT *src_rect, struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx,
From: Eric Pouech eric.pouech@gmail.com
Signed-off-by: Eric Pouech eric.pouech@gmail.com --- dlls/wined3d/texture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index d770a82caab..6dd6ab8cbd9 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -138,7 +138,7 @@ GLenum wined3d_texture_get_gl_buffer(const struct wined3d_texture *texture) return GL_BACK; }
-static DWORD wined3d_resource_access_from_location(uint32_t location) +static uint32_t wined3d_resource_access_from_location(uint32_t location) { switch (location) { @@ -796,7 +796,7 @@ BOOL wined3d_texture_load_location(struct wined3d_texture *texture,
if (WARN_ON(d3d)) { - DWORD required_access = wined3d_resource_access_from_location(location); + uint32_t required_access = wined3d_resource_access_from_location(location); if ((texture->resource.access & required_access) != required_access) WARN("Operation requires %#x access, but texture only has %#x.\n", required_access, texture->resource.access);
From: Eric Pouech eric.pouech@gmail.com
Note: didn't change the x/y overlay positions' type as they're part of ddraw's surface interface. --- dlls/wined3d/texture.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 6dd6ab8cbd9..bb19ac6183d 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -19,7 +19,6 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define WINE_NO_LONG_TYPES /* temporary */
#include "wined3d_private.h"
@@ -429,7 +428,7 @@ static void texture2d_blt_fbo(struct wined3d_device *device, struct wined3d_cont &src_staging_texture); if (FAILED(hr)) { - ERR("Failed to create staging texture, hr %#x.\n", hr); + ERR("Failed to create staging texture, hr %#lx.\n", hr); goto done; }
@@ -468,7 +467,7 @@ static void texture2d_blt_fbo(struct wined3d_device *device, struct wined3d_cont &dst_texture); if (FAILED(hr)) { - ERR("Failed to create staging texture, hr %#x.\n", hr); + ERR("Failed to create staging texture, hr %#lx.\n", hr); goto done; }
@@ -1177,7 +1176,7 @@ static void wined3d_texture_create_dc(void *object) DeleteDC(desc.hDeviceDc); if (status) { - WARN("Failed to create DC, status %#x.\n", status); + WARN("Failed to create DC, status %#lx.\n", status); return; }
@@ -1219,7 +1218,7 @@ static void wined3d_texture_destroy_dc(void *object) destroy_desc.hDc = dc_info->dc; destroy_desc.hBitmap = dc_info->bitmap; if ((status = D3DKMTDestroyDCFromMemory(&destroy_desc))) - ERR("Failed to destroy dc, status %#x.\n", status); + ERR("Failed to destroy dc, status %#lx.\n", status); dc_info->dc = NULL; dc_info->bitmap = NULL;
@@ -3988,7 +3987,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc && desc->resource_type != WINED3D_RTYPE_TEXTURE_3D && !once++) ERR_(winediag)("The application tried to create a DXTn texture, but the driver does not support them.\n");
- WARN("Failed to initialize resource, returning %#x\n", hr); + WARN("Failed to initialize resource, returning %#lx\n", hr); return hr; } wined3d_resource_update_draw_binding(&texture->resource); @@ -4087,7 +4086,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc if (FAILED(hr = device_parent->ops->texture_sub_resource_created(device_parent, desc->resource_type, texture, i, &sub_resource->parent, &sub_resource->parent_ops))) { - WARN("Failed to create sub-resource parent, hr %#x.\n", hr); + WARN("Failed to create sub-resource parent, hr %#lx.\n", hr); sub_resource->parent = NULL; wined3d_texture_cleanup_sync(texture); return hr; @@ -4199,7 +4198,7 @@ HRESULT CDECL wined3d_texture_get_overlay_position(const struct wined3d_texture *x = overlay->dst_rect.left; *y = overlay->dst_rect.top;
- TRACE("Returning position %d, %d.\n", *x, *y); + TRACE("Returning position %ld, %ld.\n", *x, *y);
return WINED3D_OK; } @@ -4210,7 +4209,7 @@ HRESULT CDECL wined3d_texture_set_overlay_position(struct wined3d_texture *textu struct wined3d_overlay_info *overlay; LONG w, h;
- TRACE("texture %p, sub_resource_idx %u, x %d, y %d.\n", texture, sub_resource_idx, x, y); + TRACE("texture %p, sub_resource_idx %u, x %ld, y %ld.\n", texture, sub_resource_idx, x, y);
if (!(texture->resource.usage & WINED3DUSAGE_OVERLAY) || !wined3d_texture_validate_sub_resource_idx(texture, sub_resource_idx)) @@ -6224,7 +6223,7 @@ static DWORD ffp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit if (FAILED(hr = wined3d_texture_create(device, &desc, 1, 1, 0, NULL, NULL, &wined3d_null_parent_ops, &staging_texture))) { - ERR("Failed to create staging texture, hr %#x.\n", hr); + ERR("Failed to create staging texture, hr %#lx.\n", hr); return dst_location; }
V2 pushed including Zebediah's remarks.
This merge request was approved by Zebediah Figura.