Revision: 41888
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41888
Author:   blendix
Date:     2011-11-15 19:23:35 +0000 (Tue, 15 Nov 2011)
Log Message:
-----------
Cycles: move clew into cycles namespace to avoid conflicts, and fix mesh
displacement panel showing with blender internal.

Modified Paths:
--------------
    trunk/blender/intern/cycles/SConscript
    trunk/blender/intern/cycles/blender/addon/ui.py
    trunk/blender/intern/cycles/util/CMakeLists.txt
    trunk/blender/intern/cycles/util/util_opencl.h

Added Paths:
-----------
    trunk/blender/intern/cycles/util/util_opencl.cpp

Removed Paths:
-------------
    trunk/blender/intern/cycles/util/util_opencl.c

Modified: trunk/blender/intern/cycles/SConscript
===================================================================
--- trunk/blender/intern/cycles/SConscript      2011-11-15 18:24:17 UTC (rev 
41887)
+++ trunk/blender/intern/cycles/SConscript      2011-11-15 19:23:35 UTC (rev 
41888)
@@ -6,7 +6,7 @@
 
 cycles.Depends('../../source/blender/makesrna/intern/RNA_blender_cpp.h', 
'makesrna')
 
-sources = cycles.Glob('bvh/*.cpp') + cycles.Glob('device/*.cpp') + 
cycles.Glob('kernel/*.cpp') + cycles.Glob('render/*.cpp') + 
cycles.Glob('subd/*.cpp') + cycles.Glob('util/*.cpp') + cycles.Glob('util/*.c') 
+ cycles.Glob('blender/*.cpp')
+sources = cycles.Glob('bvh/*.cpp') + cycles.Glob('device/*.cpp') + 
cycles.Glob('kernel/*.cpp') + cycles.Glob('render/*.cpp') + 
cycles.Glob('subd/*.cpp') + cycles.Glob('util/*.cpp') + 
cycles.Glob('blender/*.cpp')
 
 sources.remove(path.join('util', 'util_view.cpp'))
 sources.remove(path.join('render', 'film_response.cpp'))

Modified: trunk/blender/intern/cycles/blender/addon/ui.py
===================================================================
--- trunk/blender/intern/cycles/blender/addon/ui.py     2011-11-15 18:24:17 UTC 
(rev 41887)
+++ trunk/blender/intern/cycles/blender/addon/ui.py     2011-11-15 19:23:35 UTC 
(rev 41888)
@@ -295,7 +295,7 @@
 
     @classmethod
     def poll(cls, context):
-        return context.mesh or context.curve or context.meta_ball
+        return CyclesButtonsPanel.poll(context) and context.mesh or 
context.curve or context.meta_ball
 
     def draw(self, context):
         layout = self.layout

Modified: trunk/blender/intern/cycles/util/CMakeLists.txt
===================================================================
--- trunk/blender/intern/cycles/util/CMakeLists.txt     2011-11-15 18:24:17 UTC 
(rev 41887)
+++ trunk/blender/intern/cycles/util/CMakeLists.txt     2011-11-15 19:23:35 UTC 
(rev 41888)
@@ -11,7 +11,7 @@
        util_dynlib.cpp
        util_md5.cpp
        util_memarena.cpp
-       util_opencl.c
+       util_opencl.cpp
        util_path.cpp
        util_string.cpp
        util_system.cpp

