diff --git a/hydra_drv/GPUOCLLayer.cpp b/hydra_drv/GPUOCLLayer.cpp index b204c35..a3108a2 100644 --- a/hydra_drv/GPUOCLLayer.cpp +++ b/hydra_drv/GPUOCLLayer.cpp @@ -539,7 +539,7 @@ GPUOCLLayer::GPUOCLLayer(int w, int h, int a_flags, int a_deviceId) : Base(w, h, m_clglSharing = 0; int clglIsSupported = clglSharingIsSupported(m_globals.device); - cl_int ciErr1; + cl_int ciErr1 = CL_SUCCESS; if ((a_flags & GPU_RT_NOWINDOW) || (clglIsSupported == 0)) { diff --git a/hydra_drv/cbidir.h b/hydra_drv/cbidir.h index b2ed94f..eb12a53 100644 --- a/hydra_drv/cbidir.h +++ b/hydra_drv/cbidir.h @@ -558,6 +558,7 @@ static inline float3 environmentColorExtended(float3 ray_pos, float3 ray_dir, Mi else { envColor = environmentColor(ray_dir, misPrev, flags, a_globals, in_mtlStorage, in_pdfStorage, in_texStorage1); + const uint rayBounce = unpackBounceNum(flags); unsigned int otherFlags = unpackRayFlags(flags); const int backTextureId = a_globals->varsI[HRT_SHADOW_MATTE_BACK]; diff --git a/hydra_drv/clight.h b/hydra_drv/clight.h index 4ef9fff..f8b17c2 100644 --- a/hydra_drv/clight.h +++ b/hydra_drv/clight.h @@ -320,6 +320,9 @@ static inline float evalMap2DPdf(const float2 texCoordT, __global const float* i if (pixelX < 0) pixelX += sizeX; if (pixelY < 0) pixelY += sizeY; + if (pixelX < 0 || pixelY < 0) + return 1.0f; + const int pixelOffset = pixelY*sizeX + pixelX; const int maxSize = sizeX*sizeY; const int offset0 = (pixelOffset + 0 < maxSize) ? pixelOffset + 0 : maxSize - 1;