0
0
mirror of https://gitlab.winehq.org/wine/vkd3d.git synced 2025-01-28 13:05:02 -08:00

libs/vkd3d-shader: Implement more floating-point comparison instructions.

This commit is contained in:
Józef Kucia 2017-06-28 12:28:09 +02:00
parent 3190fbffb7
commit 170168c9cb

@ -1980,8 +1980,8 @@ static void vkd3d_dxbc_compiler_emit_bitfield_instruction(struct vkd3d_dxbc_comp
static void vkd3d_dxbc_compiler_emit_comparison_instruction(struct vkd3d_dxbc_compiler *compiler, static void vkd3d_dxbc_compiler_emit_comparison_instruction(struct vkd3d_dxbc_compiler *compiler,
const struct vkd3d_shader_instruction *instruction) const struct vkd3d_shader_instruction *instruction)
{ {
static const unsigned int d3d_true[] = {0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff}; static const uint32_t d3d_true[] = {0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff};
static const unsigned int d3d_false[] = {0, 0, 0, 0}; static const uint32_t d3d_false[] = {0, 0, 0, 0};
uint32_t src0_id, src1_id, type_id, result_id, true_id, false_id; uint32_t src0_id, src1_id, type_id, result_id, true_id, false_id;
struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; struct vkd3d_spirv_builder *builder = &compiler->spirv_builder;
@ -1992,15 +1992,11 @@ static void vkd3d_dxbc_compiler_emit_comparison_instruction(struct vkd3d_dxbc_co
switch (instruction->handler_idx) switch (instruction->handler_idx)
{ {
case VKD3DSIH_EQ: case VKD3DSIH_EQ: op = SpvOpFOrdEqual; break;
op = SpvOpFOrdEqual; case VKD3DSIH_GE: op = SpvOpFOrdGreaterThanEqual; break;
break; case VKD3DSIH_IEQ: op = SpvOpIEqual; break;
case VKD3DSIH_IEQ: case VKD3DSIH_LT: op = SpvOpFOrdLessThan; break;
op = SpvOpIEqual; case VKD3DSIH_NE: op = SpvOpFUnordNotEqual; break;
break;
case VKD3DSIH_NE:
op = SpvOpFUnordNotEqual;
break;
default: default:
ERR("Unexpected instruction %#x.\n", instruction->handler_idx); ERR("Unexpected instruction %#x.\n", instruction->handler_idx);
return; return;
@ -2152,7 +2148,9 @@ void vkd3d_dxbc_compiler_handle_instruction(struct vkd3d_dxbc_compiler *compiler
vkd3d_dxbc_compiler_emit_dot(compiler, instruction); vkd3d_dxbc_compiler_emit_dot(compiler, instruction);
break; break;
case VKD3DSIH_EQ: case VKD3DSIH_EQ:
case VKD3DSIH_GE:
case VKD3DSIH_IEQ: case VKD3DSIH_IEQ:
case VKD3DSIH_LT:
case VKD3DSIH_NE: case VKD3DSIH_NE:
vkd3d_dxbc_compiler_emit_comparison_instruction(compiler, instruction); vkd3d_dxbc_compiler_emit_comparison_instruction(compiler, instruction);
break; break;