Wine-devel
Threads by month
- ----- 2026 -----
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
January 2020
- 75 participants
- 595 discussions
[PATCH 3/6] wined3d: Store a gl_info pointer in struct shader_arb_ctx_priv.
by Henri Verbeet 24 Jan '20
by Henri Verbeet 24 Jan '20
24 Jan '20
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/wined3d/arb_program_shader.c | 7 +++++--
dlls/wined3d/shader.c | 1 -
dlls/wined3d/wined3d_private.h | 2 +-
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 9d98c79ce51..14ca883e761 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -237,6 +237,7 @@ struct shader_arb_ctx_priv
NV3
} target_version;
+ const struct wined3d_gl_info *gl_info;
const struct arb_vs_compile_args *cur_vs_args;
const struct arb_ps_compile_args *cur_ps_args;
const struct arb_ps_compiled_shader *compiled_fprog;
@@ -1438,7 +1439,7 @@ static void shader_hw_sample(const struct wined3d_shader_instruction *ins, DWORD
case WINED3D_SHADER_RESOURCE_TEXTURE_2D:
if (pshader && priv->cur_ps_args->super.np2_fixup & (1u << sampler_idx)
- && ins->ctx->gl_info->supported[ARB_TEXTURE_RECTANGLE])
+ && priv->gl_info->supported[ARB_TEXTURE_RECTANGLE])
tex_type = "RECT";
else
tex_type = "2D";
@@ -3301,7 +3302,7 @@ static void shader_hw_ret(const struct wined3d_shader_instruction *ins)
if(vshader)
{
if (priv->in_main_func) vshader_add_footer(priv, shader->backend_data,
- priv->cur_vs_args, ins->ctx->reg_maps, ins->ctx->gl_info, buffer);
+ priv->cur_vs_args, ins->ctx->reg_maps, priv->gl_info, buffer);
}
shader_addline(buffer, "RET;\n");
@@ -3555,6 +3556,7 @@ static GLuint shader_arb_generate_pshader(const struct wined3d_shader *shader,
/* Create the hw ARB shader */
memset(&priv_ctx, 0, sizeof(priv_ctx));
+ priv_ctx.gl_info = gl_info;
priv_ctx.cur_ps_args = args;
priv_ctx.compiled_fprog = compiled;
priv_ctx.cur_np2fixup_info = &compiled->np2fixup_info;
@@ -4113,6 +4115,7 @@ static GLuint shader_arb_generate_vshader(const struct wined3d_shader *shader,
unsigned int i;
memset(&priv_ctx, 0, sizeof(priv_ctx));
+ priv_ctx.gl_info = gl_info;
priv_ctx.cur_vs_args = args;
list_init(&priv_ctx.control_frames);
init_output_registers(shader, ps_input_sig, &priv_ctx, compiled);
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index 3b9a96abc69..757631a73ef 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -2624,7 +2624,6 @@ HRESULT shader_generate_code(const struct wined3d_shader *shader, struct wined3d
state.in_subroutine = FALSE;
ctx.shader = shader;
- ctx.gl_info = &device->adapter->gl_info;
ctx.reg_maps = reg_maps;
ctx.buffer = buffer;
ctx.tex_mx = &tex_mx;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 583d970eca8..934a422ede1 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -79,6 +79,7 @@
struct wined3d_fragment_pipe_ops;
struct wined3d_adapter;
struct wined3d_context;
+struct wined3d_gl_info;
struct wined3d_state;
struct wined3d_swapchain_gl;
struct wined3d_texture_gl;
@@ -1084,7 +1085,6 @@ struct wined3d_shader_parser_state
struct wined3d_shader_context
{
const struct wined3d_shader *shader;
- const struct wined3d_gl_info *gl_info;
const struct wined3d_shader_reg_maps *reg_maps;
struct wined3d_string_buffer *buffer;
struct wined3d_shader_tex_mx *tex_mx;
--
2.11.0
1
0
[PATCH 2/6] wined3d: Store a gl_info pointer in struct shader_glsl_ctx_priv.
by Henri Verbeet 24 Jan '20
by Henri Verbeet 24 Jan '20
24 Jan '20
Since the one in struct wined3d_shader_context is going away.
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/wined3d/glsl_shader.c | 43 +++++++++++++++++++++++++++++--------------
1 file changed, 29 insertions(+), 14 deletions(-)
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index f05631ec595..25e97723255 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -271,7 +271,9 @@ struct glsl_program_key
GLuint cs_id;
};
-struct shader_glsl_ctx_priv {
+struct shader_glsl_ctx_priv
+{
+ const struct wined3d_gl_info *gl_info;
const struct vs_compile_args *cur_vs_args;
const struct ds_compile_args *cur_ds_args;
const struct ps_compile_args *cur_ps_args;
@@ -2651,8 +2653,9 @@ static void shader_glsl_get_register_name(const struct wined3d_shader_register *
const struct wined3d_shader *shader = ctx->shader;
const struct wined3d_shader_reg_maps *reg_maps = ctx->reg_maps;
const struct wined3d_shader_version *version = ®_maps->shader_version;
- const struct wined3d_gl_info *gl_info = ctx->gl_info;
+ const struct shader_glsl_ctx_priv *priv = ctx->backend_data;
const char *prefix = shader_glsl_get_prefix(version->type);
+ const struct wined3d_gl_info *gl_info = priv->gl_info;
struct glsl_src_param rel_param0, rel_param1;
if (reg->idx[0].offset != ~0u && reg->idx[0].rel_addr)
@@ -2674,8 +2677,6 @@ static void shader_glsl_get_register_name(const struct wined3d_shader_register *
case WINED3DSPR_INCONTROLPOINT:
if (version->type == WINED3D_SHADER_TYPE_VERTEX)
{
- struct shader_glsl_ctx_priv *priv = ctx->backend_data;
-
if (reg->idx[0].rel_addr)
FIXME("VS3 input registers relative addressing.\n");
if (is_swizzled && priv->cur_vs_args->swizzle_map & (1u << reg->idx[0].offset))
@@ -3353,7 +3354,7 @@ static void shader_glsl_get_sample_function(const struct wined3d_shader_context
{
enum wined3d_shader_resource_type resource_type;
struct shader_glsl_ctx_priv *priv = ctx->backend_data;
- const struct wined3d_gl_info *gl_info = ctx->gl_info;
+ const struct wined3d_gl_info *gl_info = priv->gl_info;
BOOL shadow = glsl_is_shadow_sampler(ctx->shader, priv->cur_ps_args, resource_idx, sampler_idx);
BOOL projected = flags & WINED3D_GLSL_SAMPLE_PROJECTED;
BOOL texrect = ctx->reg_maps->shader_version.type == WINED3D_SHADER_TYPE_PIXEL
@@ -3854,8 +3855,9 @@ static void shader_glsl_udiv(const struct wined3d_shader_instruction *ins)
/* Process the WINED3DSIO_MOV opcode using GLSL (dst = src) */
static void shader_glsl_mov(const struct wined3d_shader_instruction *ins)
{
- const struct wined3d_gl_info *gl_info = ins->ctx->gl_info;
+ const struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data;
struct wined3d_string_buffer *buffer = ins->ctx->buffer;
+ const struct wined3d_gl_info *gl_info = priv->gl_info;
struct glsl_src_param src0_param;
DWORD write_mask;
@@ -4979,9 +4981,10 @@ static void shader_glsl_emit(const struct wined3d_shader_instruction *ins)
{
unsigned int stream = ins->handler_idx == WINED3DSIH_EMIT ? 0 : ins->src[0].reg.idx[0].offset;
const struct wined3d_shader_reg_maps *reg_maps = ins->ctx->reg_maps;
+ const struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data;
shader_addline(ins->ctx->buffer, "setup_gs_output(gs_out);\n");
- if (!ins->ctx->gl_info->supported[ARB_CLIP_CONTROL])
+ if (!priv->gl_info->supported[ARB_CLIP_CONTROL])
shader_glsl_fixup_position(ins->ctx->buffer, reg_maps->viewport_array);
if (!stream)
@@ -5186,7 +5189,8 @@ static void shader_glsl_tex(const struct wined3d_shader_instruction *ins)
static void shader_glsl_texldd(const struct wined3d_shader_instruction *ins)
{
- const struct wined3d_gl_info *gl_info = ins->ctx->gl_info;
+ const struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data;
+ const struct wined3d_gl_info *gl_info = priv->gl_info;
struct glsl_src_param coord_param, dx_param, dy_param;
struct glsl_sample_function sample_function;
DWORD sampler_idx;
@@ -5214,7 +5218,8 @@ static void shader_glsl_texldd(const struct wined3d_shader_instruction *ins)
static void shader_glsl_texldl(const struct wined3d_shader_instruction *ins)
{
const struct wined3d_shader_version *shader_version = &ins->ctx->reg_maps->shader_version;
- const struct wined3d_gl_info *gl_info = ins->ctx->gl_info;
+ const struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data;
+ const struct wined3d_gl_info *gl_info = priv->gl_info;
struct glsl_src_param coord_param, lod_param;
struct glsl_sample_function sample_function;
DWORD swizzle = ins->src[1].swizzle;
@@ -5769,8 +5774,9 @@ static BOOL is_mipmapped(enum wined3d_shader_resource_type resource_type)
static void shader_glsl_resinfo(const struct wined3d_shader_instruction *ins)
{
const struct wined3d_shader_version *version = &ins->ctx->reg_maps->shader_version;
- const struct wined3d_gl_info *gl_info = ins->ctx->gl_info;
+ const struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data;
struct wined3d_string_buffer *buffer = ins->ctx->buffer;
+ const struct wined3d_gl_info *gl_info = priv->gl_info;
enum wined3d_shader_resource_type resource_type;
enum wined3d_shader_register_type reg_type;
unsigned int resource_idx, bind_idx, i;
@@ -5858,7 +5864,8 @@ static void shader_glsl_resinfo(const struct wined3d_shader_instruction *ins)
static void shader_glsl_sample_info(const struct wined3d_shader_instruction *ins)
{
const struct wined3d_shader_reg_maps *reg_maps = ins->ctx->reg_maps;
- const struct wined3d_gl_info *gl_info = ins->ctx->gl_info;
+ const struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data;
+ const struct wined3d_gl_info *gl_info = priv->gl_info;
struct wined3d_string_buffer *buffer = ins->ctx->buffer;
const struct wined3d_shader_dst_param *dst = ins->dst;
const struct wined3d_shader_src_param *src = ins->src;
@@ -6060,9 +6067,10 @@ static void shader_glsl_gen_sample_c_lz_emulation(const struct wined3d_shader_in
static void shader_glsl_sample_c(const struct wined3d_shader_instruction *ins)
{
- const struct wined3d_gl_info *gl_info = ins->ctx->gl_info;
+ const struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data;
unsigned int resource_idx, sampler_idx, sampler_bind_idx;
const struct wined3d_shader_resource_info *resource_info;
+ const struct wined3d_gl_info *gl_info = priv->gl_info;
struct glsl_src_param coord_param, compare_param;
struct glsl_sample_function sample_function;
const char *lod_param = NULL;
@@ -6110,8 +6118,9 @@ static void shader_glsl_gather4(const struct wined3d_shader_instruction *ins)
unsigned int resource_param_idx, resource_idx, sampler_idx, sampler_bind_idx, component_idx;
const struct wined3d_shader_reg_maps *reg_maps = ins->ctx->reg_maps;
const char *prefix = shader_glsl_get_prefix(reg_maps->shader_version.type);
+ const struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data;
struct glsl_src_param coord_param, compare_param, offset_param;
- const struct wined3d_gl_info *gl_info = ins->ctx->gl_info;
+ const struct wined3d_gl_info *gl_info = priv->gl_info;
const struct wined3d_shader_resource_info *resource_info;
struct wined3d_string_buffer *buffer = ins->ctx->buffer;
unsigned int coord_size, offset_size;
@@ -7574,6 +7583,7 @@ static GLuint shader_glsl_generate_fragment_shader(const struct wined3d_context_
DWORD map;
memset(&priv_ctx, 0, sizeof(priv_ctx));
+ priv_ctx.gl_info = gl_info;
priv_ctx.cur_ps_args = args;
priv_ctx.cur_np2fixup_info = np2fixup_info;
priv_ctx.string_buffers = string_buffers;
@@ -7927,6 +7937,7 @@ static GLuint shader_glsl_generate_vertex_shader(const struct wined3d_context_gl
unsigned int i;
memset(&priv_ctx, 0, sizeof(priv_ctx));
+ priv_ctx.gl_info = gl_info;
priv_ctx.cur_vs_args = args;
priv_ctx.string_buffers = string_buffers;
@@ -8071,6 +8082,7 @@ static GLuint shader_glsl_generate_hull_shader(const struct wined3d_context_gl *
unsigned int i;
memset(&priv_ctx, 0, sizeof(priv_ctx));
+ priv_ctx.gl_info = gl_info;
priv_ctx.string_buffers = string_buffers;
shader_glsl_add_version_declaration(buffer, gl_info);
@@ -8164,6 +8176,7 @@ static GLuint shader_glsl_generate_domain_shader(const struct wined3d_context_gl
GLuint shader_id;
memset(&priv_ctx, 0, sizeof(priv_ctx));
+ priv_ctx.gl_info = gl_info;
priv_ctx.cur_ds_args = args;
priv_ctx.string_buffers = string_buffers;
@@ -8262,6 +8275,7 @@ static GLuint shader_glsl_generate_geometry_shader(const struct wined3d_context_
GLuint shader_id;
memset(&priv_ctx, 0, sizeof(priv_ctx));
+ priv_ctx.gl_info = gl_info;
priv_ctx.string_buffers = string_buffers;
shader_glsl_add_version_declaration(buffer, gl_info);
@@ -8351,7 +8365,7 @@ static GLuint shader_glsl_generate_geometry_shader(const struct wined3d_context_
static void shader_glsl_generate_shader_epilogue(const struct wined3d_shader_context *ctx)
{
const struct shader_glsl_ctx_priv *priv = ctx->backend_data;
- const struct wined3d_gl_info *gl_info = ctx->gl_info;
+ const struct wined3d_gl_info *gl_info = priv->gl_info;
struct wined3d_string_buffer *buffer = ctx->buffer;
const struct wined3d_shader *shader = ctx->shader;
@@ -8388,6 +8402,7 @@ static GLuint shader_glsl_generate_compute_shader(const struct wined3d_context_g
unsigned int i;
memset(&priv_ctx, 0, sizeof(priv_ctx));
+ priv_ctx.gl_info = gl_info;
priv_ctx.string_buffers = string_buffers;
shader_glsl_add_version_declaration(buffer, gl_info);
--
2.11.0
1
0
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/wined3d/adapter_vk.c | 17 ++++++++++
dlls/wined3d/buffer.c | 66 ++++++++++++++++++++++++++++++++++++--
dlls/wined3d/context.c | 72 ++++++++++++++++++++++++++++++++++++++++++
dlls/wined3d/wined3d_private.h | 21 ++++++++++++
4 files changed, 173 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c
index 4ec68013017..7d501b4b08f 100644
--- a/dlls/wined3d/adapter_vk.c
+++ b/dlls/wined3d/adapter_vk.c
@@ -555,6 +555,23 @@ static void adapter_vk_destroy_swapchain(struct wined3d_swapchain *swapchain)
heap_free(swapchain);
}
+unsigned int wined3d_adapter_vk_get_memory_type_index(const struct wined3d_adapter_vk *adapter_vk,
+ uint32_t memory_type_mask, VkMemoryPropertyFlags flags)
+{
+ const VkPhysicalDeviceMemoryProperties *memory_info = &adapter_vk->memory_properties;
+ unsigned int i;
+
+ for (i = 0; i < memory_info->memoryTypeCount; ++i)
+ {
+ if (!(memory_type_mask & (1u << i)))
+ continue;
+ if ((memory_info->memoryTypes[i].propertyFlags & flags) == flags)
+ return i;
+ }
+
+ return ~0u;
+}
+
static HRESULT adapter_vk_create_buffer(struct wined3d_device *device,
const struct wined3d_buffer_desc *desc, const struct wined3d_sub_resource_data *data,
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_buffer **buffer)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 5da6aec4fb8..4f3c28fe0b1 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -1554,6 +1554,44 @@ HRESULT wined3d_buffer_gl_init(struct wined3d_buffer_gl *buffer_gl, struct wined
return wined3d_buffer_init(&buffer_gl->b, device, desc, data, parent, parent_ops, &wined3d_buffer_gl_ops);
}
+static BOOL wined3d_buffer_vk_create_buffer_object(struct wined3d_buffer_vk *buffer_vk,
+ struct wined3d_context_vk *context_vk)
+{
+ struct wined3d_resource *resource = &buffer_vk->b.resource;
+ uint32_t bind_flags = resource->bind_flags;
+ VkMemoryPropertyFlags memory_type;
+ VkBufferUsageFlags usage;
+
+ usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
+ if (bind_flags & WINED3D_BIND_VERTEX_BUFFER)
+ usage |= VK_BUFFER_USAGE_VERTEX_BUFFER_BIT;
+ if (bind_flags & WINED3D_BIND_INDEX_BUFFER)
+ usage |= VK_BUFFER_USAGE_INDEX_BUFFER_BIT;
+ if (bind_flags & WINED3D_BIND_CONSTANT_BUFFER)
+ usage |= VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT;
+ if (bind_flags & WINED3D_BIND_SHADER_RESOURCE)
+ usage |= VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT;
+ if (bind_flags & WINED3D_BIND_UNORDERED_ACCESS)
+ usage |= VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT;
+ if (bind_flags & WINED3D_BIND_INDIRECT_BUFFER)
+ usage |= VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT;
+ if (bind_flags & (WINED3D_BIND_STREAM_OUTPUT | WINED3D_BIND_RENDER_TARGET | WINED3D_BIND_DEPTH_STENCIL))
+ FIXME("Ignoring some bind flags %#x.\n", bind_flags);
+ memory_type = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT
+ | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT
+ | VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
+ if (!(wined3d_context_vk_create_bo(context_vk, resource->size, usage, memory_type, &buffer_vk->bo)))
+ {
+ WARN("Failed to create Vulkan buffer.\n");
+ return FALSE;
+ }
+
+ buffer_vk->b.buffer_object = (uintptr_t)&buffer_vk->bo;
+ buffer_invalidate_bo_range(&buffer_vk->b, 0, 0);
+
+ return TRUE;
+}
+
static BOOL wined3d_buffer_vk_prepare_location(struct wined3d_buffer *buffer,
struct wined3d_context *context, unsigned int location)
{
@@ -1563,8 +1601,10 @@ static BOOL wined3d_buffer_vk_prepare_location(struct wined3d_buffer *buffer,
return wined3d_resource_prepare_sysmem(&buffer->resource);
case WINED3D_LOCATION_BUFFER:
- /* The Vulkan buffer is created during resource creation. */
- return TRUE;
+ if (buffer->buffer_object)
+ return TRUE;
+
+ return wined3d_buffer_vk_create_buffer_object(wined3d_buffer_vk(buffer), wined3d_context_vk(context));
default:
FIXME("Unhandled location %s.\n", wined3d_debug_location(location));
@@ -1575,7 +1615,24 @@ static BOOL wined3d_buffer_vk_prepare_location(struct wined3d_buffer *buffer,
static void wined3d_buffer_vk_unload_location(struct wined3d_buffer *buffer,
struct wined3d_context *context, unsigned int location)
{
- FIXME("buffer %p, context %p, location %s.\n", buffer, context, wined3d_debug_location(location));
+ struct wined3d_context_vk *context_vk = wined3d_context_vk(context);
+ struct wined3d_buffer_vk *buffer_vk = wined3d_buffer_vk(buffer);
+
+ TRACE("buffer %p, context %p, location %s.\n", buffer, context, wined3d_debug_location(location));
+
+ switch (location)
+ {
+ case WINED3D_LOCATION_BUFFER:
+ wined3d_context_vk_destroy_bo(context_vk, &buffer_vk->bo);
+ buffer_vk->bo.vk_buffer = VK_NULL_HANDLE;
+ buffer_vk->bo.vk_memory = VK_NULL_HANDLE;
+ buffer_vk->b.buffer_object = 0u;
+ break;
+
+ default:
+ ERR("Unhandled location %s.\n", wined3d_debug_location(location));
+ break;
+ }
}
static void wined3d_buffer_vk_upload_ranges(struct wined3d_buffer *buffer, struct wined3d_context *context,
@@ -1605,6 +1662,9 @@ HRESULT wined3d_buffer_vk_init(struct wined3d_buffer_vk *buffer_vk, struct wined
TRACE("buffer_vk %p, device %p, desc %p, data %p, parent %p, parent_ops %p.\n",
buffer_vk, device, desc, data, parent, parent_ops);
+ if (desc->access & WINED3D_RESOURCE_ACCESS_GPU)
+ buffer_vk->b.flags |= WINED3D_BUFFER_USE_BO;
+
return wined3d_buffer_init(&buffer_vk->b, device, desc, data, parent, parent_ops, &wined3d_buffer_vk_ops);
}
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 458343ce4a4..7d66fab0a26 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1493,6 +1493,74 @@ static void wined3d_context_gl_cleanup(struct wined3d_context_gl *context_gl)
wined3d_context_cleanup(&context_gl->c);
}
+BOOL wined3d_context_vk_create_bo(struct wined3d_context_vk *context_vk, VkDeviceSize size,
+ VkBufferUsageFlags usage, VkMemoryPropertyFlags memory_type, struct wined3d_bo_vk *bo)
+{
+ struct wined3d_device_vk *device_vk = wined3d_device_vk(context_vk->c.device);
+ const struct wined3d_vk_info *vk_info = context_vk->vk_info;
+ VkMemoryRequirements memory_requirements;
+ struct wined3d_adapter_vk *adapter_vk;
+ VkMemoryAllocateInfo allocate_info;
+ VkBufferCreateInfo create_info;
+ VkResult vr;
+
+ adapter_vk = wined3d_adapter_vk(device_vk->d.adapter);
+
+ create_info.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
+ create_info.pNext = NULL;
+ create_info.flags = 0;
+ create_info.size = size;
+ create_info.usage = usage;
+ create_info.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
+ create_info.queueFamilyIndexCount = 0;
+ create_info.pQueueFamilyIndices = NULL;
+
+ if ((vr = VK_CALL(vkCreateBuffer(device_vk->vk_device, &create_info, NULL, &bo->vk_buffer))) < 0)
+ {
+ ERR("Failed to create Vulkan buffer, vr %s.\n", wined3d_debug_vkresult(vr));
+ return FALSE;
+ }
+
+ VK_CALL(vkGetBufferMemoryRequirements(device_vk->vk_device, bo->vk_buffer, &memory_requirements));
+
+ allocate_info.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO;
+ allocate_info.pNext = NULL;
+ allocate_info.allocationSize = memory_requirements.size;
+ allocate_info.memoryTypeIndex = wined3d_adapter_vk_get_memory_type_index(adapter_vk,
+ memory_requirements.memoryTypeBits, memory_type);
+ if (allocate_info.memoryTypeIndex == ~0u)
+ {
+ ERR("Failed to find suitable memory type.\n");
+ VK_CALL(vkDestroyBuffer(device_vk->vk_device, bo->vk_buffer, NULL));
+ return FALSE;
+ }
+ if ((vr = VK_CALL(vkAllocateMemory(device_vk->vk_device, &allocate_info, NULL, &bo->vk_memory))) < 0)
+ {
+ ERR("Failed to allocate buffer memory, vr %s.\n", wined3d_debug_vkresult(vr));
+ VK_CALL(vkDestroyBuffer(device_vk->vk_device, bo->vk_buffer, NULL));
+ return FALSE;
+ }
+
+ if ((vr = VK_CALL(vkBindBufferMemory(device_vk->vk_device, bo->vk_buffer, bo->vk_memory, 0))) < 0)
+ {
+ ERR("Failed to bind buffer memory, vr %s.\n", wined3d_debug_vkresult(vr));
+ VK_CALL(vkFreeMemory(device_vk->vk_device, bo->vk_memory, NULL));
+ VK_CALL(vkDestroyBuffer(device_vk->vk_device, bo->vk_buffer, NULL));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+void wined3d_context_vk_destroy_bo(struct wined3d_context_vk *context_vk, const struct wined3d_bo_vk *bo)
+{
+ struct wined3d_device_vk *device_vk = wined3d_device_vk(context_vk->c.device);
+ const struct wined3d_vk_info *vk_info = context_vk->vk_info;
+
+ VK_CALL(vkDestroyBuffer(device_vk->vk_device, bo->vk_buffer, NULL));
+ VK_CALL(vkFreeMemory(device_vk->vk_device, bo->vk_memory, NULL));
+}
+
void wined3d_context_vk_cleanup(struct wined3d_context_vk *context_vk)
{
wined3d_context_cleanup(&context_vk->c);
@@ -2344,9 +2412,13 @@ fail:
HRESULT wined3d_context_vk_init(struct wined3d_context_vk *context_vk, struct wined3d_swapchain *swapchain)
{
+ struct wined3d_adapter_vk *adapter_vk;
+
TRACE("context_vk %p, swapchain %p.\n", context_vk, swapchain);
wined3d_context_init(&context_vk->c, swapchain);
+ adapter_vk = wined3d_adapter_vk(swapchain->device->adapter);
+ context_vk->vk_info = &adapter_vk->vk_info;
return WINED3D_OK;
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 21f17736ec7..583d970eca8 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1512,6 +1512,12 @@ do { \
#define checkGLcall(A) do {} while(0)
#endif
+struct wined3d_bo_vk
+{
+ VkBuffer vk_buffer;
+ VkDeviceMemory vk_memory;
+};
+
struct wined3d_bo_address
{
UINT_PTR buffer_object;
@@ -2155,9 +2161,20 @@ void wined3d_context_gl_update_stream_sources(struct wined3d_context_gl *context
struct wined3d_context_vk
{
struct wined3d_context c;
+
+ const struct wined3d_vk_info *vk_info;
};
+static inline struct wined3d_context_vk *wined3d_context_vk(struct wined3d_context *context)
+{
+ return CONTAINING_RECORD(context, struct wined3d_context_vk, c);
+}
+
void wined3d_context_vk_cleanup(struct wined3d_context_vk *context_vk) DECLSPEC_HIDDEN;
+BOOL wined3d_context_vk_create_bo(struct wined3d_context_vk *context_vk, VkDeviceSize size,
+ VkBufferUsageFlags usage, VkMemoryPropertyFlags memory_type, struct wined3d_bo_vk *bo) DECLSPEC_HIDDEN;
+void wined3d_context_vk_destroy_bo(struct wined3d_context_vk *context_vk,
+ const struct wined3d_bo_vk *bo) DECLSPEC_HIDDEN;
HRESULT wined3d_context_vk_init(struct wined3d_context_vk *context_vk,
struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
@@ -2929,6 +2946,8 @@ static inline struct wined3d_adapter_vk *wined3d_adapter_vk(struct wined3d_adapt
struct wined3d_adapter *wined3d_adapter_vk_create(unsigned int ordinal,
unsigned int wined3d_creation_flags) DECLSPEC_HIDDEN;
+unsigned int wined3d_adapter_vk_get_memory_type_index(const struct wined3d_adapter_vk *adapter_vk,
+ uint32_t memory_type_mask, VkMemoryPropertyFlags flags) DECLSPEC_HIDDEN;
struct wined3d_caps_gl_ctx
{
@@ -4208,6 +4227,8 @@ HRESULT wined3d_buffer_gl_init(struct wined3d_buffer_gl *buffer_gl, struct wined
struct wined3d_buffer_vk
{
struct wined3d_buffer b;
+
+ struct wined3d_bo_vk bo;
};
static inline struct wined3d_buffer_vk *wined3d_buffer_vk(struct wined3d_buffer *buffer)
--
2.11.0
1
0
24 Jan '20
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
v3: Only push modified constants.
This series may not necessarily be safe for code freeze, but I'm submitting it
at least to finish the review process.
dlls/wined3d/device.c | 193 ++++++++++++++++++++++++++++++++++++++
dlls/wined3d/wined3d.spec | 1 +
include/wine/wined3d.h | 1 +
3 files changed, 195 insertions(+)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 8913420724..8e20e31d3f 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3829,6 +3829,199 @@ struct wined3d_texture * CDECL wined3d_device_get_texture(const struct wined3d_d
return device->state.textures[stage];
}
+void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
+ struct wined3d_stateblock *stateblock)
+{
+ const struct wined3d_d3d_info *d3d_info = &stateblock->device->adapter->d3d_info;
+ const struct wined3d_stateblock_state *state = &stateblock->stateblock_state;
+ unsigned int i, j, count;
+
+ TRACE("device %p, stateblock %p.\n", device, stateblock);
+
+ if (stateblock->changed.vertexShader)
+ wined3d_device_set_vertex_shader(device, state->vs);
+ if (stateblock->changed.pixelShader)
+ wined3d_device_set_pixel_shader(device, state->ps);
+
+ count = 0;
+ for (i = 0; i < d3d_info->limits.vs_uniform_count; ++i)
+ {
+ if (stateblock->changed.vs_consts_f[i])
+ ++count;
+ else if (count)
+ {
+ wined3d_device_set_vs_consts_f(device, i - count, count, state->vs_consts_f + i - count);
+ count = 0;
+ }
+ }
+ if (count)
+ wined3d_device_set_vs_consts_f(device, i - count, count, state->vs_consts_f + i - count);
+
+ count = 0;
+ for (i = 0; i < WINED3D_MAX_CONSTS_B; ++i)
+ {
+ if (stateblock->changed.vertexShaderConstantsB & (1u << i))
+ ++count;
+ else if (count)
+ {
+ wined3d_device_set_vs_consts_b(device, i - count, count, state->vs_consts_b + i - count);
+ count = 0;
+ }
+ }
+ if (count)
+ wined3d_device_set_vs_consts_b(device, i - count, count, state->vs_consts_b + i - count);
+
+ count = 0;
+ for (i = 0; i < WINED3D_MAX_CONSTS_I; ++i)
+ {
+ if (stateblock->changed.vertexShaderConstantsI & (1u << i))
+ ++count;
+ else if (count)
+ {
+ wined3d_device_set_vs_consts_i(device, i - count, count, state->vs_consts_i + i - count);
+ count = 0;
+ }
+ }
+ if (count)
+ wined3d_device_set_vs_consts_i(device, i - count, count, state->vs_consts_i + i - count);
+
+ count = 0;
+ for (i = 0; i < d3d_info->limits.ps_uniform_count; ++i)
+ {
+ if (stateblock->changed.ps_consts_f[i])
+ ++count;
+ else if (count)
+ {
+ wined3d_device_set_ps_consts_f(device, i - count, count, state->ps_consts_f + i - count);
+ count = 0;
+ }
+ }
+ if (count)
+ wined3d_device_set_ps_consts_f(device, i - count, count, state->ps_consts_f + i - count);
+
+ count = 0;
+ for (i = 0; i < WINED3D_MAX_CONSTS_B; ++i)
+ {
+ if (stateblock->changed.pixelShaderConstantsB & (1u << i))
+ ++count;
+ else if (count)
+ {
+ wined3d_device_set_ps_consts_b(device, i - count, count, state->ps_consts_b + i - count);
+ count = 0;
+ }
+ }
+ if (count)
+ wined3d_device_set_ps_consts_b(device, i - count, count, state->ps_consts_b + i - count);
+
+ count = 0;
+ for (i = 0; i < WINED3D_MAX_CONSTS_I; ++i)
+ {
+ if (stateblock->changed.pixelShaderConstantsI & (1u << i))
+ ++count;
+ else if (count)
+ {
+ wined3d_device_set_ps_consts_i(device, i - count, count, state->ps_consts_i + i - count);
+ count = 0;
+ }
+ }
+ if (count)
+ wined3d_device_set_ps_consts_i(device, i - count, count, state->ps_consts_i + i - count);
+
+ for (i = 0; i < ARRAY_SIZE(state->light_state->light_map); ++i)
+ {
+ const struct wined3d_light_info *light;
+
+ LIST_FOR_EACH_ENTRY(light, &state->light_state->light_map[i], struct wined3d_light_info, entry)
+ {
+ wined3d_device_set_light(device, light->OriginalIndex, &light->OriginalParms);
+ wined3d_device_set_light_enable(device, light->OriginalIndex, light->glIndex != -1);
+ }
+ }
+
+ for (i = 0; i < ARRAY_SIZE(state->rs); ++i)
+ {
+ if (stateblock->changed.renderState[i >> 5] & (1u << (i & 0x1f)))
+ {
+ if (i == WINED3D_RS_BLENDFACTOR)
+ {
+ struct wined3d_color color;
+ wined3d_color_from_d3dcolor(&color, state->rs[i]);
+ wined3d_device_set_blend_state(device, NULL, &color);
+ }
+ else
+ wined3d_device_set_render_state(device, i, state->rs[i]);
+ }
+ }
+
+ for (i = 0; i < ARRAY_SIZE(state->texture_states); ++i)
+ {
+ for (j = 0; j < ARRAY_SIZE(state->texture_states[i]); ++j)
+ {
+ if (stateblock->changed.textureState[i] & (1u << j))
+ wined3d_device_set_texture_stage_state(device, i, j, state->texture_states[i][j]);
+ }
+ }
+
+ for (i = 0; i < ARRAY_SIZE(state->sampler_states); ++i)
+ {
+ DWORD stage = i;
+ if (stage >= WINED3D_MAX_FRAGMENT_SAMPLERS)
+ stage += WINED3DVERTEXTEXTURESAMPLER0 - WINED3D_MAX_FRAGMENT_SAMPLERS;
+ for (j = 0; j < ARRAY_SIZE(state->sampler_states[j]); ++j)
+ {
+ if (stateblock->changed.samplerState[i] & (1 << j))
+ wined3d_device_set_sampler_state(device, stage, j, state->sampler_states[i][j]);
+ }
+ }
+
+ for (i = 0; i < ARRAY_SIZE(state->transforms); ++i)
+ {
+ if (stateblock->changed.transform[i >> 5] & (1u << (i & 0x1f)))
+ wined3d_device_set_transform(device, i, &state->transforms[i]);
+ }
+
+ if (stateblock->changed.indices)
+ wined3d_device_set_index_buffer(device, state->index_buffer, state->index_format, 0);
+ wined3d_device_set_base_vertex_index(device, state->base_vertex_index);
+ if (stateblock->changed.vertexDecl)
+ wined3d_device_set_vertex_declaration(device, state->vertex_declaration);
+ if (stateblock->changed.material)
+ wined3d_device_set_material(device, &state->material);
+ if (stateblock->changed.viewport)
+ wined3d_device_set_viewports(device, 1, &state->viewport);
+ if (stateblock->changed.scissorRect)
+ wined3d_device_set_scissor_rects(device, 1, &state->scissor_rect);
+
+ for (i = 0; i < ARRAY_SIZE(state->streams); ++i)
+ {
+ if (stateblock->changed.streamSource & (1u << i))
+ wined3d_device_set_stream_source(device, i, state->streams[i].buffer,
+ state->streams[i].offset, state->streams[i].stride);
+ if (stateblock->changed.streamFreq & (1u << i))
+ wined3d_device_set_stream_source_freq(device, i,
+ state->streams[i].frequency | state->streams[i].flags);
+ }
+
+ for (i = 0; i < ARRAY_SIZE(state->textures); ++i)
+ {
+ DWORD stage = i;
+ if (stage >= WINED3D_MAX_FRAGMENT_SAMPLERS)
+ stage += WINED3DVERTEXTEXTURESAMPLER0 - WINED3D_MAX_FRAGMENT_SAMPLERS;
+ if (stateblock->changed.textures & (1u << i))
+ wined3d_device_set_texture(device, stage, state->textures[i]);
+ }
+
+ for (i = 0; i < ARRAY_SIZE(state->clip_planes); ++i)
+ {
+ if (stateblock->changed.clipplane & (1u << i))
+ wined3d_device_set_clip_plane(device, i, &state->clip_planes[i]);
+ }
+
+ memset(&stateblock->changed, 0, sizeof(stateblock->changed));
+
+ TRACE("Applied stateblock %p.\n", stateblock);
+}
+
HRESULT CDECL wined3d_device_get_device_caps(const struct wined3d_device *device, struct wined3d_caps *caps)
{
TRACE("device %p, caps %p.\n", device, caps);
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index e03c57055b..c8ef442c72 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -37,6 +37,7 @@
@ cdecl wined3d_buffer_incref(ptr)
@ cdecl wined3d_device_acquire_focus_window(ptr ptr)
+@ cdecl wined3d_device_apply_stateblock(ptr ptr)
@ cdecl wined3d_device_begin_scene(ptr)
@ cdecl wined3d_device_clear(ptr long ptr long ptr float long)
@ cdecl wined3d_device_clear_rendertarget_view(ptr ptr ptr long ptr float long)
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 9cdf18633c..4306f5ae21 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2289,6 +2289,7 @@ struct wined3d_resource * __cdecl wined3d_buffer_get_resource(struct wined3d_buf
ULONG __cdecl wined3d_buffer_incref(struct wined3d_buffer *buffer);
HRESULT __cdecl wined3d_device_acquire_focus_window(struct wined3d_device *device, HWND window);
+void __cdecl wined3d_device_apply_stateblock(struct wined3d_device *device, struct wined3d_stateblock *stateblock);
HRESULT __cdecl wined3d_device_begin_scene(struct wined3d_device *device);
HRESULT __cdecl wined3d_device_clear(struct wined3d_device *device, DWORD rect_count, const RECT *rects, DWORD flags,
const struct wined3d_color *color, float z, DWORD stencil);
--
2.24.0
3
9
[PATCH v2 1/5] winegstreamer: Rename the "ppPins" element of struct gstdemux to "sources".
by Zebediah Figura 24 Jan '20
by Zebediah Figura 24 Jan '20
24 Jan '20
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/winegstreamer/gstdemux.c | 33 +++++++++++++++++----------------
1 file changed, 17 insertions(+), 16 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index 7ae70d0a736..88310668540 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -57,7 +57,8 @@ struct gstdemux
struct strmbase_sink sink;
IAsyncReader *reader;
IMemAllocator *alloc;
- struct gstdemux_source **ppPins;
+
+ struct gstdemux_source **sources;
LONG cStreams;
LONGLONG filesize;
@@ -842,7 +843,7 @@ static void removed_decoded_pad(GstElement *bin, GstPad *pad, gpointer user)
TRACE("%p %p %p\n", This, bin, pad);
for (x = 0; x < This->cStreams; ++x) {
- if (This->ppPins[x]->their_src == pad)
+ if (This->sources[x]->their_src == pad)
break;
}
if (x == This->cStreams)
@@ -853,7 +854,7 @@ static void removed_decoded_pad(GstElement *bin, GstPad *pad, gpointer user)
return;
}
- pin = This->ppPins[x];
+ pin = This->sources[x];
if(pin->flipfilter)
gst_pad_unlink(pin->their_src, pin->flip_sink);
@@ -994,7 +995,7 @@ static void existing_new_pad(GstElement *bin, GstPad *pad, gpointer user)
}
for (x = 0; x < This->cStreams; ++x) {
- struct gstdemux_source *pin = This->ppPins[x];
+ struct gstdemux_source *pin = This->sources[x];
if (!pin->their_src) {
gst_segment_init(pin->segment, GST_FORMAT_TIME);
@@ -1215,7 +1216,7 @@ static struct strmbase_pin *gstdemux_get_pin(struct strmbase_filter *base, unsig
if (!index)
return &filter->sink.pin;
else if (index <= filter->cStreams)
- return &filter->ppPins[index - 1]->pin.pin;
+ return &filter->sources[index - 1]->pin.pin;
return NULL;
}
@@ -1280,7 +1281,7 @@ static HRESULT gstdemux_init_stream(struct strmbase_filter *iface)
for (i = 0; i < filter->cStreams; ++i)
{
- if (SUCCEEDED(pin_hr = BaseOutputPinImpl_Active(&filter->ppPins[i]->pin)))
+ if (SUCCEEDED(pin_hr = BaseOutputPinImpl_Active(&filter->sources[i]->pin)))
hr = pin_hr;
}
return hr;
@@ -1496,10 +1497,10 @@ static BOOL gstdecoder_init_gst(struct gstdemux *filter)
WaitForSingleObject(filter->no_more_pads_event, INFINITE);
- gst_pad_query_duration(filter->ppPins[0]->their_src, GST_FORMAT_TIME, &duration);
+ gst_pad_query_duration(filter->sources[0]->their_src, GST_FORMAT_TIME, &duration);
for (i = 0; i < filter->cStreams; ++i)
{
- struct gstdemux_source *pin = filter->ppPins[i];
+ struct gstdemux_source *pin = filter->sources[i];
const HANDLE events[2] = {pin->caps_event, filter->error_event};
pin->seek.llDuration = pin->seek.llStop = duration / 100;
@@ -1947,9 +1948,9 @@ static struct gstdemux_source *create_pin(struct gstdemux *filter, const WCHAR *
struct gstdemux_source *pin, **new_array;
char pad_name[19];
- if (!(new_array = heap_realloc(filter->ppPins, (filter->cStreams + 1) * sizeof(*new_array))))
+ if (!(new_array = heap_realloc(filter->sources, (filter->cStreams + 1) * sizeof(*new_array))))
return NULL;
- filter->ppPins = new_array;
+ filter->sources = new_array;
if (!(pin = heap_alloc_zero(sizeof(*pin))))
return NULL;
@@ -1970,7 +1971,7 @@ static struct gstdemux_source *create_pin(struct gstdemux *filter, const WCHAR *
gst_pad_set_event_function(pin->my_sink, event_sink_wrapper);
gst_pad_set_query_function(pin->my_sink, query_sink_wrapper);
- filter->ppPins[filter->cStreams++] = pin;
+ filter->sources[filter->cStreams++] = pin;
return pin;
}
@@ -1990,11 +1991,11 @@ static HRESULT GST_RemoveOutputPins(struct gstdemux *This)
This->my_src = This->their_sink = NULL;
for (i = 0; i < This->cStreams; ++i)
- free_source_pin(This->ppPins[i]);
+ free_source_pin(This->sources[i]);
This->cStreams = 0;
- heap_free(This->ppPins);
- This->ppPins = NULL;
+ heap_free(This->sources);
+ This->sources = NULL;
gst_element_set_bus(This->container, NULL);
gst_object_unref(This->container);
This->container = NULL;
@@ -2317,10 +2318,10 @@ static BOOL avi_splitter_init_gst(struct gstdemux *filter)
WaitForSingleObject(filter->no_more_pads_event, INFINITE);
- gst_pad_query_duration(filter->ppPins[0]->their_src, GST_FORMAT_TIME, &duration);
+ gst_pad_query_duration(filter->sources[0]->their_src, GST_FORMAT_TIME, &duration);
for (i = 0; i < filter->cStreams; ++i)
{
- struct gstdemux_source *pin = filter->ppPins[i];
+ struct gstdemux_source *pin = filter->sources[i];
const HANDLE events[2] = {pin->caps_event, filter->error_event};
pin->seek.llDuration = pin->seek.llStop = duration / 100;
--
2.25.0
1
4
24 Jan '20
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
dlls/ddraw/tests/ddraw1.c | 2 +-
dlls/ddraw/tests/ddraw2.c | 2 +-
dlls/ddraw/tests/ddraw4.c | 2 +-
dlls/ddraw/tests/ddraw7.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
3
2
[PATCH 1/5] ddraw/tests: Don't leak overlay if DWM cannot be disabled.
by Stefan Dösinger 24 Jan '20
by Stefan Dösinger 24 Jan '20
24 Jan '20
This fixes test_caps on my GeForce 650M Windows 10 machine.
Signed-off-by: Stefan Dösinger <stefan(a)codeweavers.com>
---
There's a deeper problem with test_caps() though - that this leak causes
it to fail is just a symptom. ddraw reports different caps after creating
a surface, presumably because some internal plugins get loaded. So the
results of test_caps() are potentially misleading.
---
dlls/ddraw/tests/ddraw1.c | 3 ++-
dlls/ddraw/tests/ddraw2.c | 3 ++-
dlls/ddraw/tests/ddraw4.c | 3 ++-
dlls/ddraw/tests/ddraw7.c | 3 ++-
4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
index c10be66236a..26dd8140e4c 100644
--- a/dlls/ddraw/tests/ddraw1.c
+++ b/dlls/ddraw/tests/ddraw1.c
@@ -9478,10 +9478,11 @@ static void test_overlay_rect(void)
ok(!pos_x, "Got unexpected pos_x %d.\n", pos_x);
ok(!pos_y, "Got unexpected pos_y %d.\n", pos_y);
- IDirectDrawSurface_Release(overlay);
done:
if (primary)
IDirectDrawSurface_Release(primary);
+ if (overlay)
+ IDirectDrawSurface_Release(overlay);
IDirectDraw_Release(ddraw);
DestroyWindow(window);
}
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index 8d4d44863a1..8e37243e6c1 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -10180,10 +10180,11 @@ static void test_overlay_rect(void)
ok(!pos_x, "Got unexpected pos_x %d.\n", pos_x);
ok(!pos_y, "Got unexpected pos_y %d.\n", pos_y);
- IDirectDrawSurface_Release(overlay);
done:
if (primary)
IDirectDrawSurface_Release(primary);
+ if (overlay)
+ IDirectDrawSurface_Release(overlay);
IDirectDraw2_Release(ddraw);
DestroyWindow(window);
}
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
index 1a16e2d571e..b6dbd63c885 100644
--- a/dlls/ddraw/tests/ddraw4.c
+++ b/dlls/ddraw/tests/ddraw4.c
@@ -12058,10 +12058,11 @@ static void test_overlay_rect(void)
ok(!pos_x, "Got unexpected pos_x %d.\n", pos_x);
ok(!pos_y, "Got unexpected pos_y %d.\n", pos_y);
- IDirectDrawSurface4_Release(overlay);
done:
if (primary)
IDirectDrawSurface4_Release(primary);
+ if (overlay)
+ IDirectDrawSurface4_Release(overlay);
IDirectDraw4_Release(ddraw);
DestroyWindow(window);
}
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index 20a1bc5f3af..be6aca2cec9 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -12049,10 +12049,11 @@ static void test_overlay_rect(void)
ok(!pos_x, "Got unexpected pos_x %d.\n", pos_x);
ok(!pos_y, "Got unexpected pos_y %d.\n", pos_y);
- IDirectDrawSurface7_Release(overlay);
done:
if (primary)
IDirectDrawSurface7_Release(primary);
+ if (overlay)
+ IDirectDrawSurface7_Release(overlay);
IDirectDraw7_Release(ddraw);
DestroyWindow(window);
}
--
2.24.1
3
14
24 Jan '20
Signed-off-by: Paul Gofman <gofmanp(a)gmail.com>
---
v2:
- increase tolerance for some checks (those checks were falling out of tolerance when using fallback srgb read mode in Wine).
dlls/d3d9/tests/visual.c | 395 ++++++++++++++++++++++-----------------
1 file changed, 227 insertions(+), 168 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index 3d3597bdd1..196c3fa85f 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -3767,26 +3767,49 @@ done:
static void fill_surface(IDirect3DSurface9 *surface, DWORD color, DWORD flags)
{
+ unsigned int byte_count;
D3DSURFACE_DESC desc;
+ unsigned int x, y;
D3DLOCKED_RECT l;
HRESULT hr;
- unsigned int x, y;
- DWORD *mem;
+ void *mem;
memset(&desc, 0, sizeof(desc));
memset(&l, 0, sizeof(l));
hr = IDirect3DSurface9_GetDesc(surface, &desc);
ok(hr == D3D_OK, "IDirect3DSurface9_GetDesc failed with %08x\n", hr);
+
+ switch(desc.Format)
+ {
+ case D3DFMT_A8R8G8B8:
+ case D3DFMT_X8R8G8B8:
+ byte_count = 4;
+ break;
+
+ case D3DFMT_A1R5G5B5:
+ case D3DFMT_X1R5G5B5:
+ case D3DFMT_R5G6B5:
+ byte_count = 2;
+ break;
+
+ default:
+ ok(0, "Unsupported format %#x.\n", desc.Format);
+ return;
+ }
+
hr = IDirect3DSurface9_LockRect(surface, &l, NULL, flags);
ok(hr == D3D_OK, "IDirect3DSurface9_LockRect failed with %08x\n", hr);
if(FAILED(hr)) return;
for(y = 0; y < desc.Height; y++)
{
- mem = (DWORD *) ((BYTE *) l.pBits + y * l.Pitch);
- for(x = 0; x < l.Pitch / sizeof(DWORD); x++)
+ mem = (BYTE *)l.pBits + y * l.Pitch;
+ for(x = 0; x < l.Pitch / byte_count; ++x)
{
- mem[x] = color;
+ if (byte_count == 4)
+ ((DWORD *)mem)[x] = color;
+ else
+ ((WORD *)mem)[x] = color;
}
}
hr = IDirect3DSurface9_UnlockRect(surface);
@@ -8964,7 +8987,8 @@ static void srgbtexture_test(void)
struct IDirect3DSurface9 *surface;
IDirect3DDevice9 *device;
IDirect3D9 *d3d;
- D3DCOLOR color;
+ D3DCOLOR colour;
+ unsigned int i;
ULONG refcount;
HWND window;
DWORD value;
@@ -8977,6 +9001,25 @@ static void srgbtexture_test(void)
1.0f, -1.0f, 0.0f, 1.0f, 1.0f,
1.0f, 1.0f, 0.0f, 1.0f, 0.0f,
};
+ static const struct
+ {
+ D3DFORMAT format;
+ const char *format_name;
+ DWORD fill_colour1, fill_colour2;
+ DWORD fill_colour_rb1, fill_colour_rb2;
+ DWORD conv_colour1, conv_colour2;
+ }
+ tests[] =
+ {
+ {D3DFMT_A8R8G8B8, "A8R8G8B8",
+ 0xff7f7f7f, 0xff3f3f3f, 0x007f7f7f, 0x003f3f3f, 0x00363636, 0x000d0d0d},
+ {D3DFMT_R5G6B5, "R5G6R5",
+ 0x7bef, 0x39e7, 0x007b7d7b, 0x003a3d3a, 0x00333433, 0x000a0c0a},
+ {D3DFMT_A1R5G5B5, "A1R5G5R5",
+ 0xbdef, 0x9ce7, 0x007b7b7b, 0x003a3a3a, 0x00333433, 0x000a0a0a},
+ {D3DFMT_X1R5G5B5, "X1R5G5R5",
+ 0x3def, 0x1ce7, 0x007b7b7b, 0x003a3a3a, 0x00333433, 0x000a0a0a},
+ };
window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
@@ -8987,179 +9030,195 @@ static void srgbtexture_test(void)
goto done;
}
- if (IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL,
- D3DFMT_X8R8G8B8, D3DUSAGE_QUERY_SRGBREAD, D3DRTYPE_TEXTURE, D3DFMT_A8R8G8B8) != D3D_OK)
+ for (i = 0; i < ARRAY_SIZE(tests); ++i)
{
- skip("D3DFMT_A8R8G8B8 textures with SRGBREAD not supported.\n");
- IDirect3DDevice9_Release(device);
- goto done;
- }
+ if (IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL,
+ D3DFMT_X8R8G8B8, D3DUSAGE_QUERY_SRGBREAD, D3DRTYPE_TEXTURE, tests[i].format) != D3D_OK)
+ {
+ skip("%s textures with SRGBREAD are not supported.\n", tests[i].format_name);
+ continue;
+ }
- hr = IDirect3DDevice9_CreateTexture(device, 16, 16, 2, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &texture, NULL);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DTexture9_GetSurfaceLevel(texture, 0, &surface);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- fill_surface(surface, 0xff7f7f7f, 0);
- IDirect3DSurface9_Release(surface);
- hr = IDirect3DTexture9_GetSurfaceLevel(texture, 1, &surface);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- fill_surface(surface, 0xff3f3f3f, 0);
- IDirect3DSurface9_Release(surface);
+ hr = IDirect3DDevice9_CreateTexture(device, 16, 16, 2, 0, tests[i].format, D3DPOOL_MANAGED, &texture, NULL);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DTexture9_GetSurfaceLevel(texture, 0, &surface);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ fill_surface(surface, tests[i].fill_colour1, 0);
+ IDirect3DSurface9_Release(surface);
+ hr = IDirect3DTexture9_GetSurfaceLevel(texture, 1, &surface);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ fill_surface(surface, tests[i].fill_colour2, 0);
+ IDirect3DSurface9_Release(surface);
- hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *)texture);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *)texture);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- /* AMD uses the LSB of the D3DSAMP_SRGBTEXTURE value.
- * NVIDIA ignores any values other than 0 and 1, leaving the previous
- * D3DSAMP_SRGBTEXTURE state.
- * Intel, WARP treat the value as boolean. */
- hr = IDirect3DDevice9_BeginScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 0x7e41882a);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- ok(value == 0x7e41882a, "Got unexpected value %#x.\n", value);
- hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_EndScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- color = getPixelColor(device, 320, 240);
- ok(color_match(color, 0x007f7f7f, 1) || broken(color_match(color, 0x00363636, 1)),
- "Got unexpected color 0x%08x.\n", color);
- hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ /* AMD uses the LSB of the D3DSAMP_SRGBTEXTURE value.
+ * NVIDIA ignores any values other than 0 and 1, leaving the previous
+ * D3DSAMP_SRGBTEXTURE state.
+ * Intel, WARP treat the value as boolean. */
+ hr = IDirect3DDevice9_BeginScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 0x7e41882a);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ ok(value == 0x7e41882a, "Got unexpected value %#x.\n", value);
+ hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_EndScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ colour = getPixelColor(device, 320, 240);
+ ok(color_match(colour, tests[i].fill_colour_rb1, 2)
+ || broken(color_match(colour, tests[i].conv_colour1, 1)),
+ "Format %s, got unexpected colour 0x%08x.\n", tests[i].format_name, colour);
+ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_BeginScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 100);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- ok(value == 100, "Got unexpected value %#x.\n", value);
- hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_EndScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- color = getPixelColor(device, 320, 240);
- ok(color_match(color, 0x007f7f7f, 1) || broken(color_match(color, 0x00363636, 1)),
- "Got unexpected color 0x%08x.\n", color);
- hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_BeginScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 100);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ ok(value == 100, "Got unexpected value %#x.\n", value);
+ hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_EndScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ colour = getPixelColor(device, 320, 240);
+ ok(color_match(colour, tests[i].fill_colour_rb1, 2)
+ || broken(color_match(colour, tests[i].conv_colour1, 1)),
+ "Format %s, got unexpected colour 0x%08x.\n", tests[i].format_name, colour);
+ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_BeginScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 2);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- ok(value == 2, "Got unexpected value %#x.\n", value);
- hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_EndScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- color = getPixelColor(device, 320, 240);
- ok(color_match(color, 0x007f7f7f, 1) || broken(color_match(color, 0x00363636, 1)),
- "Got unexpected color 0x%08x.\n", color);
- hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_BeginScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 2);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ ok(value == 2, "Got unexpected value %#x.\n", value);
+ hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_EndScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ colour = getPixelColor(device, 320, 240);
+ ok(color_match(colour, tests[i].fill_colour_rb1, 2)
+ || broken(color_match(colour, tests[i].conv_colour1, 1)),
+ "Format %s, got unexpected colour 0x%08x.\n", tests[i].format_name, colour);
+ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_BeginScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 3);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- ok(value == 3, "Got unexpected value %#x.\n", value);
- hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_EndScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- color = getPixelColor(device, 320, 240);
- ok(color_match(color, 0x007f7f7f, 1) || color_match(color, 0x00363636, 1),
- "Got unexpected color 0x%08x.\n", color);
- hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_BeginScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 3);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ ok(value == 3, "Got unexpected value %#x.\n", value);
+ hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_EndScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ colour = getPixelColor(device, 320, 240);
+ ok(color_match(colour, tests[i].fill_colour_rb1, 2)
+ || color_match(colour, tests[i].conv_colour1, 3),
+ "Format %s, got unexpected colour 0x%08x.\n", tests[i].format_name, colour);
+ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_BeginScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, TRUE);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- ok(value == TRUE, "Got unexpected value %#x.\n", value);
- hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_EndScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- color = getPixelColor(device, 320, 240);
- ok(color_match(color, 0x00363636, 1), "Got unexpected color 0x%08x.\n", color);
- hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_BeginScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, TRUE);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ ok(value == TRUE, "Got unexpected value %#x.\n", value);
+ hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_EndScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ colour = getPixelColor(device, 320, 240);
+ ok(color_match(colour, tests[i].conv_colour1, 3), "Format %s, got unexpected colour 0x%08x.\n",
+ tests[i].format_name, colour);
+ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_BeginScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- /* Set the other state to verify that the sampler just inherits old
- * D3DSAMP_SRGBTEXTURE but * the old sampler is not preserved entirely on
- * NVIDIA. */
- hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 0x7e41882a);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- ok(value == 0x7e41882a, "Got unexpected value %#x.\n", value);
- hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MIPFILTER, D3DTEXF_POINT);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 1);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_EndScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- color = getPixelColor(device, 320, 240);
- ok(color_match(color, 0x000d0d0d, 1) || color_match(color, 0x003f3f3f, 1),
- "Got unexpected color 0x%08x.\n", color);
- hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_BeginScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ /* Set the other state to verify that the sampler just inherits old
+ * D3DSAMP_SRGBTEXTURE but the old sampler is not preserved entirely on
+ * NVIDIA. */
+ hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 0x7e41882a);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ ok(value == 0x7e41882a, "Got unexpected value %#x.\n", value);
+ hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MIPFILTER, D3DTEXF_POINT);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 1);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_EndScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ colour = getPixelColor(device, 320, 240);
+ ok(color_match(colour, tests[i].conv_colour2, 1)
+ || color_match(colour, tests[i].fill_colour_rb2, 2),
+ "Format %s, got unexpected colour 0x%08x.\n", tests[i].format_name, colour);
+ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_BeginScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 0);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- ok(value == 0, "Got unexpected value %#x.\n", value);
- hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_EndScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- color = getPixelColor(device, 320, 240);
- ok(color_match(color, 0x003f3f3f, 1), "Got unexpected color 0x%08x.\n", color);
- hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_BeginScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 0);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ ok(value == 0, "Got unexpected value %#x.\n", value);
+ hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_EndScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ colour = getPixelColor(device, 320, 240);
+ ok(color_match(colour, tests[i].fill_colour_rb2, 2),
+ "Format %s, got unexpected colour 0x%08x.\n", tests[i].format_name, colour);
+ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+
+ hr = IDirect3DDevice9_BeginScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 0x7e41882a);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ ok(value == 0x7e41882a, "Got unexpected value %#x.\n", value);
+ hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_EndScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ colour = getPixelColor(device, 320, 240);
+ ok(color_match(colour, tests[i].fill_colour_rb2, 2)
+ || broken(color_match(colour, tests[i].conv_colour2, 1)),
+ "Format %s, got unexpected colour 0x%08x.\n", tests[i].format_name, colour);
+ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ IDirect3DTexture9_Release(texture);
+
+ hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 0);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 0);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ }
- hr = IDirect3DDevice9_BeginScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 0x7e41882a);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- ok(value == 0x7e41882a, "Got unexpected value %#x.\n", value);
- hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_EndScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- color = getPixelColor(device, 320, 240);
- ok(color_match(color, 0x003f3f3f, 1) || broken(color_match(color, 0x000d0d0d, 1)),
- "Got unexpected color 0x%08x.\n", color);
- hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- IDirect3DTexture9_Release(texture);
refcount = IDirect3DDevice9_Release(device);
ok(!refcount, "Device has %u references left.\n", refcount);
done:
--
2.24.1
3
5
24 Jan '20
Signed-off-by: Paul Gofman <gofmanp(a)gmail.com>
---
dlls/d3d9/tests/visual.c | 395 ++++++++++++++++++++++-----------------
1 file changed, 227 insertions(+), 168 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index 6b3466ece5..31b05f7501 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -3767,26 +3767,49 @@ done:
static void fill_surface(IDirect3DSurface9 *surface, DWORD color, DWORD flags)
{
+ unsigned int byte_count;
D3DSURFACE_DESC desc;
+ unsigned int x, y;
D3DLOCKED_RECT l;
HRESULT hr;
- unsigned int x, y;
- DWORD *mem;
+ void *mem;
memset(&desc, 0, sizeof(desc));
memset(&l, 0, sizeof(l));
hr = IDirect3DSurface9_GetDesc(surface, &desc);
ok(hr == D3D_OK, "IDirect3DSurface9_GetDesc failed with %08x\n", hr);
+
+ switch(desc.Format)
+ {
+ case D3DFMT_A8R8G8B8:
+ case D3DFMT_X8R8G8B8:
+ byte_count = 4;
+ break;
+
+ case D3DFMT_A1R5G5B5:
+ case D3DFMT_X1R5G5B5:
+ case D3DFMT_R5G6B5:
+ byte_count = 2;
+ break;
+
+ default:
+ ok(0, "Unsupported format %#x.\n", desc.Format);
+ return;
+ }
+
hr = IDirect3DSurface9_LockRect(surface, &l, NULL, flags);
ok(hr == D3D_OK, "IDirect3DSurface9_LockRect failed with %08x\n", hr);
if(FAILED(hr)) return;
for(y = 0; y < desc.Height; y++)
{
- mem = (DWORD *) ((BYTE *) l.pBits + y * l.Pitch);
- for(x = 0; x < l.Pitch / sizeof(DWORD); x++)
+ mem = (BYTE *)l.pBits + y * l.Pitch;
+ for(x = 0; x < l.Pitch / byte_count; ++x)
{
- mem[x] = color;
+ if (byte_count == 4)
+ ((DWORD *)mem)[x] = color;
+ else
+ ((WORD *)mem)[x] = color;
}
}
hr = IDirect3DSurface9_UnlockRect(surface);
@@ -8964,7 +8987,8 @@ static void srgbtexture_test(void)
struct IDirect3DSurface9 *surface;
IDirect3DDevice9 *device;
IDirect3D9 *d3d;
- D3DCOLOR color;
+ D3DCOLOR colour;
+ unsigned int i;
ULONG refcount;
HWND window;
DWORD value;
@@ -8977,6 +9001,25 @@ static void srgbtexture_test(void)
1.0f, -1.0f, 0.0f, 1.0f, 1.0f,
1.0f, 1.0f, 0.0f, 1.0f, 0.0f,
};
+ static const struct
+ {
+ D3DFORMAT format;
+ const char *format_name;
+ DWORD fill_colour1, fill_colour2;
+ DWORD fill_colour_rb1, fill_colour_rb2;
+ DWORD conv_colour1, conv_colour2;
+ }
+ tests[] =
+ {
+ {D3DFMT_A8R8G8B8, "A8R8G8B8",
+ 0xff7f7f7f, 0xff3f3f3f, 0x007f7f7f, 0x003f3f3f, 0x00363636, 0x000d0d0d},
+ {D3DFMT_R5G6B5, "R5G6R5",
+ 0x7bef, 0x39e7, 0x007b7d7b, 0x003a3d3a, 0x00333433, 0x000a0c0a},
+ {D3DFMT_A1R5G5B5, "A1R5G5R5",
+ 0xbdef, 0x9ce7, 0x007b7b7b, 0x003a3a3a, 0x00333433, 0x000a0a0a},
+ {D3DFMT_X1R5G5B5, "X1R5G5R5",
+ 0x3def, 0x1ce7, 0x007b7b7b, 0x003a3a3a, 0x00333433, 0x000a0a0a},
+ };
window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
@@ -8987,179 +9030,195 @@ static void srgbtexture_test(void)
goto done;
}
- if (IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL,
- D3DFMT_X8R8G8B8, D3DUSAGE_QUERY_SRGBREAD, D3DRTYPE_TEXTURE, D3DFMT_A8R8G8B8) != D3D_OK)
+ for (i = 0; i < ARRAY_SIZE(tests); ++i)
{
- skip("D3DFMT_A8R8G8B8 textures with SRGBREAD not supported.\n");
- IDirect3DDevice9_Release(device);
- goto done;
- }
+ if (IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL,
+ D3DFMT_X8R8G8B8, D3DUSAGE_QUERY_SRGBREAD, D3DRTYPE_TEXTURE, tests[i].format) != D3D_OK)
+ {
+ skip("%s textures with SRGBREAD are not supported.\n", tests[i].format_name);
+ continue;
+ }
- hr = IDirect3DDevice9_CreateTexture(device, 16, 16, 2, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &texture, NULL);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DTexture9_GetSurfaceLevel(texture, 0, &surface);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- fill_surface(surface, 0xff7f7f7f, 0);
- IDirect3DSurface9_Release(surface);
- hr = IDirect3DTexture9_GetSurfaceLevel(texture, 1, &surface);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- fill_surface(surface, 0xff3f3f3f, 0);
- IDirect3DSurface9_Release(surface);
+ hr = IDirect3DDevice9_CreateTexture(device, 16, 16, 2, 0, tests[i].format, D3DPOOL_MANAGED, &texture, NULL);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DTexture9_GetSurfaceLevel(texture, 0, &surface);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ fill_surface(surface, tests[i].fill_colour1, 0);
+ IDirect3DSurface9_Release(surface);
+ hr = IDirect3DTexture9_GetSurfaceLevel(texture, 1, &surface);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ fill_surface(surface, tests[i].fill_colour2, 0);
+ IDirect3DSurface9_Release(surface);
- hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *)texture);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *)texture);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- /* AMD uses the LSB of the D3DSAMP_SRGBTEXTURE value.
- * NVIDIA ignores any values other than 0 and 1, leaving the previous
- * D3DSAMP_SRGBTEXTURE state.
- * Intel, WARP treat the value as boolean. */
- hr = IDirect3DDevice9_BeginScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 0x7e41882a);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- ok(value == 0x7e41882a, "Got unexpected value %#x.\n", value);
- hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_EndScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- color = getPixelColor(device, 320, 240);
- ok(color_match(color, 0x007f7f7f, 1) || broken(color_match(color, 0x00363636, 1)),
- "Got unexpected color 0x%08x.\n", color);
- hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ /* AMD uses the LSB of the D3DSAMP_SRGBTEXTURE value.
+ * NVIDIA ignores any values other than 0 and 1, leaving the previous
+ * D3DSAMP_SRGBTEXTURE state.
+ * Intel, WARP treat the value as boolean. */
+ hr = IDirect3DDevice9_BeginScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 0x7e41882a);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ ok(value == 0x7e41882a, "Got unexpected value %#x.\n", value);
+ hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_EndScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ colour = getPixelColor(device, 320, 240);
+ ok(color_match(colour, tests[i].fill_colour_rb1, 1)
+ || broken(color_match(colour, tests[i].conv_colour1, 1)),
+ "Format %s, got unexpected colour 0x%08x.\n", tests[i].format_name, colour);
+ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_BeginScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 100);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- ok(value == 100, "Got unexpected value %#x.\n", value);
- hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_EndScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- color = getPixelColor(device, 320, 240);
- ok(color_match(color, 0x007f7f7f, 1) || broken(color_match(color, 0x00363636, 1)),
- "Got unexpected color 0x%08x.\n", color);
- hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_BeginScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 100);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ ok(value == 100, "Got unexpected value %#x.\n", value);
+ hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_EndScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ colour = getPixelColor(device, 320, 240);
+ ok(color_match(colour, tests[i].fill_colour_rb1, 1)
+ || broken(color_match(colour, tests[i].conv_colour1, 1)),
+ "Format %s, got unexpected colour 0x%08x.\n", tests[i].format_name, colour);
+ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_BeginScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 2);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- ok(value == 2, "Got unexpected value %#x.\n", value);
- hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_EndScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- color = getPixelColor(device, 320, 240);
- ok(color_match(color, 0x007f7f7f, 1) || broken(color_match(color, 0x00363636, 1)),
- "Got unexpected color 0x%08x.\n", color);
- hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_BeginScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 2);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ ok(value == 2, "Got unexpected value %#x.\n", value);
+ hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_EndScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ colour = getPixelColor(device, 320, 240);
+ ok(color_match(colour, tests[i].fill_colour_rb1, 1)
+ || broken(color_match(colour, tests[i].conv_colour1, 1)),
+ "Format %s, got unexpected colour 0x%08x.\n", tests[i].format_name, colour);
+ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_BeginScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 3);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- ok(value == 3, "Got unexpected value %#x.\n", value);
- hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_EndScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- color = getPixelColor(device, 320, 240);
- ok(color_match(color, 0x007f7f7f, 1) || color_match(color, 0x00363636, 1),
- "Got unexpected color 0x%08x.\n", color);
- hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_BeginScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 3);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ ok(value == 3, "Got unexpected value %#x.\n", value);
+ hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_EndScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ colour = getPixelColor(device, 320, 240);
+ ok(color_match(colour, tests[i].fill_colour_rb1, 1)
+ || color_match(colour, tests[i].conv_colour1, 1),
+ "Format %s, got unexpected colour 0x%08x.\n", tests[i].format_name, colour);
+ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_BeginScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, TRUE);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- ok(value == TRUE, "Got unexpected value %#x.\n", value);
- hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_EndScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- color = getPixelColor(device, 320, 240);
- ok(color_match(color, 0x00363636, 1), "Got unexpected color 0x%08x.\n", color);
- hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_BeginScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, TRUE);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ ok(value == TRUE, "Got unexpected value %#x.\n", value);
+ hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_EndScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ colour = getPixelColor(device, 320, 240);
+ ok(color_match(colour, tests[i].conv_colour1, 1), "Format %s, got unexpected colour 0x%08x.\n",
+ tests[i].format_name, colour);
+ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_BeginScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- /* Set the other state to verify that the sampler just inherits old
- * D3DSAMP_SRGBTEXTURE but * the old sampler is not preserved entirely on
- * NVIDIA. */
- hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 0x7e41882a);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- ok(value == 0x7e41882a, "Got unexpected value %#x.\n", value);
- hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MIPFILTER, D3DTEXF_POINT);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 1);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_EndScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- color = getPixelColor(device, 320, 240);
- ok(color_match(color, 0x000d0d0d, 1) || color_match(color, 0x003f3f3f, 1),
- "Got unexpected color 0x%08x.\n", color);
- hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_BeginScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ /* Set the other state to verify that the sampler just inherits old
+ * D3DSAMP_SRGBTEXTURE but the old sampler is not preserved entirely on
+ * NVIDIA. */
+ hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 0x7e41882a);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ ok(value == 0x7e41882a, "Got unexpected value %#x.\n", value);
+ hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MIPFILTER, D3DTEXF_POINT);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 1);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_EndScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ colour = getPixelColor(device, 320, 240);
+ ok(color_match(colour, tests[i].conv_colour2, 1)
+ || color_match(colour, tests[i].fill_colour_rb2, 1),
+ "Format %s, got unexpected colour 0x%08x.\n", tests[i].format_name, colour);
+ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_BeginScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 0);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- ok(value == 0, "Got unexpected value %#x.\n", value);
- hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_EndScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- color = getPixelColor(device, 320, 240);
- ok(color_match(color, 0x003f3f3f, 1), "Got unexpected color 0x%08x.\n", color);
- hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_BeginScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 0);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ ok(value == 0, "Got unexpected value %#x.\n", value);
+ hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_EndScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ colour = getPixelColor(device, 320, 240);
+ ok(color_match(colour, tests[i].fill_colour_rb2, 1),
+ "Format %s, got unexpected colour 0x%08x.\n", tests[i].format_name, colour);
+ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+
+ hr = IDirect3DDevice9_BeginScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 0x7e41882a);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ ok(value == 0x7e41882a, "Got unexpected value %#x.\n", value);
+ hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_EndScene(device);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ colour = getPixelColor(device, 320, 240);
+ ok(color_match(colour, tests[i].fill_colour_rb2, 1)
+ || broken(color_match(colour, tests[i].conv_colour2, 1)),
+ "Format %s, got unexpected colour 0x%08x.\n", tests[i].format_name, colour);
+ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ IDirect3DTexture9_Release(texture);
+
+ hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 0);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 0);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ }
- hr = IDirect3DDevice9_BeginScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 0x7e41882a);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- ok(value == 0x7e41882a, "Got unexpected value %#x.\n", value);
- hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- hr = IDirect3DDevice9_EndScene(device);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- color = getPixelColor(device, 320, 240);
- ok(color_match(color, 0x003f3f3f, 1) || broken(color_match(color, 0x000d0d0d, 1)),
- "Got unexpected color 0x%08x.\n", color);
- hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- IDirect3DTexture9_Release(texture);
refcount = IDirect3DDevice9_Release(device);
ok(!refcount, "Device has %u references left.\n", refcount);
done:
--
2.24.1
4
19
Signed-off-by: Daniel Lehman <dlehman25(a)gmail.com>
---
dlls/msxml3/tests/domdoc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c
index 915d802517..b882f644bb 100644
--- a/dlls/msxml3/tests/domdoc.c
+++ b/dlls/msxml3/tests/domdoc.c
@@ -2221,7 +2221,7 @@ static void test_domnode( void )
ok(r == E_INVALIDARG, "get_nodeValue ret %08x\n", r );
r = IXMLDOMDocument_get_nodeValue( doc, &var );
- ok( r == S_FALSE, "nextNode returned wrong code\n");
+ ok( r == S_FALSE, "get_nodeValue returned wrong code\n");
ok( V_VT(&var) == VT_NULL, "variant wasn't empty\n");
ok( V_BSTR(&var) == NULL, "variant value wasn't null\n");
@@ -2391,7 +2391,7 @@ static void test_domnode( void )
{
type = NODE_INVALID;
r = IXMLDOMNode_get_nodeType( node, &type);
- ok( r == S_OK, "getNamedItem returned wrong code\n");
+ ok( r == S_OK, "get_nodeType returned wrong code\n");
ok( type == NODE_ATTRIBUTE, "node not an attribute\n");
str = NULL;
@@ -2424,7 +2424,7 @@ static void test_domnode( void )
type = NODE_INVALID;
r = IXMLDOMNode_get_nodeType( next, &type);
- ok( r == S_OK, "getNamedItem returned wrong code\n");
+ ok( r == S_OK, "get_nodeType returned wrong code\n");
ok( type == NODE_TEXT, "node not text\n");
str = (void *)0xdeadbeef;
@@ -2513,7 +2513,7 @@ static void test_domnode( void )
{
type = NODE_INVALID;
r = IXMLDOMNode_get_nodeType( node, &type);
- ok( r == S_OK, "getNamedItem returned wrong code\n");
+ ok( r == S_OK, "get_nodeType returned wrong code\n");
ok( type == NODE_ELEMENT, "node not text\n");
r = IXMLDOMNode_hasChildNodes( node, NULL );
--
2.17.1
2
1