fix(agc): verify the effective user words of relocated draws

This commit is contained in:
JJenkx committed 2026-10-25 16:11:03 -04:00
1 parent 721bb69e55
commit d93bb1b3bc
3 files changed
+13 -1

No files matched your search

+4 -1
View File
@@ -2583,12 +2583,15 @@ if(BUILD_TESTING)
set_tests_properties(agc_driver_sparse_indirect_indices_unreadable agc_driver_sparse_indirect_indices_no_size agc_driver_sparse_indirect_indices_no_size_unreadable agc_driver_sparse_indirect_indices_no_size_unreadable_record PROPERTIES ENVIRONMENT_MODIFICATION
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libc>")
endif()
add_test(NAME agc_driver_draw_cache_relocation_recipe_verify COMMAND agc_driver_draw_cache_relocation_tests)
set_tests_properties(agc_driver_draw_cache_relocation_recipe_verify PROPERTIES
ENVIRONMENT "ANYPS5_NO_SHADER_CACHE=1;APS5_VERIFY_DRAW_RECIPE=1;APS5_PIPELINED_DRAWS=0" SKIP_RETURN_CODE 77 TIMEOUT 60 WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
add_test(NAME agc_driver_draw_cache_relocation_evicted COMMAND agc_driver_draw_cache_relocation_tests --evicted)
add_test(NAME agc_driver_draw_cache_relocation_kept COMMAND agc_driver_draw_cache_relocation_tests --kept)
set_tests_properties(agc_driver_draw_cache_relocation_evicted agc_driver_draw_cache_relocation_kept PROPERTIES
ENVIRONMENT "ANYPS5_NO_SHADER_CACHE=1;APS5_DRAW_CACHE_ENTRIES=2" SKIP_RETURN_CODE 77 WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
if(WIN32)
set_tests_properties(agc_driver_draw_cache_relocation_evicted agc_driver_draw_cache_relocation_kept PROPERTIES ENVIRONMENT_MODIFICATION
set_tests_properties(agc_driver_draw_cache_relocation_recipe_verify agc_driver_draw_cache_relocation_evicted agc_driver_draw_cache_relocation_kept PROPERTIES ENVIRONMENT_MODIFICATION
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libc>")
endif()
set_tests_properties(agc_driver_pixel_implicit_derivatives PROPERTIES TIMEOUT 30)
@@ -503,6 +503,11 @@ DrawVerdict Driver::draw(QueueState& queue, std::span<const std::uint32_t> packe
}
decode = std::move(refreshed);
}
if (decode != nullptr && !userPatches.empty() && verifyDrawRecipe()) {
auto patched = std::make_shared<DrawDecode>(*decode);
for (const auto& patch : userPatches) patched->programs.at(patch.program).userData.at(patch.index) = patch.value;
decode = std::move(patched);
}
try {
resolveDrawDecode(queue, submission, localDevice->graphicsContext(), decode, registerKey, drawKey, profile);
} catch (...) {
@@ -318,6 +318,10 @@ int main(int argc, char** argv) {
MovedDataHitsTheCache(libraries);
UnrelocatedAliasesStayOut(libraries);
MovedForwardedWordReachesStageDataHit(libraries);
if (std::getenv("APS5_VERIFY_DRAW_RECIPE") != nullptr) {
const auto counters = AgcDriver::DriverDetail::Driver::Get().DrawCacheCounters();
Require(counters.verifyDecodeMismatches == 0, "the effective relocated draw decode differed from its full decode");
}
AgcDriverShutdown_nid_postfix();
std::cout << "A draw whose data moved reused the cached draw " << (libraries ? "with" : "without") << " graphics pipeline libraries\n";
return 0;