From b83b9c28a13cf9f0864723a238111b3af9a25f7f Mon Sep 17 00:00:00 2001 From: "Dr. Chat" Date: Sun, 21 Feb 2016 13:19:08 -0600 Subject: [PATCH] Fix push constants declaration --- src/xenia/gpu/spirv_shader_translator.cc | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/xenia/gpu/spirv_shader_translator.cc b/src/xenia/gpu/spirv_shader_translator.cc index 51d989cfe..b33cc7a75 100644 --- a/src/xenia/gpu/spirv_shader_translator.cc +++ b/src/xenia/gpu/spirv_shader_translator.cc @@ -137,6 +137,8 @@ void SpirvShaderTranslator::StartTranslation() { Id push_constants_type = b.makeStructType( {vec4_float_type_, vec4_float_type_, vec4_float_type_, uint_type}, "push_consts_type"); + b.addDecoration(push_constants_type, spv::Decoration::DecorationBlock); + // float4 window_scale; b.addMemberDecoration( push_constants_type, 0, spv::Decoration::DecorationOffset, @@ -297,11 +299,8 @@ std::vector SpirvShaderTranslator::CompleteTranslation() { // Apply window scaling // pos.xy *= window_scale.xy - auto p_scaled = b.createUnaryOp(spv::Op::OpCopyObject, vec4_float_type_, p); - p_scaled = b.createBinOp(spv::Op::OpFMul, vec4_float_type_, p_scaled, - window_scale); - - std::vector operands({p, p_scaled}); + auto p_scaled = + b.createBinOp(spv::Op::OpFMul, vec4_float_type_, p, window_scale); p = b.createOp(spv::Op::OpVectorShuffle, vec4_float_type_, {p, p_scaled, 4, 5, 2, 3}); @@ -591,8 +590,6 @@ void SpirvShaderTranslator::ProcessVectorAluInstruction( const ParsedAluInstruction& instr) { auto& b = *builder_; - // TODO: instr.is_predicated - Id sources[3] = {0}; Id dest = 0; for (size_t i = 0; i < instr.operand_count; i++) { @@ -732,8 +729,6 @@ void SpirvShaderTranslator::ProcessScalarAluInstruction( const ParsedAluInstruction& instr) { auto& b = *builder_; - // TODO: instr.is_predicated - Id sources[3] = {0}; Id dest = 0; for (size_t i = 0, x = 0; i < instr.operand_count; i++) {