This goes on top of MR 320.
-- v10: tests/shader-runner: Add a '--dump-dxil' command line switch. tests/shader-runner: Test shaders with dxcompiler.
From: Conor McCarthy cmccarthy@codeweavers.com
The allocator is used for DXIL input/output parameter arrays. --- libs/vkd3d-shader/vkd3d_shader_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index 5645dca33..a427d996b 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -1773,7 +1773,7 @@ static struct vkd3d_shader_param_node *shader_param_allocator_node_create( static void shader_param_allocator_init(struct vkd3d_shader_param_allocator *allocator, unsigned int count, unsigned int stride) { - allocator->count = max(count, 4); + allocator->count = max(count, MAX_REG_OUTPUT); allocator->stride = stride; allocator->head = NULL; allocator->current = NULL;
From: Conor McCarthy cmccarthy@codeweavers.com
--- libs/vkd3d-shader/d3d_asm.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/libs/vkd3d-shader/d3d_asm.c b/libs/vkd3d-shader/d3d_asm.c index 2c5108095..ac63624cf 100644 --- a/libs/vkd3d-shader/d3d_asm.c +++ b/libs/vkd3d-shader/d3d_asm.c @@ -1066,6 +1066,10 @@ static void shader_dump_register(struct vkd3d_d3d_asm_compiler *compiler, const shader_addline(buffer, "oStencilRef"); break;
+ case VKD3DSPR_UNDEF: + shader_addline(buffer, "undef"); + break; + default: shader_addline(buffer, "<unhandled_rtype(%#x)>", reg->type); break;
From: Conor McCarthy cmccarthy@codeweavers.com
--- libs/vkd3d-shader/d3d_asm.c | 6 ++- libs/vkd3d-shader/spirv.c | 48 +++++++++++++++++++++++- libs/vkd3d-shader/vkd3d_shader_private.h | 3 ++ 3 files changed, 55 insertions(+), 2 deletions(-)
diff --git a/libs/vkd3d-shader/d3d_asm.c b/libs/vkd3d-shader/d3d_asm.c index ac63624cf..ab9e07ca7 100644 --- a/libs/vkd3d-shader/d3d_asm.c +++ b/libs/vkd3d-shader/d3d_asm.c @@ -1070,6 +1070,10 @@ static void shader_dump_register(struct vkd3d_d3d_asm_compiler *compiler, const shader_addline(buffer, "undef"); break;
+ case VKD3DSPR_SSA: + shader_addline(buffer, "sr"); + break; + default: shader_addline(buffer, "<unhandled_rtype(%#x)>", reg->type); break; @@ -1185,7 +1189,7 @@ static void shader_dump_register(struct vkd3d_d3d_asm_compiler *compiler, const { shader_print_subscript_range(compiler, reg->idx[1].offset, reg->idx[2].offset); } - else + else if (reg->type != VKD3DSPR_SSA) { /* For descriptors in sm < 5.1 we move the reg->idx values up one slot * to normalise with 5.1. diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 8285b56a1..f649fd5ad 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -2323,6 +2323,9 @@ struct spirv_compiler bool write_tess_geom_point_size;
struct vkd3d_string_buffer_cache string_buffers; + + uint32_t *ssa_register_ids; + unsigned int ssa_register_count; };
static bool is_in_default_phase(const struct spirv_compiler *compiler) @@ -2370,6 +2373,8 @@ static void spirv_compiler_destroy(struct spirv_compiler *compiler) shader_signature_cleanup(&compiler->output_signature); shader_signature_cleanup(&compiler->patch_constant_signature);
+ vkd3d_free(compiler->ssa_register_ids); + vkd3d_free(compiler); }
@@ -3682,6 +3687,22 @@ static uint32_t spirv_compiler_emit_load_scalar(struct spirv_compiler *compiler, return val_id; }
+static uint32_t spirv_compiler_get_ssa_register_id(const struct spirv_compiler *compiler, + const struct vkd3d_shader_register *reg) +{ + assert(reg->idx[0].offset < compiler->ssa_register_count); + assert(reg->idx_count == 1); + return compiler->ssa_register_ids[reg->idx[0].offset]; +} + +static void spirv_compiler_set_ssa_register_id(const struct spirv_compiler *compiler, + const struct vkd3d_shader_register *reg, uint32_t val_id) +{ + unsigned int i = reg->idx[0].offset; + assert(i < compiler->ssa_register_count); + compiler->ssa_register_ids[i] = val_id; +} + static uint32_t spirv_compiler_emit_load_reg(struct spirv_compiler *compiler, const struct vkd3d_shader_register *reg, DWORD swizzle, DWORD write_mask) { @@ -3701,6 +3722,10 @@ static uint32_t spirv_compiler_emit_load_reg(struct spirv_compiler *compiler,
component_count = vkd3d_write_mask_component_count(write_mask); component_type = vkd3d_component_type_from_data_type(reg->data_type); + + if (reg->type == VKD3DSPR_SSA) + return spirv_compiler_get_ssa_register_id(compiler, reg); + if (!spirv_compiler_get_register_info(compiler, reg, ®_info)) { type_id = vkd3d_spirv_get_type_id(builder, component_type, component_count); @@ -3912,6 +3937,12 @@ static void spirv_compiler_emit_store_reg(struct spirv_compiler *compiler,
assert(!register_is_constant_or_undef(reg));
+ if (reg->type == VKD3DSPR_SSA) + { + spirv_compiler_set_ssa_register_id(compiler, reg, val_id); + return; + } + if (!spirv_compiler_get_register_info(compiler, reg, ®_info)) return; spirv_compiler_emit_dereference_register(compiler, reg, ®_info); @@ -5375,6 +5406,18 @@ static void spirv_compiler_emit_temps(struct spirv_compiler *compiler, uint32_t vkd3d_spirv_end_function_stream_insertion(builder); }
+static void spirv_compiler_allocate_ssa_register_ids(struct spirv_compiler *compiler, unsigned int count) +{ + assert(!compiler->ssa_register_ids); + if (!(compiler->ssa_register_ids = vkd3d_calloc(count, sizeof(*compiler->ssa_register_ids)))) + { + ERR("Failed to allocate SSA register value id array, count %u.\n", count); + spirv_compiler_error(compiler, VKD3D_SHADER_ERROR_SPV_OUT_OF_MEMORY, + "Failed to allocate SSA register value id array of count %u.", count); + } + compiler->ssa_register_count = count; +} + static void spirv_compiler_emit_dcl_indexable_temp(struct spirv_compiler *compiler, const struct vkd3d_shader_instruction *instruction) { @@ -6694,7 +6737,8 @@ static void spirv_compiler_emit_mov(struct spirv_compiler *compiler, uint32_t components[VKD3D_VEC4_SIZE]; unsigned int i, component_count;
- if (register_is_constant_or_undef(&src->reg) || dst->modifiers || src->modifiers) + if (register_is_constant_or_undef(&src->reg) || src->reg.type == VKD3DSPR_SSA || dst->reg.type == VKD3DSPR_SSA + || dst->modifiers || src->modifiers) goto general_implementation;
spirv_compiler_get_register_info(compiler, &dst->reg, &dst_reg_info); @@ -9543,6 +9587,8 @@ static int spirv_compiler_generate_spirv(struct spirv_compiler *compiler,
if (parser->shader_desc.temp_count) spirv_compiler_emit_temps(compiler, parser->shader_desc.temp_count); + if (parser->shader_desc.ssa_count) + spirv_compiler_allocate_ssa_register_ids(compiler, parser->shader_desc.ssa_count);
spirv_compiler_emit_descriptor_declarations(compiler);
diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 5fd930918..6bc5f6d12 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -92,6 +92,7 @@ enum vkd3d_shader_error VKD3D_SHADER_ERROR_SPV_INVALID_DESCRIPTOR_BINDING = 2002, VKD3D_SHADER_ERROR_SPV_DESCRIPTOR_IDX_UNSUPPORTED = 2003, VKD3D_SHADER_ERROR_SPV_STENCIL_EXPORT_UNSUPPORTED = 2004, + VKD3D_SHADER_ERROR_SPV_OUT_OF_MEMORY = 2005,
VKD3D_SHADER_WARNING_SPV_INVALID_SWIZZLE = 2300,
@@ -529,6 +530,7 @@ enum vkd3d_shader_register_type VKD3DSPR_RASTERIZER, VKD3DSPR_OUTSTENCILREF, VKD3DSPR_UNDEF, + VKD3DSPR_SSA,
VKD3DSPR_COUNT,
@@ -880,6 +882,7 @@ struct vkd3d_shader_desc struct shader_signature patch_constant_signature;
uint32_t temp_count; + unsigned int ssa_count;
struct {
From: Conor McCarthy cmccarthy@codeweavers.com
--- libs/vkd3d-shader/spirv.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index f649fd5ad..dba0421cf 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -1215,10 +1215,14 @@ static uint32_t vkd3d_spirv_build_op_function_call(struct vkd3d_spirv_builder *b SpvOpFunctionCall, result_type, function_id, arguments, argument_count); }
-static uint32_t vkd3d_spirv_build_op_undef(struct vkd3d_spirv_builder *builder, - struct vkd3d_spirv_stream *stream, uint32_t type_id) +static uint32_t vkd3d_spirv_build_op_undef(struct vkd3d_spirv_builder *builder, uint32_t type_id) { - return vkd3d_spirv_build_op_tr(builder, stream, SpvOpUndef, type_id); + return vkd3d_spirv_build_op_tr(builder, &builder->global_stream, SpvOpUndef, type_id); +} + +static uint32_t vkd3d_spirv_get_op_undef(struct vkd3d_spirv_builder *builder, uint32_t type_id) +{ + return vkd3d_spirv_build_once1(builder, SpvOpUndef, type_id, vkd3d_spirv_build_op_undef); }
static uint32_t vkd3d_spirv_build_op_access_chain(struct vkd3d_spirv_builder *builder, @@ -2855,7 +2859,7 @@ static uint32_t spirv_compiler_get_constant(struct spirv_compiler *compiler, break; default: FIXME("Unhandled component_type %#x.\n", component_type); - return vkd3d_spirv_build_op_undef(builder, &builder->global_stream, type_id); + return vkd3d_spirv_get_op_undef(builder, type_id); }
if (component_count == 1) @@ -2884,7 +2888,7 @@ static uint32_t spirv_compiler_get_constant64(struct spirv_compiler *compiler, if (component_type != VKD3D_SHADER_COMPONENT_DOUBLE) { FIXME("Unhandled component_type %#x.\n", component_type); - return vkd3d_spirv_build_op_undef(builder, &builder->global_stream, type_id); + return vkd3d_spirv_get_op_undef(builder, type_id); }
if (component_count == 1) @@ -3636,7 +3640,7 @@ static uint32_t spirv_compiler_emit_load_undef(struct spirv_compiler *compiler, assert(reg->type == VKD3DSPR_UNDEF);
type_id = vkd3d_spirv_get_type_id_for_data_type(builder, reg->data_type, component_count); - return vkd3d_spirv_build_op_undef(builder, &builder->global_stream, type_id); + return vkd3d_spirv_get_op_undef(builder, type_id); }
static uint32_t spirv_compiler_emit_load_scalar(struct spirv_compiler *compiler, @@ -3729,7 +3733,7 @@ static uint32_t spirv_compiler_emit_load_reg(struct spirv_compiler *compiler, if (!spirv_compiler_get_register_info(compiler, reg, ®_info)) { type_id = vkd3d_spirv_get_type_id(builder, component_type, component_count); - return vkd3d_spirv_build_op_undef(builder, &builder->global_stream, type_id); + return vkd3d_spirv_get_op_undef(builder, type_id); } assert(reg_info.component_type != VKD3D_SHADER_COMPONENT_DOUBLE); spirv_compiler_emit_dereference_register(compiler, reg, ®_info);
From: Conor McCarthy cmccarthy@codeweavers.com
When DXBC contains DXIL code it uses ISG1 signatures. --- libs/vkd3d-shader/dxbc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index 1cb00688c..dbbf8a5c4 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -452,7 +452,7 @@ static int isgn_handler(const struct vkd3d_shader_dxbc_section_desc *section, { struct shader_signature *is = ctx;
- if (section->tag != TAG_ISGN) + if (section->tag != TAG_ISGN && section->tag != TAG_ISG1) return VKD3D_OK;
if (is->elements)
From: Conor McCarthy cmccarthy@codeweavers.com
--- libs/vkd3d-shader/dxil.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-)
diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index b778f6abe..3bea1362e 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -296,6 +296,7 @@ struct sm6_parser size_t global_symbol_count;
struct vkd3d_shader_dst_param *output_params; + struct vkd3d_shader_dst_param *input_params;
struct sm6_function *functions; size_t function_count; @@ -2112,6 +2113,8 @@ static void sm6_parser_emit_signature(struct sm6_parser *sm6, const struct shade param = &ins->declaration.dst; }
+ /* TODO: set the interpolation mode when signatures are loaded from DXIL metadata. */ + ins->flags = (handler_idx == VKD3DSIH_DCL_INPUT_PS) ? VKD3DSIM_LINEAR_NOPERSPECTIVE : 0; *param = params[i]; } } @@ -2123,11 +2126,24 @@ static void sm6_parser_init_output_signature(struct sm6_parser *sm6, const struc sm6->output_params); }
+static void sm6_parser_init_input_signature(struct sm6_parser *sm6, const struct shader_signature *input_signature) +{ + sm6_parser_init_signature(sm6, input_signature, VKD3DSPR_INPUT, sm6->input_params); +} + static void sm6_parser_emit_output_signature(struct sm6_parser *sm6, const struct shader_signature *output_signature) { sm6_parser_emit_signature(sm6, output_signature, VKD3DSIH_DCL_OUTPUT, VKD3DSIH_DCL_OUTPUT_SIV, sm6->output_params); }
+static void sm6_parser_emit_input_signature(struct sm6_parser *sm6, const struct shader_signature *input_signature) +{ + sm6_parser_emit_signature(sm6, input_signature, + (sm6->p.shader_version.type == VKD3D_SHADER_TYPE_PIXEL) ? VKD3DSIH_DCL_INPUT_PS : VKD3DSIH_DCL_INPUT, + (sm6->p.shader_version.type == VKD3D_SHADER_TYPE_PIXEL) ? VKD3DSIH_DCL_INPUT_PS_SIV : VKD3DSIH_DCL_INPUT_SIV, + sm6->input_params); +} + static const struct sm6_value *sm6_parser_next_function_definition(struct sm6_parser *sm6) { size_t i, count = sm6->function_count; @@ -2683,6 +2699,7 @@ static enum vkd3d_result sm6_parser_init(struct sm6_parser *sm6, const uint32_t const char *source_name, struct vkd3d_shader_message_context *message_context) { const struct shader_signature *output_signature = &sm6->p.shader_desc.output_signature; + const struct shader_signature *input_signature = &sm6->p.shader_desc.input_signature; const struct vkd3d_shader_location location = {.source_name = source_name}; uint32_t version_token, dxil_version, token_count, magic; unsigned int chunk_offset, chunk_size; @@ -2838,11 +2855,12 @@ static enum vkd3d_result sm6_parser_init(struct sm6_parser *sm6, const uint32_t return ret; }
- if (!(sm6->output_params = shader_parser_get_dst_params(&sm6->p, output_signature->element_count))) + if (!(sm6->output_params = shader_parser_get_dst_params(&sm6->p, output_signature->element_count)) + || !(sm6->input_params = shader_parser_get_dst_params(&sm6->p, input_signature->element_count))) { - ERR("Failed to allocate output parameters.\n"); + ERR("Failed to allocate input/output parameters.\n"); vkd3d_shader_error(message_context, &location, VKD3D_SHADER_ERROR_DXIL_OUT_OF_MEMORY, - "Out of memory allocating output parameters."); + "Out of memory allocating input/output parameters."); return VKD3D_ERROR_OUT_OF_MEMORY; }
@@ -2877,6 +2895,7 @@ static enum vkd3d_result sm6_parser_init(struct sm6_parser *sm6, const uint32_t }
sm6_parser_init_output_signature(sm6, output_signature); + sm6_parser_init_input_signature(sm6, input_signature);
if ((ret = sm6_parser_module_init(sm6, &sm6->root_block, 0)) < 0) { @@ -2889,13 +2908,14 @@ static enum vkd3d_result sm6_parser_init(struct sm6_parser *sm6, const uint32_t return ret; }
- if (!sm6_parser_require_space(sm6, output_signature->element_count)) + if (!sm6_parser_require_space(sm6, output_signature->element_count + input_signature->element_count)) { vkd3d_shader_error(message_context, &location, VKD3D_SHADER_ERROR_DXIL_OUT_OF_MEMORY, "Out of memory emitting shader signature declarations."); return VKD3D_ERROR_OUT_OF_MEMORY; } sm6_parser_emit_output_signature(sm6, output_signature); + sm6_parser_emit_input_signature(sm6, input_signature);
for (i = 0; i < sm6->function_count; ++i) {
From: Conor McCarthy cmccarthy@codeweavers.com
--- include/private/vkd3d_shader_utils.h | 4 -- libs/vkd3d-shader/dxil.c | 93 ++++++++++++++++++++++++++- libs/vkd3d-shader/vkd3d_shader_main.c | 4 -- 3 files changed, 91 insertions(+), 10 deletions(-)
diff --git a/include/private/vkd3d_shader_utils.h b/include/private/vkd3d_shader_utils.h index c9f8001e5..00052a899 100644 --- a/include/private/vkd3d_shader_utils.h +++ b/include/private/vkd3d_shader_utils.h @@ -43,16 +43,12 @@ static inline enum vkd3d_result vkd3d_shader_parse_dxbc_source_type(const struct if (tag == TAG_SHDR || tag == TAG_SHEX) { *type = VKD3D_SHADER_SOURCE_DXBC_TPF; -#ifndef VKD3D_SHADER_UNSUPPORTED_DXIL - break; -#else } else if (tag == TAG_DXIL) { *type = VKD3D_SHADER_SOURCE_DXBC_DXIL; /* Default to DXIL if both are present. */ break; -#endif } }
diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index 3bea1362e..bbf7589d4 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -141,6 +141,7 @@ enum bitcode_value_symtab_code
enum dx_intrinsic_opcode { + DX_LOAD_INPUT = 4, DX_STORE_OUTPUT = 5, };
@@ -305,6 +306,7 @@ struct sm6_parser size_t value_count; size_t value_capacity; size_t cur_max_value; + unsigned int ssa_next_id;
struct vkd3d_shader_parser p; }; @@ -1548,6 +1550,11 @@ static inline unsigned int sm6_value_get_constant_uint(const struct sm6_value *v return register_get_uint_value(&value->u.reg); }
+static unsigned int sm6_parser_alloc_ssa_id(struct sm6_parser *sm6) +{ + return sm6->ssa_next_id++; +} + static struct vkd3d_shader_src_param *instruction_src_params_alloc(struct vkd3d_shader_instruction *ins, unsigned int count, struct sm6_parser *sm6) { @@ -1580,6 +1587,13 @@ static struct vkd3d_shader_dst_param *instruction_dst_params_alloc(struct vkd3d_ return params; }
+static void register_init_with_id(struct vkd3d_shader_register *reg, + enum vkd3d_shader_register_type reg_type, enum vkd3d_data_type data_type, unsigned int id) +{ + shader_register_init(reg, reg_type, data_type, 1); + reg->idx[0].offset = id; +} + static enum vkd3d_data_type vkd3d_data_type_from_sm6_type(const struct sm6_type *type) { if (type->class == TYPE_CLASS_INTEGER) @@ -1613,6 +1627,24 @@ static enum vkd3d_data_type vkd3d_data_type_from_sm6_type(const struct sm6_type return VKD3D_DATA_UINT; }
+static void register_init_ssa_scalar(struct vkd3d_shader_register *reg, const struct sm6_type *type, + struct sm6_parser *sm6) +{ + enum vkd3d_data_type data_type; + unsigned int id; + + id = sm6_parser_alloc_ssa_id(sm6); + data_type = vkd3d_data_type_from_sm6_type(sm6_type_get_scalar_type(type, 0)); + register_init_with_id(reg, VKD3DSPR_SSA, data_type, id); +} + +static void dst_param_init(struct vkd3d_shader_dst_param *param) +{ + param->write_mask = VKD3DSP_WRITEMASK_0; + param->modifiers = 0; + param->shift = 0; +} + static inline void dst_param_init_scalar(struct vkd3d_shader_dst_param *param, unsigned int component_idx) { param->write_mask = 1u << component_idx; @@ -1620,12 +1652,25 @@ static inline void dst_param_init_scalar(struct vkd3d_shader_dst_param *param, u param->shift = 0; }
+static void dst_param_init_ssa_scalar(struct vkd3d_shader_dst_param *param, const struct sm6_type *type, + struct sm6_parser *sm6) +{ + dst_param_init(param); + register_init_ssa_scalar(¶m->reg, type, sm6); +} + static inline void src_param_init(struct vkd3d_shader_src_param *param) { param->swizzle = VKD3D_SHADER_SWIZZLE(X, X, X, X); param->modifiers = VKD3DSPSM_NONE; }
+static void src_param_init_scalar(struct vkd3d_shader_src_param *param, unsigned int component_idx) +{ + param->swizzle = vkd3d_shader_create_swizzle(component_idx, component_idx, component_idx, component_idx); + param->modifiers = VKD3DSPSM_NONE; +} + static void src_param_init_from_value(struct vkd3d_shader_src_param *param, const struct sm6_value *src) { src_param_init(param); @@ -1654,6 +1699,16 @@ static void register_address_init(struct vkd3d_shader_register *reg, const struc } }
+static void instruction_dst_param_init_ssa_scalar(struct vkd3d_shader_instruction *ins, struct sm6_parser *sm6) +{ + struct vkd3d_shader_dst_param *param = instruction_dst_params_alloc(ins, 1, sm6); + struct sm6_value *dst = sm6_parser_get_current_value(sm6); + + dst_param_init_ssa_scalar(param, dst->type, sm6); + param->write_mask = VKD3DSP_WRITEMASK_0; + dst->u.reg = param->reg; +} + /* Recurse through the block tree while maintaining a current value count. The current * count is the sum of the global count plus all declarations within the current function. * Store into value_capacity the highest count seen. */ @@ -2166,6 +2221,38 @@ static struct sm6_block *sm6_block_create() return block; }
+static void sm6_parser_emit_dx_load_input(struct sm6_parser *sm6, struct sm6_block *code_block, + enum dx_intrinsic_opcode op, const struct sm6_value **operands, struct vkd3d_shader_instruction *ins) +{ + struct vkd3d_shader_src_param *src_param; + const struct shader_signature *signature; + unsigned int row_index, column_index; + const struct signature_element *e; + + row_index = sm6_value_get_constant_uint(operands[0]); + column_index = sm6_value_get_constant_uint(operands[2]); + + vsir_instruction_init(ins, &sm6->p.location, VKD3DSIH_MOV); + + signature = &sm6->p.shader_desc.input_signature; + if (row_index >= signature->element_count) + { + WARN("Invalid row index %u.\n", row_index); + vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_INVALID_OPERAND, + "Invalid input row index %u.", row_index); + return; + } + e = &signature->elements[row_index]; + + src_param = instruction_src_params_alloc(ins, 1, sm6); + src_param->reg = sm6->input_params[row_index].reg; + src_param_init_scalar(src_param, column_index); + if (e->register_count > 1) + register_address_init(&src_param->reg, operands[1], 0, sm6); + + instruction_dst_param_init_ssa_scalar(ins, sm6); +} + static void sm6_parser_emit_dx_store_output(struct sm6_parser *sm6, struct sm6_block *code_block, enum dx_intrinsic_opcode op, const struct sm6_value **operands, struct vkd3d_shader_instruction *ins) { @@ -2235,6 +2322,7 @@ struct sm6_dx_opcode_info */ static const struct sm6_dx_opcode_info sm6_dx_op_table[] = { + [DX_LOAD_INPUT ] = {'o', "ii8i", sm6_parser_emit_dx_load_input}, [DX_STORE_OUTPUT ] = {'v', "ii8o", sm6_parser_emit_dx_store_output}, };
@@ -2887,6 +2975,7 @@ static enum vkd3d_result sm6_parser_init(struct sm6_parser *sm6, const uint32_t "Out of memory allocating DXIL value array."); return VKD3D_ERROR_OUT_OF_MEMORY; } + sm6->ssa_next_id = 1;
if ((ret = sm6_parser_globals_init(sm6)) < 0) { @@ -2917,6 +3006,8 @@ static enum vkd3d_result sm6_parser_init(struct sm6_parser *sm6, const uint32_t sm6_parser_emit_output_signature(sm6, output_signature); sm6_parser_emit_input_signature(sm6, input_signature);
+ sm6->p.shader_desc.ssa_count = sm6->ssa_next_id; + for (i = 0; i < sm6->function_count; ++i) { if (!sm6_block_emit_instructions(sm6->functions[i].blocks[0], sm6)) @@ -2940,8 +3031,6 @@ int vkd3d_shader_sm6_parser_create(const struct vkd3d_shader_compile_info *compi struct sm6_parser *sm6; int ret;
- ERR("Creating a DXIL parser. This is unsupported; you get to keep all the pieces if it breaks.\n"); - if (!(sm6 = vkd3d_calloc(1, sizeof(*sm6)))) { ERR("Failed to allocate parser.\n"); diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index a427d996b..c9919cd3e 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -1667,9 +1667,7 @@ const enum vkd3d_shader_source_type *vkd3d_shader_get_supported_source_types(uns VKD3D_SHADER_SOURCE_DXBC_TPF, VKD3D_SHADER_SOURCE_HLSL, VKD3D_SHADER_SOURCE_D3D_BYTECODE, -#ifdef VKD3D_SHADER_UNSUPPORTED_DXIL VKD3D_SHADER_SOURCE_DXBC_DXIL, -#endif };
TRACE("count %p.\n", count); @@ -1708,9 +1706,7 @@ const enum vkd3d_shader_target_type *vkd3d_shader_get_supported_target_types(
switch (source_type) { -#ifdef VKD3D_SHADER_UNSUPPORTED_DXIL case VKD3D_SHADER_SOURCE_DXBC_DXIL: -#endif case VKD3D_SHADER_SOURCE_DXBC_TPF: *count = ARRAY_SIZE(dxbc_tpf_types); return dxbc_tpf_types;
From: Conor McCarthy cmccarthy@codeweavers.com
Matching all possible combinations of keywords becomes too complex if more keywords are added. --- tests/shader_runner.c | 129 +++++++++++++++++++++--------------------- 1 file changed, 65 insertions(+), 64 deletions(-)
diff --git a/tests/shader_runner.c b/tests/shader_runner.c index 05edf5daf..65011f86c 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -109,6 +109,24 @@ static bool match_string(const char *line, const char *token, const char **const return true; }
+static bool match_directive_substring(const char *line, const char *token, const char **const rest) +{ + size_t len = strlen(token); + + while (isspace(*line) || *line == ']') + ++line; + + if (strncmp(line, token, len) || !(isspace(line[len]) || line[len] == ']')) + return false; + if (rest) + { + *rest = line + len; + while (isspace(**rest)) + ++*rest; + } + return true; +} + static void parse_require_directive(struct shader_runner *runner, const char *line) { unsigned int i; @@ -809,6 +827,40 @@ static void compile_shader(struct shader_runner *runner, const char *source, siz } }
+static enum parse_state read_shader_directive(struct shader_runner *runner, enum parse_state state, const char *line, + const char *src, HRESULT *expect_hr) +{ + while (*src && *src != ']') + { + if (match_directive_substring(src, "todo", &src)) + { + if (state == STATE_SHADER_COMPUTE) + state = STATE_SHADER_COMPUTE_TODO; + else if (state == STATE_SHADER_PIXEL) + state = STATE_SHADER_PIXEL_TODO; + else + state = STATE_SHADER_VERTEX_TODO; + } + else if (match_directive_substring(src, "fail", &src)) + { + *expect_hr = E_FAIL; + } + else if (match_directive_substring(src, "notimpl", &src)) + { + *expect_hr = E_NOTIMPL; + } + else + { + fatal_error("Malformed line '%s'.\n", line); + } + } + + if (strcmp(src, "]\n")) + fatal_error("Malformed line '%s'.\n", line); + + return state; +} + void run_shader_tests(struct shader_runner *runner, const struct shader_runner_ops *ops) { size_t shader_source_size = 0, shader_source_len = 0; @@ -818,7 +870,7 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o unsigned int i, line_number = 0; char *shader_source = NULL; HRESULT expect_hr = S_OK; - char line[256]; + char line_buffer[256]; FILE *f;
if (!test_options.filename) @@ -833,11 +885,12 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o
for (;;) { - char *ret = fgets(line, sizeof(line), f); + char *ret = fgets(line_buffer, sizeof(line_buffer), f); + const char *line = line_buffer;
++line_number;
- if (!ret || line[0] == '[') + if (!ret || *line == '[') { switch (state) { @@ -953,63 +1006,25 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o break; }
- if (line[0] == '[') + if (*line == '[') { unsigned int index;
- if (!strcmp(line, "[compute shader]\n")) + if (match_directive_substring(line, "[compute shader", &line)) { state = STATE_SHADER_COMPUTE; expect_hr = S_OK; - } - else if (!strcmp(line, "[compute shader todo]\n")) - { - state = STATE_SHADER_COMPUTE_TODO; - expect_hr = S_OK; - } - else if (!strcmp(line, "[compute shader fail]\n")) - { - state = STATE_SHADER_COMPUTE; - expect_hr = E_FAIL; - } - else if (!strcmp(line, "[compute shader fail todo]\n")) - { - state = STATE_SHADER_COMPUTE_TODO; - expect_hr = E_FAIL; + state = read_shader_directive(runner, state, line_buffer, line, &expect_hr); } else if (!strcmp(line, "[require]\n")) { state = STATE_REQUIRE; } - else if (!strcmp(line, "[pixel shader]\n")) + else if (match_directive_substring(line, "[pixel shader", &line)) { state = STATE_SHADER_PIXEL; expect_hr = S_OK; - } - else if (!strcmp(line, "[pixel shader todo]\n")) - { - state = STATE_SHADER_PIXEL_TODO; - expect_hr = S_OK; - } - else if (!strcmp(line, "[pixel shader fail]\n")) - { - state = STATE_SHADER_PIXEL; - expect_hr = E_FAIL; - } - else if (!strcmp(line, "[pixel shader fail todo]\n")) - { - state = STATE_SHADER_PIXEL_TODO; - expect_hr = E_FAIL; - } - else if (!strcmp(line, "[pixel shader notimpl]\n")) - { - state = STATE_SHADER_PIXEL; - expect_hr = E_NOTIMPL; - } - else if (!strcmp(line, "[pixel shader notimpl todo]\n")) - { - state = STATE_SHADER_PIXEL_TODO; - expect_hr = E_NOTIMPL; + state = read_shader_directive(runner, state, line_buffer, line, &expect_hr); } else if (sscanf(line, "[sampler %u]\n", &index)) { @@ -1103,25 +1118,11 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o { state = STATE_PREPROC_INVALID; } - else if (!strcmp(line, "[vertex shader]\n")) + else if (match_directive_substring(line, "[vertex shader", &line)) { state = STATE_SHADER_VERTEX; expect_hr = S_OK; - } - else if (!strcmp(line, "[vertex shader todo]\n")) - { - state = STATE_SHADER_VERTEX_TODO; - expect_hr = S_OK; - } - else if (!strcmp(line, "[vertex shader fail]\n")) - { - state = STATE_SHADER_VERTEX; - expect_hr = E_FAIL; - } - else if (!strcmp(line, "[vertex shader fail todo]\n")) - { - state = STATE_SHADER_VERTEX_TODO; - expect_hr = E_FAIL; + state = read_shader_directive(runner, state, line_buffer, line, &expect_hr); } else if (!strcmp(line, "[input layout]\n")) { @@ -1132,9 +1133,9 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o runner->input_element_count = 0; }
- vkd3d_test_push_context("Section %.*s, line %u", strlen(line) - 1, line, line_number); + vkd3d_test_push_context("Section %.*s, line %u", strlen(line_buffer) - 1, line_buffer, line_number); } - else if (line[0] != '%' && line[0] != '\n') + else if (*line != '%' && *line != '\n') { switch (state) {
From: Conor McCarthy cmccarthy@codeweavers.com
Tests are skipped until the next 'require' directive, which restores the defaults before the new requirements are read. --- tests/shader_runner.c | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-)
diff --git a/tests/shader_runner.c b/tests/shader_runner.c index 65011f86c..4f0c785bc 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -870,6 +870,7 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o unsigned int i, line_number = 0; char *shader_source = NULL; HRESULT expect_hr = S_OK; + bool skip_tests = false; char line_buffer[256]; FILE *f;
@@ -903,8 +904,7 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o case STATE_REQUIRE: if (runner->ops->check_requirements && !runner->ops->check_requirements(runner)) { - vkd3d_test_pop_context(); - goto out; + skip_tests = true; } break;
@@ -915,8 +915,11 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o
case STATE_SHADER_COMPUTE: case STATE_SHADER_COMPUTE_TODO: - todo_if (state == STATE_SHADER_COMPUTE_TODO) - compile_shader(runner, shader_source, shader_source_len, "cs", expect_hr); + if (!skip_tests) + { + todo_if (state == STATE_SHADER_COMPUTE_TODO) + compile_shader(runner, shader_source, shader_source_len, "cs", expect_hr); + } free(runner->cs_source); runner->cs_source = shader_source; shader_source = NULL; @@ -926,8 +929,11 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o
case STATE_SHADER_PIXEL: case STATE_SHADER_PIXEL_TODO: - todo_if (state == STATE_SHADER_PIXEL_TODO) - compile_shader(runner, shader_source, shader_source_len, "ps", expect_hr); + if (!skip_tests) + { + todo_if (state == STATE_SHADER_PIXEL_TODO) + compile_shader(runner, shader_source, shader_source_len, "ps", expect_hr); + } free(runner->ps_source); runner->ps_source = shader_source; shader_source = NULL; @@ -937,8 +943,11 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o
case STATE_SHADER_VERTEX: case STATE_SHADER_VERTEX_TODO: - todo_if (state == STATE_SHADER_VERTEX_TODO) - compile_shader(runner, shader_source, shader_source_len, "vs", expect_hr); + if (!skip_tests) + { + todo_if (state == STATE_SHADER_VERTEX_TODO) + compile_shader(runner, shader_source, shader_source_len, "vs", expect_hr); + } free(runner->vs_source); runner->vs_source = shader_source; shader_source = NULL; @@ -951,6 +960,9 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o ID3D10Blob *blob = NULL, *errors = NULL; HRESULT hr;
+ if (skip_tests) + break; + hr = D3DPreprocess(shader_source, strlen(shader_source), NULL, NULL, NULL, &blob, &errors); ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr); ok(!blob, "Expected no compiled shader blob.\n"); @@ -974,6 +986,9 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o HRESULT hr; char *text;
+ if (skip_tests) + break; + hr = D3DPreprocess(shader_source, strlen(shader_source), NULL, NULL, NULL, &blob, &errors); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); if (hr == S_OK) @@ -1019,6 +1034,9 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o else if (!strcmp(line, "[require]\n")) { state = STATE_REQUIRE; + runner->minimum_shader_model = SHADER_MODEL_2_0; + runner->compile_options = 0; + skip_tests = false; } else if (match_directive_substring(line, "[pixel shader", &line)) { @@ -1177,13 +1195,13 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o break;
case STATE_TEST: - parse_test_directive(runner, line); + if (!skip_tests) + parse_test_directive(runner, line); break; } } }
-out: for (i = 0; i < runner->input_element_count; ++i) free(runner->input_elements[i].name); free(runner->input_elements);
From: Conor McCarthy cmccarthy@codeweavers.com
--- tests/shader_runner.c | 25 ++++++++++++++++++++----- tests/shader_runner.h | 11 +++++++++++ tests/shader_runner_d3d12.c | 10 +++++----- 3 files changed, 36 insertions(+), 10 deletions(-)
diff --git a/tests/shader_runner.c b/tests/shader_runner.c index 4f0c785bc..8b463dc00 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -790,7 +790,22 @@ static HRESULT map_unidentified_hrs(HRESULT hr) return hr; }
-static void compile_shader(struct shader_runner *runner, const char *source, size_t len, const char *type, HRESULT expect) +const char *shader_type_string(enum shader_type type) +{ + static const char *const shader_types[] = + { + [SHADER_TYPE_CS] = "cs", + [SHADER_TYPE_GS] = "gs", + [SHADER_TYPE_HS] = "hs", + [SHADER_TYPE_PS] = "ps", + [SHADER_TYPE_VS] = "vs", + }; + assert(type < ARRAY_SIZE(shader_types)); + return shader_types[type]; +} + +static void compile_shader(struct shader_runner *runner, const char *source, size_t len, enum shader_type type, + HRESULT expect) { ID3D10Blob *blob = NULL, *errors = NULL; char profile[7]; @@ -806,7 +821,7 @@ static void compile_shader(struct shader_runner *runner, const char *source, siz [SHADER_MODEL_5_1] = "5_1", };
- sprintf(profile, "%s_%s", type, shader_models[runner->minimum_shader_model]); + sprintf(profile, "%s_%s", shader_type_string(type), shader_models[runner->minimum_shader_model]); hr = D3DCompile(source, len, NULL, NULL, NULL, "main", profile, runner->compile_options, 0, &blob, &errors); hr = map_unidentified_hrs(hr); ok(hr == expect, "Got unexpected hr %#x.\n", hr); @@ -918,7 +933,7 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o if (!skip_tests) { todo_if (state == STATE_SHADER_COMPUTE_TODO) - compile_shader(runner, shader_source, shader_source_len, "cs", expect_hr); + compile_shader(runner, shader_source, shader_source_len, SHADER_TYPE_CS, expect_hr); } free(runner->cs_source); runner->cs_source = shader_source; @@ -932,7 +947,7 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o if (!skip_tests) { todo_if (state == STATE_SHADER_PIXEL_TODO) - compile_shader(runner, shader_source, shader_source_len, "ps", expect_hr); + compile_shader(runner, shader_source, shader_source_len, SHADER_TYPE_PS, expect_hr); } free(runner->ps_source); runner->ps_source = shader_source; @@ -946,7 +961,7 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o if (!skip_tests) { todo_if (state == STATE_SHADER_VERTEX_TODO) - compile_shader(runner, shader_source, shader_source_len, "vs", expect_hr); + compile_shader(runner, shader_source, shader_source_len, SHADER_TYPE_VS, expect_hr); } free(runner->vs_source); runner->vs_source = shader_source; diff --git a/tests/shader_runner.h b/tests/shader_runner.h index 0844943da..ffe4b875e 100644 --- a/tests/shader_runner.h +++ b/tests/shader_runner.h @@ -38,6 +38,17 @@ enum shader_model SHADER_MODEL_5_1, };
+enum shader_type +{ + SHADER_TYPE_CS, + SHADER_TYPE_GS, + SHADER_TYPE_HS, + SHADER_TYPE_PS, + SHADER_TYPE_VS, +}; + +const char *shader_type_string(enum shader_type type); + enum texture_data_type { TEXTURE_DATA_FLOAT, diff --git a/tests/shader_runner_d3d12.c b/tests/shader_runner_d3d12.c index d620f1e2d..925bdca99 100644 --- a/tests/shader_runner_d3d12.c +++ b/tests/shader_runner_d3d12.c @@ -56,7 +56,7 @@ static struct d3d12_shader_runner *d3d12_shader_runner(struct shader_runner *r) return CONTAINING_RECORD(r, struct d3d12_shader_runner, r); }
-static ID3D10Blob *compile_shader(const struct d3d12_shader_runner *runner, const char *source, const char *type) +static ID3D10Blob *compile_shader(const struct d3d12_shader_runner *runner, const char *source, enum shader_type type) { ID3D10Blob *blob = NULL, *errors = NULL; char profile[7]; @@ -72,7 +72,7 @@ static ID3D10Blob *compile_shader(const struct d3d12_shader_runner *runner, cons [SHADER_MODEL_5_1] = "5_1", };
- sprintf(profile, "%s_%s", type, shader_models[runner->r.minimum_shader_model]); + sprintf(profile, "%s_%s", shader_type_string(type), shader_models[runner->r.minimum_shader_model]); hr = D3DCompile(source, strlen(source), NULL, NULL, NULL, "main", profile, runner->r.compile_options, 0, &blob, &errors); ok(FAILED(hr) == !blob, "Got unexpected hr %#x, blob %p.\n", hr, blob); if (errors) @@ -310,7 +310,7 @@ static bool d3d12_runner_dispatch(struct shader_runner *r, unsigned int x, unsig HRESULT hr; size_t i;
- cs_code = compile_shader(runner, runner->r.cs_source, "cs"); + cs_code = compile_shader(runner, runner->r.cs_source, SHADER_TYPE_CS); todo_if (runner->r.is_todo) ok(cs_code, "Failed to compile shader.\n"); if (!cs_code) return false; @@ -385,8 +385,8 @@ static bool d3d12_runner_draw(struct shader_runner *r, HRESULT hr; size_t i;
- ps_code = compile_shader(runner, runner->r.ps_source, "ps"); - vs_code = compile_shader(runner, runner->r.vs_source, "vs"); + ps_code = compile_shader(runner, runner->r.ps_source, SHADER_TYPE_PS); + vs_code = compile_shader(runner, runner->r.vs_source, SHADER_TYPE_VS); todo_if (runner->r.is_todo) ok(ps_code && vs_code, "Failed to compile shaders.\n");
if (!ps_code || !vs_code)
From: Conor McCarthy cmccarthy@codeweavers.com
The location of dxcompiler should be set with LD_LIBRARY_PATH, WINEPATH or PATH as applicable.
A new 'fail(sm<6)' decoration is needed on many shader declarations because dxcompiler succeeds on many shaders which fail with fxc. The opposite case is less common and is flagged with 'fail(sm>=6)'. A few tests cause dxcompiler to crash or hang, so these are avoided using [require], which now skips tests until reset instead of exiting. Also, 'todo(sm<6)' and 'todo(sm>=6)' are used to separate checking of results. --- Makefile.am | 10 +- README | 9 + tests/dxcompiler.idl | 155 +++++++++++++ tests/hlsl/abs.shader_test | 4 +- tests/hlsl/all.shader_test | 14 +- tests/hlsl/any.shader_test | 36 +-- .../hlsl/arithmetic-float-uniform.shader_test | 12 +- tests/hlsl/arithmetic-float.shader_test | 2 +- tests/hlsl/arithmetic-int-uniform.shader_test | 16 +- tests/hlsl/arithmetic-int.shader_test | 6 +- tests/hlsl/arithmetic-uint.shader_test | 4 +- tests/hlsl/array-dimension.shader_test | 2 +- tests/hlsl/array-index-expr.shader_test | 32 +-- tests/hlsl/array-parameters.shader_test | 2 +- tests/hlsl/array-size-expr.shader_test | 2 +- tests/hlsl/asfloat.shader_test | 4 +- tests/hlsl/asuint.shader_test | 4 +- tests/hlsl/attributes.shader_test | 20 +- tests/hlsl/bool-cast.shader_test | 4 +- tests/hlsl/bool-semantics.shader_test | 2 +- .../cast-componentwise-compatible.shader_test | 14 +- .../hlsl/cast-componentwise-equal.shader_test | 10 +- tests/hlsl/cast-to-float.shader_test | 2 +- tests/hlsl/cast-to-half.shader_test | 2 +- tests/hlsl/cast-to-int.shader_test | 2 +- tests/hlsl/cast-to-uint.shader_test | 2 +- tests/hlsl/cbuffer.shader_test | 46 ++-- tests/hlsl/clamp.shader_test | 2 +- tests/hlsl/clip.shader_test | 8 +- tests/hlsl/combined-samplers.shader_test | 16 +- tests/hlsl/compute.shader_test | 1 + tests/hlsl/conditional.shader_test | 10 +- tests/hlsl/const.shader_test | 4 +- tests/hlsl/cross.shader_test | 4 +- tests/hlsl/d3dcolor-to-ubyte4.shader_test | 4 +- tests/hlsl/ddxddy.shader_test | 8 +- tests/hlsl/discard.shader_test | 4 + tests/hlsl/distance.shader_test | 2 +- tests/hlsl/dot.shader_test | 10 +- tests/hlsl/duplicate-modifiers.shader_test | 2 +- tests/hlsl/entry-point-semantics.shader_test | 38 ++-- tests/hlsl/exp.shader_test | 4 +- tests/hlsl/expr-indexing.shader_test | 14 +- tests/hlsl/floor.shader_test | 6 +- tests/hlsl/fmod.shader_test | 8 +- tests/hlsl/for.shader_test | 2 +- tests/hlsl/frac.shader_test | 2 +- tests/hlsl/function-cast.shader_test | 4 +- tests/hlsl/function-overload.shader_test | 2 +- tests/hlsl/function-return.shader_test | 5 + tests/hlsl/function.shader_test | 8 +- tests/hlsl/gather-offset.shader_test | 12 +- tests/hlsl/gather.shader_test | 12 +- tests/hlsl/getdimensions.shader_test | 4 +- .../initializer-implicit-array.shader_test | 48 ++-- tests/hlsl/initializer-objects.shader_test | 4 +- tests/hlsl/intrinsic-override.shader_test | 4 +- tests/hlsl/invalid.shader_test | 26 +-- tests/hlsl/is-front-face.shader_test | 4 +- tests/hlsl/ldexp.shader_test | 4 +- tests/hlsl/length.shader_test | 10 +- tests/hlsl/lerp.shader_test | 4 +- tests/hlsl/lit.shader_test | 8 +- tests/hlsl/load-level.shader_test | 6 +- tests/hlsl/log.shader_test | 6 +- tests/hlsl/loop.shader_test | 4 +- tests/hlsl/majority-pragma.shader_test | 30 +-- tests/hlsl/majority-syntax.shader_test | 4 +- tests/hlsl/majority-typedef.shader_test | 2 +- tests/hlsl/math.shader_test | 2 +- tests/hlsl/matrix-indexing.shader_test | 12 +- tests/hlsl/matrix-semantics.shader_test | 10 +- tests/hlsl/max.shader_test | 4 +- tests/hlsl/nested-arrays.shader_test | 4 +- tests/hlsl/nointerpolation.shader_test | 2 +- tests/hlsl/normalize.shader_test | 10 +- tests/hlsl/numeric-types.shader_test | 6 +- tests/hlsl/numthreads.shader_test | 1 + tests/hlsl/object-field-offsets.shader_test | 6 +- tests/hlsl/object-parameters.shader_test | 10 +- tests/hlsl/object-references.shader_test | 22 +- tests/hlsl/pow.shader_test | 2 +- tests/hlsl/reflect.shader_test | 12 +- tests/hlsl/register-reservations.shader_test | 20 +- .../return-implicit-conversion.shader_test | 2 +- tests/hlsl/return.shader_test | 13 +- tests/hlsl/round.shader_test | 6 +- tests/hlsl/sample-bias.shader_test | 6 +- tests/hlsl/sample-grad.shader_test | 6 +- tests/hlsl/sample-level.shader_test | 6 +- tests/hlsl/sampler-offset.shader_test | 6 +- tests/hlsl/sampler.shader_test | 10 +- tests/hlsl/saturate.shader_test | 4 +- .../shader-interstage-interface.shader_test | 2 +- tests/hlsl/side-effects.shader_test | 2 +- tests/hlsl/sign.shader_test | 20 +- tests/hlsl/smoothstep.shader_test | 2 +- tests/hlsl/sqrt.shader_test | 4 +- tests/hlsl/state-block-syntax.shader_test | 20 +- tests/hlsl/static-initializer.shader_test | 10 +- tests/hlsl/step.shader_test | 2 +- tests/hlsl/storage-qualifiers.shader_test | 2 +- tests/hlsl/struct-array.shader_test | 2 +- tests/hlsl/swizzle-constant-prop.shader_test | 6 +- tests/hlsl/swizzle-matrix.shader_test | 10 +- tests/hlsl/swizzles.shader_test | 6 +- tests/hlsl/ternary.shader_test | 4 + tests/hlsl/texture-load-offset.shader_test | 6 +- tests/hlsl/texture-load-typed.shader_test | 2 +- tests/hlsl/texture-load.shader_test | 6 +- tests/hlsl/texture-ordering.shader_test | 10 +- tests/hlsl/trigonometry.shader_test | 6 +- tests/hlsl/trunc.shader_test | 8 +- tests/hlsl/type-names.shader_test | 6 +- tests/hlsl/uav-load.shader_test | 1 + tests/hlsl/uav-out-param.shader_test | 1 + tests/hlsl/uav-rwbuffer.shader_test | 8 +- tests/hlsl/uav-rwstructuredbuffer.shader_test | 2 +- tests/hlsl/uav-rwtexture.shader_test | 30 +-- tests/hlsl/uniform-semantics.shader_test | 4 +- .../hlsl/vector-indexing-uniform.shader_test | 2 +- tests/hlsl/vector-indexing.shader_test | 4 +- tests/hlsl/writemask-assignop-0.shader_test | 2 +- tests/hlsl/writemask-assignop-1.shader_test | 2 +- tests/shader_runner.c | 205 ++++++++++++++++-- tests/shader_runner.h | 12 +- tests/shader_runner_d3d11.c | 2 +- tests/shader_runner_d3d12.c | 39 +++- tests/shader_runner_d3d9.c | 2 +- tests/shader_runner_vulkan.c | 2 +- 130 files changed, 912 insertions(+), 502 deletions(-) create mode 100644 tests/dxcompiler.idl
diff --git a/Makefile.am b/Makefile.am index 744e46127..cab9345f4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,7 +14,8 @@ widl_headers = \ include/vkd3d_dxgi1_4.h \ include/vkd3d_dxgibase.h \ include/vkd3d_dxgiformat.h \ - include/vkd3d_dxgitype.h + include/vkd3d_dxgitype.h \ + tests/dxcompiler.h
vkd3d_public_headers = \ include/vkd3d.h \ @@ -197,6 +198,7 @@ vkd3d_shader_tests = \ vkd3d_test_headers = \ tests/d3d12_crosstest.h \ tests/d3d12_test_utils.h \ + tests/dxcompiler.h \ tests/shader_runner.h \ tests/utils.h \ tests/vulkan_procs.h @@ -379,7 +381,9 @@ tests_d3d12_LDADD = $(LDADD) @PTHREAD_LIBS@ @DL_LIBS@ tests_d3d12_invalid_usage_LDADD = $(LDADD) @DL_LIBS@ tests_hlsl_d3d12_LDADD = $(LDADD) @DL_LIBS@ tests_shader_runner_LDADD = $(LDADD) @DL_LIBS@ +tests_shader_runner_CFLAGS = $(AM_CFLAGS) -I$(builddir)/tests tests_shader_runner_SOURCES = \ + tests/dxcompiler.idl \ tests/shader_runner.c \ tests/shader_runner_d3d9.c \ tests/shader_runner_d3d11.c \ @@ -419,7 +423,7 @@ endif EXTRA_DIST += $(widl_headers) $(widl_headers:.h=.idl) $(widl_headers): %.h: %.idl if HAVE_WIDL - $(VKD3D_V_WIDL)$(WIDL) -h -o $@ $< + $(VKD3D_V_WIDL)$(WIDL) -I$(srcdir)/include -h -o $@ $< else @echo "widl is required to generate $@" endif @@ -463,7 +467,7 @@ dummy-vkd3d-version:
## Cross-compile tests cross_implibs = crosslibs/d3d12 -CROSS_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/include/private -I$(builddir)/include +CROSS_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/include/private -I$(builddir)/include -I$(builddir)/tests CROSS_CFLAGS = -g -O2 -Wall -municode ${CROSS_CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=0 -DVKD3D_CROSSTEST=1 EXTRA_DIST += $(cross_implibs:=.cross32.def) $(cross_implibs:=.cross64.def) EXTRA_DIST += tests/shader_runner_d3d11.c tests/shader_runner_d3d9.c diff --git a/README b/README index cb9d66156..11898701e 100644 --- a/README +++ b/README @@ -83,6 +83,15 @@ commas or semicolons.
* VKD3D_TEST_BUG - set to 0 to disable bug_if() conditions in tests.
+Shader Runner attempts to load libdxcompiler.so or dxcompiler.dll to compile +test shaders in Shader Model 6. LD_LIBRARY_PATH (linux), WINEPATH (wine) or +PATH (native windows) should include the location of dxcompiler if SM 6 shader +tests are desired. If dxcompiler is not found, Shader Runner will compile the +test shaders only in earlier shader models. The DXC source does not contain +code for adding DXBC checksums, so the official release should be installed +from: +https://github.com/microsoft/DirectXShaderCompiler/releases + ================ Developing vkd3d ================ diff --git a/tests/dxcompiler.idl b/tests/dxcompiler.idl new file mode 100644 index 000000000..83b0ed5cd --- /dev/null +++ b/tests/dxcompiler.idl @@ -0,0 +1,155 @@ +import "vkd3d_windows.h"; +#include "vkd3d_unknown.idl" + +cpp_quote("#ifdef _WIN32") +cpp_quote("#ifndef DXC_API_IMPORT") +cpp_quote("#define DXC_API_IMPORT __declspec(dllimport)") +cpp_quote("#endif") +cpp_quote("#else") +cpp_quote("#ifndef DXC_API_IMPORT") +cpp_quote("#define DXC_API_IMPORT __attribute__ ((visibility ("default")))") +cpp_quote("#endif") +cpp_quote("#endif") +/* Strip __attribute__((ms_abi)) defined in vkd3d_windows.h as dxcompiler does not use it. */ +cpp_quote("#ifdef __x86_64__") +cpp_quote("# undef __stdcall") +cpp_quote("# define __stdcall") +cpp_quote("#endif") + +cpp_quote("DEFINE_GUID(CLSID_DxcCompiler, 0x73e22d93, 0xe6ce, 0x47f3, 0xb5, 0xbf, 0xf0, 0x66, 0x4f, 0x39, 0xc1, 0xb0);") + +[ + uuid(8ba5fb08-5195-40e2-ac58-0d989c3a0102), + object, + local, + pointer_default(unique) +] +interface IDxcBlob : IUnknown +{ + void *GetBufferPointer(); + SIZE_T GetBufferSize(); +} + +[ + uuid(7241d424-2646-4191-97c0-98e96e42fc68), + object, + local, + pointer_default(unique) +] +interface IDxcBlobEncoding : IDxcBlob +{ + HRESULT GetEncoding(BOOL *pKnown, UINT32 *pCodePage); +} + +[ + uuid(3da636c9-ba71-4024-a301-30cbf125305b), + object, + local, + pointer_default(unique) +] +interface IDxcBlobUtf8 : IDxcBlobEncoding +{ + const char *GetStringPointer(); + SIZE_T GetStringLength(); +} + +[ + uuid(a3f84eab-0faa-497e-a39c-ee6ed60b2d84), + object, + local, + pointer_default(unique) +] +interface IDxcBlobUtf16 : IDxcBlobEncoding +{ + const WCHAR *GetStringPointer(); + SIZE_T GetStringLength(); +} + +[ + uuid(7f61fc7d-950d-467f-b3e3-3c02fb49187c), + object, + local, + pointer_default(unique) +] +interface IDxcIncludeHandler : IUnknown +{ + HRESULT LoadSource(const WCHAR *pFilename, IDxcBlob **ppIncludeSource); +} + +typedef struct DxcBuffer +{ + const void *Ptr; + SIZE_T Size; + UINT Encoding; +} DxcBuffer; + +typedef struct DxcDefine +{ + const WCHAR *Name; + const WCHAR *Value; +} DxcDefine; + +[ + uuid(cedb484a-d4e9-445a-b991-ca21ca157dc2), + object, + local, + pointer_default(unique) +] +interface IDxcOperationResult : IUnknown +{ + HRESULT GetStatus(HRESULT *pStatus); + + HRESULT GetResult(IDxcBlob **ppResult); + + HRESULT GetErrorBuffer(IDxcBlobEncoding **ppErrors); +} + +typedef enum DXC_OUT_KIND +{ + DXC_OUT_NONE = 0, + DXC_OUT_OBJECT = 1, + DXC_OUT_ERRORS = 2, + DXC_OUT_PDB = 3, + DXC_OUT_SHADER_HASH = 4, + DXC_OUT_DISASSEMBLY = 5, + DXC_OUT_HLSL = 6, + DXC_OUT_TEXT = 7, + DXC_OUT_REFLECTION = 8, + DXC_OUT_ROOT_SIGNATURE = 9, + DXC_OUT_EXTRA_OUTPUTS = 10, + + DXC_OUT_FORCE_DWORD = 0xFFFFFFFF +} DXC_OUT_KIND; + +[ + uuid(58346cda-dde7-4497-9461-6f87af5e0659), + object, + local, + pointer_default(unique) +] +interface IDxcResult : IDxcOperationResult +{ + BOOL HasOutput(DXC_OUT_KIND dxcOutKind); + HRESULT GetOutput(DXC_OUT_KIND dxcOutKind, + REFIID iid, void **ppvObject, IDxcBlobUtf16 **ppOutputName); + + UINT32 GetNumOutputs(); + DXC_OUT_KIND GetOutputByIndex(UINT32 Index); + DXC_OUT_KIND PrimaryOutput(); +} + +[ + uuid(228b4687-5a6a-4730-900c-9702b2203f54), + object, + local, + pointer_default(unique) +] +interface IDxcCompiler3 : IUnknown +{ + HRESULT Compile(const DxcBuffer *pSource, const WCHAR **pArguments, UINT32 argCount, + IDxcIncludeHandler *pIncludeHandler, REFIID riid, void **ppResult); + + HRESULT Disassemble(const DxcBuffer *pObject, REFIID riid, void **ppResult); +} + +typedef HRESULT (__stdcall *DxcCreateInstanceProc)(const IID *rclsid, REFIID riid, void **ppv); diff --git a/tests/hlsl/abs.shader_test b/tests/hlsl/abs.shader_test index 6fa6d1ca7..f08c01f25 100644 --- a/tests/hlsl/abs.shader_test +++ b/tests/hlsl/abs.shader_test @@ -6,8 +6,8 @@ float4 main(uniform float2 u) : sv_target
[test] uniform 0 float4 0.1 0.7 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.7, 0.4, 0.4) uniform 0 float4 -0.7 0.1 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.7, 0.1, 1.2, 0.4) diff --git a/tests/hlsl/all.shader_test b/tests/hlsl/all.shader_test index 7bdb0dc82..564cc5b00 100644 --- a/tests/hlsl/all.shader_test +++ b/tests/hlsl/all.shader_test @@ -11,17 +11,17 @@ float4 main() : sv_target
[test] uniform 0 float4 -1.1 1.6 1.3 0.5 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0)
[test] uniform 0 float4 0.0 1.6 1.3 0.5 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 0.0, 0.0)
[test] uniform 0 float4 1.0 0.0 1.3 0.5 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader] @@ -34,12 +34,12 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0)
[test] uniform 0 float4 0.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader] @@ -53,11 +53,11 @@ float4 main() : sv_target [test] uniform 0 float4 1.0 2.0 0.0 0.0 uniform 4 float4 3.0 4.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0)
[test] uniform 0 float4 1.0 2.0 0.0 0.0 uniform 4 float4 0.0 4.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 0.0, 0.0) diff --git a/tests/hlsl/any.shader_test b/tests/hlsl/any.shader_test index f2298d3a3..9b8b922c9 100644 --- a/tests/hlsl/any.shader_test +++ b/tests/hlsl/any.shader_test @@ -8,25 +8,25 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 1.0 1.0 1.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 float4 1.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 float4 0.0 1.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 float4 0.0 0.0 1.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 float4 0.0 0.0 0.0 1.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 float4 0.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 0.0, 0.0) uniform 0 float4 -1.0 -1.0 -1.0 -1.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0)
[pixel shader] @@ -39,13 +39,13 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 float4 0.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 0.0, 0.0) uniform 0 float4 -1.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0)
[require] @@ -61,22 +61,22 @@ float4 main() : sv_target
[test] uniform 0 uint4 1 1 1 1 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 uint4 1 0 0 0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 uint4 0 1 0 0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 uint4 0 0 1 0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 uint4 0 0 0 1 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 uint4 0 0 0 0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader] @@ -89,8 +89,8 @@ float4 main() : sv_target
[test] uniform 0 uint4 1 0 0 0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 uint4 0 0 0 0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 0.0, 0.0) diff --git a/tests/hlsl/arithmetic-float-uniform.shader_test b/tests/hlsl/arithmetic-float-uniform.shader_test index f022ac79f..8aaca621a 100644 --- a/tests/hlsl/arithmetic-float-uniform.shader_test +++ b/tests/hlsl/arithmetic-float-uniform.shader_test @@ -10,7 +10,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 5.0 15.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (20.0, -10.0, 75.0, 0.33333333) 1
[pixel shader] @@ -25,7 +25,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 5.0 15.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (5.0, 5.0, -5.0, 3.0) 1
[pixel shader] @@ -40,7 +40,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 42.0 5.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, -2.0, 2.0, -2.0) 16
[pixel shader] @@ -55,7 +55,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 45.0 5.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader] @@ -69,7 +69,7 @@ float4 main() : sv_target [test] uniform 0 float4 5.0 -42.1 4.0 45.0 uniform 4 float4 15.0 -5.0 4.1 5.0 -draw quad +todo(sm>=6) draw quad probe all rgba (5.0, -2.1, 4.0, 0.0) 4
[require] @@ -88,5 +88,5 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 1.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1e99, 1e99, 1e99, 1e99) diff --git a/tests/hlsl/arithmetic-float.shader_test b/tests/hlsl/arithmetic-float.shader_test index 73bd627c0..71835082c 100644 --- a/tests/hlsl/arithmetic-float.shader_test +++ b/tests/hlsl/arithmetic-float.shader_test @@ -61,7 +61,7 @@ float4 main() : sv_target
[test] draw quad -probe all rgba (5.0, -2.1, 4.0, 0.0) 4 +probe all rgba (5.0, -2.1, 4.0, 0.0) 6
[require] % Infinities are not allowed in SM1 diff --git a/tests/hlsl/arithmetic-int-uniform.shader_test b/tests/hlsl/arithmetic-int-uniform.shader_test index b2bf720fc..726a191a7 100644 --- a/tests/hlsl/arithmetic-int-uniform.shader_test +++ b/tests/hlsl/arithmetic-int-uniform.shader_test @@ -10,7 +10,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 5.0 16.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (21.0, -11.0, 80.0, 0.0)
[pixel shader] @@ -25,7 +25,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 5.0 16.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (5.0, 5.0, -5.0, 3.0)
[pixel shader] @@ -40,7 +40,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 42.0 5.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (8.0, -8.0, -8.0, 8.0)
[pixel shader] @@ -55,7 +55,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 42.0 5.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, -2.0, 2.0, -2.0)
[pixel shader] @@ -70,7 +70,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 45.0 5.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (9.0, -9.0, -9.0, 9.0)
[pixel shader] @@ -85,7 +85,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 45.0 5.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader] @@ -98,7 +98,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 5.0 -7.0 0.0 -10.0 -draw quad +todo(sm>=6) draw quad probe all rgba (5.0, 7.0, 0.0, 10.0)
[pixel shader] @@ -117,5 +117,5 @@ float4 main() : sv_target [test] uniform 0 float4 45.0 5.0 50.0 10.0 uniform 4 float4 3.0 8.0 2.0 5.0 -draw quad +todo(sm>=6) draw quad probe all rgba (9.0, 5.0, 1.0, 3.0) diff --git a/tests/hlsl/arithmetic-int.shader_test b/tests/hlsl/arithmetic-int.shader_test index c97022099..286811310 100644 --- a/tests/hlsl/arithmetic-int.shader_test +++ b/tests/hlsl/arithmetic-int.shader_test @@ -76,7 +76,7 @@ float4 main() : SV_TARGET draw quad probe all rgba (0.0, 0.0, 0.0, 0.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : SV_TARGET { int x = 1; @@ -85,7 +85,7 @@ float4 main() : SV_TARGET return x / y; }
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : SV_TARGET { int x = 1; @@ -108,7 +108,7 @@ float4 main() : SV_TARGET
[test] draw quad -probe all rgba (-2147483648.0, -2147483648.0, -2147483648.0, -2147483648.0) +todo(sm>=6) probe all rgba (-2147483648.0, -2147483648.0, -2147483648.0, -2147483648.0)
[pixel shader] float4 main() : sv_target diff --git a/tests/hlsl/arithmetic-uint.shader_test b/tests/hlsl/arithmetic-uint.shader_test index f1801b9c2..8b9c2bc91 100644 --- a/tests/hlsl/arithmetic-uint.shader_test +++ b/tests/hlsl/arithmetic-uint.shader_test @@ -27,7 +27,7 @@ float4 main() : SV_TARGET draw quad probe all rgba (5.0, 5.0, 4294967296.0, 3.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : SV_TARGET { uint x = 1; @@ -36,7 +36,7 @@ float4 main() : SV_TARGET return x / y; }
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : SV_TARGET { uint x = 1; diff --git a/tests/hlsl/array-dimension.shader_test b/tests/hlsl/array-dimension.shader_test index 4e8bc12f7..4bdf5f01e 100644 --- a/tests/hlsl/array-dimension.shader_test +++ b/tests/hlsl/array-dimension.shader_test @@ -1,6 +1,6 @@ % Test what kinds of expressions are valid array dimensions.
-[pixel shader todo] +[pixel shader todo fail(sm>=6)] float4 main() : sv_target { const int dim = 4; diff --git a/tests/hlsl/array-index-expr.shader_test b/tests/hlsl/array-index-expr.shader_test index 0a83080cc..f575a3ee1 100644 --- a/tests/hlsl/array-index-expr.shader_test +++ b/tests/hlsl/array-index-expr.shader_test @@ -13,16 +13,16 @@ uniform 4 float4 5.0 6.0 7.0 8.0 uniform 8 float4 9.0 10.0 11.0 12.0 uniform 12 float4 0 0 0 0 todo draw quad -todo probe all rgba (1.0, 2.0, 3.0, 4.0) +todo(sm<6) probe all rgba (1.0, 2.0, 3.0, 4.0) uniform 12 float4 1 0 0 0 todo draw quad -todo probe all rgba (5.0, 6.0, 7.0, 8.0) +todo(sm<6) probe all rgba (5.0, 6.0, 7.0, 8.0) uniform 12 float4 0 1 0 0 todo draw quad -todo probe all rgba (5.0, 6.0, 7.0, 8.0) +todo(sm<6) probe all rgba (5.0, 6.0, 7.0, 8.0) uniform 12 float4 1 1 0 0 todo draw quad -todo probe all rgba (9.0, 10.0, 11.0, 12.0) +todo(sm<6) probe all rgba (9.0, 10.0, 11.0, 12.0)
[pixel shader] @@ -36,16 +36,16 @@ float4 main() : SV_TARGET
[test] uniform 0 float 0 -draw quad +todo(sm>=6) draw quad probe all rgba (11.0, 11.0, 11.0, 11.0) uniform 0 float 1 -draw quad +todo(sm>=6) draw quad probe all rgba (12.0, 12.0, 12.0, 12.0) uniform 0 float 2 -draw quad +todo(sm>=6) draw quad probe all rgba (13.0, 13.0, 13.0, 13.0) uniform 0 float 3 -draw quad +todo(sm>=6) draw quad probe all rgba (14.0, 14.0, 14.0, 14.0)
@@ -61,16 +61,16 @@ float4 main() : SV_TARGET
[test] uniform 0 float 0 -draw quad +todo(sm>=6) draw quad probe all rgba (21.0, 1.0, 24.0, 0.0) uniform 0 float 1 -draw quad +todo(sm>=6) draw quad probe all rgba (22.0, 0.0, 23.0, 1.0) uniform 0 float 2 -draw quad +todo(sm>=6) draw quad probe all rgba (23.0, 1.0, 22.0, 0.0) uniform 0 float 3 -draw quad +todo(sm>=6) draw quad probe all rgba (24.0, 0.0, 21.0, 1.0)
@@ -87,13 +87,13 @@ float4 main() : sv_target [test] uniform 0 float4 0 0 0 0 todo draw quad -todo probe all rgba (1.0, 2.0, 3.0, 4.0) +todo(sm<6) probe all rgba (1.0, 2.0, 3.0, 4.0) uniform 0 float4 1 0 0 0 todo draw quad -todo probe all rgba (5.0, 6.0, 7.0, 8.0) +todo(sm<6) probe all rgba (5.0, 6.0, 7.0, 8.0) uniform 0 float4 0 1 0 0 todo draw quad -todo probe all rgba (5.0, 6.0, 7.0, 8.0) +todo(sm<6) probe all rgba (5.0, 6.0, 7.0, 8.0) uniform 0 float4 1 1 0 0 todo draw quad -todo probe all rgba (9.0, 10.0, 11.0, 12.0) +todo(sm<6) probe all rgba (9.0, 10.0, 11.0, 12.0) diff --git a/tests/hlsl/array-parameters.shader_test b/tests/hlsl/array-parameters.shader_test index 6e866ceb5..28a3c5996 100644 --- a/tests/hlsl/array-parameters.shader_test +++ b/tests/hlsl/array-parameters.shader_test @@ -111,7 +111,7 @@ float4 main() : sv_target
% Implicit size arrays are not allowed. -[pixel shader fail] +[pixel shader fail(sm<6)] float fun(float a[]) { return 0; diff --git a/tests/hlsl/array-size-expr.shader_test b/tests/hlsl/array-size-expr.shader_test index 1fd4e2627..55af741da 100644 --- a/tests/hlsl/array-size-expr.shader_test +++ b/tests/hlsl/array-size-expr.shader_test @@ -53,7 +53,7 @@ draw quad probe all rgba (2, 3, 6, 1)
% Additional level of indirection -[pixel shader todo] +[pixel shader todo fail(sm>=6)] static const float array[8] = {1, 2, 3, 4, 5, 6, 7, 8}; static const int idx = 2; static const float array2[array[idx]] = {1, 2, 3}; diff --git a/tests/hlsl/asfloat.shader_test b/tests/hlsl/asfloat.shader_test index 9c0d93732..3b9aab045 100644 --- a/tests/hlsl/asfloat.shader_test +++ b/tests/hlsl/asfloat.shader_test @@ -15,7 +15,7 @@ float4 main(uniform float f, uniform int i, uniform uint u, uniform half h) : sv
[test] uniform 0 float4 123.0 -2.0 456 0.01 -draw quad +todo(sm>=6) draw quad probe (320,240) rgba (123.0, -2.0, 456.0, 0.01)
[pixel shader] @@ -28,7 +28,7 @@ float4 main(uniform float2x2 m, uniform float4 v) : sv_target uniform 0 float4 11 12 0 0 uniform 4 float4 13 14 0 0 uniform 8 float4 20 21 22 23 -draw quad +todo(sm>=6) draw quad probe (320,240) rgba (13.0, 21.0, 0.0, 0.0)
[pixel shader fail] diff --git a/tests/hlsl/asuint.shader_test b/tests/hlsl/asuint.shader_test index 633a543a6..581de37d9 100644 --- a/tests/hlsl/asuint.shader_test +++ b/tests/hlsl/asuint.shader_test @@ -16,7 +16,7 @@ float4 main(uniform float f, uniform int i, uniform uint u, uniform half h) : sv
[test] uniform 0 uint4 123 0xc0000000 456 0x7fd69345 -draw quad +todo(sm>=6) draw quad probe (320,240) rgba (123.0, 3221225472.0, 456.0, 2144768896.0)
@@ -31,7 +31,7 @@ float4 main(uniform float2x2 m, uniform float4 v) : sv_target uniform 0 uint4 11 12 0 0 uniform 4 uint4 13 14 0 0 uniform 8 uint4 20 21 22 23 -draw quad +todo(sm>=6) draw quad probe (320,240) rgba (13.0, 21.0, 0.0, 0.0)
diff --git a/tests/hlsl/attributes.shader_test b/tests/hlsl/attributes.shader_test index cb6c2b5e5..fd9c087a3 100644 --- a/tests/hlsl/attributes.shader_test +++ b/tests/hlsl/attributes.shader_test @@ -2,32 +2,32 @@ % we need to get the parsing syntax right. Most of the following tests which % succeed print warnings.
-[pixel shader] +[pixel shader fail(sm>=6)]
[numthreads] float4 main() : sv_target { return 0; }
-[pixel shader] +[pixel shader fail(sm>=6)]
[ numthreads ] float4 main() : sv_target { return 0; }
-[pixel shader] +[pixel shader fail(sm>=6)]
[numthreads(1)] float4 main() : sv_target { return 0; }
-[pixel shader todo] +[pixel shader todo fail(sm>=6)]
[numthreads("")] float4 main() : sv_target { return 0; }
-[pixel shader todo] +[pixel shader todo fail(sm>=6)]
[numthreads("one")] float4 main() : sv_target { return 0; }
-[pixel shader todo] +[pixel shader todo fail(sm>=6)]
uniform float4 f;
@@ -77,12 +77,12 @@ float4 main() : sv_target { return 0; } [one][two] float4 main() : sv_target { return 0; }
-[pixel shader fail todo] +[pixel shader fail(sm<6) todo]
[one][one] float4 main() : sv_target { return 0; }
-[pixel shader fail todo] +[pixel shader fail(sm<6) todo]
[one][one(1)] float4 main() : sv_target { return 0; } @@ -92,7 +92,7 @@ float4 main() : sv_target { return 0; } [one][One] float4 main() : sv_target { return 0; }
-[pixel shader] +[pixel shader fail(sm>=6)]
[numthreads] float4 main(); @@ -112,7 +112,7 @@ static int i = 1; [three(i = 4)] float4 main() : sv_target { return 0; }
-[pixel shader fail] +[pixel shader fail(sm<6)]
[one] float4 f; diff --git a/tests/hlsl/bool-cast.shader_test b/tests/hlsl/bool-cast.shader_test index 09ca12e2b..dc75ea376 100644 --- a/tests/hlsl/bool-cast.shader_test +++ b/tests/hlsl/bool-cast.shader_test @@ -30,7 +30,7 @@ float4 main() : SV_TARGET [test] uniform 0 float4 0.0 0.0 2.0 4.0 uniform 4 int4 0 1 0 10 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 10.0, 1.0, 11.0)
@@ -44,5 +44,5 @@ float4 main() : sv_target
[test] uniform 0 uint4 0x00000001 0x00000002 0x80000000 0x00000000 -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, 2.0, 2.0, 0.0) diff --git a/tests/hlsl/bool-semantics.shader_test b/tests/hlsl/bool-semantics.shader_test index bcbd9f9bf..d8df96a2a 100644 --- a/tests/hlsl/bool-semantics.shader_test +++ b/tests/hlsl/bool-semantics.shader_test @@ -49,5 +49,5 @@ float4 main(struct input i) : sv_target }
[test] -draw triangle strip 4 +todo(sm>=6) draw triangle strip 4 probe all rgba (0.0, 2.0, 2.0, 2.0) diff --git a/tests/hlsl/cast-componentwise-compatible.shader_test b/tests/hlsl/cast-componentwise-compatible.shader_test index da55628bf..8ad21d12a 100644 --- a/tests/hlsl/cast-componentwise-compatible.shader_test +++ b/tests/hlsl/cast-componentwise-compatible.shader_test @@ -262,7 +262,7 @@ draw quad probe all rgba (41.0, 42.0, 43.0, 44.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] struct apple { float2 aa; @@ -301,7 +301,7 @@ draw quad probe all rgba (55.0, 56.0, 57.0, 58.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] struct apple { float2 aa; @@ -333,7 +333,7 @@ draw quad probe all rgba (61.0, 62.0, 63.0, 64.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : sv_target { float arr[5] = {1, 2, 3, 4, 5}; @@ -359,7 +359,7 @@ draw quad probe all rgba (71.0, 72.0, 73.0, 74.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : sv_target { float2x2 mat = {1, 2, 3, 4}; @@ -381,7 +381,7 @@ float4 main() : sv_target }
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : sv_target { float arr[5] = {1, 2, 3, 4, 5}; @@ -440,7 +440,7 @@ draw quad probe all rgba (11.0, 12.0, 13.0, 0.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] struct apple { float3 aa; @@ -541,7 +541,7 @@ draw quad probe all rgba (51.0, 52.0, 53.0, 0.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : sv_target { float4 vec = {1, 2, 3, 4}; diff --git a/tests/hlsl/cast-componentwise-equal.shader_test b/tests/hlsl/cast-componentwise-equal.shader_test index 4a25f6dd5..bb1c26fe0 100644 --- a/tests/hlsl/cast-componentwise-equal.shader_test +++ b/tests/hlsl/cast-componentwise-equal.shader_test @@ -32,7 +32,7 @@ float4 main() : sv_target }
-[pixel shader] +[pixel shader fail(sm>=6)] struct apple { float3 aa; @@ -71,7 +71,7 @@ float4 main() : sv_target }
-[pixel shader] +[pixel shader fail(sm>=6)] struct apple { float3 aa; @@ -93,7 +93,7 @@ draw quad probe all rgba (5.0, 6.0, 7.0, 8.0)
-[pixel shader] +[pixel shader fail(sm>=6)] Texture2D tex;
struct apple @@ -124,7 +124,7 @@ draw quad probe all rgba (4.0, 4.0, 4.0, 4.0)
-[pixel shader] +[pixel shader fail(sm>=6)] Texture2D tex;
struct apple @@ -158,7 +158,7 @@ draw quad probe all rgba (5.0, 5.0, 5.0, 5.0)
-[pixel shader] +[pixel shader fail(sm>=6)] struct apple { float3 xx[2]; diff --git a/tests/hlsl/cast-to-float.shader_test b/tests/hlsl/cast-to-float.shader_test index f09100204..7bc22f7f2 100644 --- a/tests/hlsl/cast-to-float.shader_test +++ b/tests/hlsl/cast-to-float.shader_test @@ -12,7 +12,7 @@ uniform 0 int -1 uniform 1 uint 3 uniform 2 int -2 uniform 3 float 0.5 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 0.5, 0.5, 0.5)
[pixel shader] diff --git a/tests/hlsl/cast-to-half.shader_test b/tests/hlsl/cast-to-half.shader_test index 81d6bc5d5..c52179cd9 100644 --- a/tests/hlsl/cast-to-half.shader_test +++ b/tests/hlsl/cast-to-half.shader_test @@ -13,7 +13,7 @@ uniform 0 int -1 uniform 1 uint 3 uniform 2 int -2 uniform 3 float 0.5 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 0.5, 0.5, 0.5)
[pixel shader] diff --git a/tests/hlsl/cast-to-int.shader_test b/tests/hlsl/cast-to-int.shader_test index fe8c79a3c..a72635fbc 100644 --- a/tests/hlsl/cast-to-int.shader_test +++ b/tests/hlsl/cast-to-int.shader_test @@ -19,7 +19,7 @@ uniform 0 float 2.6 uniform 1 int -2 uniform 2 int -2 uniform 3 float -3.6 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 0.5, 0.5, 0.5)
[pixel shader] diff --git a/tests/hlsl/cast-to-uint.shader_test b/tests/hlsl/cast-to-uint.shader_test index 93862a36f..69dcfc10a 100644 --- a/tests/hlsl/cast-to-uint.shader_test +++ b/tests/hlsl/cast-to-uint.shader_test @@ -19,7 +19,7 @@ uniform 0 float 2.6 uniform 1 int 2 uniform 2 int -2 uniform 3 float -3.6 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 0.5, 0.5, 0.5)
[pixel shader] diff --git a/tests/hlsl/cbuffer.shader_test b/tests/hlsl/cbuffer.shader_test index 83397c189..bd814bef7 100644 --- a/tests/hlsl/cbuffer.shader_test +++ b/tests/hlsl/cbuffer.shader_test @@ -13,7 +13,7 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 2.0 3.0 4.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 2.0, 3.0, 4.0)
[pixel shader] @@ -31,7 +31,7 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 2.0 3.0 4.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 2.0, 3.0, 4.0)
% SM1 buffer offset allocation follows different rules than SM4. @@ -72,7 +72,7 @@ uniform 0 float4 0.0 1.0 2.0 3.0 uniform 4 float4 4.0 5.0 6.0 7.0 uniform 8 float4 8.0 9.0 10.0 11.0 uniform 12 float4 12.0 13.0 14.0 15.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 2.0, 4.0, 8.0)
@@ -93,7 +93,7 @@ float4 main() : sv_target uniform 0 float4 0.0 1.0 2.0 3.0 uniform 4 float4 4.0 5.0 6.0 7.0 uniform 8 float4 8.0 9.0 10.0 11.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 4.0, 8.0, 9.0)
@@ -119,11 +119,11 @@ uniform 0 float4 0.0 1.0 2.0 3.0 uniform 4 float4 4.0 5.0 6.0 7.0 uniform 8 float4 8.0 9.0 10.0 11.0 uniform 12 float4 12.0 13.0 14.0 15.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 4.0, 5.0, 6.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] // Elements cannot overlap if buffer is used. cbuffer buffer { @@ -168,7 +168,7 @@ float4 main() : sv_target uniform 0 float4 1.0 2.0 3.0 4.0 uniform 4 float4 5.0 6.0 7.0 8.0 uniform 8 float4 9.0 10.0 11.0 12.0 -draw quad +todo(sm>=6) draw quad probe all rgba (509, 610, 711, 812)
@@ -196,7 +196,7 @@ uniform 0 float4 0.0 1.0 2.0 3.0 uniform 4 float4 4.0 5.0 6.0 7.0 uniform 8 float4 8.0 9.0 10.0 11.0 uniform 12 float4 12.0 13.0 14.0 15.0 -draw quad +todo(sm>=6) draw quad probe all rgba (12468.0, 13509.0, 14010.0, 15011.0)
@@ -213,7 +213,7 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 2.0 3.0 4.0 -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, 3.0, 2.0, 3.0)
@@ -230,7 +230,7 @@ float4 main() : sv_target }
-[pixel shader fail] +[pixel shader fail(sm<6)] // Matrices must be aligned. cbuffer buffer { @@ -243,7 +243,7 @@ float4 main() : sv_target }
-[pixel shader fail] +[pixel shader fail(sm<6)] // Arrays must be aligned. cbuffer buffer { @@ -256,7 +256,7 @@ float4 main() : sv_target }
-[pixel shader fail] +[pixel shader fail(sm<6)] // Structs must be aligned. struct apple { @@ -318,11 +318,11 @@ float4 main() : sv_target uniform 0 float 1.0 uniform 1 float 2.0 uniform 4 float4 5.0 6.0 7.0 8.0 -draw quad +todo(sm>=6) draw quad probe all rgba (512.0, 612.0, 712.0, 812.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] // packoffset cannot be used unless all elements use it. cbuffer buffer { @@ -349,7 +349,7 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 2.0 3.0 4.0 -draw quad +todo(sm>=6) draw quad probe all rgba (3.0, 4.0, 3.0, 4.0)
@@ -491,7 +491,7 @@ float4 main() : sv_target uniform 0 float4 1.0 0.0 0.0 0.0 uniform 4 float4 0.0 2.0 0.0 0.0 uniform 8 float4 0.0 0.0 3.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 2.0, 0.0, 4.0)
@@ -541,14 +541,14 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0)
% Samplers cannot have packoffset(), unless register() is also specified, or they are not used. % Note: In SM1 the rules are different: packoffset() is allowed for samplers, but they cannot be % used together with other numeric fields, which seems like a bug. -[pixel shader fail todo] +[pixel shader fail(sm<6) todo] Texture2D tex;
cbuffer buffer @@ -599,7 +599,7 @@ float4 main() : sv_target
% When packoffset is used in one field, resources are also expected to have a reservation. -[pixel shader fail] +[pixel shader fail(sm<6)] cbuffer buffer { float4 foo : packoffset(c0); @@ -611,7 +611,7 @@ float4 main() : sv_target return 0; }
-[pixel shader fail] +[pixel shader fail(sm<6)] cbuffer buffer { float4 foo : packoffset(c0); @@ -649,7 +649,7 @@ float4 main() : sv_target }
% Using register() alone is considered manual packing for resources, so the other fields expect packoffset(). -[pixel shader fail] +[pixel shader fail(sm<6)] cbuffer buffer { float4 foo; @@ -661,7 +661,7 @@ float4 main() : sv_target return 0; }
-[pixel shader fail] +[pixel shader fail(sm<6)] cbuffer buffer { float4 foo; @@ -718,5 +718,5 @@ uniform 0 float4 0.0 1.0 2.0 3.0 uniform 4 float4 4.0 5.0 6.0 7.0 uniform 8 float4 8.0 9.0 10.0 11.0 uniform 12 float4 12.0 13.0 14.0 15.0 -draw quad +todo(sm>=6) draw quad probe all rgba (124.0, 135.0, 146.0, 150.5) diff --git a/tests/hlsl/clamp.shader_test b/tests/hlsl/clamp.shader_test index 1320c3dd3..529eb5667 100644 --- a/tests/hlsl/clamp.shader_test +++ b/tests/hlsl/clamp.shader_test @@ -6,7 +6,7 @@ float4 main(uniform float3 u) : sv_target
[test] uniform 0 float4 -0.3 -0.1 0.7 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (-0.1, 0.7, -0.3, 0.3)
diff --git a/tests/hlsl/clip.shader_test b/tests/hlsl/clip.shader_test index f9859e1b8..d7473c999 100644 --- a/tests/hlsl/clip.shader_test +++ b/tests/hlsl/clip.shader_test @@ -9,14 +9,14 @@ float4 main() : sv_target
[test] uniform 0 float4 1 2 3 4 -draw quad +todo(sm>=6) draw quad probe all rgba (1, 2, 3, 4) uniform 0 float4 9 8 7 6 -draw quad +todo(sm>=6) draw quad probe all rgba (9, 8, 7, 6) uniform 0 float4 -1 8 7 6 -draw quad +todo(sm>=6) draw quad probe all rgba (9, 8, 7, 6) uniform 0 float4 9 0 7 6 -draw quad +todo(sm>=6) draw quad probe all rgba (9, 0, 7, 6) diff --git a/tests/hlsl/combined-samplers.shader_test b/tests/hlsl/combined-samplers.shader_test index 465c11cb5..ff011e46a 100644 --- a/tests/hlsl/combined-samplers.shader_test +++ b/tests/hlsl/combined-samplers.shader_test @@ -46,7 +46,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0, 0, 0, 1)
@@ -61,7 +61,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (10, 10, 10, 11)
@@ -75,7 +75,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (21, 21, 21, 11)
@@ -91,7 +91,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (12, 12, 12, 111)
@@ -106,13 +106,13 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (104, 104, 104, 111)
% Sampler arrays with components that have different usage dimensions are only forbidden in SM4 upwards. % However, tex2D and tex1D are considered the same dimension for these purposes. -[pixel shader fail] +[pixel shader fail(sm<6)] sampler sam[2];
float4 main() : sv_target @@ -130,7 +130,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (1, 1, 1, 11)
@@ -152,4 +152,4 @@ float4 main() : sv_target
[test] todo draw quad -todo probe all rgba (10, 10, 10, 11) +todo(sm<6) probe all rgba (10, 10, 10, 11) diff --git a/tests/hlsl/compute.shader_test b/tests/hlsl/compute.shader_test index 6d2f698c7..35c61daf8 100644 --- a/tests/hlsl/compute.shader_test +++ b/tests/hlsl/compute.shader_test @@ -1,5 +1,6 @@ [require] shader model >= 5.0 +shader model < 6.0
[uav 0] format r32 float diff --git a/tests/hlsl/conditional.shader_test b/tests/hlsl/conditional.shader_test index b3b18dc1a..98addceb6 100644 --- a/tests/hlsl/conditional.shader_test +++ b/tests/hlsl/conditional.shader_test @@ -9,10 +9,10 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 0.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.9, 0.8, 0.7, 0.6) uniform 0 float4 0.1 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.2, 0.3, 0.4)
[pixel shader] @@ -37,10 +37,10 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 0.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.9, 0.8, 0.7, 0.6)
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 u;
float main() : sv_target @@ -80,5 +80,5 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 0.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.9, 0.8, 0.7, 0.6) diff --git a/tests/hlsl/const.shader_test b/tests/hlsl/const.shader_test index ed5899f65..17427c385 100644 --- a/tests/hlsl/const.shader_test +++ b/tests/hlsl/const.shader_test @@ -10,10 +10,10 @@ float4 main() : sv_target [test] uniform 0 float4 1.0 2.0 3.0 4.0 uniform 4 float4 0.1 0.2 0.3 0.4 -draw quad +todo(sm>=6) draw quad probe all rgba (1.1, 2.2, 3.3, 4.4)
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : sv_target { const float f; diff --git a/tests/hlsl/cross.shader_test b/tests/hlsl/cross.shader_test index 101db6071..adc4b3e83 100644 --- a/tests/hlsl/cross.shader_test +++ b/tests/hlsl/cross.shader_test @@ -9,7 +9,7 @@ float4 main(uniform float4 u, uniform float4 v) : sv_target [test] uniform 0 float4 1 -2 3 4 uniform 4 float4 10 100 1000 10000 -draw quad +todo(sm>=6) draw quad probe all rgba (-2300, -970, 120, 0)
@@ -24,5 +24,5 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 1 -2 3 4 -draw quad +todo(sm>=6) draw quad probe all rgba (-20, 8, 12, 3.5) diff --git a/tests/hlsl/d3dcolor-to-ubyte4.shader_test b/tests/hlsl/d3dcolor-to-ubyte4.shader_test index e31ef61ca..946b4766b 100644 --- a/tests/hlsl/d3dcolor-to-ubyte4.shader_test +++ b/tests/hlsl/d3dcolor-to-ubyte4.shader_test @@ -9,7 +9,7 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 -0.5 6.5 7.5 3.4 -draw quad +todo(sm>=6) draw quad probe all rgba (1912.0, 1657.0, -127.0, 867.0) 1
[pixel shader] @@ -20,5 +20,5 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 -0.5 6.5 7.5 3.4 -draw quad +todo(sm>=6) draw quad probe all rgba (-127.0, -127.0, -127.0, -127.0) 1 diff --git a/tests/hlsl/ddxddy.shader_test b/tests/hlsl/ddxddy.shader_test index 4986c233f..3a9c90fd1 100644 --- a/tests/hlsl/ddxddy.shader_test +++ b/tests/hlsl/ddxddy.shader_test @@ -9,7 +9,7 @@ float4 main(float4 pos : sv_position) : sv_target
[test] draw quad -probe all rgba (1.0, 1.0, 0.0, 0.0) +todo(sm>=6) probe all rgba (1.0, 1.0, 0.0, 0.0)
[pixel shader] @@ -29,7 +29,7 @@ float4 main(float4 pos : sv_position) : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe (10, 10) rgba (-16.0, -5.0, 3.0, 0.0) probe (11, 10) rgba (-21.0, -5.0, 3.0, 0.0) probe (10, 11) rgba (-13.0, -5.0, 3.0, 0.0) @@ -55,7 +55,7 @@ float4 main(float4 pos : sv_position) : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe (10, 10) rgba (-16.0, -5.0, 3.0, 0.0) probe (11, 10) rgba (-21.0, -5.0, 3.0, 0.0) probe (10, 11) rgba (-13.0, -5.0, 3.0, 0.0) @@ -74,7 +74,7 @@ float4 main(float4 pos : sv_position) : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe (10, 10) rgba (-0.524999976, -0.164999843, 0.104999900, 0.0) 16 probe (11, 10) rgba (-0.689999819, -0.164999843, 0.114999890, 0.0) 32 probe (10, 11) rgba (-0.420000076, -0.154999852, 0.104999900, 0.0) 32 diff --git a/tests/hlsl/discard.shader_test b/tests/hlsl/discard.shader_test index f543f877b..b52894ea7 100644 --- a/tests/hlsl/discard.shader_test +++ b/tests/hlsl/discard.shader_test @@ -1,3 +1,7 @@ +[require] +shader model < 6.0 + + [pixel shader] uniform float4 x;
diff --git a/tests/hlsl/distance.shader_test b/tests/hlsl/distance.shader_test index 3f5446451..6527c218a 100644 --- a/tests/hlsl/distance.shader_test +++ b/tests/hlsl/distance.shader_test @@ -10,7 +10,7 @@ float4 main() : sv_target [test] uniform 0 float4 -2.0 3.0 4.0 0.1 uniform 4 float4 2.0 -1.0 4.0 5.0 -draw quad +todo(sm>=6) draw quad probe all rgba (7.483983, 7.483983, 7.483983, 7.483983) 1
[pixel shader] diff --git a/tests/hlsl/dot.shader_test b/tests/hlsl/dot.shader_test index 15f120f70..bb71919ce 100644 --- a/tests/hlsl/dot.shader_test +++ b/tests/hlsl/dot.shader_test @@ -10,7 +10,7 @@ float4 main() : SV_TARGET [test] uniform 0 float4 2.0 3.0 4.0 5.0 uniform 4 float4 10.0 11.0 12.0 13.0 -draw quad +todo(sm>=6) draw quad probe all rgba (166.0, 166.0, 166.0, 166.0)
[pixel shader] @@ -25,7 +25,7 @@ float4 main() : SV_TARGET [test] uniform 0 float4 2.0 3.0 0.0 0.0 uniform 4 float4 10.0 11.0 12.0 13.0 -draw quad +todo(sm>=6) draw quad probe all rgba (53.0, 53.0, 53.0, 53.0)
[pixel shader] @@ -40,7 +40,7 @@ float4 main() : SV_TARGET [test] uniform 0 float4 2.0 0.0 0.0 0.0 uniform 4 float4 10.0 11.0 12.0 13.0 -draw quad +todo(sm>=6) draw quad probe all rgba (92.0, 92.0, 92.0, 92.0)
[pixel shader] @@ -55,7 +55,7 @@ float4 main() : SV_TARGET [test] uniform 0 float4 10.0 11.0 12.0 13.0 uniform 4 float4 2.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (92.0, 92.0, 92.0, 92.0)
[pixel shader] @@ -71,7 +71,7 @@ float4 main() : SV_TARGET % Account for both the SM1 and SM4 uniform layout uniform 0 float4 2.0 3.0 0.0 0.0 uniform 4 float4 3.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (6.0, 6.0, 6.0, 6.0)
[pixel shader] diff --git a/tests/hlsl/duplicate-modifiers.shader_test b/tests/hlsl/duplicate-modifiers.shader_test index 6491701ae..4419d4a92 100644 --- a/tests/hlsl/duplicate-modifiers.shader_test +++ b/tests/hlsl/duplicate-modifiers.shader_test @@ -8,4 +8,4 @@ float4 main() : sv_target
[test] draw quad -probe all rgba (0.1, 0.2, 0.3, 0.4) +todo(sm>=6) probe all rgba (0.1, 0.2, 0.3, 0.4) diff --git a/tests/hlsl/entry-point-semantics.shader_test b/tests/hlsl/entry-point-semantics.shader_test index 32cd43c2f..2a7c26927 100644 --- a/tests/hlsl/entry-point-semantics.shader_test +++ b/tests/hlsl/entry-point-semantics.shader_test @@ -7,7 +7,7 @@ void main(out float tex : texcoord, inout float4 pos : sv_position) tex = 0.2; }
-[pixel shader fail] +[pixel shader fail(sm<6)]
float4 main(float tex : texcoord) : sv_target;
@@ -16,7 +16,7 @@ float4 main(float tex) return tex; }
-[pixel shader fail] +[pixel shader fail(sm<6)]
float4 main(float tex) { @@ -63,7 +63,7 @@ void main(out float4 tex[4] : texcoord, inout float4 pos : sv_position)
% Array parameters of non-struct elements must have a semantic. -[pixel shader fail] +[pixel shader fail(sm<6)] float4 main(in float2 arr[2]) : sv_target { return 0.0; @@ -84,7 +84,7 @@ float4 main(in apple a) : sv_target
[test] draw quad -probe (0, 0) rgba (10.0, 20.0, 30.0, 40.0) +todo(sm>=6) probe (0, 0) rgba (10.0, 20.0, 30.0, 40.0)
% Arrays of matrices get successive indexes. @@ -101,7 +101,7 @@ float4 main(in apple a) : sv_target
[test] draw quad -probe (0, 0) rgba (10.0, 11.0, 30.0, 31.0) +todo(sm>=6) probe (0, 0) rgba (10.0, 11.0, 30.0, 31.0)
% Arrays (even multi-dimensional) of struct elements are allowed. The fields in the different struct @@ -120,7 +120,7 @@ float4 main(in apple aps[2][2]) : sv_target
[test] draw quad -probe (0, 0) rgba (10.0, 10.0, 20.0, 20.0) +todo(sm>=6) probe (0, 0) rgba (10.0, 10.0, 20.0, 20.0)
[pixel shader] @@ -142,10 +142,10 @@ float4 main(in banana bans[2]) : sv_target
[test] draw quad -probe (0, 0) rgba (10.0, 11.0, 20.0, 21.0) +todo(sm>=6) probe (0, 0) rgba (10.0, 11.0, 20.0, 21.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] struct apple { float2 miss; // missing semantic. @@ -201,11 +201,11 @@ float4 main(in float4 tex0 : TEXCOORD0, in float4 tex1 : TEXCOORD1) : sv_target
[test] draw quad -probe (0, 0) rgba (1.0, 2.0, 10.0, 20.0) +todo(sm>=6) probe (0, 0) rgba (1.0, 2.0, 10.0, 20.0)
% Output semantics cannot be mapped to more than one value. -[vertex shader fail] +[vertex shader fail(sm<6)] struct apple { float2 tex : TEXCOORD0; @@ -218,7 +218,7 @@ void main(out apple apls[2], inout float4 pos : sv_position) }
-[vertex shader fail] +[vertex shader fail(sm<6)] struct apple { float2 f : SEMANTIC; @@ -232,7 +232,7 @@ void main(out apple a, out apple b, inout float4 pos : sv_position)
% Semantic names are case-insensitive. -[vertex shader fail] +[vertex shader fail(sm<6)] void main(out float2 a : sem0, out float2 b : SEM, inout float4 pos : sv_position) { a = float2(1, 2); @@ -259,7 +259,7 @@ float4 main(in float4 t1 : TEXCOORD0, in float4 t2 : TEXCOORD0) : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe (0, 0) rgba (99.0, 99.0, 10.0, 11.0)
@@ -272,7 +272,7 @@ float4 main(in float4 a : TEXCOORD0, in float3 b : TEXCOORD1) : sv_target
[test] draw quad -probe (0, 0) rgba (10.0, 11.0, 20.0, 21.0) +todo(sm>=6) probe (0, 0) rgba (10.0, 11.0, 20.0, 21.0)
% In SM4, duplicated input semantics can only have different types if they have the same layout and @@ -295,14 +295,14 @@ float4 main(in uint2 a : TEXCOORD0, in int2 b : TEXCOORD0, in int2x1 c : TEXCOOR shader model >= 4.0
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main(in float2 a : TEXCOORD0, in float3 b : TEXCOORD0) : sv_target { return 0.0; }
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main(in float2 a : TEXCOORD0, in int2 b : TEXCOORD0) : sv_target { return 0.0; @@ -311,19 +311,19 @@ float4 main(in float2 a : TEXCOORD0, in int2 b : TEXCOORD0) : sv_target
% For some reason, vectors from row_major matrices are not considered as having the same layout as % regular vectors. -[pixel shader fail todo] +[pixel shader fail(sm<6) todo] float4 main(in float2 a : TEXCOORD0, row_major float1x2 b : TEXCOORD0) : sv_target { return 0.0; }
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main(in float2 a : TEXCOORD0, row_major float2x1 b : TEXCOORD0) : sv_target { return 0.0; }
-[pixel shader fail todo] +[pixel shader fail(sm<6) todo] float4 main(in float4 a : TEXCOORD0, row_major float1x4 b : TEXCOORD0) : sv_target { return 0.0; diff --git a/tests/hlsl/exp.shader_test b/tests/hlsl/exp.shader_test index 1d1889977..38f8750fd 100644 --- a/tests/hlsl/exp.shader_test +++ b/tests/hlsl/exp.shader_test @@ -8,7 +8,7 @@ float4 main() : sv_target
[test] uniform 0 float4 -1.0 0.0 1.0 2.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 1.0, 2.0, 4.0) 2
[pixel shader] @@ -21,5 +21,5 @@ float4 main() : sv_target
[test] uniform 0 float4 -1.0 0.0 1.0 2.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.36787948, 1.0, 2.7182815, 7.38905573) 2 diff --git a/tests/hlsl/expr-indexing.shader_test b/tests/hlsl/expr-indexing.shader_test index 3dcc5727e..1816c6eb7 100644 --- a/tests/hlsl/expr-indexing.shader_test +++ b/tests/hlsl/expr-indexing.shader_test @@ -9,7 +9,7 @@ float4 main() : sv_target [test] uniform 0 float4 1.0 2.0 3.0 4.0 uniform 4 float4 5.0 6.0 7.0 8.0 -draw quad +todo(sm>=6) draw quad probe all rgba (8.0, 8.0, 8.0, 8.0)
@@ -26,7 +26,7 @@ float4 main() : sv_target uniform 0 float4 1.0 2.0 3.0 4.0 uniform 4 float4 5.0 6.0 7.0 8.0 uniform 8 float 2 -draw quad +todo(sm>=6) draw quad probe all rgba (10.0, 10.0, 10.0, 10.0)
@@ -40,7 +40,7 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 2.0 3.0 4.0 -draw quad +todo(sm>=6) draw quad probe all rgba (3.0, 3.0, 3.0, 3.0)
@@ -56,10 +56,10 @@ float4 main() : sv_target [test] uniform 0 float4 1.0 2.0 3.0 4.0 uniform 4 float 0 -draw quad +todo(sm>=6) draw quad probe all rgba (4.0, 4.0, 4.0, 4.0) uniform 4 float 2 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0)
@@ -78,7 +78,7 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 2.0 3.0 4.0 -draw quad +todo(sm>=6) draw quad probe all rgba (4.0, 4.0, 4.0, 4.0)
@@ -99,5 +99,5 @@ float4 main() : sv_target [test] uniform 0 float4 1.0 2.0 3.0 4.0 uniform 4 float 1 -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, 2.0, 2.0, 2.0) diff --git a/tests/hlsl/floor.shader_test b/tests/hlsl/floor.shader_test index c111f98b9..2a294265b 100644 --- a/tests/hlsl/floor.shader_test +++ b/tests/hlsl/floor.shader_test @@ -6,7 +6,7 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 -0.5 6.5 7.5 3.4 -draw quad +todo(sm>=6) draw quad probe all rgba (-1.0, 6.0, 7.0, 3.0) 4
[pixel shader] @@ -20,7 +20,7 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 -0.5 6.5 7.5 3.4 -draw quad +todo(sm>=6) draw quad probe all rgba (6.0, 7.0, -1.0, 3.0) 4
[require] @@ -37,5 +37,5 @@ float4 main(uniform int4 u) : sv_target
[test] uniform 0 int4 -1 6 7 3 -draw quad +todo(sm>=6) draw quad probe all rgba (6.0, 7.0, -1.0, 3.0) 4 diff --git a/tests/hlsl/fmod.shader_test b/tests/hlsl/fmod.shader_test index 9eb69c3bb..412f7ba68 100644 --- a/tests/hlsl/fmod.shader_test +++ b/tests/hlsl/fmod.shader_test @@ -6,10 +6,10 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 -0.5 6.5 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (-0.5, 0.0, 0.0, 0.0) 4 uniform 0 float4 1.1 0.3 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.2, 0.0, 0.0, 0.0) 4
[pixel shader] @@ -20,8 +20,8 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 -0.5 6.5 2.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (-0.5, 0.5, 0.0, 0.0) 4 uniform 0 float4 1.1 0.3 3.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.1, 0.3, 0.0, 0.0) 4 diff --git a/tests/hlsl/for.shader_test b/tests/hlsl/for.shader_test index b68969819..3dd01d862 100644 --- a/tests/hlsl/for.shader_test +++ b/tests/hlsl/for.shader_test @@ -43,7 +43,7 @@ float4 main(float tex : texcoord) : sv_target draw quad probe all rgba (10.0, 45.0, 0.0, 0.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main(float tex : texcoord) : sv_target { int i; diff --git a/tests/hlsl/frac.shader_test b/tests/hlsl/frac.shader_test index f54f3fe88..2ac9b530d 100644 --- a/tests/hlsl/frac.shader_test +++ b/tests/hlsl/frac.shader_test @@ -8,5 +8,5 @@ float4 main() : sv_target
[test] uniform 0 float4 -1.1 1.6 1.3 0.5 -draw quad +todo(sm>=6) draw quad probe all rgba (0.9, 0.6, 0.3, 0.5) 2 diff --git a/tests/hlsl/function-cast.shader_test b/tests/hlsl/function-cast.shader_test index e6a5a96b4..4018dbe4c 100644 --- a/tests/hlsl/function-cast.shader_test +++ b/tests/hlsl/function-cast.shader_test @@ -23,7 +23,7 @@ probe all rgba (-1.0, -1.0, 2.0, 4.0)
% As above, but cast "x" to float4 first.
-[pixel shader todo] +[pixel shader todo fail(sm>=6)]
uniform float4 f;
@@ -46,7 +46,7 @@ probe all rgba (-1.0, -1.0, 2.0, 4.0)
% As above, but declare "x" as float4 and cast it to int4.
-[pixel shader todo] +[pixel shader todo fail(sm>=6)]
uniform float4 f;
diff --git a/tests/hlsl/function-overload.shader_test b/tests/hlsl/function-overload.shader_test index 099f63f34..c5a30b165 100644 --- a/tests/hlsl/function-overload.shader_test +++ b/tests/hlsl/function-overload.shader_test @@ -36,5 +36,5 @@ float4 main() : sv_target }
[test] -todo draw quad +todo(sm<6) draw quad probe all rgba (0.1, 0.2, 0.1, 0.2) diff --git a/tests/hlsl/function-return.shader_test b/tests/hlsl/function-return.shader_test index cbd29749f..08abb398a 100644 --- a/tests/hlsl/function-return.shader_test +++ b/tests/hlsl/function-return.shader_test @@ -32,6 +32,11 @@ float4 main() : sv_target draw quad probe all rgba (0.2, 0.1, 0.8, 0.5);
+ +[require] +shader model < 6.0 + + [pixel shader]
uniform float f; diff --git a/tests/hlsl/function.shader_test b/tests/hlsl/function.shader_test index 0db0477ed..ac531124d 100644 --- a/tests/hlsl/function.shader_test +++ b/tests/hlsl/function.shader_test @@ -89,7 +89,7 @@ float4 main() : sv_target return func(); }
-[pixel shader fail] +[pixel shader fail(sm<6)]
void foo() { @@ -226,7 +226,7 @@ probe all rgba (0.6, 0.1, 0.5, 0)
% Recursion is forbidden.
-[pixel shader notimpl] +[pixel shader notimpl fail(sm>=6)]
void bar();
@@ -246,7 +246,7 @@ float4 main() : sv_target return 0; }
-[pixel shader notimpl] +[pixel shader notimpl fail(sm>=6)]
% Even trivially finite recursion is forbidden.
@@ -317,7 +317,7 @@ probe all rgba (2.0, 3.0, 6.0, 7.0)
% Inline modifier used on entry point
-[pixel shader] +[pixel shader fail(sm>=6)] float func(float a) { return a + 1; diff --git a/tests/hlsl/gather-offset.shader_test b/tests/hlsl/gather-offset.shader_test index 51e6a6b64..6360d1fc8 100644 --- a/tests/hlsl/gather-offset.shader_test +++ b/tests/hlsl/gather-offset.shader_test @@ -23,7 +23,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.2, 0.2, 0.1)
@@ -37,7 +37,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.1, 0.1, 0.0)
@@ -55,7 +55,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.2, 0.2, 0.1, 0.1)
@@ -69,7 +69,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.1, 0.0, 0.0)
@@ -83,7 +83,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 0.0, 0.5, 0.0)
@@ -97,5 +97,5 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.4, 0.0, 0.4) diff --git a/tests/hlsl/gather.shader_test b/tests/hlsl/gather.shader_test index 28fd6f9a5..9cfc2d599 100644 --- a/tests/hlsl/gather.shader_test +++ b/tests/hlsl/gather.shader_test @@ -23,7 +23,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.1, 0.1, 0.0)
@@ -37,7 +37,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.2, 0.2, 0.1)
@@ -55,7 +55,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.1, 0.0, 0.0)
@@ -69,7 +69,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.2, 0.2, 0.1, 0.1)
@@ -97,7 +97,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.5, 0.0, 0.5)
@@ -111,5 +111,5 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.4, 0.0, 0.4, 0.0) diff --git a/tests/hlsl/getdimensions.shader_test b/tests/hlsl/getdimensions.shader_test index 4d781b320..01d12f87a 100644 --- a/tests/hlsl/getdimensions.shader_test +++ b/tests/hlsl/getdimensions.shader_test @@ -28,7 +28,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, 3.0, 2.0, 3.0)
[texture 1] @@ -53,5 +53,5 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, 2.0, 1.0, 2.0) diff --git a/tests/hlsl/initializer-implicit-array.shader_test b/tests/hlsl/initializer-implicit-array.shader_test index 38c8234cb..5d86fe68e 100644 --- a/tests/hlsl/initializer-implicit-array.shader_test +++ b/tests/hlsl/initializer-implicit-array.shader_test @@ -22,7 +22,7 @@ float4 main() : sv_target
[test] draw quad -probe all rgba (5.0, 6.0, 7.0, 8.0) +todo(sm>=6) probe all rgba (5.0, 6.0, 7.0, 8.0)
[pixel shader] @@ -121,7 +121,7 @@ float4 main() : sv_target }
-[pixel shader fail] +[pixel shader fail(sm<6)] // Implicit size array as function argument float4 fun(float4 arr[]) { @@ -150,18 +150,7 @@ float4 main() : sv_target }
-[pixel shader fail] -// Implicit size array as a cast -float4 main() : sv_target -{ - float2 arr1[4] = {1, 2, 3, 4, 5, 6, 7, 8}; - float4 arr2[2] = (float4 []) arr1; - - return 0.0; -} - - -[pixel shader fail] +[pixel shader fail(sm<6)] // Implicit size array as a typedef typedef float4 arrtype[];
@@ -174,52 +163,67 @@ float4 main() : sv_target
[pixel shader fail] -// Implicit size array of elements of size 0 +// Implicit size array of elements of size 0, without initializer struct emp { };
float4 main() : sv_target { - struct emp arr[] = {1, 2, 3, 4}; + struct emp arr[];
return 0.0; }
[pixel shader fail] -// Implicit size array of elements of size 0, without initializer +// Implicit size array with an initializer of size 0 struct emp { };
float4 main() : sv_target { - struct emp arr[]; + float4 arr[] = (struct emp) 42;
return 0.0; }
+[require] +shader model < 6.0 + + [pixel shader fail] -// Broadcast to an implicit size array +// Implicit size array as a cast float4 main() : sv_target { - int a[4] = (int[]) 0; + float2 arr1[4] = {1, 2, 3, 4, 5, 6, 7, 8}; + float4 arr2[2] = (float4 []) arr1;
return 0.0; }
[pixel shader fail] -// Implicit size array with an initializer of size 0 +// Implicit size array of elements of size 0 struct emp { };
float4 main() : sv_target { - float4 arr[] = (struct emp) 42; + struct emp arr[] = {1, 2, 3, 4}; + + return 0.0; +} + + +[pixel shader fail] +// Broadcast to an implicit size array +float4 main() : sv_target +{ + int a[4] = (int[]) 0;
return 0.0; } diff --git a/tests/hlsl/initializer-objects.shader_test b/tests/hlsl/initializer-objects.shader_test index d9c0bc91c..514a7cebb 100644 --- a/tests/hlsl/initializer-objects.shader_test +++ b/tests/hlsl/initializer-objects.shader_test @@ -25,7 +25,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.2, 0.2, 0.2, 0.1)
@@ -48,7 +48,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (31.1, 41.1, 51.1, 61.1) 1
diff --git a/tests/hlsl/intrinsic-override.shader_test b/tests/hlsl/intrinsic-override.shader_test index 55a23f21d..a88392a65 100644 --- a/tests/hlsl/intrinsic-override.shader_test +++ b/tests/hlsl/intrinsic-override.shader_test @@ -1,4 +1,4 @@ -[pixel shader] +[pixel shader fail(sm>=6)]
float2 max(float2 a, float2 b) { @@ -14,7 +14,7 @@ float4 main() : sv_target draw quad probe all rgba (0.3, 0.3, 0.4, 0.6)
-[pixel shader] +[pixel shader fail(sm>=6)]
float2 max(float2 a, float3 b) { diff --git a/tests/hlsl/invalid.shader_test b/tests/hlsl/invalid.shader_test index ad0626520..422f094d0 100644 --- a/tests/hlsl/invalid.shader_test +++ b/tests/hlsl/invalid.shader_test @@ -58,14 +58,14 @@ float4 main(float2 pos : TEXCOORD0) : sv_target return pos; }
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : sv_target { float a[0]; return 0; }
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : sv_target { float a[65537]; @@ -86,33 +86,33 @@ uniform float4 main() : sv_target return 0; }
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() { return 0; }
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main(out float4 o : sv_target) { o = 1; return 0; }
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main(out float4 o) : sv_target { o = 1; return 0; }
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main(in float4 i) : sv_target { return 0; }
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main(float4 i) : sv_target { return 0; @@ -126,14 +126,14 @@ float4 main() : sv_target return 0; }
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : sv_target { const float4 x; return x; }
-[pixel shader fail] +[pixel shader fail(sm<6)] struct input { float4 a; @@ -144,7 +144,7 @@ float4 main(struct input i) : sv_target return i.a; }
-[pixel shader fail] +[pixel shader fail(sm<6)] struct output { float4 t : sv_target; @@ -186,7 +186,7 @@ void main(out float4 o : sv_target) sub(o); }
-[pixel shader fail] +[pixel shader fail(sm<6)] void sub(in out uniform float4 o) { } @@ -211,7 +211,7 @@ float4 main(void) : sv_target return 0; }
-[pixel shader fail] +[pixel shader fail(sm<6)] const const float4 c;
float4 main() : sv_target @@ -233,7 +233,7 @@ float4 main() : sv_target return a.a; }
-[pixel shader fail] +[pixel shader fail(sm<6)] struct apple { sampler sam; diff --git a/tests/hlsl/is-front-face.shader_test b/tests/hlsl/is-front-face.shader_test index 11447d262..162d4e634 100644 --- a/tests/hlsl/is-front-face.shader_test +++ b/tests/hlsl/is-front-face.shader_test @@ -22,7 +22,7 @@ float4 main(bool face : sv_isfrontface) : sv_target }
[test] -draw triangle strip 4 +todo(sm>=6) draw triangle strip 4 probe all rgba (0.0, 1.0, 0.0, 1.0)
[vertex buffer 0] @@ -32,5 +32,5 @@ probe all rgba (0.0, 1.0, 0.0, 1.0) 2.0 2.0
[test] -draw triangle strip 4 +todo(sm>=6) draw triangle strip 4 probe all rgba (1.0, 2.0, 1.0, 2.0) diff --git a/tests/hlsl/ldexp.shader_test b/tests/hlsl/ldexp.shader_test index f8ad40d8e..2db624067 100644 --- a/tests/hlsl/ldexp.shader_test +++ b/tests/hlsl/ldexp.shader_test @@ -10,7 +10,7 @@ float4 main() : SV_TARGET [test] uniform 0 float4 2.0 3.0 4.0 5.0 uniform 4 float4 0.0 -10.0 10.0 100.0 -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, 0.00292968750, 4096.0, 6.33825300e+030) 2
[require] @@ -28,7 +28,7 @@ float4 main() : SV_TARGET [test] uniform 0 int4 2 3 4 5 uniform 4 int4 0 -10 10 100 -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, 0.00292968750, 4096.0, 6.33825300e+030) 2
diff --git a/tests/hlsl/length.shader_test b/tests/hlsl/length.shader_test index d5a708e27..8653942e0 100644 --- a/tests/hlsl/length.shader_test +++ b/tests/hlsl/length.shader_test @@ -8,7 +8,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 2.0 3.0 4.0 5.0 -draw quad +todo(sm>=6) draw quad probe all rgba (7.34846926, 7.34846926, 7.34846926, 7.34846926) 1
[pixel shader] @@ -21,7 +21,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 2.0 3.0 4.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (5.38516474, 5.38516474, 5.38516474, 5.38516474) 1
[pixel shader] @@ -34,7 +34,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 2.0 3.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (3.60555124, 3.60555124, 3.60555124, 3.60555124) 1
[pixel shader] @@ -47,7 +47,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 2.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, 2.0, 2.0, 2.0)
[pixel shader] @@ -60,7 +60,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 2.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, 2.0, 2.0, 2.0)
[pixel shader fail] diff --git a/tests/hlsl/lerp.shader_test b/tests/hlsl/lerp.shader_test index 15e90cef9..27c45fe7d 100644 --- a/tests/hlsl/lerp.shader_test +++ b/tests/hlsl/lerp.shader_test @@ -12,7 +12,7 @@ float4 main() : SV_TARGET uniform 0 float4 2.0 3.0 4.0 5.0 uniform 4 float4 0.0 -10.0 10.0 100.0 uniform 8 float4 0.0 1.0 -1.0 0.75 -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, -10.0, -2.0, 76.25)
[require] @@ -32,7 +32,7 @@ float4 main() : SV_TARGET uniform 0 int4 2 3 4 0 uniform 4 int4 0 -10 10 1000000 uniform 8 int4 0 1 -1 1000000 -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, -10.0, -2.0, 1e12)
diff --git a/tests/hlsl/lit.shader_test b/tests/hlsl/lit.shader_test index cbfffb4ee..f59a582e1 100644 --- a/tests/hlsl/lit.shader_test +++ b/tests/hlsl/lit.shader_test @@ -6,17 +6,17 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 -0.1 10.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 0.0, 0.0, 1.0)
[test] uniform 0 float4 1.2 -0.1 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.2, 0.0, 1.0)
[test] uniform 0 float4 1.2 2.0 3.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.2, 8.0, 1.0)
[pixel shader] @@ -27,7 +27,7 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 1.2 2.0 3.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, 2.4, 16.0, 2.0)
[pixel shader fail] diff --git a/tests/hlsl/load-level.shader_test b/tests/hlsl/load-level.shader_test index 0f64bd5d5..9df2f01fb 100644 --- a/tests/hlsl/load-level.shader_test +++ b/tests/hlsl/load-level.shader_test @@ -22,10 +22,10 @@ float4 main() : sv_target
[test] uniform 0 uint 0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 0.0, 1.0, 0.0) uniform 0 uint 1 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 1.0, 0.0)
[pixel shader fail] @@ -47,5 +47,5 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 0.0, 1.0, 0.0) diff --git a/tests/hlsl/log.shader_test b/tests/hlsl/log.shader_test index b0f405d11..2f7d5c7c0 100644 --- a/tests/hlsl/log.shader_test +++ b/tests/hlsl/log.shader_test @@ -8,7 +8,7 @@ float4 main() : sv_target
[test] uniform 0 float4 2.0 4.0 5.0 0.4 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 2.0, 2.32192802, -1.32192802) 1
[pixel shader] @@ -21,7 +21,7 @@ float4 main() : sv_target
[test] uniform 0 float4 10.0 100.0 1.0 0.1 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 2.0, 0.0, -1.0) 1
[pixel shader] @@ -34,5 +34,5 @@ float4 main() : sv_target
[test] uniform 0 float4 3.0 10.0 1.0 0.1 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0986123, 2.302585, 0.0, -2.302585) 2 diff --git a/tests/hlsl/loop.shader_test b/tests/hlsl/loop.shader_test index 75a31f7af..2f70b1dc0 100644 --- a/tests/hlsl/loop.shader_test +++ b/tests/hlsl/loop.shader_test @@ -16,7 +16,7 @@ float4 main() : sv_target
[test] uniform 0 float 5.0 -draw quad +todo(sm>=6) draw quad probe all rgba (50.0, 50.0, 50.0, 50.0)
@@ -39,5 +39,5 @@ float4 main() : sv_target
[test] uniform 0 float 4.0 -draw quad +todo(sm>=6) draw quad probe all rgba (20.0, 20.0, 20.0, 20.0) diff --git a/tests/hlsl/majority-pragma.shader_test b/tests/hlsl/majority-pragma.shader_test index 808313e70..f7baa90b9 100644 --- a/tests/hlsl/majority-pragma.shader_test +++ b/tests/hlsl/majority-pragma.shader_test @@ -17,7 +17,7 @@ uniform 0 float4 0.1 0.2 0.0 0.0 uniform 4 float4 0.3 0.4 0.0 0.0 uniform 8 float4 0.1 0.3 0.0 0.0 uniform 12 float4 0.2 0.4 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.17, 0.39, 0.17, 0.39) 1
@@ -40,7 +40,7 @@ float4 main() : sv_target [test] uniform 0 float4 0.1 0.2 0.0 0.0 uniform 4 float4 0.3 0.4 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.2, 0.3, 0.4)
@@ -61,7 +61,7 @@ uniform 0 float4 0.0 0.0 0.0 0.0 uniform 4 float4 0.0 0.0 0.0 0.0 uniform 8 float4 0.5 0.6 0.0 0.0 uniform 12 float4 0.7 0.8 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 0.6, 0.7, 0.8)
@@ -90,7 +90,7 @@ float4 main() : sv_target [test] uniform 0 float4 0.1 0.2 0.0 0.0 uniform 4 float4 0.3 0.4 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.23, 0.34, 0.5, 0.5) 1
@@ -111,7 +111,7 @@ float4 main() : sv_target [test] uniform 0 float4 0.1 0.2 0.0 0.0 uniform 4 float4 0.3 0.4 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.2, 0.3, 0.4)
@@ -149,7 +149,7 @@ uniform 0 float4 0.3 0.4 0.0 0.0 uniform 4 float4 0.0 0.0 0.0 0.0 uniform 8 float4 0.0 0.0 0.0 0.0 uniform 12 float4 0.5 0.6 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.3, 0.4, 0.5, 0.6)
@@ -173,7 +173,7 @@ float4 main() : sv_target [test] uniform 0 float4 0.1 0.2 0.0 0.0 uniform 4 float4 0.3 0.4 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.2, 0.3, 0.4)
@@ -201,7 +201,7 @@ float4 main() : sv_target [test] uniform 0 float4 0.2 0.4 0.0 0.0 uniform 4 float4 0.3 0.5 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.2, 0.3, 0.4, 0.5)
@@ -221,7 +221,7 @@ uniform 0 float4 0.3 0.0 0.0 0.0 uniform 4 float4 0.4 0.0 0.0 0.0 uniform 8 float4 0.0 0.5 0.0 0.0 uniform 12 float4 0.0 0.6 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.3, 0.4, 0.5, 0.6)
% Compiler options @@ -245,7 +245,7 @@ uniform 0 float4 0.1 0.5 0.9 1.3 uniform 4 float4 0.2 0.6 1.0 1.4 uniform 8 float4 0.3 0.7 1.1 1.5 uniform 12 float4 0.4 0.8 1.2 1.6 -draw quad +todo(sm>=6) draw quad probe all rgba (0.2, 0.3, 0.6, 0.7) 1
[require] @@ -267,7 +267,7 @@ uniform 0 float4 0.1 0.5 0.9 1.3 uniform 4 float4 0.2 0.6 1.0 1.4 uniform 8 float4 0.3 0.7 1.1 1.5 uniform 12 float4 0.4 0.8 1.2 1.6 -draw quad +todo(sm>=6) draw quad probe all rgba (0.2, 0.3, 0.6, 0.7) 1
[require] @@ -289,7 +289,7 @@ uniform 0 float4 0.1 0.5 0.9 1.3 uniform 4 float4 0.2 0.6 1.0 1.4 uniform 8 float4 0.3 0.7 1.1 1.5 uniform 12 float4 0.4 0.8 1.2 1.6 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 0.9, 0.6, 1.0) 1
[require] @@ -317,7 +317,7 @@ uniform 16 float4 1.7 2.1 2.5 2.9 uniform 20 float4 1.8 2.2 2.6 3.0 uniform 24 float4 1.9 2.3 2.7 3.1 uniform 28 float4 2.0 2.4 2.8 3.2 -draw quad +todo(sm>=6) draw quad probe all rgba (0.3, 0.4, 2.5, 2.9) 1
[require] @@ -345,7 +345,7 @@ uniform 16 float4 1.7 2.1 2.5 2.9 uniform 20 float4 1.8 2.2 2.6 3.0 uniform 24 float4 1.9 2.3 2.7 3.1 uniform 28 float4 2.0 2.4 2.8 3.2 -draw quad +todo(sm>=6) draw quad probe all rgba (1.2, 1.6, 3.1, 3.2) 1
[require] @@ -365,5 +365,5 @@ float4 main() : sv_target [test] uniform 0 float4 0.1 0.2 0.0 0.0 uniform 4 float4 0.3 0.4 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.3, 0.2, 0.4) 1 diff --git a/tests/hlsl/majority-syntax.shader_test b/tests/hlsl/majority-syntax.shader_test index 4ab385a5d..63e5d2986 100644 --- a/tests/hlsl/majority-syntax.shader_test +++ b/tests/hlsl/majority-syntax.shader_test @@ -11,10 +11,10 @@ float4 main() : sv_target [test] uniform 0 float4 0.1 0.3 0.0 0.0 uniform 4 float4 0.2 0.4 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.3, 0.2, 0.4)
-[pixel shader fail] +[pixel shader fail(sm<6)] row_major row_major float4x4 m;
float4 main() : sv_target diff --git a/tests/hlsl/majority-typedef.shader_test b/tests/hlsl/majority-typedef.shader_test index 1460e9a08..fa62dd5f7 100644 --- a/tests/hlsl/majority-typedef.shader_test +++ b/tests/hlsl/majority-typedef.shader_test @@ -18,5 +18,5 @@ uniform 0 float4 0.1 0.2 0.0 0.0 uniform 4 float4 0.3 0.4 0.0 0.0 uniform 8 float4 0.1 0.3 0.0 0.0 uniform 12 float4 0.2 0.4 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.17, 0.39, 0.17, 0.39) 1 diff --git a/tests/hlsl/math.shader_test b/tests/hlsl/math.shader_test index 6bd9656d8..b7639de12 100644 --- a/tests/hlsl/math.shader_test +++ b/tests/hlsl/math.shader_test @@ -11,5 +11,5 @@ float4 main(uniform float4 a, uniform float2 b) : SV_TARGET [test] uniform 0 float4 2.5 0.3 0.2 0.7 uniform 4 float4 0.1 1.5 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (-12.43, 9.833333, 1.6, 35.0) 1 diff --git a/tests/hlsl/matrix-indexing.shader_test b/tests/hlsl/matrix-indexing.shader_test index a57d8fb8b..7cc49edd3 100644 --- a/tests/hlsl/matrix-indexing.shader_test +++ b/tests/hlsl/matrix-indexing.shader_test @@ -11,7 +11,7 @@ uniform 0 float4 1.0 2.0 3.0 4.0 uniform 4 float4 5.0 6.0 7.0 8.0 uniform 8 float4 9.0 10.0 11.0 12.0 uniform 12 float4 13.0 14.0 15.0 16.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 2.0, 10.0, 15.0)
[pixel shader] @@ -27,7 +27,7 @@ uniform 0 float4 1.0 2.0 3.0 4.0 uniform 4 float4 5.0 6.0 7.0 8.0 uniform 8 float4 9.0 10.0 11.0 12.0 uniform 12 float4 13.0 14.0 15.0 16.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 2.0, 10.0, 15.0)
[pixel shader] @@ -43,7 +43,7 @@ uniform 0 float4 1.0 2.0 3.0 4.0 uniform 4 float4 5.0 6.0 7.0 8.0 uniform 8 float4 9.0 10.0 11.0 12.0 uniform 12 float4 13.0 14.0 15.0 16.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 5.0, 7.0, 12.0)
[pixel shader] @@ -58,7 +58,7 @@ float4 main() : SV_TARGET [test] uniform 0 float4 1.0 2.0 3.0 0.0 uniform 4 float4 5.0 6.0 7.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 3.0, 6.0, 7.0)
[pixel shader] @@ -120,7 +120,7 @@ float4 main() : sv_target
[test] uniform 0 float 2 -draw quad +todo(sm>=6) draw quad probe all rgba (8, 9, 10, 11)
@@ -137,4 +137,4 @@ float4 main() : sv_target [test] uniform 0 float 3 todo draw quad -todo probe all rgba (12, 13, 14, 15) +todo(sm<6) probe all rgba (12, 13, 14, 15) diff --git a/tests/hlsl/matrix-semantics.shader_test b/tests/hlsl/matrix-semantics.shader_test index b704dc1a6..75f2af049 100644 --- a/tests/hlsl/matrix-semantics.shader_test +++ b/tests/hlsl/matrix-semantics.shader_test @@ -44,7 +44,7 @@ row_major float4x1 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe render target 0 all r (1.0) probe render target 1 all r (2.0) probe render target 2 all r (3.0) @@ -57,13 +57,13 @@ float1x4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe render target 0 all r (1.0) probe render target 1 all r (2.0) probe render target 2 all r (3.0) probe render target 3 all r (4.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] void main(out float1x2 x : sv_target0, out float1x2 y : sv_target1) { x = float2(1.0, 2.0); @@ -78,7 +78,7 @@ void main(out float1x2 x : sv_target0, out float1x2 y : sv_target2) }
[test] -draw quad +todo(sm>=6) draw quad probe render target 0 all r (1.0) probe render target 1 all r (2.0) probe render target 2 all r (5.0) @@ -96,7 +96,7 @@ void main(out row_major float1x4 x : sv_target0, out float1x2 y : sv_target1) }
[test] -draw quad +todo(sm>=6) draw quad probe render target 0 all rgba (1.0, 2.0, 3.0, 4.0) probe render target 1 all r (5.0) probe render target 2 all r (6.0) diff --git a/tests/hlsl/max.shader_test b/tests/hlsl/max.shader_test index 3a5c3125a..648ab5d0c 100644 --- a/tests/hlsl/max.shader_test +++ b/tests/hlsl/max.shader_test @@ -6,7 +6,7 @@ float4 main(uniform float2 u) : sv_target
[test] uniform 0 float4 0.7 -0.1 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.7, 2.1, 2.0, -1.0)
@@ -20,7 +20,7 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 0.7 -0.1 0.4 0.8 -draw quad +todo(sm>=6) draw quad probe all rgba (0.7, 0.8, 0.7, 0.2)
diff --git a/tests/hlsl/nested-arrays.shader_test b/tests/hlsl/nested-arrays.shader_test index 66ae93e10..b7aeec442 100644 --- a/tests/hlsl/nested-arrays.shader_test +++ b/tests/hlsl/nested-arrays.shader_test @@ -1,4 +1,4 @@ -[pixel shader fail] +[pixel shader fail(sm<6)] uniform float4 color[2][3];
float4 main() : sv_target @@ -21,5 +21,5 @@ uniform 8 float4 0.3 0.0 0.0 0.0 uniform 12 float4 0.4 0.0 0.0 0.0 uniform 16 float4 0.5 0.0 0.0 0.0 uniform 20 float4 0.6 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.4, 0.1, 0.6, 0.3) diff --git a/tests/hlsl/nointerpolation.shader_test b/tests/hlsl/nointerpolation.shader_test index 8f15be6ed..86492e52f 100644 --- a/tests/hlsl/nointerpolation.shader_test +++ b/tests/hlsl/nointerpolation.shader_test @@ -23,5 +23,5 @@ float4 main(nointerpolation float4 t : texcoord) : sv_target }
[test] -draw triangle list 3 +todo(sm>=6) draw triangle list 3 probe all rgba (0.0, 1.0, 0.0, 1.0) diff --git a/tests/hlsl/normalize.shader_test b/tests/hlsl/normalize.shader_test index 359a7590d..0fe0dea3c 100644 --- a/tests/hlsl/normalize.shader_test +++ b/tests/hlsl/normalize.shader_test @@ -8,7 +8,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 2.0 3.0 4.0 5.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.272165537, 0.408248305, 0.544331074, 0.680413842) 2
[pixel shader] @@ -21,7 +21,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 2.0 3.0 4.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.371390700, 0.557086051, 0.742781401, 0.0) 1
[pixel shader] @@ -34,7 +34,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 2.0 3.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.554700196, 0.832050323, 0.0, 0.0) 1
[pixel shader] @@ -47,7 +47,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 2.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0)
[pixel shader] @@ -60,7 +60,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 2.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0)
[pixel shader fail] diff --git a/tests/hlsl/numeric-types.shader_test b/tests/hlsl/numeric-types.shader_test index 7504f95aa..dfdd7a538 100644 --- a/tests/hlsl/numeric-types.shader_test +++ b/tests/hlsl/numeric-types.shader_test @@ -38,7 +38,7 @@ vector main() : sv_target return ret; }
-[pixel shader fail] +[pixel shader fail(sm<6)] vector main() : sv_target { vector<float> ret = vector(1.0, 2.0, 3.0, 4.0); @@ -71,7 +71,7 @@ float4 main() : sv_target draw quad probe all rgba (5.0, 6.0, 7.0, 0.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : sv_target { matrix m = matrix<float>(1.0, 2.0, 3.0, 4.0, @@ -81,7 +81,7 @@ float4 main() : sv_target return m[1]; }
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : sv_target { matrix m = matrix<float, 4>(1.0, 2.0, 3.0, 4.0, diff --git a/tests/hlsl/numthreads.shader_test b/tests/hlsl/numthreads.shader_test index 404d7d763..9daab77b9 100644 --- a/tests/hlsl/numthreads.shader_test +++ b/tests/hlsl/numthreads.shader_test @@ -2,6 +2,7 @@
[require] shader model >= 5.0 +shader model < 6.0
[compute shader]
diff --git a/tests/hlsl/object-field-offsets.shader_test b/tests/hlsl/object-field-offsets.shader_test index 8afd9af7d..d1741c3e4 100644 --- a/tests/hlsl/object-field-offsets.shader_test +++ b/tests/hlsl/object-field-offsets.shader_test @@ -19,7 +19,7 @@ float4 main() : sv_target [test] uniform 0 float4 1.0 2.0 3.0 4.0 uniform 4 float4 5.0 6.0 7.0 8.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 2.0, 3.0, 0.0)
@@ -45,7 +45,7 @@ float4 main() : sv_target [test] uniform 0 float4 1.0 2.0 3.0 4.0 uniform 4 float4 5.0 6.0 7.0 8.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 2.0, 5.0, 0.0)
@@ -66,5 +66,5 @@ float4 main() : sv_target [test] uniform 0 float4 1.0 2.0 3.0 4.0 uniform 4 float4 5.0 6.0 7.0 8.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 2.0, 5.0, 0.0) diff --git a/tests/hlsl/object-parameters.shader_test b/tests/hlsl/object-parameters.shader_test index c6109aef7..b828288e7 100644 --- a/tests/hlsl/object-parameters.shader_test +++ b/tests/hlsl/object-parameters.shader_test @@ -7,6 +7,10 @@ float4 main(out Texture2D tex : TEXTURE) : sv_target }
+[require] +shader model < 6.0 + + [pixel shader fail todo] struct params { @@ -110,7 +114,7 @@ float4 main(struct apple input) : sv_target
[test] todo draw quad -todo probe all rgba (416.0, 416.0, 416.0, 111.0) +todo(sm<6) probe all rgba (416.0, 416.0, 416.0, 111.0)
[pixel shader todo] @@ -133,7 +137,7 @@ float4 main(struct apple input, sampler samp) : sv_target
[test] todo draw quad -todo probe all rgba (1.0, 1.0, 0.5, 0.5) +todo(sm<6) probe all rgba (1.0, 1.0, 0.5, 0.5)
[sampler 0] @@ -179,4 +183,4 @@ float4 main(struct apple input, sampler samp) : sv_target
[test] todo draw quad -todo probe all rgba (0.5, 1.0, 0.5, 1.0) +todo(sm<6) probe all rgba (0.5, 1.0, 0.5, 1.0) diff --git a/tests/hlsl/object-references.shader_test b/tests/hlsl/object-references.shader_test index 5ed4dcd63..3e056c3d9 100644 --- a/tests/hlsl/object-references.shader_test +++ b/tests/hlsl/object-references.shader_test @@ -1,4 +1,4 @@ -[pixel shader fail] +[pixel shader fail(sm<6)] sampler sam;
float4 main() : sv_target @@ -46,7 +46,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (77.77, 77.77, 77.77, 77.77)
@@ -73,7 +73,7 @@ float4 main(float4 pos : sv_position) : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe (0, 0) rgba (0.1, 0.2, 0.3, 0.4) probe (1, 0) rgba (0.5, 0.7, 0.6, 0.8) probe (0, 1) rgba (0.6, 0.5, 0.2, 0.1) @@ -111,7 +111,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (312, 312, 312, 111)
@@ -134,11 +134,11 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (2132, 2132, 2132, 1111)
-[pixel shader fail] +[pixel shader fail(sm<6)] Texture2D tex[3]; uniform int n;
@@ -158,7 +158,7 @@ float4 main() : sv_target }
-[pixel shader fail] +[pixel shader fail(sm<6)] // Note: Only valid in shader model 5.1 Texture2D tex[3]; uniform int n; @@ -169,7 +169,7 @@ float4 main() : sv_target }
-[pixel shader fail] +[pixel shader fail(sm<6)] // Note: Only valid in shader model 5.1 RWTexture2D<float4> tex[3]; uniform int n; @@ -202,11 +202,11 @@ float4 main() : sv_target
[test] uniform 0 float 10.0 -draw quad +todo(sm>=6) draw quad probe (0, 0) rgba (11.0, 12.0, 13.0, 11.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main(Texture2D tex2) : sv_target { Texture2D tex1; @@ -237,4 +237,4 @@ float4 main(struct apple input) : sv_target
[test] todo draw quad -todo probe (0, 0) rgba (1.0, 2.0, 3.0, 4.0) +todo(sm<6) probe (0, 0) rgba (1.0, 2.0, 3.0, 4.0) diff --git a/tests/hlsl/pow.shader_test b/tests/hlsl/pow.shader_test index 1bb3bd944..1fcce40f0 100644 --- a/tests/hlsl/pow.shader_test +++ b/tests/hlsl/pow.shader_test @@ -6,7 +6,7 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 0.4 0.8 2.5 2.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.512, 0.101192884, 0.64, 0.25) 4
diff --git a/tests/hlsl/reflect.shader_test b/tests/hlsl/reflect.shader_test index 02488589b..808b4b772 100644 --- a/tests/hlsl/reflect.shader_test +++ b/tests/hlsl/reflect.shader_test @@ -10,7 +10,7 @@ float4 main() : sv_target [test] uniform 0 float4 0.5 -0.1 0.2 0.3 uniform 4 float4 0.6 0.4 -0.3 1.0 -draw quad +todo(sm>=6) draw quad probe all rgba (-0.1, -0.5, 0.5, -0.7) 4
[pixel shader] @@ -27,7 +27,7 @@ float4 main() : sv_target [test] uniform 0 float4 0.5 0.0 0.0 0.0 uniform 4 float4 0.6 0.4 -0.3 1.0 -draw quad +todo(sm>=6) draw quad probe all rgba (-0.52, -0.18, 1.01, -1.2) 4
[pixel shader] @@ -44,7 +44,7 @@ float4 main() : sv_target [test] uniform 0 float4 0.5 -0.1 0.2 0.3 uniform 4 float4 0.6 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (-0.148, -0.748, -0.448, -0.348) 4
[pixel shader] @@ -62,7 +62,7 @@ float4 main() : sv_target [test] uniform 0 float4 0.5 0.0 0.0 0.0 uniform 4 float4 0.6 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.14, 0.14, 0.14, 0.14) 4
[pixel shader] @@ -79,7 +79,7 @@ float4 main() : sv_target [test] uniform 0 float4 0.5 -0.1 0.0 0.0 uniform 4 float4 0.6 0.4 -0.3 1.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.188, -0.308, 0.0, 0.0) 4
[pixel shader] @@ -97,5 +97,5 @@ float4 main() : sv_target [test] uniform 0 float4 0.5 -0.1 0.2 0.0 uniform 4 float4 0.6 0.4 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.188, -0.308, 0.0, 0.0) 4 diff --git a/tests/hlsl/register-reservations.shader_test b/tests/hlsl/register-reservations.shader_test index 7e109ecad..92a986ba0 100644 --- a/tests/hlsl/register-reservations.shader_test +++ b/tests/hlsl/register-reservations.shader_test @@ -34,7 +34,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (41.0, 41.0, 41.0, 1089.0)
@@ -50,7 +50,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 0.0, 99.0)
@@ -65,7 +65,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 99.0)
@@ -80,12 +80,12 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 0.0, 99.0)
% Register reservation with incorrect register type. -[pixel shader] +[pixel shader fail(sm>=6)] sampler2D unused : register(t0); Texture2D tex;
@@ -97,7 +97,7 @@ float4 main() : sv_target
[test] draw quad -probe all rgba (0.0, 0.0, 0.0, 99.0) +todo(sm>=6) probe all rgba (0.0, 0.0, 0.0, 99.0)
[pixel shader] Texture2D unused[2][2] : register(t0); @@ -109,7 +109,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (4.0, 4.0, 4.0, 99.0)
@@ -125,7 +125,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 99.0)
@@ -140,7 +140,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, 2.0, 2.0, 99.0)
@@ -154,5 +154,5 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, 2.0, 2.0, 99.0) diff --git a/tests/hlsl/return-implicit-conversion.shader_test b/tests/hlsl/return-implicit-conversion.shader_test index 1767748be..7070b28ae 100644 --- a/tests/hlsl/return-implicit-conversion.shader_test +++ b/tests/hlsl/return-implicit-conversion.shader_test @@ -165,7 +165,7 @@ float4 main() : sv_target draw quad probe all rgba (0.4, 0.3, 0.2, 0.0)
-[pixel shader fail todo] +[pixel shader fail(sm<6) todo] float3x1 func() { return float4(0.4, 0.3, 0.2, 0.1); diff --git a/tests/hlsl/return.shader_test b/tests/hlsl/return.shader_test index 9f800d1a7..96270bed8 100644 --- a/tests/hlsl/return.shader_test +++ b/tests/hlsl/return.shader_test @@ -38,10 +38,10 @@ float4 main() : sv_target
[test] uniform 0 float 0.2 -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.2, 0.3, 0.4) uniform 0 float 0.8 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 0.6, 0.7, 0.8)
[pixel shader] @@ -65,12 +65,17 @@ void main(out float4 ret : sv_target)
[test] uniform 0 float 0.2 -draw quad +todo(sm>=6) draw quad probe all rgba (0.3, 0.4, 0.5, 0.6) uniform 0 float 0.8 -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.2, 0.3, 0.4)
+ +[require] +shader model < 6.0 + + [pixel shader]
uniform float f; diff --git a/tests/hlsl/round.shader_test b/tests/hlsl/round.shader_test index 5e40dc6dd..0df2b56d1 100644 --- a/tests/hlsl/round.shader_test +++ b/tests/hlsl/round.shader_test @@ -6,7 +6,7 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 -0.4 -6.6 7.6 3.4 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, -7.0, 8.0, 3.0) 4
@@ -22,7 +22,7 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 -0.4 -6.6 7.6 3.4 -draw quad +todo(sm>=6) draw quad probe all rgba (-7.0, 8.0, 0.0, 3.0) 4
@@ -36,5 +36,5 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 -1 0 2 10 -draw quad +todo(sm>=6) draw quad probe all rgba (-1.0, 0.0, 2.0, 10.0) 4 diff --git a/tests/hlsl/sample-bias.shader_test b/tests/hlsl/sample-bias.shader_test index 08e506965..e56945d06 100644 --- a/tests/hlsl/sample-bias.shader_test +++ b/tests/hlsl/sample-bias.shader_test @@ -31,13 +31,13 @@ float4 main(float2 coord : texcoord) : sv_target
[test] uniform 0 float4 6.5 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (10.0, 0.0, 10.0, 0.0)
uniform 0 float4 7.5 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (4.0, 0.0, 10.0, 0.0)
uniform 0 float4 8.5 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 10.0, 0.0) diff --git a/tests/hlsl/sample-grad.shader_test b/tests/hlsl/sample-grad.shader_test index c37da299c..298037a77 100644 --- a/tests/hlsl/sample-grad.shader_test +++ b/tests/hlsl/sample-grad.shader_test @@ -26,11 +26,11 @@ float4 main() : sv_target
[test] uniform 0 float4 0.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 0.0, 1.0, 0.0) uniform 0 float4 1.0 1.0 1.0 1.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 1.0, 0.0) uniform 0 float4 2.0 2.0 2.0 2.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 1.0, 0.0) diff --git a/tests/hlsl/sample-level.shader_test b/tests/hlsl/sample-level.shader_test index ec7c7e2a2..c91c65493 100644 --- a/tests/hlsl/sample-level.shader_test +++ b/tests/hlsl/sample-level.shader_test @@ -26,11 +26,11 @@ float4 main() : sv_target
[test] uniform 0 float4 0.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 0.0, 1.0, 0.0) uniform 0 float4 0.5 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 0.0, 1.0, 0.0) uniform 0 float4 1.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 1.0, 0.0) diff --git a/tests/hlsl/sampler-offset.shader_test b/tests/hlsl/sampler-offset.shader_test index 6f8357dfa..498a8ed3a 100644 --- a/tests/hlsl/sampler-offset.shader_test +++ b/tests/hlsl/sampler-offset.shader_test @@ -22,7 +22,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.2, 0.5, 0.0)
@@ -36,7 +36,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.2, 0.2, 0.0, 0.4)
@@ -50,5 +50,5 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.2, 0.0, 0.4) diff --git a/tests/hlsl/sampler.shader_test b/tests/hlsl/sampler.shader_test index c4b38b327..e073de863 100644 --- a/tests/hlsl/sampler.shader_test +++ b/tests/hlsl/sampler.shader_test @@ -17,7 +17,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.25, 0, 0.25, 0)
[pixel shader] @@ -30,7 +30,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.25, 0, 0.25, 0)
[pixel shader fail] @@ -42,7 +42,7 @@ float4 main() : sv_target }
-[pixel shader fail] +[pixel shader fail(sm<6)] sampler s;
float4 main() : sv_target @@ -53,7 +53,7 @@ float4 main() : sv_target [require] options: backcompat
-[pixel shader] +[pixel shader fail(sm>=6)] samplerCUBE s;
float4 main() : sv_target @@ -61,7 +61,7 @@ float4 main() : sv_target return texCUBE(s, float3(0.0, 0.0, 0.0)); }
-[pixel shader] +[pixel shader fail(sm>=6)] sampler1D s;
float4 main() : sv_target diff --git a/tests/hlsl/saturate.shader_test b/tests/hlsl/saturate.shader_test index 41ccc62ae..676fb00d1 100644 --- a/tests/hlsl/saturate.shader_test +++ b/tests/hlsl/saturate.shader_test @@ -6,7 +6,7 @@ float4 main(uniform float2 u) : sv_target
[test] uniform 0 float4 0.7 -0.1 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.7, 0.0, 1.0, 0.0)
[pixel shader] @@ -18,5 +18,5 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 -2 0 2 -1 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 1.0, 0.0) diff --git a/tests/hlsl/shader-interstage-interface.shader_test b/tests/hlsl/shader-interstage-interface.shader_test index 584b88cf9..271eb3bbe 100644 --- a/tests/hlsl/shader-interstage-interface.shader_test +++ b/tests/hlsl/shader-interstage-interface.shader_test @@ -52,5 +52,5 @@ void main(float4 position : SV_Position, float2 t0 : TEXCOORD0, }
[test] -draw triangle strip 4 +todo(sm>=6) draw triangle strip 4 probe all rgba (10.0, 8.0, 7.0, 3.0) diff --git a/tests/hlsl/side-effects.shader_test b/tests/hlsl/side-effects.shader_test index 8e4557f02..46887d148 100644 --- a/tests/hlsl/side-effects.shader_test +++ b/tests/hlsl/side-effects.shader_test @@ -44,4 +44,4 @@ float4 main() : sv_target
[test] draw quad -probe all rgba (2.2, 2.2, 2.2, 2.2) +todo(sm>=6) probe all rgba (2.2, 2.2, 2.2, 2.2) diff --git a/tests/hlsl/sign.shader_test b/tests/hlsl/sign.shader_test index 7ed632dbe..c56d90823 100644 --- a/tests/hlsl/sign.shader_test +++ b/tests/hlsl/sign.shader_test @@ -8,13 +8,13 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 float4 -1.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (-1.0, -1.0, -1.0, -1.0) uniform 0 float4 0.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader] @@ -27,7 +27,7 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 2.0 3.0 4.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0)
[pixel shader] @@ -41,7 +41,7 @@ float4 main() : sv_target [test] uniform 0 float4 1.0 2.0 0.0 0.0 uniform 4 float4 3.0 4.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0)
[pixel shader] @@ -54,13 +54,13 @@ float4 main() : sv_target
[test] uniform 0 int4 1 0 0 0 -draw quad +todo(sm>=6) draw quad probe all rgba (1, 1, 1, 1) uniform 0 int4 -1 0 0 0 -draw quad +todo(sm>=6) draw quad probe all rgba (-1, -1, -1, -1) uniform 0 int4 0 0 0 0 -draw quad +todo(sm>=6) draw quad probe all rgba (0, 0, 0, 0)
[pixel shader] @@ -73,7 +73,7 @@ float4 main() : sv_target
[test] uniform 0 int4 1 2 3 4 -draw quad +todo(sm>=6) draw quad probe all rgba (1, 1, 1, 1)
[pixel shader] @@ -87,5 +87,5 @@ float4 main() : sv_target [test] uniform 0 int4 1 2 0 0 uniform 4 int4 3 4 0 0 -draw quad +todo(sm>=6) draw quad probe all rgba (1, 1, 1, 1) diff --git a/tests/hlsl/smoothstep.shader_test b/tests/hlsl/smoothstep.shader_test index 63755b081..971f6d5d8 100644 --- a/tests/hlsl/smoothstep.shader_test +++ b/tests/hlsl/smoothstep.shader_test @@ -27,7 +27,7 @@ float4 main() : sv_target
[test] draw quad -probe all rgba (0, 0.104, 0.896, 1.000000) 5 +probe all rgba (0, 0.104, 0.896, 1.000000) 6
[pixel shader] diff --git a/tests/hlsl/sqrt.shader_test b/tests/hlsl/sqrt.shader_test index 78d89d38f..73ecba899 100644 --- a/tests/hlsl/sqrt.shader_test +++ b/tests/hlsl/sqrt.shader_test @@ -8,7 +8,7 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 9.0 32.3 46.5 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 3.0, 5.683309, 6.819091) 1
[pixel shader] @@ -21,5 +21,5 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 9.0 4.0 16.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 0.33333333, 0.5, 0.25) 1 diff --git a/tests/hlsl/state-block-syntax.shader_test b/tests/hlsl/state-block-syntax.shader_test index 26853bf40..7df3ae7c9 100644 --- a/tests/hlsl/state-block-syntax.shader_test +++ b/tests/hlsl/state-block-syntax.shader_test @@ -1,4 +1,4 @@ -[pixel shader fail] +[pixel shader fail(sm<6)] sampler s { foo = float; @@ -9,7 +9,7 @@ float4 main() : sv_target return float4(0, 0, 0, 0); }
-[pixel shader fail] +[pixel shader fail(sm<6)] sampler s = sampler_state { foo = float; @@ -20,7 +20,7 @@ float4 main() : sv_target return float4(0, 0, 0, 0); }
-[pixel shader fail] +[pixel shader fail(sm<6)] sampler s { 2 = 3; @@ -31,7 +31,7 @@ float4 main() : sv_target return float4(0, 0, 0, 0); }
-[pixel shader fail] +[pixel shader fail(sm<6)] sampler s { 2; @@ -42,7 +42,7 @@ float4 main() : sv_target return float4(0, 0, 0, 0); }
-[pixel shader fail] +[pixel shader fail(sm<6)] sampler s { foo; @@ -53,7 +53,7 @@ float4 main() : sv_target return float4(0, 0, 0, 0); }
-[pixel shader fail] +[pixel shader fail(sm<6)] sampler s { foo = bar @@ -104,7 +104,7 @@ float4 main() : sv_target return float4(0, 0, 0, 0); }
-[pixel shader fail] +[pixel shader fail(sm<6)] float f { foo = (sampler)2; @@ -115,7 +115,7 @@ float4 main() : sv_target return float4(0, 0, 0, 0); }
-[pixel shader fail] +[pixel shader fail(sm<6)] float f { foo = (faketype)2; @@ -126,7 +126,7 @@ float4 main() : sv_target return float4(0, 0, 0, 0); }
-[pixel shader fail] +[pixel shader fail(sm<6)] float f { foo = (sampler)bar; @@ -137,7 +137,7 @@ float4 main() : sv_target return float4(0, 0, 0, 0); }
-[pixel shader fail] +[pixel shader fail(sm<6)] float f { foo = bar(); diff --git a/tests/hlsl/static-initializer.shader_test b/tests/hlsl/static-initializer.shader_test index 8415d851a..d29ec0a11 100644 --- a/tests/hlsl/static-initializer.shader_test +++ b/tests/hlsl/static-initializer.shader_test @@ -16,7 +16,7 @@ draw quad probe all rgba (0.8, 0.0, 0.0, 0.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] static uint i;
float4 main() : sv_target @@ -65,7 +65,7 @@ size (1, 1) 1.0 2.0 3.0 4.0
-[pixel shader fail] +[pixel shader fail(sm<6)] static Texture2D tex; sampler sam;
@@ -124,7 +124,7 @@ float4 main() : sv_target }
-[pixel shader fail] +[pixel shader fail(sm<6)] static Texture2D tex1; sampler sam;
@@ -146,7 +146,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (1, 2, 3, 4)
@@ -162,7 +162,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (1, 2, 3, 4)
diff --git a/tests/hlsl/step.shader_test b/tests/hlsl/step.shader_test index e201e15f9..b857f00b2 100644 --- a/tests/hlsl/step.shader_test +++ b/tests/hlsl/step.shader_test @@ -9,7 +9,7 @@ float4 main() : sv_target [test] uniform 0 float4 5.0 -2.6 3.0 2.0 uniform 4 float4 1.0 -4.3 3.0 4.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 1.0, 1.0)
diff --git a/tests/hlsl/storage-qualifiers.shader_test b/tests/hlsl/storage-qualifiers.shader_test index 00e7b8367..78c2a7e77 100644 --- a/tests/hlsl/storage-qualifiers.shader_test +++ b/tests/hlsl/storage-qualifiers.shader_test @@ -17,5 +17,5 @@ void main(in uniform float4 a, uniform float4 b, out float4 o : sv_target) [test] uniform 0 float4 0.1 0.0 0.0 0.0 uniform 4 float4 0.2 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.2, 0.3, 0.4) diff --git a/tests/hlsl/struct-array.shader_test b/tests/hlsl/struct-array.shader_test index aff0a677a..4097f3835 100644 --- a/tests/hlsl/struct-array.shader_test +++ b/tests/hlsl/struct-array.shader_test @@ -18,5 +18,5 @@ float4 main() : sv_target uniform 0 float4 0.1 0.2 0.0 0.0 uniform 4 float4 0.3 0.4 0.0 0.0 uniform 8 float4 0.5 0.6 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.2, 0.3, 0.6, 0.5) diff --git a/tests/hlsl/swizzle-constant-prop.shader_test b/tests/hlsl/swizzle-constant-prop.shader_test index 357a3496e..a0ec18e45 100644 --- a/tests/hlsl/swizzle-constant-prop.shader_test +++ b/tests/hlsl/swizzle-constant-prop.shader_test @@ -25,7 +25,7 @@ float4 main() : sv_target
[test] uniform 0 int 4 -draw quad +todo(sm>=6) draw quad probe all rgba (110, 210, 410, 410)
@@ -43,7 +43,7 @@ float4 main() : sv_target
[test] uniform 0 int 3 -draw quad +todo(sm>=6) draw quad probe all rgba (105, 5, 305, 305)
@@ -59,5 +59,5 @@ float4 main() : sv_target
[test] uniform 0 int 1 -draw quad +todo(sm>=6) draw quad probe all rgba (14.0, 14.0, 14.0, 14.0) diff --git a/tests/hlsl/swizzle-matrix.shader_test b/tests/hlsl/swizzle-matrix.shader_test index bc2814ebb..1cba9d060 100644 --- a/tests/hlsl/swizzle-matrix.shader_test +++ b/tests/hlsl/swizzle-matrix.shader_test @@ -9,7 +9,7 @@ float4 main() : sv_target [test] uniform 0 float4 11 21 31 -1 uniform 4 float4 12 22 32 -1 -draw quad +todo(sm>=6) draw quad probe all rgba (21.0, 31.0, 11.0, 12.0)
@@ -24,7 +24,7 @@ float4 main() : sv_target [test] uniform 0 float4 11 21 31 -1 uniform 4 float4 12 22 32 -1 -draw quad +todo(sm>=6) draw quad probe all rgba (11.0, 31.0, 12.0, 32.0)
@@ -40,7 +40,7 @@ float4 main() : sv_target uniform 0 float4 11 12 -1 -1 uniform 4 float4 21 22 -1 -1 uniform 8 float4 31 32 -1 -1 -draw quad +todo(sm>=6) draw quad probe all rgba (11.0, 31.0, 12.0, 32.0)
@@ -170,7 +170,7 @@ float4 main() : sv_target [test] uniform 0 float4 20 30 40 -1 todo draw quad -todo probe all rgba (10.0, 20.0, 30.0, 40.0) +todo(sm<6) probe all rgba (10.0, 20.0, 30.0, 40.0)
[pixel shader todo] @@ -188,7 +188,7 @@ float4 main() : sv_target [test] uniform 0 float4 20 30 80 -1 todo draw quad -todo probe all rgba (80.0, 30.0, 20.0, 10.0) +todo(sm<6) probe all rgba (80.0, 30.0, 20.0, 10.0)
% Cannot repeat components when assigning to a swizzle. diff --git a/tests/hlsl/swizzles.shader_test b/tests/hlsl/swizzles.shader_test index c3d3343f3..ddfc09fc9 100644 --- a/tests/hlsl/swizzles.shader_test +++ b/tests/hlsl/swizzles.shader_test @@ -11,7 +11,7 @@ float4 main() : sv_target
[test] uniform 0 float4 0.0303 0.08 0.07 0.0202 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0101, 0.0303, 0.0202, 0.0404)
@@ -149,7 +149,7 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 2.0 3.0 4.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 2.0, 3.0, 4.0)
@@ -166,5 +166,5 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 2.0 3.0 4.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 4.0, 2.0, 3.0) diff --git a/tests/hlsl/ternary.shader_test b/tests/hlsl/ternary.shader_test index 91f49e0e9..9bb94ec12 100644 --- a/tests/hlsl/ternary.shader_test +++ b/tests/hlsl/ternary.shader_test @@ -1,3 +1,7 @@ +[require] +shader model < 6.0 + + [pixel shader] uniform float4 x;
diff --git a/tests/hlsl/texture-load-offset.shader_test b/tests/hlsl/texture-load-offset.shader_test index 52b6a5f93..b07b8ae98 100644 --- a/tests/hlsl/texture-load-offset.shader_test +++ b/tests/hlsl/texture-load-offset.shader_test @@ -18,7 +18,7 @@ float4 main(float4 pos : sv_position) : sv_target
[test] -draw quad +todo(sm>=6) draw quad probe (0, 0) rgba (0, 1, 0, 1) probe (1, 0) rgba (1, 1, 0, 1) probe (0, 1) rgba (0, 2, 0, 1) @@ -35,14 +35,14 @@ float4 main(float4 pos : sv_position) : sv_target
[test] -draw quad +todo(sm>=6) draw quad probe (3, 0) rgba (1, 0, 0, 1) probe (4, 0) rgba (2, 0, 0, 1) probe (3, 1) rgba (1, 1, 0, 1) probe (4, 1) rgba (2, 1, 0, 1)
-[pixel shader fail] +[pixel shader fail(sm<6)] Texture2D t;
float4 main(float4 pos : sv_position) : sv_target diff --git a/tests/hlsl/texture-load-typed.shader_test b/tests/hlsl/texture-load-typed.shader_test index c92273373..f964463f4 100644 --- a/tests/hlsl/texture-load-typed.shader_test +++ b/tests/hlsl/texture-load-typed.shader_test @@ -36,7 +36,7 @@ size (1, 1)
4294967295 123
-[pixel shader] +[pixel shader fail(sm>=6)] typedef int myint_t; texture2D<float> f1; Texture2D<myint_t> i1; diff --git a/tests/hlsl/texture-load.shader_test b/tests/hlsl/texture-load.shader_test index 362e1d2e3..8609828b8 100644 --- a/tests/hlsl/texture-load.shader_test +++ b/tests/hlsl/texture-load.shader_test @@ -15,7 +15,7 @@ float4 main(float4 pos : sv_position) : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe (0, 0) rgba (0.1, 0.2, 0.3, 0.4) probe (1, 0) rgba (0.5, 0.7, 0.6, 0.8) probe (0, 1) rgba (0.6, 0.5, 0.2, 0.1) @@ -30,7 +30,7 @@ float4 main(float4 pos : sv_position) : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe (0, 0) rgba (0.1, 0.2, 0.3, 0.4) probe (1, 0) rgba (0.6, 0.5, 0.2, 0.1) probe (0, 1) rgba (0.5, 0.7, 0.6, 0.8) @@ -46,7 +46,7 @@ float4 main(float4 pos : sv_position) : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe (0, 0) rgba (0.1, 0.2, 0.3, 0.4) probe (1, 0) rgba (0.6, 0.5, 0.2, 0.1) probe (0, 1) rgba (0.5, 0.7, 0.6, 0.8) diff --git a/tests/hlsl/texture-ordering.shader_test b/tests/hlsl/texture-ordering.shader_test index 2291ddf88..f7a2e09af 100644 --- a/tests/hlsl/texture-ordering.shader_test +++ b/tests/hlsl/texture-ordering.shader_test @@ -133,7 +133,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (450, 139, 876, 333)
@@ -186,7 +186,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (450, 138, 796, 333)
@@ -239,7 +239,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (478, 913, 256, 333)
@@ -272,7 +272,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (215, 215, 215, 111)
@@ -302,5 +302,5 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (5, 4, 2, 0) diff --git a/tests/hlsl/trigonometry.shader_test b/tests/hlsl/trigonometry.shader_test index 09933d3b7..f003f163d 100644 --- a/tests/hlsl/trigonometry.shader_test +++ b/tests/hlsl/trigonometry.shader_test @@ -12,7 +12,7 @@ float4 main(float tex : texcoord) : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe ( 0, 0) rgba ( 0.00000000, 1.00000000, 0.0, 0.0) probe ( 1, 0) rgba ( 0.84147098, 0.54030231, 0.0, 0.0) 1024 probe ( 2, 0) rgba ( 0.90929743, -0.41614684, 0.0, 0.0) 1024 @@ -41,7 +41,7 @@ float4 main() : sv_target
[test] uniform 0 float4 0.0 0.52359877 2.61799387 3.14159265 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 500.0, 500.0, 0.0)
@@ -55,5 +55,5 @@ float4 main() : sv_target
[test] uniform 0 float4 0.0 0.78539816 1.57079632 2.35619449 -draw quad +todo(sm>=6) draw quad probe all rgba (1000.0, 707.0, -0.0, -707.0) diff --git a/tests/hlsl/trunc.shader_test b/tests/hlsl/trunc.shader_test index 419608fb0..361ec2c24 100644 --- a/tests/hlsl/trunc.shader_test +++ b/tests/hlsl/trunc.shader_test @@ -6,10 +6,10 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 -0.5 6.5 7.5 3.4 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 6.0, 7.0, 3.0) uniform 0 float4 -1.5 6.5 7.5 3.4 -draw quad +todo(sm>=6) draw quad probe all rgba (-1.0, 6.0, 7.0, 3.0)
[pixel shader] @@ -23,7 +23,7 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 -0.5 6.5 7.5 3.4 -draw quad +todo(sm>=6) draw quad probe all rgba (6.0, 7.0, 0.0, 3.0)
[require] @@ -40,5 +40,5 @@ float4 main(uniform int4 u) : sv_target
[test] uniform 0 int4 -1 6 7 3 -draw quad +todo(sm>=6) draw quad probe all rgba (6.0, 7.0, -1.0, 3.0) diff --git a/tests/hlsl/type-names.shader_test b/tests/hlsl/type-names.shader_test index f382ffae6..6e88fd285 100644 --- a/tests/hlsl/type-names.shader_test +++ b/tests/hlsl/type-names.shader_test @@ -1,4 +1,4 @@ -[pixel shader] +[pixel shader fail(sm>=6)] typedef float2 Dword; typedef float3 dWord; typedef float2 fLoat; @@ -73,7 +73,7 @@ float4 main() : sv_target return float4(0, 0, 0, 0); }
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 f() { typedef float2 matrix; @@ -85,7 +85,7 @@ float4 main() : SV_TARGET return f(); }
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 f() { typedef float2 vector; diff --git a/tests/hlsl/uav-load.shader_test b/tests/hlsl/uav-load.shader_test index fe6350e0c..ef57ff68c 100644 --- a/tests/hlsl/uav-load.shader_test +++ b/tests/hlsl/uav-load.shader_test @@ -1,5 +1,6 @@ [require] shader model >= 5.0 +shader model < 6.0
[uav 0] format r32 float diff --git a/tests/hlsl/uav-out-param.shader_test b/tests/hlsl/uav-out-param.shader_test index f31344748..1846429b7 100644 --- a/tests/hlsl/uav-out-param.shader_test +++ b/tests/hlsl/uav-out-param.shader_test @@ -1,5 +1,6 @@ [require] shader model >= 5.0 +shader model < 6.0
[uav 0] format r32g32b32a32 float diff --git a/tests/hlsl/uav-rwbuffer.shader_test b/tests/hlsl/uav-rwbuffer.shader_test index 1a7fcf1e8..a5280e7bd 100644 --- a/tests/hlsl/uav-rwbuffer.shader_test +++ b/tests/hlsl/uav-rwbuffer.shader_test @@ -41,7 +41,7 @@ float4 main() : sv_target1 return 0; }
-[pixel shader fail todo] +[pixel shader fail(sm<6) todo] RWBuffer<double3> u;
float4 main() : sv_target1 @@ -58,7 +58,7 @@ float4 main() : sv_target1 }
% Array type -[pixel shader fail] +[pixel shader fail(sm<6)] typedef float arr[2]; RWBuffer<arr> u;
@@ -68,7 +68,7 @@ float4 main() : sv_target1 }
% Object types -[pixel shader fail] +[pixel shader fail(sm<6)] RWBuffer<Texture2D> u;
float4 main() : sv_target1 @@ -104,4 +104,4 @@ float4 main() : sv_target1
[test] draw quad -probe buffer uav 2 (0, 0) rgba (11.1, 12.2, 13.3, 14.4) +todo(sm>=6) probe buffer uav 2 (0, 0) rgba (11.1, 12.2, 13.3, 14.4) diff --git a/tests/hlsl/uav-rwstructuredbuffer.shader_test b/tests/hlsl/uav-rwstructuredbuffer.shader_test index 5ea673299..904d15514 100644 --- a/tests/hlsl/uav-rwstructuredbuffer.shader_test +++ b/tests/hlsl/uav-rwstructuredbuffer.shader_test @@ -36,7 +36,7 @@ float4 main() : sv_target1 }
% Object types -[pixel shader fail] +[pixel shader fail(sm<6)] RWStructuredBuffer<Texture2D> u;
float4 main() : sv_target1 diff --git a/tests/hlsl/uav-rwtexture.shader_test b/tests/hlsl/uav-rwtexture.shader_test index 07c28cb84..25a5292cd 100644 --- a/tests/hlsl/uav-rwtexture.shader_test +++ b/tests/hlsl/uav-rwtexture.shader_test @@ -1,7 +1,7 @@ [require] shader model >= 5.0
-[pixel shader fail] +[pixel shader fail(sm<6)] RWTexture2D<float4> u;
float4 main() : sv_target @@ -50,11 +50,11 @@ float4 main() : sv_target
[test] draw quad -probe uav 1 (0, 0) r (0.5) -probe uav 1 (0, 1) r (0.6) +todo(sm>=6) probe uav 1 (0, 0) r (0.5) +todo(sm>=6) probe uav 1 (0, 1) r (0.6) probe uav 1 (1, 0) r (0.2) -probe uav 1 (1, 1) r (0.7) -probe uav 2 (0, 0) rgba (2.0, 1.0, 4.0, 3.0) +todo(sm>=6) probe uav 1 (1, 1) r (0.7) +todo(sm>=6) probe uav 2 (0, 0) rgba (2.0, 1.0, 4.0, 3.0)
% UAVs are implicitly allocated starting from the highest render target slot. @@ -71,7 +71,7 @@ size (1, 1)
0.1 0.2 0.3 0.4
-[pixel shader fail] +[pixel shader fail(sm<6)] RWTexture2D<float4> u : register(u0);
float4 main() : sv_target1 @@ -80,7 +80,7 @@ float4 main() : sv_target1 return 0; }
-[pixel shader fail] +[pixel shader fail(sm<6)] RWTexture2D<float4> u : register(u1);
float4 main() : sv_target1 @@ -100,7 +100,7 @@ float4 main() : sv_target1
[test] draw quad -probe uav 2 (0, 0) rgba (0.9, 0.8, 0.7, 0.6) +todo(sm>=6) probe uav 2 (0, 0) rgba (0.9, 0.8, 0.7, 0.6)
[uav 3] @@ -119,7 +119,7 @@ float4 main() : sv_target1
[test] draw quad -probe uav 3 (0, 0) rgba (0.9, 0.8, 0.7, 0.6) +todo(sm>=6) probe uav 3 (0, 0) rgba (0.9, 0.8, 0.7, 0.6)
% Uppercase register set name [pixel shader] @@ -133,7 +133,7 @@ float4 main() : sv_target1
[test] draw quad -probe uav 3 (0, 0) rgba (0.9, 0.8, 0.7, 0.6) +todo(sm>=6) probe uav 3 (0, 0) rgba (0.9, 0.8, 0.7, 0.6)
% Test that we can declare and use an array of UAVs.
@@ -159,11 +159,11 @@ float4 main() : sv_target1
[test] draw quad -probe uav 2 (0, 0) rgba (1.1, 1.2, 1.3, 1.4) -probe uav 3 (0, 0) rgba (2.1, 2.2, 2.3, 2.4) +todo(sm>=6) probe uav 2 (0, 0) rgba (1.1, 1.2, 1.3, 1.4) +todo(sm>=6) probe uav 3 (0, 0) rgba (2.1, 2.2, 2.3, 2.4)
% RWTexture1D types -[pixel shader] +[pixel shader fail(sm>=6)] struct s { float3 a; @@ -181,7 +181,7 @@ float4 main() : sv_target1 }
% RWTexture2D types -[pixel shader] +[pixel shader fail(sm>=6)] struct s { float3 a; @@ -199,7 +199,7 @@ float4 main() : sv_target1 }
% RWTexture3D types -[pixel shader] +[pixel shader fail(sm>=6)] struct s { float3 a; diff --git a/tests/hlsl/uniform-semantics.shader_test b/tests/hlsl/uniform-semantics.shader_test index 1125117fe..86e3b83f9 100644 --- a/tests/hlsl/uniform-semantics.shader_test +++ b/tests/hlsl/uniform-semantics.shader_test @@ -10,7 +10,7 @@ float4 main() : sv_target
[test] uniform 0 float 3.5 -draw quad +todo(sm>=6) draw quad probe all rgba (3.5, 3.5, 3.5, 3.5)
@@ -24,5 +24,5 @@ float4 main() : sv_target
[test] uniform 0 float4 4.0 5.0 6.0 7.0 -draw quad +todo(sm>=6) draw quad probe all rgba (4.0, 5.0, 4.0, 5.0) diff --git a/tests/hlsl/vector-indexing-uniform.shader_test b/tests/hlsl/vector-indexing-uniform.shader_test index e5ffbdd02..3501f3af7 100644 --- a/tests/hlsl/vector-indexing-uniform.shader_test +++ b/tests/hlsl/vector-indexing-uniform.shader_test @@ -12,5 +12,5 @@ float4 main() : SV_TARGET
[test] uniform 0 float 2 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 0.3, 0.8, 0.2) diff --git a/tests/hlsl/vector-indexing.shader_test b/tests/hlsl/vector-indexing.shader_test index 1542d358a..71a4ca26d 100644 --- a/tests/hlsl/vector-indexing.shader_test +++ b/tests/hlsl/vector-indexing.shader_test @@ -23,11 +23,11 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 1.0 2.0 3.0 4.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 2.0, 2.0, 3.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : SV_TARGET { float4 vec = {0, 1, 2, 3}; diff --git a/tests/hlsl/writemask-assignop-0.shader_test b/tests/hlsl/writemask-assignop-0.shader_test index 374a38bb4..fa8ecc2e4 100644 --- a/tests/hlsl/writemask-assignop-0.shader_test +++ b/tests/hlsl/writemask-assignop-0.shader_test @@ -11,5 +11,5 @@ float4 main() : SV_target
[test] uniform 0 float4 0.0303 0.08 0.07 0.0202 -draw quad +todo(sm>=6) draw quad probe all rgba (-0.4697, -0.02, 0.57, 0.3202) 2 diff --git a/tests/hlsl/writemask-assignop-1.shader_test b/tests/hlsl/writemask-assignop-1.shader_test index 61993257c..3bebcce61 100644 --- a/tests/hlsl/writemask-assignop-1.shader_test +++ b/tests/hlsl/writemask-assignop-1.shader_test @@ -12,5 +12,5 @@ float4 main() : SV_target
[test] uniform 0 float4 0.0303 0.08 0.07 0.0202 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5697, -0.08, -0.27, -0.4202) diff --git a/tests/shader_runner.c b/tests/shader_runner.c index 8b463dc00..ba2d4ae03 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -47,6 +47,8 @@ typedef int HRESULT; #endif
+#define WIDL_C_INLINE_WRAPPERS + #define COBJMACROS #define CONST_VTABLE #include "config.h" @@ -59,6 +61,7 @@ typedef int HRESULT; #include "vkd3d_d3dcommon.h" #include "vkd3d_d3dcompiler.h" #include "vkd3d_test.h" +#include "dxcompiler.h" #include "shader_runner.h"
struct test_options test_options = {0}; @@ -129,9 +132,11 @@ static bool match_directive_substring(const char *line, const char *token, const
static void parse_require_directive(struct shader_runner *runner, const char *line) { + bool less_than = false; unsigned int i;
- if (match_string(line, "shader model >=", &line)) + if (match_string(line, "shader model >=", &line) + || (less_than = match_string(line, "shader model <", &line))) { static const char *const model_strings[] = { @@ -141,13 +146,23 @@ static void parse_require_directive(struct shader_runner *runner, const char *li [SHADER_MODEL_4_1] = "4.1", [SHADER_MODEL_5_0] = "5.0", [SHADER_MODEL_5_1] = "5.1", + [SHADER_MODEL_6_0] = "6.0", };
for (i = 0; i < ARRAY_SIZE(model_strings); ++i) { if (match_string(line, model_strings[i], &line)) { - runner->minimum_shader_model = i; + if (less_than) + { + if (!i) + fatal_error("Shader model < '%s' is invalid.\n", line); + runner->maximum_shader_model = min(runner->maximum_shader_model, i - 1); + } + else + { + runner->minimum_shader_model = max(runner->minimum_shader_model, i); + } return; } } @@ -478,13 +493,22 @@ static void read_uint4(const char **line, struct uvec4 *v)
static void parse_test_directive(struct shader_runner *runner, const char *line) { + bool use_dxcompiler = runner->minimum_shader_model >= SHADER_MODEL_6_0; char *rest; int ret;
runner->is_todo = false; + runner->is_todo_6 = false;
if (match_string(line, "todo", &line)) + { + runner->is_todo = !use_dxcompiler; + runner->is_todo_6 = use_dxcompiler; + } + else if (match_string(line, "todo(sm<6)", &line) && !use_dxcompiler) runner->is_todo = true; + else if (match_string(line, "todo(sm>=6)", &line) && use_dxcompiler) + runner->is_todo_6 = true;
if (match_string(line, "dispatch", &line)) { @@ -663,7 +687,7 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) fatal_error("Malformed probe arguments '%s'.\n", line); if (ret < 5) ulps = 0; - todo_if(runner->is_todo) check_readback_data_vec4(rb, &rect, &v, ulps); + todo_if(runner->is_todo || runner->is_todo_6) check_readback_data_vec4(rb, &rect, &v, ulps); } else if (match_string(line, "r", &line)) { @@ -674,7 +698,7 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) fatal_error("Malformed probe arguments '%s'.\n", line); if (ret < 2) ulps = 0; - todo_if(runner->is_todo) check_readback_data_float(rb, &rect, expect, ulps); + todo_if(runner->is_todo || runner->is_todo_6) check_readback_data_float(rb, &rect, expect, ulps); } else { @@ -804,9 +828,113 @@ const char *shader_type_string(enum shader_type type) return shader_types[type]; }
+#ifdef _WIN32 +static const char dxcompiler_name[] = "dxcompiler.dll"; +#else +static const char dxcompiler_name[] = "libdxcompiler.so"; +#endif + +HRESULT dxcompiler_compile_shader(enum shader_type type, const char *hlsl, ID3D10Blob **blob_out, + ID3D10Blob **errors_out) +{ + DxcBuffer src_buf = {hlsl, strlen(hlsl), 65001}; + DxcCreateInstanceProc create_instance; + IDxcCompiler3 *compiler; + IDxcBlobUtf8 *errors; + IDxcResult *result; + IDxcBlob *blob; + HRESULT hr; + void *dll; + + static const WCHAR *const shader_profiles[] = + { + [SHADER_TYPE_CS] = L"cs_6_0", + [SHADER_TYPE_GS] = L"gs_6_0", + [SHADER_TYPE_HS] = L"hs_6_0", + [SHADER_TYPE_PS] = L"ps_6_0", + [SHADER_TYPE_VS] = L"vs_6_0", + }; + const WCHAR *args[] = + { + L"/T", + shader_profiles[type], + L"/Qstrip_reflect", + L"/Qstrip_debug", + L"/flegacy-macro-expansion", + L"/flegacy-resource-reservation", + }; + + *blob_out = NULL; + *errors_out = NULL; + + if (!(dll = vkd3d_dlopen(dxcompiler_name))) + { + trace("Failed to load dxcompiler library, %s.\n", vkd3d_dlerror()); + return E_FAIL; + } + create_instance = (DxcCreateInstanceProc)vkd3d_dlsym(dll, "DxcCreateInstance"); + + if (!create_instance) + { + trace("Failed to get DxcCreateInstance() pointer.\n"); + return E_FAIL; + } + + if (FAILED(hr = create_instance(&CLSID_DxcCompiler, &IID_IDxcCompiler3, (void **)&compiler))) + { + trace("Failed to create instance, hr %#x.\n", hr); + return hr; + } + + if (FAILED(hr = IDxcCompiler3_Compile(compiler, &src_buf, args, ARRAY_SIZE(args), NULL, &IID_IDxcResult, (void **)&result))) + { + trace("Failed to compile shader, hr %#x.\n", hr); + goto compiler_release; + } + + if (IDxcResult_HasOutput(result, DXC_OUT_ERRORS) + && SUCCEEDED(hr = IDxcResult_GetOutput(result, DXC_OUT_ERRORS, &IID_IDxcBlobUtf8, (void **)&errors, NULL))) + { + if (IDxcBlobUtf8_GetStringLength(errors)) + *errors_out = (ID3D10Blob *)errors; + else + IDxcBlobUtf8_Release(errors); + } + + /* Rarely the compiler returns no output if the HLSL is invalid, but far more common + * is a blob with a zero buffer size. */ + if (!IDxcResult_HasOutput(result, DXC_OUT_OBJECT)) + { + hr = E_FAIL; + goto result_release; + } + + hr = IDxcResult_GetOutput(result, DXC_OUT_OBJECT, &IID_IDxcBlob, (void **)&blob, NULL); + IDxcResult_Release(result); + if (FAILED(hr)) + goto compiler_release; + + if (!IDxcBlob_GetBufferSize(blob)) + { + hr = E_FAIL; + goto compiler_release; + } + + IDxcCompiler3_Release(compiler); + *blob_out = (ID3D10Blob *)blob; + return S_OK; + +result_release: + IDxcResult_Release(result); +compiler_release: + IDxcCompiler3_Release(compiler); + return hr; +} + static void compile_shader(struct shader_runner *runner, const char *source, size_t len, enum shader_type type, HRESULT expect) { + bool use_dxcompiler = runner->minimum_shader_model >= SHADER_MODEL_6_0; ID3D10Blob *blob = NULL, *errors = NULL; char profile[7]; HRESULT hr; @@ -819,10 +947,18 @@ static void compile_shader(struct shader_runner *runner, const char *source, siz [SHADER_MODEL_4_1] = "4_1", [SHADER_MODEL_5_0] = "5_0", [SHADER_MODEL_5_1] = "5_1", + [SHADER_MODEL_6_0] = "6_0", };
- sprintf(profile, "%s_%s", shader_type_string(type), shader_models[runner->minimum_shader_model]); - hr = D3DCompile(source, len, NULL, NULL, NULL, "main", profile, runner->compile_options, 0, &blob, &errors); + if (use_dxcompiler) + { + hr = dxcompiler_compile_shader(type, source, &blob, &errors); + } + else + { + sprintf(profile, "%s_%s", shader_type_string(type), shader_models[runner->minimum_shader_model]); + hr = D3DCompile(source, len, NULL, NULL, NULL, "main", profile, runner->compile_options, 0, &blob, &errors); + } hr = map_unidentified_hrs(hr); ok(hr == expect, "Got unexpected hr %#x.\n", hr); if (hr == S_OK) @@ -837,7 +973,11 @@ static void compile_shader(struct shader_runner *runner, const char *source, siz if (errors) { if (vkd3d_test_state.debug_level) - trace("%s\n", (char *)ID3D10Blob_GetBufferPointer(errors)); + { + /* GetBufferPointer() on an IDxcBlob returns null for string blobs. */ + trace("%s\n", use_dxcompiler ? IDxcBlobUtf8_GetStringPointer((IDxcBlobUtf8*)errors) + : (char *)ID3D10Blob_GetBufferPointer(errors)); + } ID3D10Blob_Release(errors); } } @@ -845,10 +985,15 @@ static void compile_shader(struct shader_runner *runner, const char *source, siz static enum parse_state read_shader_directive(struct shader_runner *runner, enum parse_state state, const char *line, const char *src, HRESULT *expect_hr) { + bool use_dxcompiler = runner->minimum_shader_model >= SHADER_MODEL_6_0; + while (*src && *src != ']') { + /* 'todo' is not meaningful when dxcompiler is in use, so it has no '(sm<6) qualifier. */ if (match_directive_substring(src, "todo", &src)) { + if (use_dxcompiler) + continue; if (state == STATE_SHADER_COMPUTE) state = STATE_SHADER_COMPUTE_TODO; else if (state == STATE_SHADER_PIXEL) @@ -860,9 +1005,20 @@ static enum parse_state read_shader_directive(struct shader_runner *runner, enum { *expect_hr = E_FAIL; } + else if (match_directive_substring(src, "fail(sm<6)", &src)) + { + if (!use_dxcompiler) + *expect_hr = E_FAIL; + } + else if (match_directive_substring(src, "fail(sm>=6)", &src)) + { + if (use_dxcompiler) + *expect_hr = E_FAIL; + } else if (match_directive_substring(src, "notimpl", &src)) { - *expect_hr = E_NOTIMPL; + if (!use_dxcompiler) + *expect_hr = E_NOTIMPL; } else { @@ -876,7 +1032,8 @@ static enum parse_state read_shader_directive(struct shader_runner *runner, enum return state; }
-void run_shader_tests(struct shader_runner *runner, const struct shader_runner_ops *ops) +void run_shader_tests(struct shader_runner *runner, const struct shader_runner_ops *ops, + enum shader_model minimum_shader_model, enum shader_model maximum_shader_model) { size_t shader_source_size = 0, shader_source_len = 0; struct resource_params current_resource; @@ -897,7 +1054,8 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o
memset(runner, 0, sizeof(*runner)); runner->ops = ops; - runner->minimum_shader_model = SHADER_MODEL_2_0; + runner->minimum_shader_model = minimum_shader_model; + runner->maximum_shader_model = maximum_shader_model;
for (;;) { @@ -1049,7 +1207,8 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o else if (!strcmp(line, "[require]\n")) { state = STATE_REQUIRE; - runner->minimum_shader_model = SHADER_MODEL_2_0; + runner->minimum_shader_model = minimum_shader_model; + runner->maximum_shader_model = maximum_shader_model; runner->compile_options = 0; skip_tests = false; } @@ -1210,7 +1369,10 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o break;
case STATE_TEST: - if (!skip_tests) + assert(SUCCEEDED(expect_hr) || runner->minimum_shader_model >= SHADER_MODEL_6_0); + /* Compilation which fails with dxcompiler is not 'todo', therefore the tests are + * not 'todo' either. They cannot run, so skip them entirely. */ + if (!skip_tests && SUCCEEDED(expect_hr)) parse_test_directive(runner, line); break; } @@ -1300,7 +1462,7 @@ START_TEST(shader_runner) run_shader_tests_d3d11();
trace("Compiling shaders with d3dcompiler_47.dll and executing with d3d12.dll\n"); - run_shader_tests_d3d12(); + run_shader_tests_d3d12(SHADER_MODEL_4_0, SHADER_MODEL_5_1);
print_dll_version("d3dcompiler_47.dll"); print_dll_version("dxgi.dll"); @@ -1317,7 +1479,14 @@ START_TEST(shader_runner) run_shader_tests_d3d11();
trace("Compiling shaders with vkd3d-shader and executing with vkd3d\n"); - run_shader_tests_d3d12(); + run_shader_tests_d3d12(SHADER_MODEL_4_0, SHADER_MODEL_5_1); + + if (vkd3d_dlopen(dxcompiler_name)) + { + trace("Compiling shaders with dxcompiler and executing with vkd3d\n"); + run_shader_tests_d3d12(SHADER_MODEL_6_0, SHADER_MODEL_6_0); + print_dll_version("dxcompiler.dll"); + }
print_dll_version("d3d9.dll"); print_dll_version("d3d11.dll"); @@ -1328,6 +1497,12 @@ START_TEST(shader_runner) run_shader_tests_vulkan();
trace("Compiling shaders with vkd3d-shader and executing with vkd3d\n"); - run_shader_tests_d3d12(); + run_shader_tests_d3d12(SHADER_MODEL_4_0, SHADER_MODEL_5_1); + + if (vkd3d_dlopen(dxcompiler_name)) + { + trace("Compiling shaders with dxcompiler and executing with vkd3d\n"); + run_shader_tests_d3d12(SHADER_MODEL_6_0, SHADER_MODEL_6_0); + } #endif } diff --git a/tests/shader_runner.h b/tests/shader_runner.h index ffe4b875e..ef8aec7ee 100644 --- a/tests/shader_runner.h +++ b/tests/shader_runner.h @@ -36,6 +36,7 @@ enum shader_model SHADER_MODEL_4_1, SHADER_MODEL_5_0, SHADER_MODEL_5_1, + SHADER_MODEL_6_0, };
enum shader_type @@ -114,12 +115,16 @@ struct shader_runner { const struct shader_runner_ops *ops;
+ bool use_dxcompiler; bool is_todo; + /* Indicates shader conversion, and therefore pipeline creation, is expected to fail. */ + bool is_todo_6;
char *vs_source; char *ps_source; char *cs_source; enum shader_model minimum_shader_model; + enum shader_model maximum_shader_model;
bool last_render_failed;
@@ -160,8 +165,11 @@ void fatal_error(const char *format, ...) VKD3D_NORETURN VKD3D_PRINTF_FUNC(1, 2)
unsigned int get_vb_stride(const struct shader_runner *runner, unsigned int slot); void init_resource(struct resource *resource, const struct resource_params *params); +HRESULT dxcompiler_compile_shader(enum shader_type type, const char *hlsl, ID3D10Blob **blob_out, + ID3D10Blob **errors_out);
-void run_shader_tests(struct shader_runner *runner, const struct shader_runner_ops *ops); +void run_shader_tests(struct shader_runner *runner, const struct shader_runner_ops *ops, + enum shader_model minimum_shader_model, enum shader_model maximum_shader_model);
#ifdef _WIN32 void run_shader_tests_d3d9(void); @@ -169,4 +177,4 @@ void run_shader_tests_d3d11(void); #else void run_shader_tests_vulkan(void); #endif -void run_shader_tests_d3d12(void); +void run_shader_tests_d3d12(enum shader_model minimum_shader_model, enum shader_model maximum_shader_model); diff --git a/tests/shader_runner_d3d11.c b/tests/shader_runner_d3d11.c index 25b585b14..1542ab02f 100644 --- a/tests/shader_runner_d3d11.c +++ b/tests/shader_runner_d3d11.c @@ -747,7 +747,7 @@ void run_shader_tests_d3d11(void) init_adapter_info(); if (init_test_context(&runner)) { - run_shader_tests(&runner.r, &d3d11_runner_ops); + run_shader_tests(&runner.r, &d3d11_runner_ops, SHADER_MODEL_2_0, SHADER_MODEL_5_1); destroy_test_context(&runner); } } diff --git a/tests/shader_runner_d3d12.c b/tests/shader_runner_d3d12.c index 925bdca99..8d89e915a 100644 --- a/tests/shader_runner_d3d12.c +++ b/tests/shader_runner_d3d12.c @@ -22,6 +22,7 @@ #define CONST_VTABLE #define VKD3D_TEST_NO_DEFS #include "d3d12_crosstest.h" +#include "dxcompiler.h" #include "shader_runner.h"
struct d3d12_resource @@ -70,10 +71,18 @@ static ID3D10Blob *compile_shader(const struct d3d12_shader_runner *runner, cons [SHADER_MODEL_4_1] = "4_1", [SHADER_MODEL_5_0] = "5_0", [SHADER_MODEL_5_1] = "5_1", + [SHADER_MODEL_6_0] = "6_0", };
- sprintf(profile, "%s_%s", shader_type_string(type), shader_models[runner->r.minimum_shader_model]); - hr = D3DCompile(source, strlen(source), NULL, NULL, NULL, "main", profile, runner->r.compile_options, 0, &blob, &errors); + if (runner->r.minimum_shader_model >= SHADER_MODEL_6_0) + { + hr = dxcompiler_compile_shader(type, source, &blob, &errors); + } + else + { + sprintf(profile, "%s_%s", shader_type_string(type), shader_models[runner->r.minimum_shader_model]); + hr = D3DCompile(source, strlen(source), NULL, NULL, NULL, "main", profile, runner->r.compile_options, 0, &blob, &errors); + } ok(FAILED(hr) == !blob, "Got unexpected hr %#x, blob %p.\n", hr, blob); if (errors) { @@ -84,6 +93,13 @@ static ID3D10Blob *compile_shader(const struct d3d12_shader_runner *runner, cons return blob; }
+static bool d3d12_runner_check_requirements(struct shader_runner *r) +{ + struct d3d12_shader_runner *runner = d3d12_shader_runner(r); + + return runner->r.maximum_shader_model >= SHADER_MODEL_6_0; +} + #define MAX_RESOURCE_DESCRIPTORS (MAX_RESOURCES * 2)
static struct resource *d3d12_runner_create_resource(struct shader_runner *r, const struct resource_params *params) @@ -319,8 +335,16 @@ static bool d3d12_runner_dispatch(struct shader_runner *r, unsigned int x, unsig
cs.pShaderBytecode = ID3D10Blob_GetBufferPointer(cs_code); cs.BytecodeLength = ID3D10Blob_GetBufferSize(cs_code); + todo_if(runner->r.is_todo_6) pso = create_compute_pipeline_state(device, root_signature, cs); ID3D10Blob_Release(cs_code); + + if (!pso) + { + ID3D12RootSignature_Release(root_signature); + return false; + } + add_pso(test_context, pso);
ID3D12GraphicsCommandList_SetComputeRootSignature(command_list, root_signature); @@ -445,10 +469,14 @@ static bool d3d12_runner_draw(struct shader_runner *r,
hr = ID3D12Device_CreateGraphicsPipelineState(device, &pso_desc, &IID_ID3D12PipelineState, (void **)&pso); - ok(hr == S_OK, "Failed to create state, hr %#x.\n", hr); + todo_if(runner->r.is_todo_6) ok(hr == S_OK, "Failed to create state, hr %#x.\n", hr); ID3D10Blob_Release(vs_code); ID3D10Blob_Release(ps_code); free(input_element_descs); + + if (FAILED(hr)) + return false; + add_pso(test_context, pso);
ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, test_context->root_signature); @@ -542,6 +570,7 @@ static void d3d12_runner_release_readback(struct shader_runner *r, struct resour
static const struct shader_runner_ops d3d12_runner_ops = { + .check_requirements = d3d12_runner_check_requirements, .create_resource = d3d12_runner_create_resource, .destroy_resource = d3d12_runner_destroy_resource, .dispatch = d3d12_runner_dispatch, @@ -550,7 +579,7 @@ static const struct shader_runner_ops d3d12_runner_ops = .release_readback = d3d12_runner_release_readback, };
-void run_shader_tests_d3d12(void) +void run_shader_tests_d3d12(enum shader_model minimum_shader_model, enum shader_model maximum_shader_model) { static const struct test_context_desc desc = { @@ -580,7 +609,7 @@ void run_shader_tests_d3d12(void) runner.compute_allocator, NULL, &IID_ID3D12GraphicsCommandList, (void **)&runner.compute_list); ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr);
- run_shader_tests(&runner.r, &d3d12_runner_ops); + run_shader_tests(&runner.r, &d3d12_runner_ops, minimum_shader_model, maximum_shader_model);
ID3D12GraphicsCommandList_Release(runner.compute_list); ID3D12CommandAllocator_Release(runner.compute_allocator); diff --git a/tests/shader_runner_d3d9.c b/tests/shader_runner_d3d9.c index 0c6d37884..239afc7b7 100644 --- a/tests/shader_runner_d3d9.c +++ b/tests/shader_runner_d3d9.c @@ -541,7 +541,7 @@ void run_shader_tests_d3d9(void)
init_adapter_info(); init_test_context(&runner); - run_shader_tests(&runner.r, &d3d9_runner_ops); + run_shader_tests(&runner.r, &d3d9_runner_ops, SHADER_MODEL_2_0, SHADER_MODEL_3_0); destroy_test_context(&runner); } FreeLibrary(d3d9_module); diff --git a/tests/shader_runner_vulkan.c b/tests/shader_runner_vulkan.c index 60c473a45..b395c66ab 100644 --- a/tests/shader_runner_vulkan.c +++ b/tests/shader_runner_vulkan.c @@ -1381,7 +1381,7 @@ void run_shader_tests_vulkan(void) if (!init_vulkan_runner(&runner)) return;
- run_shader_tests(&runner.r, &vulkan_runner_ops); + run_shader_tests(&runner.r, &vulkan_runner_ops, SHADER_MODEL_2_0, SHADER_MODEL_5_1);
cleanup_vulkan_runner(&runner); }
From: Conor McCarthy cmccarthy@codeweavers.com
Dumps DXIL disassembly when shaders are compiled with dxcompiler. --- tests/shader_runner.c | 19 ++++++++++++++++++- tests/utils.h | 3 +++ 2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/tests/shader_runner.c b/tests/shader_runner.c index ba2d4ae03..f448db4db 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -839,8 +839,8 @@ HRESULT dxcompiler_compile_shader(enum shader_type type, const char *hlsl, ID3D1 { DxcBuffer src_buf = {hlsl, strlen(hlsl), 65001}; DxcCreateInstanceProc create_instance; + IDxcBlobUtf8 *errors, *disassembly; IDxcCompiler3 *compiler; - IDxcBlobUtf8 *errors; IDxcResult *result; IDxcBlob *blob; HRESULT hr; @@ -920,6 +920,23 @@ HRESULT dxcompiler_compile_shader(enum shader_type type, const char *hlsl, ID3D1 goto compiler_release; }
+ if (test_options.dump_dxil) + { + src_buf.Ptr = IDxcBlob_GetBufferPointer(blob); + src_buf.Size = IDxcBlob_GetBufferSize(blob); + src_buf.Encoding = 0; + + if (SUCCEEDED(hr = IDxcCompiler3_Disassemble(compiler, &src_buf, &IID_IDxcResult, (void **)&result))) + { + if (SUCCEEDED(hr = IDxcResult_GetOutput(result, DXC_OUT_DISASSEMBLY, &IID_IDxcBlobUtf8, (void **)&disassembly, NULL))) + { + trace("dxcompiler disassembly:\n%s\n", IDxcBlobUtf8_GetStringPointer(disassembly)); + IDxcBlobUtf8_Release(disassembly); + } + IDxcResult_Release(result); + } + } + IDxcCompiler3_Release(compiler); *blob_out = (ID3D10Blob *)blob; return S_OK; diff --git a/tests/utils.h b/tests/utils.h index 670941905..8de930bd2 100644 --- a/tests/utils.h +++ b/tests/utils.h @@ -215,6 +215,7 @@ struct test_options bool enable_debug_layer; bool enable_gpu_based_validation; const char *filename; + bool dump_dxil; };
extern struct test_options test_options; @@ -233,6 +234,8 @@ static inline void parse_args(int argc, char **argv) test_options.enable_debug_layer = true; else if (!strcmp(argv[i], "--gbv")) test_options.enable_gpu_based_validation = true; + else if (!strcmp(argv[i], "--dump-dxil")) + test_options.dump_dxil = true; else if (argv[i][0] != '-') test_options.filename = argv[i]; }
Note that this MR is failing CI.
+enum shader_type +{ + SHADER_TYPE_CS, + SHADER_TYPE_GS, + SHADER_TYPE_HS, + SHADER_TYPE_PS, + SHADER_TYPE_VS, +};
This effectively adds hull and geometry shaders. I suppose that's fine, although it does mean the commit does a bit more than the commit message suggests. But if we're going to add those, why not add domain shaders as well then?
diff --git a/tests/dxcompiler.idl b/tests/dxcompiler.idl new file mode 100644 index 000000000..83b0ed5cd --- /dev/null +++ b/tests/dxcompiler.idl @@ -0,0 +1,155 @@ +import "vkd3d_windows.h"; +#include "vkd3d_unknown.idl"
That's missing our usual copyright header.
+cpp_quote("#ifdef _WIN32") +cpp_quote("#ifndef DXC_API_IMPORT") +cpp_quote("#define DXC_API_IMPORT __declspec(dllimport)") +cpp_quote("#endif") +cpp_quote("#else") +cpp_quote("#ifndef DXC_API_IMPORT") +cpp_quote("#define DXC_API_IMPORT __attribute__ ((visibility (\"default\")))") +cpp_quote("#endif") +cpp_quote("#endif")
I don't think these are used?
+/* Strip __attribute__((ms_abi)) defined in vkd3d_windows.h as dxcompiler does not use it. */ +cpp_quote("#ifdef __x86_64__") +cpp_quote("# undef __stdcall") +cpp_quote("# define __stdcall") +cpp_quote("#endif")
That's going to affect subsequent code as well.
+interface IDxcBlobEncoding : IDxcBlob +{ + HRESULT GetEncoding(BOOL *pKnown, UINT32 *pCodePage); +}
That's not our usual convention for parameter names. Affects IDxcIncludeHandler, IDxcOperationResult, IDxcResult, and IDxcCompiler3 as well.
+typedef struct DxcDefine +{ + const WCHAR *Name; + const WCHAR *Value; +} DxcDefine; +
This seems to be unused.
@@ -478,13 +493,22 @@ static void read_uint4(const char **line, struct uvec4 *v) static void parse_test_directive(struct shader_runner *runner, const char *line) { + bool use_dxcompiler = runner->minimum_shader_model >= SHADER_MODEL_6_0; char *rest; int ret; runner->is_todo = false; + runner->is_todo_6 = false; if (match_string(line, "todo", &line)) + { + runner->is_todo = !use_dxcompiler; + runner->is_todo_6 = use_dxcompiler; + } + else if (match_string(line, "todo(sm<6)", &line) && !use_dxcompiler) runner->is_todo = true; + else if (match_string(line, "todo(sm>=6)", &line) && use_dxcompiler) + runner->is_todo_6 = true; if (match_string(line, "dispatch", &line)) {
That just looks confusing to me. What I'd expect here is essentially something like this:
```c if (match_string(line, "todo", &line)) runner->is_todo = true; else if (match_string(line, "todo(sm<6)", &line)) runner->is_todo = runner->minimum_shader_model < SHADER_MODEL_6_0; else if (match_string(line, "todo(sm>=6)", &line)) runner->is_todo = runner->minimum_shader_model >= SHADER_MODEL_6_0; ```
Something similar comes up in a number of other places as well. Fundamentally, I don't think the shader runner should be concerned about where a particular backend runner is using dxcompiler or not.
+#ifdef _WIN32 +static const char dxcompiler_name[] = "dxcompiler.dll"; +#else +static const char dxcompiler_name[] = "libdxcompiler.so"; +#endif
We could probably introduce SONAME_LIBDXCOMPILER for this.
From 5635ad98aa3303a1a7d00080d63afe8f4d683747 Mon Sep 17 00:00:00 2001 From: Conor McCarthy <cmccarthy@codeweavers.com> Date: Thu, 14 Sep 2023 19:42:57 +1000 Subject: [PATCH 12/12] tests/shader-runner: Add a '--dump-dxil' command line switch. Dumps DXIL disassembly when shaders are compiled with dxcompiler.
I suppose that's fine. I wonder though, does this need to be specific to DXIL? If this is useful, I don't think there's a reason we couldn't support dumping disassembly for shaders compiled by d3dcompiler or vkd3d-shader as well?