mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-10 01:28:44 +02:00
fix(shader): correct msaa sample addressing and prepared test failure cleanup
This commit is contained in:
@@ -669,17 +669,20 @@ if(BUILD_TESTING)
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
foreach(preparedMode IN ITEMS indirect uncached debug)
|
||||
foreach(preparedMode IN ITEMS indirect uncached debug debug_failure)
|
||||
set(preparedTest "agc_driver_prepared_shaders_${preparedMode}")
|
||||
if(preparedMode STREQUAL "indirect")
|
||||
add_test(NAME ${preparedTest} COMMAND agc_driver_prepared_shaders_tests --indirect)
|
||||
elseif(preparedMode STREQUAL "debug_failure")
|
||||
add_test(NAME ${preparedTest} COMMAND agc_driver_prepared_shaders_tests --fail-before-registration)
|
||||
set_tests_properties(${preparedTest} PROPERTIES WILL_FAIL TRUE TIMEOUT 30)
|
||||
else()
|
||||
add_test(NAME ${preparedTest} COMMAND agc_driver_prepared_shaders_tests)
|
||||
endif()
|
||||
set_tests_properties(${preparedTest} PROPERTIES ENVIRONMENT "ANYPS5_NO_SHADER_CACHE=1" SKIP_RETURN_CODE 77 WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
|
||||
if(preparedMode STREQUAL "uncached")
|
||||
set_property(TEST ${preparedTest} APPEND PROPERTY ENVIRONMENT "APS5_NO_DISPATCH_CACHE=1")
|
||||
elseif(preparedMode STREQUAL "debug")
|
||||
elseif(preparedMode STREQUAL "debug" OR preparedMode STREQUAL "debug_failure")
|
||||
set_property(TEST ${preparedTest} APPEND PROPERTY ENVIRONMENT "APS5_PROFILE_DRAW=1" "APS5_NO_UNLOCKED_DEVICE=1")
|
||||
endif()
|
||||
if(WIN32)
|
||||
|
||||
@@ -265,10 +265,11 @@ void Registration(bool indirect) {
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
try {
|
||||
Require(argc == 1 || (argc == 2 && std::string_view(argv[1]) == "--indirect"), "invalid test arguments");
|
||||
Require(argc == 1 || (argc == 2 && (std::string_view(argv[1]) == "--indirect" || std::string_view(argv[1]) == "--fail-before-registration")), "invalid test arguments");
|
||||
auto device = OpenVulkanTestDevice();
|
||||
if (!device) return VulkanTestSkipped;
|
||||
Run(*device);
|
||||
Require(argc != 2 || std::string_view(argv[1]) != "--fail-before-registration", "injected failure before registration");
|
||||
PrepareMultisampledStorage(*device);
|
||||
device.reset();
|
||||
Registration(argc == 2);
|
||||
@@ -276,6 +277,11 @@ int main(int argc, char** argv) {
|
||||
return 0;
|
||||
} catch (const std::exception& error) {
|
||||
std::cerr << error.what() << '\n';
|
||||
try {
|
||||
AgcDriverShutdown_nid_postfix();
|
||||
} catch (const std::exception& shutdownError) {
|
||||
std::cerr << shutdownError.what() << '\n';
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -897,10 +897,10 @@ void EmitReadOp(SpirvValueEmitContext& ctx, const ImageEmitAccess& access) {
|
||||
}
|
||||
|
||||
std::uint32_t ImageSampleIndex(SpirvValueEmitContext& ctx, const ImageEmitAccess& access) {
|
||||
const auto& dimension = RdnaImageDimensionInfoFor(access.image.dimension);
|
||||
if (dimension.multisampled == 0u) return ConstantU32(ctx.state, 0u);
|
||||
if (access.mem.imageAddressComponents <= dimension.coordinateComponents) ctx.Fail(access.inst, "has no sample index in the image address");
|
||||
return AddressU32(ctx, access, dimension.coordinateComponents);
|
||||
if (RdnaImageDimensionInfoFor(access.image.dimension).multisampled == 0u) return ConstantU32(ctx.state, 0u);
|
||||
const auto& addressInfo = AddressDimension(access);
|
||||
if (addressInfo.multisampled == 0u || access.mem.imageAddressComponents <= addressInfo.coordinateComponents) ctx.Fail(access.inst, "has no sample index in the image address");
|
||||
return AddressU32(ctx, access, addressInfo.coordinateComponents);
|
||||
}
|
||||
|
||||
void EmitWriteOp(SpirvValueEmitContext& ctx, const ImageEmitAccess& access) {
|
||||
|
||||
Reference in New Issue
Block a user