anv/cmd_buffer: Use gen_mi_sub instead of gen_mi_add with a negative
authorJason Ekstrand <jason@jlekstrand.net>
Sun, 31 Mar 2019 22:27:13 +0000 (17:27 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Thu, 11 Apr 2019 18:04:09 +0000 (18:04 +0000)
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/vulkan/genX_cmd_buffer.c

index 7771afe663e3fe3857b2c918fd6b0c5943076235..b6d935c690180dab7ebd2fd7bdceeffbf4865d80 100644 (file)
@@ -2950,7 +2950,7 @@ void genX(CmdDrawIndirectByteCountEXT)(
       gen_mi_mem32(anv_address_add(counter_buffer->address,
                                    counterBufferOffset));
    if (counterOffset)
-      count = gen_mi_iadd(&b, count, gen_mi_imm(-counterOffset));
+      count = gen_mi_isub(&b, count, gen_mi_imm(counterOffset));
    count = gen_mi_udiv32_imm(&b, count, vertexStride);
    gen_mi_store(&b, gen_mi_reg32(GEN7_3DPRIM_VERTEX_COUNT), count);