nvk: simplify code by using new helpers

All tests still pass:
dEQP-VK.query_pool.*.compute_shader_invocations*

Test run totals:
  Passed:        78/78 (100.0%)
  Failed:        0/78 (0.0%)
  Not supported: 0/78 (0.0%)
  Warnings:      0/78 (0.0%)
  Waived:        0/78 (0.0%)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Thomas H.P. Andersen 2023-04-03 01:41:22 +02:00 committed by Marge Bot
parent d1bbd16f1f
commit 71a00a0a1c
2 changed files with 5 additions and 11 deletions

View file

@ -204,10 +204,8 @@ static void
nvk_build_mme_add_cs_invocations(struct mme_builder *b,
struct mme_value64 count)
{
struct mme_value accum_hi = mme_state(b,
NVC597_SET_MME_SHADOW_SCRATCH(NVK_MME_SCRATCH_CS_INVOCATIONS_HI));
struct mme_value accum_lo = mme_state(b,
NVC597_SET_MME_SHADOW_SCRATCH(NVK_MME_SCRATCH_CS_INVOCATIONS_LO));
struct mme_value accum_hi = nvk_mme_load_scratch(b, CS_INVOCATIONS_HI);
struct mme_value accum_lo = nvk_mme_load_scratch(b, CS_INVOCATIONS_LO);
struct mme_value64 accum = mme_value64(accum_lo, accum_hi);
accum = mme_add64(b, accum, count);
@ -223,9 +221,7 @@ nvk_build_mme_add_cs_invocations(struct mme_builder *b,
void
nvk_mme_add_cs_invocations(struct mme_builder *b)
{
struct mme_value count_hi = mme_load(b);
struct mme_value count_lo = mme_load(b);
struct mme_value64 count = mme_value64(count_lo, count_hi);
struct mme_value64 count = mme_load_addr64(b);
nvk_build_mme_add_cs_invocations(b, count);
}

View file

@ -703,10 +703,8 @@ nvk_mme_copy_queries(struct mme_builder *b)
mme_sub64_to(b, result, end, begin);
mme_sub_to(b, report_count, report_count, mme_imm(2));
mme_free_reg(b, begin_lo);
mme_free_reg(b, begin_hi);
mme_free_reg(b, end_lo);
mme_free_reg(b, end_hi);
mme_free_reg64(b, begin);
mme_free_reg64(b, end);
}
mme_store_global(b, write_addr, result_lo);