2024-02-09 23:55:27 -08:00
|
|
|
From 29082a5f01e6e1fb631668d6f29b2615300e481e Mon Sep 17 00:00:00 2001
|
2024-02-06 19:12:01 -08:00
|
|
|
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
|
|
|
Date: Wed, 7 Feb 2024 13:39:16 +1100
|
2024-02-09 23:55:27 -08:00
|
|
|
Subject: [PATCH 3/5] Updated vkd3d to
|
|
|
|
06ddb10c4008adde7d81e1ece4fdce7a2b267870.
|
2024-02-06 19:12:01 -08:00
|
|
|
|
|
|
|
---
|
|
|
|
libs/vkd3d/include/private/vkd3d_common.h | 2 +-
|
|
|
|
libs/vkd3d/libs/vkd3d-shader/dxil.c | 181 ++++++-
|
|
|
|
libs/vkd3d/libs/vkd3d-shader/spirv.c | 21 +-
|
|
|
|
.../libs/vkd3d-shader/vkd3d_shader_private.h | 10 +
|
|
|
|
libs/vkd3d/libs/vkd3d/command.c | 16 +-
|
|
|
|
libs/vkd3d/libs/vkd3d/device.c | 444 ++++++++++--------
|
|
|
|
libs/vkd3d/libs/vkd3d/resource.c | 8 +-
|
|
|
|
libs/vkd3d/libs/vkd3d/state.c | 8 +-
|
|
|
|
libs/vkd3d/libs/vkd3d/utils.c | 5 +
|
|
|
|
libs/vkd3d/libs/vkd3d/vkd3d_main.c | 16 +-
|
|
|
|
libs/vkd3d/libs/vkd3d/vkd3d_private.h | 32 +-
|
|
|
|
11 files changed, 505 insertions(+), 238 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/libs/vkd3d/include/private/vkd3d_common.h b/libs/vkd3d/include/private/vkd3d_common.h
|
|
|
|
index 979676c4d5a..666bb80faf9 100644
|
|
|
|
--- a/libs/vkd3d/include/private/vkd3d_common.h
|
|
|
|
+++ b/libs/vkd3d/include/private/vkd3d_common.h
|
|
|
|
@@ -71,7 +71,7 @@
|
|
|
|
#define TAG_XNAP VKD3D_MAKE_TAG('X', 'N', 'A', 'P')
|
|
|
|
#define TAG_XNAS VKD3D_MAKE_TAG('X', 'N', 'A', 'S')
|
|
|
|
|
|
|
|
-static inline size_t align(size_t addr, size_t alignment)
|
|
|
|
+static inline uint64_t align(uint64_t addr, size_t alignment)
|
|
|
|
{
|
|
|
|
return (addr + (alignment - 1)) & ~(alignment - 1);
|
|
|
|
}
|
|
|
|
diff --git a/libs/vkd3d/libs/vkd3d-shader/dxil.c b/libs/vkd3d/libs/vkd3d-shader/dxil.c
|
|
|
|
index 0358dbb6e06..ba951a6e51b 100644
|
|
|
|
--- a/libs/vkd3d/libs/vkd3d-shader/dxil.c
|
|
|
|
+++ b/libs/vkd3d/libs/vkd3d-shader/dxil.c
|
|
|
|
@@ -33,6 +33,7 @@ static const uint64_t ALLOCA_FLAG_IN_ALLOCA = 0x20;
|
|
|
|
static const uint64_t ALLOCA_FLAG_EXPLICIT_TYPE = 0x40;
|
|
|
|
static const uint64_t ALLOCA_ALIGNMENT_MASK = ALLOCA_FLAG_IN_ALLOCA - 1;
|
|
|
|
static const unsigned int SHADER_DESCRIPTOR_TYPE_COUNT = 4;
|
|
|
|
+static const size_t MAX_IR_INSTRUCTIONS_PER_DXIL_INSTRUCTION = 5;
|
|
|
|
|
|
|
|
static const unsigned int dx_max_thread_group_size[3] = {1024, 1024, 64};
|
|
|
|
|
|
|
|
@@ -362,11 +363,13 @@ enum dx_intrinsic_opcode
|
|
|
|
DX_UBFE = 52,
|
|
|
|
DX_CREATE_HANDLE = 57,
|
|
|
|
DX_CBUFFER_LOAD_LEGACY = 59,
|
|
|
|
+ DX_TEXTURE_LOAD = 66,
|
|
|
|
DX_BUFFER_LOAD = 68,
|
|
|
|
DX_DERIV_COARSEX = 83,
|
|
|
|
DX_DERIV_COARSEY = 84,
|
|
|
|
DX_DERIV_FINEX = 85,
|
|
|
|
DX_DERIV_FINEY = 86,
|
|
|
|
+ DX_SPLIT_DOUBLE = 102,
|
|
|
|
DX_LEGACY_F32TOF16 = 130,
|
|
|
|
DX_LEGACY_F16TOF32 = 131,
|
|
|
|
DX_RAW_BUFFER_LOAD = 139,
|
|
|
|
@@ -1732,6 +1735,11 @@ static bool sm6_type_is_f16_f32(const struct sm6_type *type)
|
|
|
|
return type->class == TYPE_CLASS_FLOAT && (type->u.width == 16 || type->u.width == 32);
|
|
|
|
}
|
|
|
|
|
|
|
|
+static bool sm6_type_is_double(const struct sm6_type *type)
|
|
|
|
+{
|
|
|
|
+ return type->class == TYPE_CLASS_FLOAT && type->u.width == 64;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
static inline bool sm6_type_is_floating_point(const struct sm6_type *type)
|
|
|
|
{
|
|
|
|
return type->class == TYPE_CLASS_FLOAT;
|
|
|
|
@@ -2371,6 +2379,26 @@ static bool sm6_value_validate_is_handle(const struct sm6_value *value, struct s
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
+static bool sm6_value_validate_is_texture_handle(const struct sm6_value *value, enum dx_intrinsic_opcode op,
|
|
|
|
+ struct sm6_parser *sm6)
|
|
|
|
+{
|
|
|
|
+ enum dxil_resource_kind kind;
|
|
|
|
+
|
|
|
|
+ if (!sm6_value_validate_is_handle(value, sm6))
|
|
|
|
+ return false;
|
|
|
|
+
|
|
|
|
+ kind = value->u.handle.d->kind;
|
|
|
|
+ if (kind < RESOURCE_KIND_TEXTURE1D || kind > RESOURCE_KIND_TEXTURECUBEARRAY)
|
|
|
|
+ {
|
|
|
|
+ WARN("Resource kind %u for op %u is not a texture.\n", kind, op);
|
|
|
|
+ vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_INVALID_RESOURCE_HANDLE,
|
|
|
|
+ "Resource kind %u for texture operation %u is not a texture.", kind, op);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return true;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
static bool sm6_value_validate_is_pointer(const struct sm6_value *value, struct sm6_parser *sm6)
|
|
|
|
{
|
|
|
|
if (!sm6_type_is_pointer(value->type))
|
|
|
|
@@ -3199,6 +3227,7 @@ struct function_emission_state
|
|
|
|
{
|
|
|
|
struct sm6_block *code_block;
|
|
|
|
struct vkd3d_shader_instruction *ins;
|
|
|
|
+ unsigned int temp_idx;
|
|
|
|
};
|
|
|
|
|
|
|
|
static void sm6_parser_emit_alloca(struct sm6_parser *sm6, const struct dxil_record *record,
|
|
|
|
@@ -3518,6 +3547,72 @@ static void sm6_parser_emit_br(struct sm6_parser *sm6, const struct dxil_record
|
|
|
|
ins->handler_idx = VKD3DSIH_NOP;
|
|
|
|
}
|
|
|
|
|
|
|
|
+static bool sm6_parser_emit_coordinate_construct(struct sm6_parser *sm6, const struct sm6_value **operands,
|
|
|
|
+ const struct sm6_value *z_operand, struct function_emission_state *state,
|
|
|
|
+ struct vkd3d_shader_register *reg)
|
|
|
|
+{
|
|
|
|
+ const struct vkd3d_shader_register *operand_regs[VKD3D_VEC4_SIZE];
|
|
|
|
+ struct vkd3d_shader_instruction *ins = state->ins;
|
|
|
|
+ struct vkd3d_shader_src_param *src_params;
|
|
|
|
+ struct vkd3d_shader_dst_param *dst_param;
|
|
|
|
+ const unsigned int max_operands = 3;
|
|
|
|
+ unsigned int i, component_count;
|
|
|
|
+ bool all_constant = true;
|
|
|
|
+
|
|
|
|
+ for (component_count = 0; component_count < max_operands; ++component_count)
|
|
|
|
+ {
|
|
|
|
+ if (!z_operand && operands[component_count]->is_undefined)
|
|
|
|
+ break;
|
|
|
|
+ operand_regs[component_count] = &operands[component_count]->u.reg;
|
|
|
|
+ all_constant &= register_is_constant_or_undef(operand_regs[component_count]);
|
|
|
|
+ }
|
|
|
|
+ if (z_operand)
|
|
|
|
+ {
|
|
|
|
+ all_constant &= register_is_constant(&z_operand->u.reg);
|
|
|
|
+ operand_regs[component_count++] = &z_operand->u.reg;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (component_count == 1)
|
|
|
|
+ {
|
|
|
|
+ *reg = operands[0]->u.reg;
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (all_constant)
|
|
|
|
+ {
|
|
|
|
+ vsir_register_init(reg, VKD3DSPR_IMMCONST, operand_regs[0]->data_type, 0);
|
|
|
|
+ reg->dimension = VSIR_DIMENSION_VEC4;
|
|
|
|
+ for (i = 0; i < component_count; ++i)
|
|
|
|
+ reg->u.immconst_u32[i] = operand_regs[i]->u.immconst_u32[0];
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ register_init_with_id(reg, VKD3DSPR_TEMP, operands[0]->u.reg.data_type, state->temp_idx++);
|
|
|
|
+ reg->dimension = VSIR_DIMENSION_VEC4;
|
|
|
|
+
|
|
|
|
+ for (i = 0; i < component_count; ++i, ++ins)
|
|
|
|
+ {
|
|
|
|
+ vsir_instruction_init(ins, &sm6->p.location, VKD3DSIH_MOV);
|
|
|
|
+
|
|
|
|
+ if (!(src_params = instruction_src_params_alloc(ins, 1, sm6)))
|
|
|
|
+ return false;
|
|
|
|
+
|
|
|
|
+ src_param_init(&src_params[0]);
|
|
|
|
+ src_params[0].reg = *operand_regs[i];
|
|
|
|
+
|
|
|
|
+ if (!(dst_param = instruction_dst_params_alloc(ins, 1, sm6)))
|
|
|
|
+ return false;
|
|
|
|
+
|
|
|
|
+ dst_param_init_scalar(dst_param, i);
|
|
|
|
+ dst_param->reg = *reg;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ state->ins = ins;
|
|
|
|
+ state->code_block->instruction_count += component_count;
|
|
|
|
+
|
|
|
|
+ return true;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
static enum vkd3d_shader_opcode map_dx_unary_op(enum dx_intrinsic_opcode op)
|
|
|
|
{
|
|
|
|
switch (op)
|
|
|
|
@@ -3858,6 +3953,19 @@ static void sm6_parser_emit_dx_buffer_load(struct sm6_parser *sm6, enum dx_intri
|
|
|
|
instruction_dst_param_init_ssa_vector(ins, VKD3D_VEC4_SIZE, sm6);
|
|
|
|
}
|
|
|
|
|
|
|
|
+static unsigned int sm6_value_get_texel_offset(const struct sm6_value *value)
|
|
|
|
+{
|
|
|
|
+ return sm6_value_is_undef(value) ? 0 : sm6_value_get_constant_uint(value);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static void instruction_set_texel_offset(struct vkd3d_shader_instruction *ins,
|
|
|
|
+ const struct sm6_value **operands, struct sm6_parser *sm6)
|
|
|
|
+{
|
|
|
|
+ ins->texel_offset.u = sm6_value_get_texel_offset(operands[0]);
|
|
|
|
+ ins->texel_offset.v = sm6_value_get_texel_offset(operands[1]);
|
|
|
|
+ ins->texel_offset.w = sm6_value_get_texel_offset(operands[2]);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
static void sm6_parser_emit_dx_sincos(struct sm6_parser *sm6, enum dx_intrinsic_opcode op,
|
|
|
|
const struct sm6_value **operands, struct function_emission_state *state)
|
|
|
|
{
|
|
|
|
@@ -3880,6 +3988,19 @@ static void sm6_parser_emit_dx_sincos(struct sm6_parser *sm6, enum dx_intrinsic_
|
|
|
|
dst->u.reg = dst_params[index].reg;
|
|
|
|
}
|
|
|
|
|
|
|
|
+static void sm6_parser_emit_dx_split_double(struct sm6_parser *sm6, enum dx_intrinsic_opcode op,
|
|
|
|
+ const struct sm6_value **operands, struct function_emission_state *state)
|
|
|
|
+{
|
|
|
|
+ struct vkd3d_shader_instruction *ins = state->ins;
|
|
|
|
+ struct vkd3d_shader_src_param *src_param;
|
|
|
|
+
|
|
|
|
+ vsir_instruction_init(ins, &sm6->p.location, VKD3DSIH_MOV);
|
|
|
|
+ src_param = instruction_src_params_alloc(ins, 1, sm6);
|
|
|
|
+ src_param_init_from_value(src_param, operands[0]);
|
|
|
|
+
|
|
|
|
+ instruction_dst_param_init_ssa_vector(ins, 2, sm6);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
static void sm6_parser_emit_dx_store_output(struct sm6_parser *sm6, enum dx_intrinsic_opcode op,
|
|
|
|
const struct sm6_value **operands, struct function_emission_state *state)
|
|
|
|
{
|
|
|
|
@@ -3934,6 +4055,50 @@ static void sm6_parser_emit_dx_store_output(struct sm6_parser *sm6, enum dx_intr
|
|
|
|
src_param_init_from_value(src_param, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
+static void sm6_parser_emit_dx_texture_load(struct sm6_parser *sm6, enum dx_intrinsic_opcode op,
|
|
|
|
+ const struct sm6_value **operands, struct function_emission_state *state)
|
|
|
|
+{
|
|
|
|
+ const struct sm6_value *resource, *mip_level_or_sample_count;
|
|
|
|
+ enum vkd3d_shader_resource_type resource_type;
|
|
|
|
+ struct vkd3d_shader_src_param *src_params;
|
|
|
|
+ struct vkd3d_shader_instruction *ins;
|
|
|
|
+ struct vkd3d_shader_register coord;
|
|
|
|
+ bool is_multisample, is_uav;
|
|
|
|
+ unsigned int i;
|
|
|
|
+
|
|
|
|
+ resource = operands[0];
|
|
|
|
+ if (!sm6_value_validate_is_texture_handle(resource, op, sm6))
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ resource_type = resource->u.handle.d->resource_type;
|
|
|
|
+ is_multisample = resource_type == VKD3D_SHADER_RESOURCE_TEXTURE_2DMS
|
|
|
|
+ || resource_type == VKD3D_SHADER_RESOURCE_TEXTURE_2DMSARRAY;
|
|
|
|
+ is_uav = resource->u.handle.d->type == VKD3D_SHADER_DESCRIPTOR_TYPE_UAV;
|
|
|
|
+
|
|
|
|
+ mip_level_or_sample_count = (resource_type != VKD3D_SHADER_RESOURCE_BUFFER) ? operands[1] : NULL;
|
|
|
|
+ if (!sm6_parser_emit_coordinate_construct(sm6, &operands[2],
|
|
|
|
+ is_multisample ? NULL : mip_level_or_sample_count, state, &coord))
|
|
|
|
+ {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ins = state->ins;
|
|
|
|
+ instruction_init_with_resource(ins, is_uav ? VKD3DSIH_LD_UAV_TYPED
|
|
|
|
+ : is_multisample ? VKD3DSIH_LD2DMS : VKD3DSIH_LD, resource, sm6);
|
|
|
|
+ instruction_set_texel_offset(ins, &operands[5], sm6);
|
|
|
|
+
|
|
|
|
+ for (i = 0; i < VKD3D_VEC4_SIZE; ++i)
|
|
|
|
+ ins->resource_data_type[i] = resource->u.handle.d->resource_data_type;
|
|
|
|
+
|
|
|
|
+ src_params = instruction_src_params_alloc(ins, 2 + is_multisample, sm6);
|
|
|
|
+ src_param_init_vector_from_reg(&src_params[0], &coord);
|
|
|
|
+ src_param_init_vector_from_reg(&src_params[1], &resource->u.handle.reg);
|
|
|
|
+ if (is_multisample)
|
|
|
|
+ src_param_init_from_value(&src_params[2], mip_level_or_sample_count);
|
|
|
|
+
|
|
|
|
+ instruction_dst_param_init_ssa_vector(ins, VKD3D_VEC4_SIZE, sm6);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
struct sm6_dx_opcode_info
|
|
|
|
{
|
|
|
|
const char *ret_type;
|
|
|
|
@@ -3947,12 +4112,15 @@ struct sm6_dx_opcode_info
|
|
|
|
8 -> int8
|
|
|
|
b -> constant int1
|
|
|
|
c -> constant int8/16/32
|
|
|
|
+ C -> constant or undefined int8/16/32
|
|
|
|
i -> int32
|
|
|
|
m -> int16/32/64
|
|
|
|
f -> float
|
|
|
|
+ d -> double
|
|
|
|
e -> half/float
|
|
|
|
g -> half/float/double
|
|
|
|
H -> handle
|
|
|
|
+ S -> splitdouble
|
|
|
|
v -> void
|
|
|
|
o -> overloaded
|
|
|
|
R -> matches the return type
|
|
|
|
@@ -3993,9 +4161,11 @@ static const struct sm6_dx_opcode_info sm6_dx_op_table[] =
|
|
|
|
[DX_ROUND_Z ] = {"g", "R", sm6_parser_emit_dx_unary},
|
|
|
|
[DX_RSQRT ] = {"g", "R", sm6_parser_emit_dx_unary},
|
|
|
|
[DX_SIN ] = {"g", "R", sm6_parser_emit_dx_sincos},
|
|
|
|
+ [DX_SPLIT_DOUBLE ] = {"S", "d", sm6_parser_emit_dx_split_double},
|
|
|
|
[DX_SQRT ] = {"g", "R", sm6_parser_emit_dx_unary},
|
|
|
|
[DX_STORE_OUTPUT ] = {"v", "ii8o", sm6_parser_emit_dx_store_output},
|
|
|
|
[DX_TAN ] = {"g", "R", sm6_parser_emit_dx_unary},
|
|
|
|
+ [DX_TEXTURE_LOAD ] = {"o", "HiiiiCCC", sm6_parser_emit_dx_texture_load},
|
|
|
|
[DX_UBFE ] = {"m", "iiR", sm6_parser_emit_dx_tertiary},
|
|
|
|
[DX_UMAX ] = {"m", "RR", sm6_parser_emit_dx_binary},
|
|
|
|
[DX_UMIN ] = {"m", "RR", sm6_parser_emit_dx_binary},
|
|
|
|
@@ -4023,18 +4193,25 @@ static bool sm6_parser_validate_operand_type(struct sm6_parser *sm6, const struc
|
|
|
|
case 'c':
|
|
|
|
return sm6_value_is_constant(value) && sm6_type_is_integer(type) && type->u.width >= 8
|
|
|
|
&& type->u.width <= 32;
|
|
|
|
+ case 'C':
|
|
|
|
+ return (sm6_value_is_constant(value) || sm6_value_is_undef(value))
|
|
|
|
+ && sm6_type_is_integer(type) && type->u.width >= 8 && type->u.width <= 32;
|
|
|
|
case 'i':
|
|
|
|
return sm6_type_is_i32(type);
|
|
|
|
case 'm':
|
|
|
|
return sm6_type_is_i16_i32_i64(type);
|
|
|
|
case 'f':
|
|
|
|
return sm6_type_is_float(type);
|
|
|
|
+ case 'd':
|
|
|
|
+ return sm6_type_is_double(type);
|
|
|
|
case 'e':
|
|
|
|
return sm6_type_is_f16_f32(type);
|
|
|
|
case 'g':
|
|
|
|
return sm6_type_is_floating_point(type);
|
|
|
|
case 'H':
|
|
|
|
return (is_return || sm6_value_is_handle(value)) && type == sm6->handle_type;
|
|
|
|
+ case 'S':
|
|
|
|
+ return sm6_type_is_struct(type) && !strcmp(type->u.struc->name, "dx.types.splitdouble");
|
|
|
|
case 'v':
|
|
|
|
return !type;
|
|
|
|
case 'o':
|
|
|
|
@@ -5380,7 +5557,8 @@ static enum vkd3d_result sm6_parser_function_init(struct sm6_parser *sm6, const
|
|
|
|
|
|
|
|
/* Some instructions can emit >1 IR instruction, so extra may be used. */
|
|
|
|
if (!vkd3d_array_reserve((void **)&code_block->instructions, &code_block->instruction_capacity,
|
|
|
|
- code_block->instruction_count + 1, sizeof(*code_block->instructions)))
|
|
|
|
+ code_block->instruction_count + MAX_IR_INSTRUCTIONS_PER_DXIL_INSTRUCTION,
|
|
|
|
+ sizeof(*code_block->instructions)))
|
|
|
|
{
|
|
|
|
ERR("Failed to allocate instructions.\n");
|
|
|
|
return VKD3D_ERROR_OUT_OF_MEMORY;
|
|
|
|
@@ -5411,6 +5589,7 @@ static enum vkd3d_result sm6_parser_function_init(struct sm6_parser *sm6, const
|
|
|
|
{
|
|
|
|
struct function_emission_state state = {code_block, ins};
|
|
|
|
sm6_parser_emit_call(sm6, record, &state, dst);
|
|
|
|
+ sm6->p.program.temp_count = max(sm6->p.program.temp_count, state.temp_idx);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case FUNC_CODE_INST_CAST:
|
|
|
|
diff --git a/libs/vkd3d/libs/vkd3d-shader/spirv.c b/libs/vkd3d/libs/vkd3d-shader/spirv.c
|
|
|
|
index aedbfc24a93..9b6ce742976 100644
|
|
|
|
--- a/libs/vkd3d/libs/vkd3d-shader/spirv.c
|
|
|
|
+++ b/libs/vkd3d/libs/vkd3d-shader/spirv.c
|
|
|
|
@@ -223,16 +223,6 @@ enum vkd3d_shader_input_sysval_semantic vkd3d_siv_from_sysval_indexed(enum vkd3d
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
-static inline bool register_is_undef(const struct vkd3d_shader_register *reg)
|
|
|
|
-{
|
|
|
|
- return reg->type == VKD3DSPR_UNDEF;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static inline bool register_is_constant_or_undef(const struct vkd3d_shader_register *reg)
|
|
|
|
-{
|
|
|
|
- return register_is_constant(reg) || register_is_undef(reg);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
#define VKD3D_SPIRV_VERSION 0x00010000
|
|
|
|
#define VKD3D_SPIRV_GENERATOR_ID 18
|
|
|
|
#define VKD3D_SPIRV_GENERATOR_VERSION 10
|
|
|
|
@@ -3894,9 +3884,10 @@ static uint32_t spirv_compiler_emit_load_ssa_reg(struct spirv_compiler *compiler
|
|
|
|
}
|
|
|
|
assert(vkd3d_swizzle_is_scalar(swizzle, reg));
|
|
|
|
|
|
|
|
+ reg_component_type = vkd3d_component_type_from_data_type(ssa->data_type);
|
|
|
|
+
|
|
|
|
if (reg->dimension == VSIR_DIMENSION_SCALAR)
|
|
|
|
{
|
|
|
|
- reg_component_type = vkd3d_component_type_from_data_type(ssa->data_type);
|
|
|
|
if (component_type != reg_component_type)
|
|
|
|
{
|
|
|
|
type_id = vkd3d_spirv_get_type_id(builder, component_type, 1);
|
|
|
|
@@ -3906,6 +3897,14 @@ static uint32_t spirv_compiler_emit_load_ssa_reg(struct spirv_compiler *compiler
|
|
|
|
return val_id;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ if (component_type != reg_component_type)
|
|
|
|
+ {
|
|
|
|
+ /* Required for resource loads with sampled type int, because DXIL has no signedness.
|
|
|
|
+ * Only 128-bit vector sizes are used. */
|
|
|
|
+ type_id = vkd3d_spirv_get_type_id(builder, component_type, VKD3D_VEC4_SIZE);
|
|
|
|
+ val_id = vkd3d_spirv_build_op_bitcast(builder, type_id, val_id);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
type_id = vkd3d_spirv_get_type_id(builder, component_type, 1);
|
|
|
|
component_idx = vsir_swizzle_get_component(swizzle, 0);
|
|
|
|
return vkd3d_spirv_build_op_composite_extract1(builder, type_id, val_id, component_idx);
|
|
|
|
diff --git a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
|
|
|
index 0ba7e71922a..a709121f1a1 100644
|
|
|
|
--- a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
|
|
|
+++ b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
|
|
|
@@ -1194,6 +1194,16 @@ static inline bool register_is_constant(const struct vkd3d_shader_register *reg)
|
|
|
|
return (reg->type == VKD3DSPR_IMMCONST || reg->type == VKD3DSPR_IMMCONST64);
|
|
|
|
}
|
|
|
|
|
|
|
|
+static inline bool register_is_undef(const struct vkd3d_shader_register *reg)
|
|
|
|
+{
|
|
|
|
+ return reg->type == VKD3DSPR_UNDEF;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline bool register_is_constant_or_undef(const struct vkd3d_shader_register *reg)
|
|
|
|
+{
|
|
|
|
+ return register_is_constant(reg) || register_is_undef(reg);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
static inline bool register_is_scalar_constant_zero(const struct vkd3d_shader_register *reg)
|
|
|
|
{
|
|
|
|
return register_is_constant(reg) && reg->dimension == VSIR_DIMENSION_SCALAR
|
|
|
|
diff --git a/libs/vkd3d/libs/vkd3d/command.c b/libs/vkd3d/libs/vkd3d/command.c
|
|
|
|
index 3cf58e06d40..f9940b3d383 100644
|
|
|
|
--- a/libs/vkd3d/libs/vkd3d/command.c
|
|
|
|
+++ b/libs/vkd3d/libs/vkd3d/command.c
|
|
|
|
@@ -5132,8 +5132,8 @@ static void STDMETHODCALLTYPE d3d12_command_list_ClearDepthStencilView(ID3D12Gra
|
|
|
|
struct VkAttachmentDescription attachment_desc;
|
|
|
|
struct VkAttachmentReference ds_reference;
|
|
|
|
|
|
|
|
- TRACE("iface %p, dsv %#lx, flags %#x, depth %.8e, stencil 0x%02x, rect_count %u, rects %p.\n",
|
|
|
|
- iface, dsv.ptr, flags, depth, stencil, rect_count, rects);
|
|
|
|
+ TRACE("iface %p, dsv %s, flags %#x, depth %.8e, stencil 0x%02x, rect_count %u, rects %p.\n",
|
|
|
|
+ iface, debug_cpu_handle(dsv), flags, depth, stencil, rect_count, rects);
|
|
|
|
|
|
|
|
d3d12_command_list_track_resource_usage(list, dsv_desc->resource);
|
|
|
|
|
|
|
|
@@ -5180,8 +5180,8 @@ static void STDMETHODCALLTYPE d3d12_command_list_ClearRenderTargetView(ID3D12Gra
|
|
|
|
struct VkAttachmentReference color_reference;
|
|
|
|
VkClearValue clear_value;
|
|
|
|
|
|
|
|
- TRACE("iface %p, rtv %#lx, color %p, rect_count %u, rects %p.\n",
|
|
|
|
- iface, rtv.ptr, color, rect_count, rects);
|
|
|
|
+ TRACE("iface %p, rtv %s, color %p, rect_count %u, rects %p.\n",
|
|
|
|
+ iface, debug_cpu_handle(rtv), color, rect_count, rects);
|
|
|
|
|
|
|
|
d3d12_command_list_track_resource_usage(list, rtv_desc->resource);
|
|
|
|
|
|
|
|
@@ -5432,8 +5432,8 @@ static void STDMETHODCALLTYPE d3d12_command_list_ClearUnorderedAccessViewUint(ID
|
|
|
|
struct d3d12_resource *resource_impl;
|
|
|
|
VkClearColorValue colour;
|
|
|
|
|
|
|
|
- TRACE("iface %p, gpu_handle %#"PRIx64", cpu_handle %lx, resource %p, values %p, rect_count %u, rects %p.\n",
|
|
|
|
- iface, gpu_handle.ptr, cpu_handle.ptr, resource, values, rect_count, rects);
|
|
|
|
+ TRACE("iface %p, gpu_handle %#"PRIx64", cpu_handle %s, resource %p, values %p, rect_count %u, rects %p.\n",
|
|
|
|
+ iface, gpu_handle.ptr, debug_cpu_handle(cpu_handle), resource, values, rect_count, rects);
|
|
|
|
|
|
|
|
resource_impl = unsafe_impl_from_ID3D12Resource(resource);
|
|
|
|
if (!(descriptor = d3d12_desc_from_cpu_handle(cpu_handle)->s.u.view))
|
|
|
|
@@ -5496,8 +5496,8 @@ static void STDMETHODCALLTYPE d3d12_command_list_ClearUnorderedAccessViewFloat(I
|
|
|
|
VkClearColorValue colour;
|
|
|
|
struct vkd3d_view *view;
|
|
|
|
|
|
|
|
- TRACE("iface %p, gpu_handle %#"PRIx64", cpu_handle %lx, resource %p, values %p, rect_count %u, rects %p.\n",
|
|
|
|
- iface, gpu_handle.ptr, cpu_handle.ptr, resource, values, rect_count, rects);
|
|
|
|
+ TRACE("iface %p, gpu_handle %#"PRIx64", cpu_handle %s, resource %p, values %p, rect_count %u, rects %p.\n",
|
|
|
|
+ iface, gpu_handle.ptr, debug_cpu_handle(cpu_handle), resource, values, rect_count, rects);
|
|
|
|
|
|
|
|
resource_impl = unsafe_impl_from_ID3D12Resource(resource);
|
|
|
|
if (!(view = d3d12_desc_from_cpu_handle(cpu_handle)->s.u.view))
|
|
|
|
diff --git a/libs/vkd3d/libs/vkd3d/device.c b/libs/vkd3d/libs/vkd3d/device.c
|
|
|
|
index e45072b9367..cf8b506fdf5 100644
|
|
|
|
--- a/libs/vkd3d/libs/vkd3d/device.c
|
|
|
|
+++ b/libs/vkd3d/libs/vkd3d/device.c
|
|
|
|
@@ -1969,7 +1969,7 @@ static HRESULT vkd3d_select_queues(const struct vkd3d_instance *vkd3d_instance,
|
|
|
|
* which applies to resources of a total size of 4 MiB or less. */
|
|
|
|
static bool d3d12_is_64k_msaa_supported(struct d3d12_device *device)
|
|
|
|
{
|
|
|
|
- D3D12_RESOURCE_ALLOCATION_INFO info;
|
|
|
|
+ struct vkd3d_resource_allocation_info info;
|
|
|
|
D3D12_RESOURCE_DESC resource_desc;
|
|
|
|
|
|
|
|
memset(&resource_desc, 0, sizeof(resource_desc));
|
|
|
|
@@ -1986,7 +1986,7 @@ static bool d3d12_is_64k_msaa_supported(struct d3d12_device *device)
|
|
|
|
* resources, which must have 0x10000 in their description, so we might
|
|
|
|
* reasonably return true here for 0x20000 or 0x40000. */
|
|
|
|
return SUCCEEDED(vkd3d_get_image_allocation_info(device, &resource_desc, &info))
|
|
|
|
- && info.Alignment <= 0x10000;
|
|
|
|
+ && info.alignment <= 0x10000;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT vkd3d_create_vk_device(struct d3d12_device *device,
|
|
|
|
@@ -2133,7 +2133,7 @@ static void d3d12_device_destroy_pipeline_cache(struct d3d12_device *device)
|
|
|
|
#define VKD3D_VA_SLAB_COUNT (64 * 1024)
|
|
|
|
|
|
|
|
static D3D12_GPU_VIRTUAL_ADDRESS vkd3d_gpu_va_allocator_allocate_slab(struct vkd3d_gpu_va_allocator *allocator,
|
|
|
|
- size_t aligned_size, void *ptr)
|
|
|
|
+ uint64_t aligned_size, void *ptr)
|
|
|
|
{
|
|
|
|
struct vkd3d_gpu_va_slab *slab;
|
|
|
|
D3D12_GPU_VIRTUAL_ADDRESS address;
|
|
|
|
@@ -2149,13 +2149,13 @@ static D3D12_GPU_VIRTUAL_ADDRESS vkd3d_gpu_va_allocator_allocate_slab(struct vkd
|
|
|
|
slab_idx = slab - allocator->slabs;
|
|
|
|
address = VKD3D_VA_SLAB_BASE + slab_idx * VKD3D_VA_SLAB_SIZE;
|
|
|
|
|
|
|
|
- TRACE("Allocated address %#"PRIx64", slab %u, size %zu.\n", address, slab_idx, aligned_size);
|
|
|
|
+ TRACE("Allocated address %#"PRIx64", slab %u, size %"PRIu64".\n", address, slab_idx, aligned_size);
|
|
|
|
|
|
|
|
return address;
|
|
|
|
}
|
|
|
|
|
|
|
|
static D3D12_GPU_VIRTUAL_ADDRESS vkd3d_gpu_va_allocator_allocate_fallback(struct vkd3d_gpu_va_allocator *allocator,
|
|
|
|
- size_t alignment, size_t aligned_size, void *ptr)
|
|
|
|
+ size_t alignment, uint64_t aligned_size, void *ptr)
|
|
|
|
{
|
|
|
|
struct vkd3d_gpu_va_allocation *allocation;
|
|
|
|
D3D12_GPU_VIRTUAL_ADDRESS base, ceiling;
|
|
|
|
@@ -2181,17 +2181,17 @@ static D3D12_GPU_VIRTUAL_ADDRESS vkd3d_gpu_va_allocator_allocate_fallback(struct
|
|
|
|
* only fail once we have exhausted 63 bits of address space. */
|
|
|
|
allocator->fallback_floor = base + aligned_size;
|
|
|
|
|
|
|
|
- TRACE("Allocated address %#"PRIx64", size %zu.\n", base, aligned_size);
|
|
|
|
+ TRACE("Allocated address %#"PRIx64", size %"PRIu64".\n", base, aligned_size);
|
|
|
|
|
|
|
|
return base;
|
|
|
|
}
|
|
|
|
|
|
|
|
D3D12_GPU_VIRTUAL_ADDRESS vkd3d_gpu_va_allocator_allocate(struct vkd3d_gpu_va_allocator *allocator,
|
|
|
|
- size_t alignment, size_t size, void *ptr)
|
|
|
|
+ size_t alignment, uint64_t size, void *ptr)
|
|
|
|
{
|
|
|
|
D3D12_GPU_VIRTUAL_ADDRESS address;
|
|
|
|
|
|
|
|
- if (size > ~(size_t)0 - (alignment - 1))
|
|
|
|
+ if (size > ~(uint64_t)0 - (alignment - 1))
|
|
|
|
return 0;
|
|
|
|
size = align(size, alignment);
|
|
|
|
|
|
|
|
@@ -2227,7 +2227,7 @@ static void *vkd3d_gpu_va_allocator_dereference_slab(struct vkd3d_gpu_va_allocat
|
|
|
|
base_offset -= slab_idx * VKD3D_VA_SLAB_SIZE;
|
|
|
|
if (base_offset >= slab->size)
|
|
|
|
{
|
|
|
|
- ERR("Address %#"PRIx64" is %#"PRIx64" bytes into slab %u of size %zu.\n",
|
|
|
|
+ ERR("Address %#"PRIx64" is %#"PRIx64" bytes into slab %u of size %"PRIu64".\n",
|
|
|
|
address, base_offset, slab_idx, slab->size);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
@@ -2498,17 +2498,19 @@ static void vkd3d_desc_object_cache_cleanup(struct vkd3d_desc_object_cache *cach
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ID3D12Device */
|
|
|
|
-static inline struct d3d12_device *impl_from_ID3D12Device5(ID3D12Device5 *iface)
|
|
|
|
+static inline struct d3d12_device *impl_from_ID3D12Device7(ID3D12Device7 *iface)
|
|
|
|
{
|
|
|
|
- return CONTAINING_RECORD(iface, struct d3d12_device, ID3D12Device5_iface);
|
|
|
|
+ return CONTAINING_RECORD(iface, struct d3d12_device, ID3D12Device7_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_QueryInterface(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_QueryInterface(ID3D12Device7 *iface,
|
|
|
|
REFIID riid, void **object)
|
|
|
|
{
|
|
|
|
TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
|
|
|
|
|
|
|
|
- if (IsEqualGUID(riid, &IID_ID3D12Device5)
|
|
|
|
+ if (IsEqualGUID(riid, &IID_ID3D12Device7)
|
|
|
|
+ || IsEqualGUID(riid, &IID_ID3D12Device6)
|
|
|
|
+ || IsEqualGUID(riid, &IID_ID3D12Device5)
|
|
|
|
|| IsEqualGUID(riid, &IID_ID3D12Device4)
|
|
|
|
|| IsEqualGUID(riid, &IID_ID3D12Device3)
|
|
|
|
|| IsEqualGUID(riid, &IID_ID3D12Device2)
|
|
|
|
@@ -2528,9 +2530,9 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_QueryInterface(ID3D12Device5 *ifac
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static ULONG STDMETHODCALLTYPE d3d12_device_AddRef(ID3D12Device5 *iface)
|
|
|
|
+static ULONG STDMETHODCALLTYPE d3d12_device_AddRef(ID3D12Device7 *iface)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
unsigned int refcount = vkd3d_atomic_increment_u32(&device->refcount);
|
|
|
|
|
|
|
|
TRACE("%p increasing refcount to %u.\n", device, refcount);
|
|
|
|
@@ -2560,9 +2562,9 @@ static HRESULT device_worker_stop(struct d3d12_device *device)
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static ULONG STDMETHODCALLTYPE d3d12_device_Release(ID3D12Device5 *iface)
|
|
|
|
+static ULONG STDMETHODCALLTYPE d3d12_device_Release(ID3D12Device7 *iface)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
unsigned int refcount = vkd3d_atomic_decrement_u32(&device->refcount);
|
|
|
|
|
|
|
|
TRACE("%p decreasing refcount to %u.\n", device, refcount);
|
|
|
|
@@ -2599,10 +2601,10 @@ static ULONG STDMETHODCALLTYPE d3d12_device_Release(ID3D12Device5 *iface)
|
|
|
|
return refcount;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_GetPrivateData(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_GetPrivateData(ID3D12Device7 *iface,
|
|
|
|
REFGUID guid, UINT *data_size, void *data)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
|
|
|
|
TRACE("iface %p, guid %s, data_size %p, data %p.\n",
|
|
|
|
iface, debugstr_guid(guid), data_size, data);
|
|
|
|
@@ -2610,10 +2612,10 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_GetPrivateData(ID3D12Device5 *ifac
|
|
|
|
return vkd3d_get_private_data(&device->private_store, guid, data_size, data);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_SetPrivateData(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_SetPrivateData(ID3D12Device7 *iface,
|
|
|
|
REFGUID guid, UINT data_size, const void *data)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
|
|
|
|
TRACE("iface %p, guid %s, data_size %u, data %p.\n",
|
|
|
|
iface, debugstr_guid(guid), data_size, data);
|
|
|
|
@@ -2621,19 +2623,19 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_SetPrivateData(ID3D12Device5 *ifac
|
|
|
|
return vkd3d_set_private_data(&device->private_store, guid, data_size, data);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_SetPrivateDataInterface(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_SetPrivateDataInterface(ID3D12Device7 *iface,
|
|
|
|
REFGUID guid, const IUnknown *data)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
|
|
|
|
TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
|
|
|
|
|
|
|
|
return vkd3d_set_private_data_interface(&device->private_store, guid, data);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_SetName(ID3D12Device5 *iface, const WCHAR *name)
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_SetName(ID3D12Device7 *iface, const WCHAR *name)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
|
|
|
|
TRACE("iface %p, name %s.\n", iface, debugstr_w(name, device->wchar_size));
|
|
|
|
|
|
|
|
@@ -2641,17 +2643,17 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_SetName(ID3D12Device5 *iface, cons
|
|
|
|
VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static UINT STDMETHODCALLTYPE d3d12_device_GetNodeCount(ID3D12Device5 *iface)
|
|
|
|
+static UINT STDMETHODCALLTYPE d3d12_device_GetNodeCount(ID3D12Device7 *iface)
|
|
|
|
{
|
|
|
|
TRACE("iface %p.\n", iface);
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandQueue(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandQueue(ID3D12Device7 *iface,
|
|
|
|
const D3D12_COMMAND_QUEUE_DESC *desc, REFIID riid, void **command_queue)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
struct d3d12_command_queue *object;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
@@ -2665,10 +2667,10 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandQueue(ID3D12Device5 *
|
|
|
|
riid, command_queue);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandAllocator(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandAllocator(ID3D12Device7 *iface,
|
|
|
|
D3D12_COMMAND_LIST_TYPE type, REFIID riid, void **command_allocator)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
struct d3d12_command_allocator *object;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
@@ -2682,10 +2684,10 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandAllocator(ID3D12Devic
|
|
|
|
riid, command_allocator);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateGraphicsPipelineState(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CreateGraphicsPipelineState(ID3D12Device7 *iface,
|
|
|
|
const D3D12_GRAPHICS_PIPELINE_STATE_DESC *desc, REFIID riid, void **pipeline_state)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
struct d3d12_pipeline_state *object;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
@@ -2699,10 +2701,10 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateGraphicsPipelineState(ID3D12
|
|
|
|
&IID_ID3D12PipelineState, riid, pipeline_state);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateComputePipelineState(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CreateComputePipelineState(ID3D12Device7 *iface,
|
|
|
|
const D3D12_COMPUTE_PIPELINE_STATE_DESC *desc, REFIID riid, void **pipeline_state)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
struct d3d12_pipeline_state *object;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
@@ -2716,11 +2718,11 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateComputePipelineState(ID3D12D
|
|
|
|
&IID_ID3D12PipelineState, riid, pipeline_state);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandList(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandList(ID3D12Device7 *iface,
|
|
|
|
UINT node_mask, D3D12_COMMAND_LIST_TYPE type, ID3D12CommandAllocator *command_allocator,
|
|
|
|
ID3D12PipelineState *initial_pipeline_state, REFIID riid, void **command_list)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
struct d3d12_command_list *object;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
@@ -2843,10 +2845,10 @@ bool d3d12_device_is_uma(struct d3d12_device *device, bool *coherent)
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_CheckFeatureSupport(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CheckFeatureSupport(ID3D12Device7 *iface,
|
|
|
|
D3D12_FEATURE feature, void *feature_data, UINT feature_data_size)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
|
|
|
|
TRACE("iface %p, feature %#x, feature_data %p, feature_data_size %u.\n",
|
|
|
|
iface, feature, feature_data, feature_data_size);
|
|
|
|
@@ -3352,10 +3354,10 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CheckFeatureSupport(ID3D12Device5
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateDescriptorHeap(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CreateDescriptorHeap(ID3D12Device7 *iface,
|
|
|
|
const D3D12_DESCRIPTOR_HEAP_DESC *desc, REFIID riid, void **descriptor_heap)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
struct d3d12_descriptor_heap *object;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
@@ -3369,7 +3371,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateDescriptorHeap(ID3D12Device5
|
|
|
|
&IID_ID3D12DescriptorHeap, riid, descriptor_heap);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static UINT STDMETHODCALLTYPE d3d12_device_GetDescriptorHandleIncrementSize(ID3D12Device5 *iface,
|
|
|
|
+static UINT STDMETHODCALLTYPE d3d12_device_GetDescriptorHandleIncrementSize(ID3D12Device7 *iface,
|
|
|
|
D3D12_DESCRIPTOR_HEAP_TYPE descriptor_heap_type)
|
|
|
|
{
|
|
|
|
TRACE("iface %p, descriptor_heap_type %#x.\n", iface, descriptor_heap_type);
|
|
|
|
@@ -3392,11 +3394,11 @@ static UINT STDMETHODCALLTYPE d3d12_device_GetDescriptorHandleIncrementSize(ID3D
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateRootSignature(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CreateRootSignature(ID3D12Device7 *iface,
|
|
|
|
UINT node_mask, const void *bytecode, SIZE_T bytecode_length,
|
|
|
|
REFIID riid, void **root_signature)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
struct d3d12_root_signature *object;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
@@ -3412,89 +3414,89 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateRootSignature(ID3D12Device5
|
|
|
|
&IID_ID3D12RootSignature, riid, root_signature);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static void STDMETHODCALLTYPE d3d12_device_CreateConstantBufferView(ID3D12Device5 *iface,
|
|
|
|
+static void STDMETHODCALLTYPE d3d12_device_CreateConstantBufferView(ID3D12Device7 *iface,
|
|
|
|
const D3D12_CONSTANT_BUFFER_VIEW_DESC *desc, D3D12_CPU_DESCRIPTOR_HANDLE descriptor)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
struct d3d12_desc tmp = {0};
|
|
|
|
|
|
|
|
- TRACE("iface %p, desc %p, descriptor %#lx.\n", iface, desc, descriptor.ptr);
|
|
|
|
+ TRACE("iface %p, desc %p, descriptor %s.\n", iface, desc, debug_cpu_handle(descriptor));
|
|
|
|
|
|
|
|
d3d12_desc_create_cbv(&tmp, device, desc);
|
|
|
|
d3d12_desc_write_atomic(d3d12_desc_from_cpu_handle(descriptor), &tmp, device);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static void STDMETHODCALLTYPE d3d12_device_CreateShaderResourceView(ID3D12Device5 *iface,
|
|
|
|
+static void STDMETHODCALLTYPE d3d12_device_CreateShaderResourceView(ID3D12Device7 *iface,
|
|
|
|
ID3D12Resource *resource, const D3D12_SHADER_RESOURCE_VIEW_DESC *desc,
|
|
|
|
D3D12_CPU_DESCRIPTOR_HANDLE descriptor)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
struct d3d12_desc tmp = {0};
|
|
|
|
|
|
|
|
- TRACE("iface %p, resource %p, desc %p, descriptor %#lx.\n",
|
|
|
|
- iface, resource, desc, descriptor.ptr);
|
|
|
|
+ TRACE("iface %p, resource %p, desc %p, descriptor %s.\n",
|
|
|
|
+ iface, resource, desc, debug_cpu_handle(descriptor));
|
|
|
|
|
|
|
|
d3d12_desc_create_srv(&tmp, device, unsafe_impl_from_ID3D12Resource(resource), desc);
|
|
|
|
d3d12_desc_write_atomic(d3d12_desc_from_cpu_handle(descriptor), &tmp, device);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static void STDMETHODCALLTYPE d3d12_device_CreateUnorderedAccessView(ID3D12Device5 *iface,
|
|
|
|
+static void STDMETHODCALLTYPE d3d12_device_CreateUnorderedAccessView(ID3D12Device7 *iface,
|
|
|
|
ID3D12Resource *resource, ID3D12Resource *counter_resource,
|
|
|
|
const D3D12_UNORDERED_ACCESS_VIEW_DESC *desc, D3D12_CPU_DESCRIPTOR_HANDLE descriptor)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
struct d3d12_desc tmp = {0};
|
|
|
|
|
|
|
|
- TRACE("iface %p, resource %p, counter_resource %p, desc %p, descriptor %#lx.\n",
|
|
|
|
- iface, resource, counter_resource, desc, descriptor.ptr);
|
|
|
|
+ TRACE("iface %p, resource %p, counter_resource %p, desc %p, descriptor %s.\n",
|
|
|
|
+ iface, resource, counter_resource, desc, debug_cpu_handle(descriptor));
|
|
|
|
|
|
|
|
d3d12_desc_create_uav(&tmp, device, unsafe_impl_from_ID3D12Resource(resource),
|
|
|
|
unsafe_impl_from_ID3D12Resource(counter_resource), desc);
|
|
|
|
d3d12_desc_write_atomic(d3d12_desc_from_cpu_handle(descriptor), &tmp, device);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static void STDMETHODCALLTYPE d3d12_device_CreateRenderTargetView(ID3D12Device5 *iface,
|
|
|
|
+static void STDMETHODCALLTYPE d3d12_device_CreateRenderTargetView(ID3D12Device7 *iface,
|
|
|
|
ID3D12Resource *resource, const D3D12_RENDER_TARGET_VIEW_DESC *desc,
|
|
|
|
D3D12_CPU_DESCRIPTOR_HANDLE descriptor)
|
|
|
|
{
|
|
|
|
- TRACE("iface %p, resource %p, desc %p, descriptor %#lx.\n",
|
|
|
|
- iface, resource, desc, descriptor.ptr);
|
|
|
|
+ TRACE("iface %p, resource %p, desc %p, descriptor %s.\n",
|
|
|
|
+ iface, resource, desc, debug_cpu_handle(descriptor));
|
|
|
|
|
|
|
|
d3d12_rtv_desc_create_rtv(d3d12_rtv_desc_from_cpu_handle(descriptor),
|
|
|
|
- impl_from_ID3D12Device5(iface), unsafe_impl_from_ID3D12Resource(resource), desc);
|
|
|
|
+ impl_from_ID3D12Device7(iface), unsafe_impl_from_ID3D12Resource(resource), desc);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static void STDMETHODCALLTYPE d3d12_device_CreateDepthStencilView(ID3D12Device5 *iface,
|
|
|
|
+static void STDMETHODCALLTYPE d3d12_device_CreateDepthStencilView(ID3D12Device7 *iface,
|
|
|
|
ID3D12Resource *resource, const D3D12_DEPTH_STENCIL_VIEW_DESC *desc,
|
|
|
|
D3D12_CPU_DESCRIPTOR_HANDLE descriptor)
|
|
|
|
{
|
|
|
|
- TRACE("iface %p, resource %p, desc %p, descriptor %#lx.\n",
|
|
|
|
- iface, resource, desc, descriptor.ptr);
|
|
|
|
+ TRACE("iface %p, resource %p, desc %p, descriptor %s.\n",
|
|
|
|
+ iface, resource, desc, debug_cpu_handle(descriptor));
|
|
|
|
|
|
|
|
d3d12_dsv_desc_create_dsv(d3d12_dsv_desc_from_cpu_handle(descriptor),
|
|
|
|
- impl_from_ID3D12Device5(iface), unsafe_impl_from_ID3D12Resource(resource), desc);
|
|
|
|
+ impl_from_ID3D12Device7(iface), unsafe_impl_from_ID3D12Resource(resource), desc);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static void STDMETHODCALLTYPE d3d12_device_CreateSampler(ID3D12Device5 *iface,
|
|
|
|
+static void STDMETHODCALLTYPE d3d12_device_CreateSampler(ID3D12Device7 *iface,
|
|
|
|
const D3D12_SAMPLER_DESC *desc, D3D12_CPU_DESCRIPTOR_HANDLE descriptor)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
struct d3d12_desc tmp = {0};
|
|
|
|
|
|
|
|
- TRACE("iface %p, desc %p, descriptor %#lx.\n", iface, desc, descriptor.ptr);
|
|
|
|
+ TRACE("iface %p, desc %p, descriptor %s.\n", iface, desc, debug_cpu_handle(descriptor));
|
|
|
|
|
|
|
|
d3d12_desc_create_sampler(&tmp, device, desc);
|
|
|
|
d3d12_desc_write_atomic(d3d12_desc_from_cpu_handle(descriptor), &tmp, device);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static void STDMETHODCALLTYPE d3d12_device_CopyDescriptors(ID3D12Device5 *iface,
|
|
|
|
+static void STDMETHODCALLTYPE d3d12_device_CopyDescriptors(ID3D12Device7 *iface,
|
|
|
|
UINT dst_descriptor_range_count, const D3D12_CPU_DESCRIPTOR_HANDLE *dst_descriptor_range_offsets,
|
|
|
|
const UINT *dst_descriptor_range_sizes,
|
|
|
|
UINT src_descriptor_range_count, const D3D12_CPU_DESCRIPTOR_HANDLE *src_descriptor_range_offsets,
|
|
|
|
const UINT *src_descriptor_range_sizes,
|
|
|
|
D3D12_DESCRIPTOR_HEAP_TYPE descriptor_heap_type)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
unsigned int dst_range_idx, dst_idx, src_range_idx, src_idx;
|
|
|
|
unsigned int dst_range_size, src_range_size;
|
|
|
|
struct d3d12_descriptor_heap *dst_heap;
|
|
|
|
@@ -3550,101 +3552,126 @@ static void STDMETHODCALLTYPE d3d12_device_CopyDescriptors(ID3D12Device5 *iface,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
-static void STDMETHODCALLTYPE d3d12_device_CopyDescriptorsSimple(ID3D12Device5 *iface,
|
|
|
|
+static void STDMETHODCALLTYPE d3d12_device_CopyDescriptorsSimple(ID3D12Device7 *iface,
|
|
|
|
UINT descriptor_count, const D3D12_CPU_DESCRIPTOR_HANDLE dst_descriptor_range_offset,
|
|
|
|
const D3D12_CPU_DESCRIPTOR_HANDLE src_descriptor_range_offset,
|
|
|
|
D3D12_DESCRIPTOR_HEAP_TYPE descriptor_heap_type)
|
|
|
|
{
|
|
|
|
- TRACE("iface %p, descriptor_count %u, dst_descriptor_range_offset %#lx, "
|
|
|
|
- "src_descriptor_range_offset %#lx, descriptor_heap_type %#x.\n",
|
|
|
|
- iface, descriptor_count, dst_descriptor_range_offset.ptr, src_descriptor_range_offset.ptr,
|
|
|
|
- descriptor_heap_type);
|
|
|
|
+ TRACE("iface %p, descriptor_count %u, dst_descriptor_range_offset %s, "
|
|
|
|
+ "src_descriptor_range_offset %s, descriptor_heap_type %#x.\n",
|
|
|
|
+ iface, descriptor_count, debug_cpu_handle(dst_descriptor_range_offset),
|
|
|
|
+ debug_cpu_handle(src_descriptor_range_offset), descriptor_heap_type);
|
|
|
|
|
|
|
|
d3d12_device_CopyDescriptors(iface, 1, &dst_descriptor_range_offset, &descriptor_count,
|
|
|
|
1, &src_descriptor_range_offset, &descriptor_count, descriptor_heap_type);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static D3D12_RESOURCE_ALLOCATION_INFO * STDMETHODCALLTYPE d3d12_device_GetResourceAllocationInfo(
|
|
|
|
- ID3D12Device5 *iface, D3D12_RESOURCE_ALLOCATION_INFO *info, UINT visible_mask,
|
|
|
|
- UINT count, const D3D12_RESOURCE_DESC *resource_descs)
|
|
|
|
+static void d3d12_resource_allocation_info1_from_vkd3d(D3D12_RESOURCE_ALLOCATION_INFO1 *result,
|
|
|
|
+ const struct vkd3d_resource_allocation_info *info)
|
|
|
|
+{
|
|
|
|
+ result->Offset = info->offset;
|
|
|
|
+ result->Alignment = info->alignment;
|
|
|
|
+ result->SizeInBytes = info->size_in_bytes;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static void d3d12_device_get_resource_allocation_info(struct d3d12_device *device,
|
|
|
|
+ D3D12_RESOURCE_ALLOCATION_INFO1 *infos1, unsigned int count, const D3D12_RESOURCE_DESC *resource_descs,
|
|
|
|
+ D3D12_RESOURCE_ALLOCATION_INFO *result)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct vkd3d_resource_allocation_info info;
|
|
|
|
const D3D12_RESOURCE_DESC *desc;
|
|
|
|
uint64_t requested_alignment;
|
|
|
|
+ unsigned int i;
|
|
|
|
|
|
|
|
- TRACE("iface %p, info %p, visible_mask 0x%08x, count %u, resource_descs %p.\n",
|
|
|
|
- iface, info, visible_mask, count, resource_descs);
|
|
|
|
-
|
|
|
|
- debug_ignored_node_mask(visible_mask);
|
|
|
|
-
|
|
|
|
- info->SizeInBytes = 0;
|
|
|
|
- info->Alignment = 0;
|
|
|
|
-
|
|
|
|
- if (count != 1)
|
|
|
|
- {
|
|
|
|
- FIXME("Multiple resource descriptions not supported.\n");
|
|
|
|
- return info;
|
|
|
|
- }
|
|
|
|
+ result->Alignment = 0;
|
|
|
|
+ result->SizeInBytes = 0;
|
|
|
|
|
|
|
|
- desc = &resource_descs[0];
|
|
|
|
+ info.offset = 0;
|
|
|
|
|
|
|
|
- if (FAILED(d3d12_resource_validate_desc(desc, device)))
|
|
|
|
+ for (i = 0; i < count; ++i)
|
|
|
|
{
|
|
|
|
- WARN("Invalid resource desc.\n");
|
|
|
|
- goto invalid;
|
|
|
|
- }
|
|
|
|
+ desc = &resource_descs[i];
|
|
|
|
|
|
|
|
- if (desc->Dimension == D3D12_RESOURCE_DIMENSION_BUFFER)
|
|
|
|
- {
|
|
|
|
- info->SizeInBytes = align(desc->Width, D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT);
|
|
|
|
- info->Alignment = D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT;
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- if (FAILED(vkd3d_get_image_allocation_info(device, desc, info)))
|
|
|
|
+ if (FAILED(d3d12_resource_validate_desc(desc, device)))
|
|
|
|
{
|
|
|
|
- WARN("Failed to get allocation info for texture.\n");
|
|
|
|
+ WARN("Invalid resource desc.\n");
|
|
|
|
goto invalid;
|
|
|
|
}
|
|
|
|
|
|
|
|
- requested_alignment = desc->Alignment
|
|
|
|
- ? desc->Alignment : D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT;
|
|
|
|
- info->Alignment = max(info->Alignment, requested_alignment);
|
|
|
|
+ if (desc->Dimension == D3D12_RESOURCE_DIMENSION_BUFFER)
|
|
|
|
+ {
|
|
|
|
+ info.alignment = D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT;
|
|
|
|
+ info.offset = align(info.offset, info.alignment);
|
|
|
|
+ info.size_in_bytes = align(desc->Width, D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ if (FAILED(vkd3d_get_image_allocation_info(device, desc, &info)))
|
|
|
|
+ {
|
|
|
|
+ WARN("Failed to get allocation info for texture.\n");
|
|
|
|
+ goto invalid;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- info->SizeInBytes = align(info->SizeInBytes, info->Alignment);
|
|
|
|
+ requested_alignment = desc->Alignment
|
|
|
|
+ ? desc->Alignment : D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT;
|
|
|
|
+ info.alignment = max(info.alignment, requested_alignment);
|
|
|
|
+ info.size_in_bytes = align(info.size_in_bytes, info.alignment);
|
|
|
|
|
|
|
|
- /* Pad by the maximum heap offset increase which may be needed to align to a higher
|
|
|
|
- * Vulkan requirement an offset supplied by the calling application. This allows
|
|
|
|
- * us to return the standard D3D12 alignment and adjust resource placement later. */
|
|
|
|
- if (info->Alignment > requested_alignment)
|
|
|
|
- {
|
|
|
|
- info->SizeInBytes += info->Alignment - requested_alignment;
|
|
|
|
- info->Alignment = requested_alignment;
|
|
|
|
+ /* Pad by the maximum heap offset increase which may be needed to align to a higher
|
|
|
|
+ * Vulkan requirement an offset supplied by the calling application. This allows
|
|
|
|
+ * us to return the standard D3D12 alignment and adjust resource placement later. */
|
|
|
|
+ if (info.alignment > requested_alignment)
|
|
|
|
+ {
|
|
|
|
+ info.size_in_bytes += info.alignment - requested_alignment;
|
|
|
|
+ info.alignment = requested_alignment;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ info.offset = align(info.offset, info.alignment);
|
|
|
|
}
|
|
|
|
- }
|
|
|
|
|
|
|
|
- TRACE("Size %#"PRIx64", alignment %#"PRIx64".\n", info->SizeInBytes, info->Alignment);
|
|
|
|
+ if (infos1)
|
|
|
|
+ d3d12_resource_allocation_info1_from_vkd3d(&infos1[i], &info);
|
|
|
|
|
|
|
|
- return info;
|
|
|
|
+ info.offset += info.size_in_bytes;
|
|
|
|
+
|
|
|
|
+ result->Alignment = max(result->Alignment, info.alignment);
|
|
|
|
+ result->SizeInBytes = info.offset;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return;
|
|
|
|
|
|
|
|
invalid:
|
|
|
|
- info->SizeInBytes = ~(uint64_t)0;
|
|
|
|
+ result->SizeInBytes = UINT64_MAX;
|
|
|
|
|
|
|
|
- /* FIXME: Should we support D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT for small MSSA resources? */
|
|
|
|
+ /* FIXME: Should we support D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT for small MSAA resources? */
|
|
|
|
if (desc->SampleDesc.Count != 1)
|
|
|
|
- info->Alignment = D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT;
|
|
|
|
+ result->Alignment = D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT;
|
|
|
|
else
|
|
|
|
- info->Alignment = D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT;
|
|
|
|
+ result->Alignment = D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT;
|
|
|
|
|
|
|
|
- TRACE("Alignment %#"PRIx64".\n", info->Alignment);
|
|
|
|
+ TRACE("Alignment %#"PRIx64".\n", result->Alignment);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static D3D12_RESOURCE_ALLOCATION_INFO * STDMETHODCALLTYPE d3d12_device_GetResourceAllocationInfo(
|
|
|
|
+ ID3D12Device7 *iface, D3D12_RESOURCE_ALLOCATION_INFO *info, UINT visible_mask,
|
|
|
|
+ UINT count, const D3D12_RESOURCE_DESC *resource_descs)
|
|
|
|
+{
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
+
|
|
|
|
+ TRACE("iface %p, info %p, visible_mask 0x%08x, count %u, resource_descs %p.\n",
|
|
|
|
+ iface, info, visible_mask, count, resource_descs);
|
|
|
|
+
|
|
|
|
+ debug_ignored_node_mask(visible_mask);
|
|
|
|
+
|
|
|
|
+ d3d12_device_get_resource_allocation_info(device, NULL, count, resource_descs, info);
|
|
|
|
|
|
|
|
return info;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static D3D12_HEAP_PROPERTIES * STDMETHODCALLTYPE d3d12_device_GetCustomHeapProperties(ID3D12Device5 *iface,
|
|
|
|
+static D3D12_HEAP_PROPERTIES * STDMETHODCALLTYPE d3d12_device_GetCustomHeapProperties(ID3D12Device7 *iface,
|
|
|
|
D3D12_HEAP_PROPERTIES *heap_properties, UINT node_mask, D3D12_HEAP_TYPE heap_type)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
bool coherent;
|
|
|
|
|
|
|
|
TRACE("iface %p, heap_properties %p, node_mask 0x%08x, heap_type %#x.\n",
|
|
|
|
@@ -3684,12 +3711,12 @@ static D3D12_HEAP_PROPERTIES * STDMETHODCALLTYPE d3d12_device_GetCustomHeapPrope
|
|
|
|
return heap_properties;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommittedResource(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommittedResource(ID3D12Device7 *iface,
|
|
|
|
const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags,
|
|
|
|
const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state,
|
|
|
|
const D3D12_CLEAR_VALUE *optimized_clear_value, REFIID iid, void **resource)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
struct d3d12_resource *object;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
@@ -3708,10 +3735,10 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommittedResource(ID3D12Devi
|
|
|
|
return return_interface(&object->ID3D12Resource1_iface, &IID_ID3D12Resource1, iid, resource);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateHeap(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CreateHeap(ID3D12Device7 *iface,
|
|
|
|
const D3D12_HEAP_DESC *desc, REFIID iid, void **heap)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
struct d3d12_heap *object;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
@@ -3727,12 +3754,12 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateHeap(ID3D12Device5 *iface,
|
|
|
|
return return_interface(&object->ID3D12Heap_iface, &IID_ID3D12Heap, iid, heap);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreatePlacedResource(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CreatePlacedResource(ID3D12Device7 *iface,
|
|
|
|
ID3D12Heap *heap, UINT64 heap_offset,
|
|
|
|
const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state,
|
|
|
|
const D3D12_CLEAR_VALUE *optimized_clear_value, REFIID iid, void **resource)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
struct d3d12_heap *heap_object;
|
|
|
|
struct d3d12_resource *object;
|
|
|
|
HRESULT hr;
|
|
|
|
@@ -3751,11 +3778,11 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreatePlacedResource(ID3D12Device5
|
|
|
|
return return_interface(&object->ID3D12Resource1_iface, &IID_ID3D12Resource1, iid, resource);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateReservedResource(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CreateReservedResource(ID3D12Device7 *iface,
|
|
|
|
const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state,
|
|
|
|
const D3D12_CLEAR_VALUE *optimized_clear_value, REFIID iid, void **resource)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
struct d3d12_resource *object;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
@@ -3769,11 +3796,11 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateReservedResource(ID3D12Devic
|
|
|
|
return return_interface(&object->ID3D12Resource1_iface, &IID_ID3D12Resource1, iid, resource);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateSharedHandle(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CreateSharedHandle(ID3D12Device7 *iface,
|
|
|
|
ID3D12DeviceChild *object, const SECURITY_ATTRIBUTES *attributes, DWORD access,
|
|
|
|
const WCHAR *name, HANDLE *handle)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
|
|
|
|
FIXME("iface %p, object %p, attributes %p, access %#x, name %s, handle %p stub!\n",
|
|
|
|
iface, object, attributes, access, debugstr_w(name, device->wchar_size), handle);
|
|
|
|
@@ -3781,7 +3808,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateSharedHandle(ID3D12Device5 *
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_OpenSharedHandle(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_OpenSharedHandle(ID3D12Device7 *iface,
|
|
|
|
HANDLE handle, REFIID riid, void **object)
|
|
|
|
{
|
|
|
|
FIXME("iface %p, handle %p, riid %s, object %p stub!\n",
|
|
|
|
@@ -3790,10 +3817,10 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_OpenSharedHandle(ID3D12Device5 *if
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_OpenSharedHandleByName(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_OpenSharedHandleByName(ID3D12Device7 *iface,
|
|
|
|
const WCHAR *name, DWORD access, HANDLE *handle)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
|
|
|
|
FIXME("iface %p, name %s, access %#x, handle %p stub!\n",
|
|
|
|
iface, debugstr_w(name, device->wchar_size), access, handle);
|
|
|
|
@@ -3801,7 +3828,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_OpenSharedHandleByName(ID3D12Devic
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_MakeResident(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_MakeResident(ID3D12Device7 *iface,
|
|
|
|
UINT object_count, ID3D12Pageable * const *objects)
|
|
|
|
{
|
|
|
|
ID3D12Fence *fence;
|
|
|
|
@@ -3809,17 +3836,17 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_MakeResident(ID3D12Device5 *iface,
|
|
|
|
|
|
|
|
TRACE("iface %p, object_count %u, objects %p.\n", iface, object_count, objects);
|
|
|
|
|
|
|
|
- if (FAILED(hr = ID3D12Device5_CreateFence(iface, 0, 0, &IID_ID3D12Fence, (void **)&fence)))
|
|
|
|
+ if (FAILED(hr = ID3D12Device7_CreateFence(iface, 0, 0, &IID_ID3D12Fence, (void **)&fence)))
|
|
|
|
return hr;
|
|
|
|
|
|
|
|
- hr = ID3D12Device5_EnqueueMakeResident(iface, 0, object_count, objects, fence, 1);
|
|
|
|
+ hr = ID3D12Device7_EnqueueMakeResident(iface, 0, object_count, objects, fence, 1);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
ID3D12Fence_SetEventOnCompletion(fence, 1, NULL);
|
|
|
|
ID3D12Fence_Release(fence);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_Evict(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_Evict(ID3D12Device7 *iface,
|
|
|
|
UINT object_count, ID3D12Pageable * const *objects)
|
|
|
|
{
|
|
|
|
FIXME_ONCE("iface %p, object_count %u, objects %p stub!\n",
|
|
|
|
@@ -3828,10 +3855,10 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_Evict(ID3D12Device5 *iface,
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateFence(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CreateFence(ID3D12Device7 *iface,
|
|
|
|
UINT64 initial_value, D3D12_FENCE_FLAGS flags, REFIID riid, void **fence)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
struct d3d12_fence *object;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
@@ -3844,21 +3871,21 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateFence(ID3D12Device5 *iface,
|
|
|
|
return return_interface(&object->ID3D12Fence1_iface, &IID_ID3D12Fence1, riid, fence);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_GetDeviceRemovedReason(ID3D12Device5 *iface)
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_GetDeviceRemovedReason(ID3D12Device7 *iface)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
|
|
|
|
TRACE("iface %p.\n", iface);
|
|
|
|
|
|
|
|
return device->removed_reason;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static void STDMETHODCALLTYPE d3d12_device_GetCopyableFootprints(ID3D12Device5 *iface,
|
|
|
|
+static void STDMETHODCALLTYPE d3d12_device_GetCopyableFootprints(ID3D12Device7 *iface,
|
|
|
|
const D3D12_RESOURCE_DESC *desc, UINT first_sub_resource, UINT sub_resource_count,
|
|
|
|
UINT64 base_offset, D3D12_PLACED_SUBRESOURCE_FOOTPRINT *layouts,
|
|
|
|
UINT *row_counts, UINT64 *row_sizes, UINT64 *total_bytes)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
|
|
|
|
unsigned int i, sub_resource_idx, miplevel_idx, row_count, row_size, row_pitch;
|
|
|
|
unsigned int width, height, depth, plane_count, sub_resources_per_plane;
|
|
|
|
@@ -3938,10 +3965,10 @@ static void STDMETHODCALLTYPE d3d12_device_GetCopyableFootprints(ID3D12Device5 *
|
|
|
|
*total_bytes = total;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateQueryHeap(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CreateQueryHeap(ID3D12Device7 *iface,
|
|
|
|
const D3D12_QUERY_HEAP_DESC *desc, REFIID iid, void **heap)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
struct d3d12_query_heap *object;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
@@ -3954,18 +3981,18 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateQueryHeap(ID3D12Device5 *ifa
|
|
|
|
return return_interface(&object->ID3D12QueryHeap_iface, &IID_ID3D12QueryHeap, iid, heap);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_SetStablePowerState(ID3D12Device5 *iface, BOOL enable)
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_SetStablePowerState(ID3D12Device7 *iface, BOOL enable)
|
|
|
|
{
|
|
|
|
FIXME("iface %p, enable %#x stub!\n", iface, enable);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandSignature(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandSignature(ID3D12Device7 *iface,
|
|
|
|
const D3D12_COMMAND_SIGNATURE_DESC *desc, ID3D12RootSignature *root_signature,
|
|
|
|
REFIID iid, void **command_signature)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
struct d3d12_command_signature *object;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
@@ -3979,14 +4006,14 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandSignature(ID3D12Devic
|
|
|
|
&IID_ID3D12CommandSignature, iid, command_signature);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static void STDMETHODCALLTYPE d3d12_device_GetResourceTiling(ID3D12Device5 *iface,
|
|
|
|
+static void STDMETHODCALLTYPE d3d12_device_GetResourceTiling(ID3D12Device7 *iface,
|
|
|
|
ID3D12Resource *resource, UINT *total_tile_count,
|
|
|
|
D3D12_PACKED_MIP_INFO *packed_mip_info, D3D12_TILE_SHAPE *standard_tile_shape,
|
|
|
|
UINT *sub_resource_tiling_count, UINT first_sub_resource_tiling,
|
|
|
|
D3D12_SUBRESOURCE_TILING *sub_resource_tilings)
|
|
|
|
{
|
|
|
|
const struct d3d12_resource *resource_impl = impl_from_ID3D12Resource(resource);
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
|
|
|
|
TRACE("iface %p, resource %p, total_tile_count %p, packed_mip_info %p, "
|
|
|
|
"standard_title_shape %p, sub_resource_tiling_count %p, "
|
|
|
|
@@ -3999,9 +4026,9 @@ static void STDMETHODCALLTYPE d3d12_device_GetResourceTiling(ID3D12Device5 *ifac
|
|
|
|
sub_resource_tiling_count, first_sub_resource_tiling, sub_resource_tilings);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static LUID * STDMETHODCALLTYPE d3d12_device_GetAdapterLuid(ID3D12Device5 *iface, LUID *luid)
|
|
|
|
+static LUID * STDMETHODCALLTYPE d3d12_device_GetAdapterLuid(ID3D12Device7 *iface, LUID *luid)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
|
|
|
|
TRACE("iface %p, luid %p.\n", iface, luid);
|
|
|
|
|
|
|
|
@@ -4010,7 +4037,7 @@ static LUID * STDMETHODCALLTYPE d3d12_device_GetAdapterLuid(ID3D12Device5 *iface
|
|
|
|
return luid;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreatePipelineLibrary(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CreatePipelineLibrary(ID3D12Device7 *iface,
|
|
|
|
const void *blob, SIZE_T blob_size, REFIID iid, void **lib)
|
|
|
|
{
|
|
|
|
FIXME("iface %p, blob %p, blob_size %lu, iid %s, lib %p stub!\n", iface, blob, blob_size, debugstr_guid(iid), lib);
|
|
|
|
@@ -4018,7 +4045,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreatePipelineLibrary(ID3D12Device
|
|
|
|
return DXGI_ERROR_UNSUPPORTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_SetEventOnMultipleFenceCompletion(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_SetEventOnMultipleFenceCompletion(ID3D12Device7 *iface,
|
|
|
|
ID3D12Fence *const *fences, const UINT64 *values, UINT fence_count,
|
|
|
|
D3D12_MULTIPLE_FENCE_WAIT_FLAGS flags, HANDLE event)
|
|
|
|
{
|
|
|
|
@@ -4028,7 +4055,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_SetEventOnMultipleFenceCompletion(
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_SetResidencyPriority(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_SetResidencyPriority(ID3D12Device7 *iface,
|
|
|
|
UINT object_count, ID3D12Pageable *const *objects, const D3D12_RESIDENCY_PRIORITY *priorities)
|
|
|
|
{
|
|
|
|
FIXME_ONCE("iface %p, object_count %u, objects %p, priorities %p stub!\n", iface, object_count, objects, priorities);
|
|
|
|
@@ -4036,10 +4063,10 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_SetResidencyPriority(ID3D12Device5
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreatePipelineState(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CreatePipelineState(ID3D12Device7 *iface,
|
|
|
|
const D3D12_PIPELINE_STATE_STREAM_DESC *desc, REFIID iid, void **pipeline_state)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
struct d3d12_pipeline_state *object;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
@@ -4051,7 +4078,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreatePipelineState(ID3D12Device5
|
|
|
|
return return_interface(&object->ID3D12PipelineState_iface, &IID_ID3D12PipelineState, iid, pipeline_state);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_OpenExistingHeapFromAddress(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_OpenExistingHeapFromAddress(ID3D12Device7 *iface,
|
|
|
|
const void *address, REFIID iid, void **heap)
|
|
|
|
{
|
|
|
|
FIXME("iface %p, address %p, iid %s, heap %p stub!\n", iface, address, debugstr_guid(iid), heap);
|
|
|
|
@@ -4059,7 +4086,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_OpenExistingHeapFromAddress(ID3D12
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_OpenExistingHeapFromFileMapping(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_OpenExistingHeapFromFileMapping(ID3D12Device7 *iface,
|
|
|
|
HANDLE file_mapping, REFIID iid, void **heap)
|
|
|
|
{
|
|
|
|
FIXME("iface %p, file_mapping %p, iid %s, heap %p stub!\n", iface, file_mapping, debugstr_guid(iid), heap);
|
|
|
|
@@ -4067,7 +4094,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_OpenExistingHeapFromFileMapping(ID
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_EnqueueMakeResident(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_EnqueueMakeResident(ID3D12Device7 *iface,
|
|
|
|
D3D12_RESIDENCY_FLAGS flags, UINT num_objects, ID3D12Pageable *const *objects,
|
|
|
|
ID3D12Fence *fence, UINT64 fence_value)
|
|
|
|
{
|
|
|
|
@@ -4078,7 +4105,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_EnqueueMakeResident(ID3D12Device5
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandList1(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandList1(ID3D12Device7 *iface,
|
|
|
|
UINT node_mask, D3D12_COMMAND_LIST_TYPE type, D3D12_COMMAND_LIST_FLAGS flags,
|
|
|
|
REFIID iid, void **command_list)
|
|
|
|
{
|
|
|
|
@@ -4088,7 +4115,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandList1(ID3D12Device5 *
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateProtectedResourceSession(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CreateProtectedResourceSession(ID3D12Device7 *iface,
|
|
|
|
const D3D12_PROTECTED_RESOURCE_SESSION_DESC *desc, REFIID iid, void **session)
|
|
|
|
{
|
|
|
|
FIXME("iface %p, desc %p, iid %s, session %p stub!\n", iface, desc, debugstr_guid(iid), session);
|
|
|
|
@@ -4096,13 +4123,13 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateProtectedResourceSession(ID3
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommittedResource1(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommittedResource1(ID3D12Device7 *iface,
|
|
|
|
const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags,
|
|
|
|
const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state,
|
|
|
|
const D3D12_CLEAR_VALUE *optimized_clear_value,
|
|
|
|
ID3D12ProtectedResourceSession *protected_session, REFIID iid, void **resource)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
struct d3d12_resource *object;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
@@ -4121,11 +4148,11 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommittedResource1(ID3D12Dev
|
|
|
|
return return_interface(&object->ID3D12Resource1_iface, &IID_ID3D12Resource1, iid, resource);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateHeap1(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CreateHeap1(ID3D12Device7 *iface,
|
|
|
|
const D3D12_HEAP_DESC *desc, ID3D12ProtectedResourceSession *protected_session,
|
|
|
|
REFIID iid, void **heap)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *device = impl_from_ID3D12Device5(iface);
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
struct d3d12_heap *object;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
@@ -4141,7 +4168,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateHeap1(ID3D12Device5 *iface,
|
|
|
|
return return_interface(&object->ID3D12Heap_iface, &IID_ID3D12Heap, iid, heap);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateReservedResource1(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CreateReservedResource1(ID3D12Device7 *iface,
|
|
|
|
const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state,
|
|
|
|
const D3D12_CLEAR_VALUE *optimized_clear_value,
|
|
|
|
ID3D12ProtectedResourceSession *protected_session, REFIID iid, void **resource)
|
|
|
|
@@ -4155,17 +4182,23 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateReservedResource1(ID3D12Devi
|
|
|
|
}
|
|
|
|
|
|
|
|
static D3D12_RESOURCE_ALLOCATION_INFO * STDMETHODCALLTYPE d3d12_device_GetResourceAllocationInfo1(
|
|
|
|
- ID3D12Device5 *iface, D3D12_RESOURCE_ALLOCATION_INFO *info, UINT visible_mask,
|
|
|
|
+ ID3D12Device7 *iface, D3D12_RESOURCE_ALLOCATION_INFO *info, UINT visible_mask,
|
|
|
|
UINT count, const D3D12_RESOURCE_DESC *resource_descs,
|
|
|
|
D3D12_RESOURCE_ALLOCATION_INFO1 *info1)
|
|
|
|
{
|
|
|
|
- FIXME("iface %p, info %p, visible_mask 0x%08x, count %u, resource_descs %p, info1 %p stub!\n",
|
|
|
|
+ struct d3d12_device *device = impl_from_ID3D12Device7(iface);
|
|
|
|
+
|
|
|
|
+ TRACE("iface %p, info %p, visible_mask 0x%08x, count %u, resource_descs %p, info1 %p.\n",
|
|
|
|
iface, info, visible_mask, count, resource_descs, info1);
|
|
|
|
|
|
|
|
+ debug_ignored_node_mask(visible_mask);
|
|
|
|
+
|
|
|
|
+ d3d12_device_get_resource_allocation_info(device, info1, count, resource_descs, info);
|
|
|
|
+
|
|
|
|
return info;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateLifetimeTracker(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CreateLifetimeTracker(ID3D12Device7 *iface,
|
|
|
|
ID3D12LifetimeOwner *owner, REFIID iid, void **tracker)
|
|
|
|
{
|
|
|
|
FIXME("iface %p, owner %p, iid %s, tracker %p stub!\n", iface, owner, debugstr_guid(iid), tracker);
|
|
|
|
@@ -4173,12 +4206,12 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateLifetimeTracker(ID3D12Device
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static void STDMETHODCALLTYPE d3d12_device_RemoveDevice(ID3D12Device5 *iface)
|
|
|
|
+static void STDMETHODCALLTYPE d3d12_device_RemoveDevice(ID3D12Device7 *iface)
|
|
|
|
{
|
|
|
|
FIXME("iface %p stub!\n", iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_EnumerateMetaCommands(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_EnumerateMetaCommands(ID3D12Device7 *iface,
|
|
|
|
UINT *num_meta_commands, D3D12_META_COMMAND_DESC *command_desc)
|
|
|
|
{
|
|
|
|
FIXME("iface %p, num_meta_commands %p, command_desc %p stub!\n", iface,
|
|
|
|
@@ -4187,7 +4220,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_EnumerateMetaCommands(ID3D12Device
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_EnumerateMetaCommandParameters(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_EnumerateMetaCommandParameters(ID3D12Device7 *iface,
|
|
|
|
REFGUID command_id, D3D12_META_COMMAND_PARAMETER_STAGE stage,
|
|
|
|
UINT *size_in_bytes, UINT *parameter_count,
|
|
|
|
D3D12_META_COMMAND_PARAMETER_DESC *parameter_desc)
|
|
|
|
@@ -4199,7 +4232,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_EnumerateMetaCommandParameters(ID3
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateMetaCommand(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CreateMetaCommand(ID3D12Device7 *iface,
|
|
|
|
REFGUID command_id, UINT node_mask, const void *parameters_data,
|
|
|
|
SIZE_T data_size_in_bytes, REFIID iid, void **meta_command)
|
|
|
|
{
|
|
|
|
@@ -4211,7 +4244,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateMetaCommand(ID3D12Device5 *i
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateStateObject(ID3D12Device5 *iface,
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CreateStateObject(ID3D12Device7 *iface,
|
|
|
|
const D3D12_STATE_OBJECT_DESC *desc, REFIID iid, void **state_object)
|
|
|
|
{
|
|
|
|
FIXME("iface %p, desc %p, iid %s, state_object %p stub!\n", iface, desc, debugstr_guid(iid), state_object);
|
|
|
|
@@ -4219,14 +4252,14 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateStateObject(ID3D12Device5 *i
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static void STDMETHODCALLTYPE d3d12_device_GetRaytracingAccelerationStructurePrebuildInfo(ID3D12Device5 *iface,
|
|
|
|
+static void STDMETHODCALLTYPE d3d12_device_GetRaytracingAccelerationStructurePrebuildInfo(ID3D12Device7 *iface,
|
|
|
|
const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *desc,
|
|
|
|
D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *info)
|
|
|
|
{
|
|
|
|
FIXME("iface %p, desc %p, info %p stub!\n", iface, desc, info);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS STDMETHODCALLTYPE d3d12_device_CheckDriverMatchingIdentifier(ID3D12Device5 *iface,
|
|
|
|
+static D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS STDMETHODCALLTYPE d3d12_device_CheckDriverMatchingIdentifier(ID3D12Device7 *iface,
|
|
|
|
D3D12_SERIALIZED_DATA_TYPE data_type, const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *identifier)
|
|
|
|
{
|
|
|
|
FIXME("iface %p, data_type %u, identifier %p stub!\n", iface, data_type, identifier);
|
|
|
|
@@ -4234,7 +4267,35 @@ static D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS STDMETHODCALLTYPE d3d12_device_Ch
|
|
|
|
return D3D12_DRIVER_MATCHING_IDENTIFIER_UNRECOGNIZED;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static const struct ID3D12Device5Vtbl d3d12_device_vtbl =
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_SetBackgroundProcessingMode(ID3D12Device7 *iface,
|
|
|
|
+ D3D12_BACKGROUND_PROCESSING_MODE mode, D3D12_MEASUREMENTS_ACTION action, HANDLE event,
|
|
|
|
+ BOOL *further_measurements_desired)
|
|
|
|
+{
|
|
|
|
+ FIXME("iface %p, mode %#x, action %#x, event %p, further_measurements_desired %p stub!\n",
|
|
|
|
+ iface, mode, action, event, further_measurements_desired);
|
|
|
|
+
|
|
|
|
+ return E_NOTIMPL;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_AddToStateObject(ID3D12Device7 *iface,
|
|
|
|
+ const D3D12_STATE_OBJECT_DESC *addition, ID3D12StateObject *state_object_to_grow_from,
|
|
|
|
+ REFIID riid, void **new_state_object)
|
|
|
|
+{
|
|
|
|
+ FIXME("iface %p, addition %p, state_object_to_grow_from %p, riid %s, new_state_object %p stub!\n",
|
|
|
|
+ iface, addition, state_object_to_grow_from, debugstr_guid(riid), new_state_object);
|
|
|
|
+
|
|
|
|
+ return E_NOTIMPL;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT STDMETHODCALLTYPE d3d12_device_CreateProtectedResourceSession1(ID3D12Device7 *iface,
|
|
|
|
+ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *desc, REFIID riid, void **session)
|
|
|
|
+{
|
|
|
|
+ FIXME("iface %p, desc %p, riid %s, session %p stub!\n", iface, desc, debugstr_guid(riid), session);
|
|
|
|
+
|
|
|
|
+ return E_NOTIMPL;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static const struct ID3D12Device7Vtbl d3d12_device_vtbl =
|
|
|
|
{
|
|
|
|
/* IUnknown methods */
|
|
|
|
d3d12_device_QueryInterface,
|
|
|
|
@@ -4309,14 +4370,19 @@ static const struct ID3D12Device5Vtbl d3d12_device_vtbl =
|
|
|
|
d3d12_device_CreateStateObject,
|
|
|
|
d3d12_device_GetRaytracingAccelerationStructurePrebuildInfo,
|
|
|
|
d3d12_device_CheckDriverMatchingIdentifier,
|
|
|
|
+ /* ID3D12Device6 methods */
|
|
|
|
+ d3d12_device_SetBackgroundProcessingMode,
|
|
|
|
+ /* ID3D12Device7 methods */
|
|
|
|
+ d3d12_device_AddToStateObject,
|
|
|
|
+ d3d12_device_CreateProtectedResourceSession1,
|
|
|
|
};
|
|
|
|
|
|
|
|
-struct d3d12_device *unsafe_impl_from_ID3D12Device5(ID3D12Device5 *iface)
|
|
|
|
+struct d3d12_device *unsafe_impl_from_ID3D12Device7(ID3D12Device7 *iface)
|
|
|
|
{
|
|
|
|
if (!iface)
|
|
|
|
return NULL;
|
|
|
|
assert(iface->lpVtbl == &d3d12_device_vtbl);
|
|
|
|
- return impl_from_ID3D12Device5(iface);
|
|
|
|
+ return impl_from_ID3D12Device7(iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void *device_worker_main(void *arg)
|
|
|
|
@@ -4359,7 +4425,7 @@ static HRESULT d3d12_device_init(struct d3d12_device *device,
|
|
|
|
const struct vkd3d_vk_device_procs *vk_procs;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
- device->ID3D12Device5_iface.lpVtbl = &d3d12_device_vtbl;
|
|
|
|
+ device->ID3D12Device7_iface.lpVtbl = &d3d12_device_vtbl;
|
|
|
|
device->refcount = 1;
|
|
|
|
|
|
|
|
vkd3d_instance_incref(device->vkd3d_instance = instance);
|
|
|
|
@@ -4607,28 +4673,28 @@ HRESULT vkd3d_join_thread(struct vkd3d_instance *instance, union vkd3d_thread_ha
|
|
|
|
|
|
|
|
IUnknown *vkd3d_get_device_parent(ID3D12Device *device)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *d3d12_device = impl_from_ID3D12Device5((ID3D12Device5 *)device);
|
|
|
|
+ struct d3d12_device *d3d12_device = impl_from_ID3D12Device7((ID3D12Device7 *)device);
|
|
|
|
|
|
|
|
return d3d12_device->parent;
|
|
|
|
}
|
|
|
|
|
|
|
|
VkDevice vkd3d_get_vk_device(ID3D12Device *device)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *d3d12_device = impl_from_ID3D12Device5((ID3D12Device5 *)device);
|
|
|
|
+ struct d3d12_device *d3d12_device = impl_from_ID3D12Device7((ID3D12Device7 *)device);
|
|
|
|
|
|
|
|
return d3d12_device->vk_device;
|
|
|
|
}
|
|
|
|
|
|
|
|
VkPhysicalDevice vkd3d_get_vk_physical_device(ID3D12Device *device)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *d3d12_device = impl_from_ID3D12Device5((ID3D12Device5 *)device);
|
|
|
|
+ struct d3d12_device *d3d12_device = impl_from_ID3D12Device7((ID3D12Device7 *)device);
|
|
|
|
|
|
|
|
return d3d12_device->vk_physical_device;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct vkd3d_instance *vkd3d_instance_from_device(ID3D12Device *device)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *d3d12_device = impl_from_ID3D12Device5((ID3D12Device5 *)device);
|
|
|
|
+ struct d3d12_device *d3d12_device = impl_from_ID3D12Device7((ID3D12Device7 *)device);
|
|
|
|
|
|
|
|
return d3d12_device->vkd3d_instance;
|
|
|
|
}
|
|
|
|
diff --git a/libs/vkd3d/libs/vkd3d/resource.c b/libs/vkd3d/libs/vkd3d/resource.c
|
|
|
|
index cd2f9af0e39..c04f48702a0 100644
|
|
|
|
--- a/libs/vkd3d/libs/vkd3d/resource.c
|
|
|
|
+++ b/libs/vkd3d/libs/vkd3d/resource.c
|
|
|
|
@@ -940,7 +940,7 @@ static HRESULT vkd3d_create_image(struct d3d12_device *device,
|
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT vkd3d_get_image_allocation_info(struct d3d12_device *device,
|
|
|
|
- const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_ALLOCATION_INFO *allocation_info)
|
|
|
|
+ const D3D12_RESOURCE_DESC *desc, struct vkd3d_resource_allocation_info *allocation_info)
|
|
|
|
{
|
|
|
|
static const D3D12_HEAP_PROPERTIES heap_properties = {D3D12_HEAP_TYPE_DEFAULT};
|
|
|
|
const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs;
|
|
|
|
@@ -968,8 +968,8 @@ HRESULT vkd3d_get_image_allocation_info(struct d3d12_device *device,
|
|
|
|
VK_CALL(vkGetImageMemoryRequirements(device->vk_device, vk_image, &requirements));
|
|
|
|
VK_CALL(vkDestroyImage(device->vk_device, vk_image, NULL));
|
|
|
|
|
|
|
|
- allocation_info->SizeInBytes = requirements.size;
|
|
|
|
- allocation_info->Alignment = requirements.alignment;
|
|
|
|
+ allocation_info->size_in_bytes = requirements.size;
|
|
|
|
+ allocation_info->alignment = requirements.alignment;
|
|
|
|
}
|
|
|
|
|
|
|
|
return hr;
|
|
|
|
@@ -2239,7 +2239,7 @@ HRESULT d3d12_reserved_resource_create(struct d3d12_device *device,
|
|
|
|
HRESULT vkd3d_create_image_resource(ID3D12Device *device,
|
|
|
|
const struct vkd3d_image_resource_create_info *create_info, ID3D12Resource **resource)
|
|
|
|
{
|
|
|
|
- struct d3d12_device *d3d12_device = unsafe_impl_from_ID3D12Device5((ID3D12Device5 *)device);
|
|
|
|
+ struct d3d12_device *d3d12_device = unsafe_impl_from_ID3D12Device7((ID3D12Device7 *)device);
|
|
|
|
struct d3d12_resource *object;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
diff --git a/libs/vkd3d/libs/vkd3d/state.c b/libs/vkd3d/libs/vkd3d/state.c
|
|
|
|
index 5f383d256cc..3428742dd7f 100644
|
|
|
|
--- a/libs/vkd3d/libs/vkd3d/state.c
|
|
|
|
+++ b/libs/vkd3d/libs/vkd3d/state.c
|
|
|
|
@@ -52,7 +52,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_root_signature_QueryInterface(ID3D12RootS
|
|
|
|
static ULONG STDMETHODCALLTYPE d3d12_root_signature_AddRef(ID3D12RootSignature *iface)
|
|
|
|
{
|
|
|
|
struct d3d12_root_signature *root_signature = impl_from_ID3D12RootSignature(iface);
|
|
|
|
- ULONG refcount = InterlockedIncrement(&root_signature->refcount);
|
|
|
|
+ unsigned int refcount = vkd3d_atomic_increment_u32(&root_signature->refcount);
|
|
|
|
|
|
|
|
TRACE("%p increasing refcount to %u.\n", root_signature, refcount);
|
|
|
|
|
|
|
|
@@ -110,7 +110,7 @@ static void d3d12_root_signature_cleanup(struct d3d12_root_signature *root_signa
|
|
|
|
static ULONG STDMETHODCALLTYPE d3d12_root_signature_Release(ID3D12RootSignature *iface)
|
|
|
|
{
|
|
|
|
struct d3d12_root_signature *root_signature = impl_from_ID3D12RootSignature(iface);
|
|
|
|
- ULONG refcount = InterlockedDecrement(&root_signature->refcount);
|
|
|
|
+ unsigned int refcount = vkd3d_atomic_decrement_u32(&root_signature->refcount);
|
|
|
|
|
|
|
|
TRACE("%p decreasing refcount to %u.\n", root_signature, refcount);
|
|
|
|
|
|
|
|
@@ -1984,7 +1984,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_pipeline_state_QueryInterface(ID3D12Pipel
|
|
|
|
static ULONG STDMETHODCALLTYPE d3d12_pipeline_state_AddRef(ID3D12PipelineState *iface)
|
|
|
|
{
|
|
|
|
struct d3d12_pipeline_state *state = impl_from_ID3D12PipelineState(iface);
|
|
|
|
- ULONG refcount = InterlockedIncrement(&state->refcount);
|
|
|
|
+ unsigned int refcount = vkd3d_atomic_increment_u32(&state->refcount);
|
|
|
|
|
|
|
|
TRACE("%p increasing refcount to %u.\n", state, refcount);
|
|
|
|
|
|
|
|
@@ -2027,7 +2027,7 @@ static void d3d12_pipeline_uav_counter_state_cleanup(struct d3d12_pipeline_uav_c
|
|
|
|
static ULONG STDMETHODCALLTYPE d3d12_pipeline_state_Release(ID3D12PipelineState *iface)
|
|
|
|
{
|
|
|
|
struct d3d12_pipeline_state *state = impl_from_ID3D12PipelineState(iface);
|
|
|
|
- ULONG refcount = InterlockedDecrement(&state->refcount);
|
|
|
|
+ unsigned int refcount = vkd3d_atomic_decrement_u32(&state->refcount);
|
|
|
|
|
|
|
|
TRACE("%p decreasing refcount to %u.\n", state, refcount);
|
|
|
|
|
|
|
|
diff --git a/libs/vkd3d/libs/vkd3d/utils.c b/libs/vkd3d/libs/vkd3d/utils.c
|
|
|
|
index 751971220e7..28913a83e8c 100644
|
|
|
|
--- a/libs/vkd3d/libs/vkd3d/utils.c
|
|
|
|
+++ b/libs/vkd3d/libs/vkd3d/utils.c
|
|
|
|
@@ -632,6 +632,11 @@ HRESULT return_interface(void *iface, REFIID iface_iid,
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
+const char *debug_cpu_handle(D3D12_CPU_DESCRIPTOR_HANDLE handle)
|
|
|
|
+{
|
|
|
|
+ return vkd3d_dbg_sprintf("{%#"PRIxPTR"}", (uintptr_t)handle.ptr);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
const char *debug_d3d12_box(const D3D12_BOX *box)
|
|
|
|
{
|
|
|
|
if (!box)
|
|
|
|
diff --git a/libs/vkd3d/libs/vkd3d/vkd3d_main.c b/libs/vkd3d/libs/vkd3d/vkd3d_main.c
|
|
|
|
index 0139de5dd23..f71b370137f 100644
|
|
|
|
--- a/libs/vkd3d/libs/vkd3d/vkd3d_main.c
|
|
|
|
+++ b/libs/vkd3d/libs/vkd3d/vkd3d_main.c
|
|
|
|
@@ -71,18 +71,18 @@ HRESULT vkd3d_create_device(const struct vkd3d_device_create_info *create_info,
|
|
|
|
|
|
|
|
if (!device)
|
|
|
|
{
|
|
|
|
- ID3D12Device_Release(&object->ID3D12Device5_iface);
|
|
|
|
+ ID3D12Device_Release(&object->ID3D12Device7_iface);
|
|
|
|
return S_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
- return return_interface(&object->ID3D12Device5_iface, &IID_ID3D12Device, iid, device);
|
|
|
|
+ return return_interface(&object->ID3D12Device7_iface, &IID_ID3D12Device, iid, device);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ID3D12RootSignatureDeserializer */
|
|
|
|
struct d3d12_root_signature_deserializer
|
|
|
|
{
|
|
|
|
ID3D12RootSignatureDeserializer ID3D12RootSignatureDeserializer_iface;
|
|
|
|
- LONG refcount;
|
|
|
|
+ unsigned int refcount;
|
|
|
|
|
|
|
|
union
|
|
|
|
{
|
|
|
|
@@ -123,7 +123,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_root_signature_deserializer_QueryInterfac
|
|
|
|
static ULONG STDMETHODCALLTYPE d3d12_root_signature_deserializer_AddRef(ID3D12RootSignatureDeserializer *iface)
|
|
|
|
{
|
|
|
|
struct d3d12_root_signature_deserializer *deserializer = impl_from_ID3D12RootSignatureDeserializer(iface);
|
|
|
|
- ULONG refcount = InterlockedIncrement(&deserializer->refcount);
|
|
|
|
+ unsigned int refcount = vkd3d_atomic_increment_u32(&deserializer->refcount);
|
|
|
|
|
|
|
|
TRACE("%p increasing refcount to %u.\n", deserializer, refcount);
|
|
|
|
|
|
|
|
@@ -133,7 +133,7 @@ static ULONG STDMETHODCALLTYPE d3d12_root_signature_deserializer_AddRef(ID3D12Ro
|
|
|
|
static ULONG STDMETHODCALLTYPE d3d12_root_signature_deserializer_Release(ID3D12RootSignatureDeserializer *iface)
|
|
|
|
{
|
|
|
|
struct d3d12_root_signature_deserializer *deserializer = impl_from_ID3D12RootSignatureDeserializer(iface);
|
|
|
|
- ULONG refcount = InterlockedDecrement(&deserializer->refcount);
|
|
|
|
+ unsigned int refcount = vkd3d_atomic_decrement_u32(&deserializer->refcount);
|
|
|
|
|
|
|
|
TRACE("%p decreasing refcount to %u.\n", deserializer, refcount);
|
|
|
|
|
|
|
|
@@ -242,7 +242,7 @@ HRESULT vkd3d_create_root_signature_deserializer(const void *data, SIZE_T data_s
|
|
|
|
struct d3d12_versioned_root_signature_deserializer
|
|
|
|
{
|
|
|
|
ID3D12VersionedRootSignatureDeserializer ID3D12VersionedRootSignatureDeserializer_iface;
|
|
|
|
- LONG refcount;
|
|
|
|
+ unsigned int refcount;
|
|
|
|
|
|
|
|
union
|
|
|
|
{
|
|
|
|
@@ -284,7 +284,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_versioned_root_signature_deserializer_Que
|
|
|
|
static ULONG STDMETHODCALLTYPE d3d12_versioned_root_signature_deserializer_AddRef(ID3D12VersionedRootSignatureDeserializer *iface)
|
|
|
|
{
|
|
|
|
struct d3d12_versioned_root_signature_deserializer *deserializer = impl_from_ID3D12VersionedRootSignatureDeserializer(iface);
|
|
|
|
- ULONG refcount = InterlockedIncrement(&deserializer->refcount);
|
|
|
|
+ unsigned int refcount = vkd3d_atomic_increment_u32(&deserializer->refcount);
|
|
|
|
|
|
|
|
TRACE("%p increasing refcount to %u.\n", deserializer, refcount);
|
|
|
|
|
|
|
|
@@ -294,7 +294,7 @@ static ULONG STDMETHODCALLTYPE d3d12_versioned_root_signature_deserializer_AddRe
|
|
|
|
static ULONG STDMETHODCALLTYPE d3d12_versioned_root_signature_deserializer_Release(ID3D12VersionedRootSignatureDeserializer *iface)
|
|
|
|
{
|
|
|
|
struct d3d12_versioned_root_signature_deserializer *deserializer = impl_from_ID3D12VersionedRootSignatureDeserializer(iface);
|
|
|
|
- ULONG refcount = InterlockedDecrement(&deserializer->refcount);
|
|
|
|
+ unsigned int refcount = vkd3d_atomic_decrement_u32(&deserializer->refcount);
|
|
|
|
|
|
|
|
TRACE("%p decreasing refcount to %u.\n", deserializer, refcount);
|
|
|
|
|
|
|
|
diff --git a/libs/vkd3d/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/libs/vkd3d/vkd3d_private.h
|
|
|
|
index 92840871631..8ecf6764ab6 100644
|
|
|
|
--- a/libs/vkd3d/libs/vkd3d/vkd3d_private.h
|
|
|
|
+++ b/libs/vkd3d/libs/vkd3d/vkd3d_private.h
|
|
|
|
@@ -493,13 +493,13 @@ struct vkd3d_fence_worker
|
|
|
|
struct vkd3d_gpu_va_allocation
|
|
|
|
{
|
|
|
|
D3D12_GPU_VIRTUAL_ADDRESS base;
|
|
|
|
- size_t size;
|
|
|
|
+ uint64_t size;
|
|
|
|
void *ptr;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct vkd3d_gpu_va_slab
|
|
|
|
{
|
|
|
|
- size_t size;
|
|
|
|
+ uint64_t size;
|
|
|
|
void *ptr;
|
|
|
|
};
|
|
|
|
|
|
|
|
@@ -517,7 +517,7 @@ struct vkd3d_gpu_va_allocator
|
|
|
|
};
|
|
|
|
|
|
|
|
D3D12_GPU_VIRTUAL_ADDRESS vkd3d_gpu_va_allocator_allocate(struct vkd3d_gpu_va_allocator *allocator,
|
|
|
|
- size_t alignment, size_t size, void *ptr);
|
|
|
|
+ size_t alignment, uint64_t size, void *ptr);
|
|
|
|
void *vkd3d_gpu_va_allocator_dereference(struct vkd3d_gpu_va_allocator *allocator, D3D12_GPU_VIRTUAL_ADDRESS address);
|
|
|
|
void vkd3d_gpu_va_allocator_free(struct vkd3d_gpu_va_allocator *allocator, D3D12_GPU_VIRTUAL_ADDRESS address);
|
|
|
|
|
|
|
|
@@ -770,6 +770,13 @@ static inline bool d3d12_resource_is_texture(const struct d3d12_resource *resour
|
|
|
|
return resource->desc.Dimension != D3D12_RESOURCE_DIMENSION_BUFFER;
|
|
|
|
}
|
|
|
|
|
|
|
|
+struct vkd3d_resource_allocation_info
|
|
|
|
+{
|
|
|
|
+ uint64_t offset;
|
|
|
|
+ uint64_t alignment;
|
|
|
|
+ uint64_t size_in_bytes;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
bool d3d12_resource_is_cpu_accessible(const struct d3d12_resource *resource);
|
|
|
|
HRESULT d3d12_resource_validate_desc(const D3D12_RESOURCE_DESC *desc, struct d3d12_device *device);
|
|
|
|
void d3d12_resource_get_tiling(struct d3d12_device *device, const struct d3d12_resource *resource,
|
|
|
|
@@ -797,7 +804,7 @@ HRESULT vkd3d_create_buffer(struct d3d12_device *device,
|
|
|
|
const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags,
|
|
|
|
const D3D12_RESOURCE_DESC *desc, VkBuffer *vk_buffer);
|
|
|
|
HRESULT vkd3d_get_image_allocation_info(struct d3d12_device *device,
|
|
|
|
- const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_ALLOCATION_INFO *allocation_info);
|
|
|
|
+ const D3D12_RESOURCE_DESC *desc, struct vkd3d_resource_allocation_info *allocation_info);
|
|
|
|
|
|
|
|
enum vkd3d_view_type
|
|
|
|
{
|
|
|
|
@@ -1172,7 +1179,7 @@ struct d3d12_descriptor_set_layout
|
|
|
|
struct d3d12_root_signature
|
|
|
|
{
|
|
|
|
ID3D12RootSignature ID3D12RootSignature_iface;
|
|
|
|
- LONG refcount;
|
|
|
|
+ unsigned int refcount;
|
|
|
|
|
|
|
|
VkPipelineLayout vk_pipeline_layout;
|
|
|
|
struct d3d12_descriptor_set_layout descriptor_set_layouts[VKD3D_MAX_DESCRIPTOR_SETS];
|
|
|
|
@@ -1281,7 +1288,7 @@ struct d3d12_pipeline_uav_counter_state
|
|
|
|
struct d3d12_pipeline_state
|
|
|
|
{
|
|
|
|
ID3D12PipelineState ID3D12PipelineState_iface;
|
|
|
|
- LONG refcount;
|
|
|
|
+ unsigned int refcount;
|
|
|
|
|
|
|
|
union
|
|
|
|
{
|
|
|
|
@@ -1748,7 +1755,7 @@ struct vkd3d_desc_object_cache
|
|
|
|
/* ID3D12Device */
|
|
|
|
struct d3d12_device
|
|
|
|
{
|
|
|
|
- ID3D12Device5 ID3D12Device5_iface;
|
|
|
|
+ ID3D12Device7 ID3D12Device7_iface;
|
|
|
|
unsigned int refcount;
|
|
|
|
|
|
|
|
VkDevice vk_device;
|
|
|
|
@@ -1823,29 +1830,29 @@ struct vkd3d_queue *d3d12_device_get_vkd3d_queue(struct d3d12_device *device, D3
|
|
|
|
bool d3d12_device_is_uma(struct d3d12_device *device, bool *coherent);
|
|
|
|
void d3d12_device_mark_as_removed(struct d3d12_device *device, HRESULT reason,
|
|
|
|
const char *message, ...) VKD3D_PRINTF_FUNC(3, 4);
|
|
|
|
-struct d3d12_device *unsafe_impl_from_ID3D12Device5(ID3D12Device5 *iface);
|
|
|
|
+struct d3d12_device *unsafe_impl_from_ID3D12Device7(ID3D12Device7 *iface);
|
|
|
|
HRESULT d3d12_device_add_descriptor_heap(struct d3d12_device *device, struct d3d12_descriptor_heap *heap);
|
|
|
|
void d3d12_device_remove_descriptor_heap(struct d3d12_device *device, struct d3d12_descriptor_heap *heap);
|
|
|
|
|
|
|
|
static inline HRESULT d3d12_device_query_interface(struct d3d12_device *device, REFIID iid, void **object)
|
|
|
|
{
|
|
|
|
- return ID3D12Device5_QueryInterface(&device->ID3D12Device5_iface, iid, object);
|
|
|
|
+ return ID3D12Device7_QueryInterface(&device->ID3D12Device7_iface, iid, object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline ULONG d3d12_device_add_ref(struct d3d12_device *device)
|
|
|
|
{
|
|
|
|
- return ID3D12Device5_AddRef(&device->ID3D12Device5_iface);
|
|
|
|
+ return ID3D12Device7_AddRef(&device->ID3D12Device7_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline ULONG d3d12_device_release(struct d3d12_device *device)
|
|
|
|
{
|
|
|
|
- return ID3D12Device5_Release(&device->ID3D12Device5_iface);
|
|
|
|
+ return ID3D12Device7_Release(&device->ID3D12Device7_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline unsigned int d3d12_device_get_descriptor_handle_increment_size(struct d3d12_device *device,
|
|
|
|
D3D12_DESCRIPTOR_HEAP_TYPE descriptor_type)
|
|
|
|
{
|
|
|
|
- return ID3D12Device5_GetDescriptorHandleIncrementSize(&device->ID3D12Device5_iface, descriptor_type);
|
|
|
|
+ return ID3D12Device7_GetDescriptorHandleIncrementSize(&device->ID3D12Device7_iface, descriptor_type);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* utils */
|
|
|
|
@@ -1953,6 +1960,7 @@ bool is_write_resource_state(D3D12_RESOURCE_STATES state);
|
|
|
|
|
|
|
|
HRESULT return_interface(void *iface, REFIID iface_iid, REFIID requested_iid, void **object);
|
|
|
|
|
|
|
|
+const char *debug_cpu_handle(D3D12_CPU_DESCRIPTOR_HANDLE handle);
|
|
|
|
const char *debug_d3d12_box(const D3D12_BOX *box);
|
|
|
|
const char *debug_d3d12_shader_component_mapping(unsigned int mapping);
|
|
|
|
const char *debug_vk_extent_3d(VkExtent3D extent);
|
|
|
|
--
|
|
|
|
2.43.0
|
|
|
|
|