Description
To implement urAdapterGetLastError
every adapter currently has almost exactly this code, with setErrorMessage
and associated global variables in its respective common.cpp
/common.hpp
. Since these implementations are all so similar we should implement some kind of common helper to eliminate the repetition. Doing this cleanly is made complicated by the need for adapter-local global variables to store the error message and code in, as well as level zero's version of setErrorMessage
being slightly different (it has an extra parameter and an extra global).
I started working on a change here to replace the helper function + globals with a helper class. At time of writing I haven't yet decided the cleanest way to support the extra stuff level zero needs.