SWDEV-575867: Fix error code for mapped graphics resources (#2662)

This commit is contained in:
Jin Jung
2026-01-30 04:47:13 -08:00
committad av GitHub
förälder 8800e03058
incheckning 25d0107d24
2 ändrade filer med 7 tillägg och 7 borttagningar
+3 -3
Visa fil
@@ -1,4 +1,4 @@
/* Copyright (c) 2010 - 2021 Advanced Micro Devices, Inc.
/* Copyright (c) 2010 - 2026 Advanced Micro Devices, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -945,8 +945,8 @@ hipError_t hipGraphicsUnregisterResource(hipGraphicsResource_t resource) {
}
if (device->mappedGraphics().isValid(resource)) {
LogError("resource still mapped");
HIP_RETURN(hipErrorArrayIsMapped);
LogError("resource already mapped");
HIP_RETURN(hipErrorAlreadyMapped);
}
if (!device->registeredGraphics().isValid(resource)) {
@@ -1,5 +1,5 @@
/*
Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved.
Copyright (c) 2022 - 2026 Advanced Micro Devices, Inc. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -57,6 +57,6 @@ TEST_CASE("Unit_hipGraphicsUnregisterResource_Negative_Parameters") {
hipGraphicsResource* mapped_resource;
HIP_CHECK(hipGraphicsGLRegisterBuffer(&mapped_resource, vbo, hipGraphicsRegisterFlagsNone));
HIP_CHECK(hipGraphicsMapResources(1, &mapped_resource, 0));
HIP_CHECK_ERROR(hipGraphicsUnregisterResource(mapped_resource), hipErrorArrayIsMapped);
HIP_CHECK_ERROR(hipGraphicsUnregisterResource(mapped_resource), hipErrorAlreadyMapped);
}
}