From e3e7fcb226a9401881426dca9a66b5e2d520ef9a Mon Sep 17 00:00:00 2001 From: castano Date: Thu, 28 Feb 2008 17:52:32 +0000 Subject: [PATCH] Check cuda errors to find out whether the cuda context initialization succeeded. --- src/nvtt/cuda/CudaCompressDXT.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/nvtt/cuda/CudaCompressDXT.cpp b/src/nvtt/cuda/CudaCompressDXT.cpp index 6ee3ff5..433f318 100644 --- a/src/nvtt/cuda/CudaCompressDXT.cpp +++ b/src/nvtt/cuda/CudaCompressDXT.cpp @@ -109,6 +109,12 @@ CudaCompressor::~CudaCompressor() bool CudaCompressor::isValid() const { +#if defined HAVE_CUDA + if (cudaGetLastError() != cudaSuccess) + { + return false; + } +#endif return m_data != NULL && m_result != NULL && m_bitmapTable != NULL; }