diff options
-rw-r--r-- | src/gallium/drivers/swr/swr_screen.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gallium/drivers/swr/swr_screen.cpp b/src/gallium/drivers/swr/swr_screen.cpp index 99f0ca7216a..f7125ee365f 100644 --- a/src/gallium/drivers/swr/swr_screen.cpp +++ b/src/gallium/drivers/swr/swr_screen.cpp @@ -594,12 +594,11 @@ mesa_to_swr_format(enum pipe_format format) */ }; - try { - return mesa2swr.at(format); - } - catch (std::out_of_range) { + auto it = mesa2swr.find(format); + if (it == mesa2swr.end()) return (SWR_FORMAT)-1; - } + else + return it->second; } static boolean |