libs/vkd3d-shader: Use vkd3d_dxbc_compiler_emit_variable() in vkd3d_dxbc_compiler_emit_dcl_temps().

This commit is contained in:
Józef Kucia 2017-07-11 17:23:02 +02:00
parent c8d713dc83
commit 1a8b74549a

View File

@ -1915,18 +1915,15 @@ static void vkd3d_dxbc_compiler_emit_dcl_temps(struct vkd3d_dxbc_compiler *compi
const struct vkd3d_shader_instruction *instruction) const struct vkd3d_shader_instruction *instruction)
{ {
struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; struct vkd3d_spirv_builder *builder = &compiler->spirv_builder;
uint32_t type_id, ptr_type_id, id;
unsigned int i; unsigned int i;
uint32_t id;
type_id = vkd3d_spirv_get_type_id(builder, VKD3D_TYPE_FLOAT, VKD3D_VEC4_SIZE);
ptr_type_id = vkd3d_dxbc_compiler_get_pointer_type(compiler, type_id, SpvStorageClassFunction);
assert(!compiler->temp_count); assert(!compiler->temp_count);
compiler->temp_count = instruction->declaration.count; compiler->temp_count = instruction->declaration.count;
for (i = 0; i < compiler->temp_count; ++i) for (i = 0; i < compiler->temp_count; ++i)
{ {
id = vkd3d_spirv_build_op_variable(builder, &builder->function_stream, id = vkd3d_dxbc_compiler_emit_variable(compiler, &builder->function_stream,
ptr_type_id, SpvStorageClassFunction, 0); SpvStorageClassFunction, VKD3D_TYPE_FLOAT, VKD3D_VEC4_SIZE);
if (!i) if (!i)
compiler->temp_id = id; compiler->temp_id = id;
assert(id == compiler->temp_id + i); assert(id == compiler->temp_id + i);