Deleted: trunk/blender/intern/cycles/util/util_opencl.c
===================================================================
--- trunk/blender/intern/cycles/util/util_opencl.c      2011-11-15 18:24:17 UTC 
(rev 41887)
+++ trunk/blender/intern/cycles/util/util_opencl.c      2011-11-15 19:23:35 UTC 
(rev 41888)
@@ -1,317 +0,0 @@
-//////////////////////////////////////////////////////////////////////////
-//  Copyright (c) 2009 Organic Vectory B.V.
-//  Written by George van Venrooij
-//
-//  Distributed under the Boost Software License, Version 1.0.
-//  (See accompanying file doc/license/Boost.txt)
-//  Extracted from the CLCC project - http://clcc.sourceforge.net/
-//////////////////////////////////////////////////////////////////////////
-
-#include "util_opencl.h"
-
-#ifndef CLCC_GENERATE_DOCUMENTATION
-#ifdef _WIN32
-    #define WIN32_LEAN_AND_MEAN
-    #define VC_EXTRALEAN
-    #include <windows.h>
-
-    typedef HMODULE             CLCC_DYNLIB_HANDLE;
-
-    #define CLCC_DYNLIB_OPEN    LoadLibrary
-    #define CLCC_DYNLIB_CLOSE   FreeLibrary
-    #define CLCC_DYNLIB_IMPORT  GetProcAddress
-#else
-    #include <dlfcn.h>
-    
-    typedef void*                   CLCC_DYNLIB_HANDLE;
-
-    #define CLCC_DYNLIB_OPEN(path)  dlopen(path, RTLD_NOW | RTLD_GLOBAL)
-    #define CLCC_DYNLIB_CLOSE       dlclose
-    #define CLCC_DYNLIB_IMPORT      dlsym
-#endif
-#else
-    //typedef implementation_defined  CLCC_DYNLIB_HANDLE;
-    //#define CLCC_DYNLIB_OPEN(path)  implementation_defined
-    //#define CLCC_DYNLIB_CLOSE       implementation_defined
-    //#define CLCC_DYNLIB_IMPORT      implementation_defined
-#endif
-
-#include <stdlib.h>
-
-//! \brief module handle
-static CLCC_DYNLIB_HANDLE module = NULL;
-
-//  Variables holding function entry points
-#ifndef CLCC_GENERATE_DOCUMENTATION
-PFNCLGETPLATFORMIDS                 __clewGetPlatformIDs                = NULL;
-PFNCLGETPLATFORMINFO                __clewGetPlatformInfo               = NULL;
-PFNCLGETDEVICEIDS                   __clewGetDeviceIDs                  = NULL;
-PFNCLGETDEVICEINFO                  __clewGetDeviceInfo                 = NULL;
-PFNCLCREATECONTEXT                  __clewCreateContext                 = NULL;
-PFNCLCREATECONTEXTFROMTYPE          __clewCreateContextFromType         = NULL;
-PFNCLRETAINCONTEXT                  __clewRetainContext                 = NULL;
-PFNCLRELEASECONTEXT                 __clewReleaseContext                = NULL;
-PFNCLGETCONTEXTINFO                 __clewGetContextInfo                = NULL;
-PFNCLCREATECOMMANDQUEUE             __clewCreateCommandQueue            = NULL;
-PFNCLRETAINCOMMANDQUEUE             __clewRetainCommandQueue            = NULL;
-PFNCLRELEASECOMMANDQUEUE            __clewReleaseCommandQueue           = NULL;
-PFNCLGETCOMMANDQUEUEINFO            __clewGetCommandQueueInfo           = NULL;
-PFNCLSETCOMMANDQUEUEPROPERTY        __clewSetCommandQueueProperty       = NULL;
-PFNCLCREATEBUFFER                   __clewCreateBuffer                  = NULL;
-PFNCLCREATEIMAGE2D                  __clewCreateImage2D                 = NULL;
-PFNCLCREATEIMAGE3D                  __clewCreateImage3D                 = NULL;
-PFNCLRETAINMEMOBJECT                __clewRetainMemObject               = NULL;
-PFNCLRELEASEMEMOBJECT               __clewReleaseMemObject              = NULL;
-PFNCLGETSUPPORTEDIMAGEFORMATS       __clewGetSupportedImageFormats      = NULL;
-PFNCLGETMEMOBJECTINFO               __clewGetMemObjectInfo              = NULL;
-PFNCLGETIMAGEINFO                   __clewGetImageInfo                  = NULL;
-PFNCLCREATESAMPLER                  __clewCreateSampler                 = NULL;
-PFNCLRETAINSAMPLER                  __clewRetainSampler                 = NULL;
-PFNCLRELEASESAMPLER                 __clewReleaseSampler                = NULL;
-PFNCLGETSAMPLERINFO                 __clewGetSamplerInfo                = NULL;
-PFNCLCREATEPROGRAMWITHSOURCE        __clewCreateProgramWithSource       = NULL;
-PFNCLCREATEPROGRAMWITHBINARY        __clewCreateProgramWithBinary       = NULL;
-PFNCLRETAINPROGRAM                  __clewRetainProgram                 = NULL;
-PFNCLRELEASEPROGRAM                 __clewReleaseProgram                = NULL;
-PFNCLBUILDPROGRAM                   __clewBuildProgram                  = NULL;
-PFNCLUNLOADCOMPILER                 __clewUnloadCompiler                = NULL;
-PFNCLGETPROGRAMINFO                 __clewGetProgramInfo                = NULL;
-PFNCLGETPROGRAMBUILDINFO            __clewGetProgramBuildInfo           = NULL;
-PFNCLCREATEKERNEL                   __clewCreateKernel                  = NULL;
-PFNCLCREATEKERNELSINPROGRAM         __clewCreateKernelsInProgram        = NULL;
-PFNCLRETAINKERNEL                   __clewRetainKernel                  = NULL;
-PFNCLRELEASEKERNEL                  __clewReleaseKernel                 = NULL;
-PFNCLSETKERNELARG                   __clewSetKernelArg                  = NULL;
-PFNCLGETKERNELINFO                  __clewGetKernelInfo                 = NULL;
-PFNCLGETKERNELWORKGROUPINFO         __clewGetKernelWorkGroupInfo        = NULL;
-PFNCLWAITFOREVENTS                  __clewWaitForEvents                 = NULL;
-PFNCLGETEVENTINFO                   __clewGetEventInfo                  = NULL;
-PFNCLRETAINEVENT                    __clewRetainEvent                   = NULL;
-PFNCLRELEASEEVENT                   __clewReleaseEvent                  = NULL;
-PFNCLGETEVENTPROFILINGINFO          __clewGetEventProfilingInfo         = NULL;
-PFNCLFLUSH                          __clewFlush                         = NULL;
-PFNCLFINISH                         __clewFinish                        = NULL;
-PFNCLENQUEUEREADBUFFER              __clewEnqueueReadBuffer             = NULL;
-PFNCLENQUEUEWRITEBUFFER             __clewEnqueueWriteBuffer            = NULL;
-PFNCLENQUEUECOPYBUFFER              __clewEnqueueCopyBuffer             = NULL;
-PFNCLENQUEUEREADIMAGE               __clewEnqueueReadImage              = NULL;
-PFNCLENQUEUEWRITEIMAGE              __clewEnqueueWriteImage             = NULL;
-PFNCLENQUEUECOPYIMAGE               __clewEnqueueCopyImage              = NULL;
-PFNCLENQUEUECOPYIMAGETOBUFFER       __clewEnqueueCopyImageToBuffer      = NULL;
-PFNCLENQUEUECOPYBUFFERTOIMAGE       __clewEnqueueCopyBufferToImage      = NULL;
-PFNCLENQUEUEMAPBUFFER               __clewEnqueueMapBuffer              = NULL;
-PFNCLENQUEUEMAPIMAGE                __clewEnqueueMapImage               = NULL;
-PFNCLENQUEUEUNMAPMEMOBJECT          __clewEnqueueUnmapMemObject         = NULL;
-PFNCLENQUEUENDRANGEKERNEL           __clewEnqueueNDRangeKernel          = NULL;
-PFNCLENQUEUETASK                    __clewEnqueueTask                   = NULL;
-PFNCLENQUEUENATIVEKERNEL            __clewEnqueueNativeKernel           = NULL;
-PFNCLENQUEUEMARKER                  __clewEnqueueMarker                 = NULL;
-PFNCLENQUEUEWAITFOREVENTS           __clewEnqueueWaitForEvents          = NULL;
-PFNCLENQUEUEBARRIER                 __clewEnqueueBarrier                = NULL;
-PFNCLGETEXTENSIONFUNCTIONADDRESS    __clewGetExtensionFunctionAddress   = NULL;
-#endif  //  CLCC_GENERATE_DOCUMENTATION
-
-
-//! \brief Unloads OpenCL dynamic library, should not be called directly
-static void clewExit(void)
-{
-    if (module != NULL)
-    {
-        //  Ignore errors
-        CLCC_DYNLIB_CLOSE(module);
-        module = NULL;
-    }
-}
-
-//! \param path path to dynamic library to load
-//! \return CLEW_ERROR_OPEN_FAILED if the library could not be opened
-//! CLEW_ERROR_ATEXIT_FAILED if atexit(clewExit) failed
-//! CLEW_SUCCESS when the library was succesfully loaded
-int clLibraryInit()
-{
-#ifdef _WIN32
-       const char *path = "OpenCL.dll";
-#elif defined(__APPLE__)
-       const char *path = "/Library/Frameworks/OpenCL.framework/OpenCL";
-#else
-       const char *path = "libOpenCL.so";
-#endif
-    int error = 0;
-
-    //  Check if already initialized
-    if (module != NULL)
-    {
-        return 1;
-    }
-
-    //  Load library
-    module = CLCC_DYNLIB_OPEN(path);
-
-    //  Check for errors
-    if (module == NULL)
-    {
-        return 0;
-    }
-
-    //  Set unloading
-    error = atexit(clewExit);
-
-    if (error)
-    {
-        //  Failure queing atexit, shutdown with error
-        CLCC_DYNLIB_CLOSE(module);
-        module = NULL;
-
-        return 0;
-    }
-
-    //  Determine function entry-points

@@ Diff output truncated at 10240 characters. @@
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to