diff --git a/Sources/OpenSubdiv/osd/GLComputeEvaluator.cpp b/Sources/OpenSubdiv/osd/GLComputeEvaluator.cpp index d05c3f26..b06ec52b 100644 --- a/Sources/OpenSubdiv/osd/GLComputeEvaluator.cpp +++ b/Sources/OpenSubdiv/osd/GLComputeEvaluator.cpp @@ -24,12 +24,14 @@ #include "glLoader.h" -#if __has_include("GPUShaders/GPUShaders-Swift.h") +#if 0 +# if __has_include("GPUShaders/GPUShaders-Swift.h") #include "GPUShaders/GPUShaders-Swift.h" -#else +# else #define GPU_SHADERS_INC #include GPU_SHADERS_INC -#endif +# endif +#endif // 0 #include "OpenSubdiv/OSDSurfaceGLComputeEvaluator.h" #include "OpenSubdiv/OSDSurfaceGLSLPatchShaderSource.h" @@ -42,13 +44,12 @@ #include #include -#include GPU_SHADERS_INC - namespace OpenSubdiv { namespace OPENSUBDIV_VERSION { namespace Osd { +#if 0 /* and here, we use our Swift implementation right out of the box, in cxx. magic. */ static GPUShaders::GPUShaders glCompShaders = GPUShaders::GPUShaders::init(); static swift::String glCompCode = glCompShaders.setupMetal(); @@ -61,6 +62,11 @@ static const char *getShaderCode() { ss.str().copy(source, bufSize); return &source[bufSize]; } +#else // 0 +static const char *getShaderCode() { + return ""; +} +#endif static const char *shaderSource = getShaderCode(); diff --git a/Sources/OpenSubdiv/osd/GLSLPatchShaderSource.cpp b/Sources/OpenSubdiv/osd/GLSLPatchShaderSource.cpp index 3bcd58e9..9758fbb7 100644 --- a/Sources/OpenSubdiv/osd/GLSLPatchShaderSource.cpp +++ b/Sources/OpenSubdiv/osd/GLSLPatchShaderSource.cpp @@ -22,24 +22,25 @@ // language governing permissions and limitations under the Apache License. // -#if __has_include("GPUShaders/GPUShaders-Swift.h") +#if 0 +# if __has_include("GPUShaders/GPUShaders-Swift.h") #include "GPUShaders/GPUShaders-Swift.h" -#else +# else #define GPU_SHADERS_INC #include GPU_SHADERS_INC -#endif +# endif +#endif // 0 #include "OpenSubdiv/OSDSurfaceGLSLPatchShaderSource.h" #include #include -#include GPU_SHADERS_INC - namespace OpenSubdiv { namespace OPENSUBDIV_VERSION { namespace Osd { +#if 0 /* and here, we use our Swift implementation right out of the box, in cxx. magic. */ static GPUShaders::GPUShaders glslShaders = GPUShaders::GPUShaders::init(); static swift::String glslCode = glslShaders.setupMetal(); @@ -52,6 +53,11 @@ static const char *getShaderCode() { ss.str().copy(source, bufSize); return &source[bufSize]; } +#else // 0 +static const char *getShaderCode() { + return ""; +} +#endif static const char *commonShaderSource = getShaderCode(); static const char *commonTessShaderSource = getShaderCode(); diff --git a/Sources/OpenSubdiv/osd/GLXFBEvaluator.cpp b/Sources/OpenSubdiv/osd/GLXFBEvaluator.cpp index 794993b9..302b890a 100644 --- a/Sources/OpenSubdiv/osd/GLXFBEvaluator.cpp +++ b/Sources/OpenSubdiv/osd/GLXFBEvaluator.cpp @@ -24,12 +24,14 @@ #include "glLoader.h" -#if __has_include("GPUShaders/GPUShaders-Swift.h") +#if 0 +# if __has_include("GPUShaders/GPUShaders-Swift.h") #include "GPUShaders/GPUShaders-Swift.h" -#else +# else #define GPU_SHADERS_INC #include GPU_SHADERS_INC -#endif +# endif +#endif // 0 #include "OpenSubdiv/OSDSurfaceGLXFBEvaluator.h" #include "OpenSubdiv/OSDSurfaceGLSLPatchShaderSource.h" @@ -42,8 +44,6 @@ #include "OpenSubdiv/OSDAdaptiveError.h" #include "OpenSubdiv/OSDAdaptiveStencilTable.h" -#include GPU_SHADERS_INC - #if _MSC_VER #define snprintf _snprintf #endif @@ -53,6 +53,7 @@ namespace OPENSUBDIV_VERSION { namespace Osd { +#if 0 /* and here, we use our Swift implementation right out of the box, in cxx. magic. */ static GPUShaders::GPUShaders glXShaders = GPUShaders::GPUShaders::init(); static swift::String glXCode = glXShaders.setupMetal(); @@ -65,6 +66,11 @@ static const char *getShaderCode() { ss.str().copy(source, bufSize); return &source[bufSize]; } +#else // 0 +static const char *getShaderCode() { + return ""; +} +#endif static const char *shaderSource = getShaderCode(); diff --git a/Sources/OpenSubdiv/osd/MTLPatchShaderSource.mm b/Sources/OpenSubdiv/osd/MTLPatchShaderSource.mm index d8ae50c0..88ff3058 100644 --- a/Sources/OpenSubdiv/osd/MTLPatchShaderSource.mm +++ b/Sources/OpenSubdiv/osd/MTLPatchShaderSource.mm @@ -22,12 +22,14 @@ // language governing permissions and limitations under the Apache License. // -#if __has_include("GPUShaders/GPUShaders-Swift.h") +#if 0 +# if __has_include("GPUShaders/GPUShaders-Swift.h") #import "GPUShaders/GPUShaders-Swift.h" -#else +# else #define GPU_SHADERS_INC #import GPU_SHADERS_INC -#endif +# endif +#endif // 0 #include "OpenSubdiv/OSDAdaptiveError.h" #include "OpenSubdiv/OSDSurfaceMTLPatchShaderSource.h" @@ -41,6 +43,7 @@ namespace Osd { +#if 0 /* and here, we use our Swift implementation right out of the box, in cxx. magic. */ static GPUShaders::GPUShaders mtlShaders = GPUShaders::GPUShaders::init(); static swift::String shaderCode = mtlShaders.setupMetal(); @@ -55,6 +58,18 @@ static std::string gregoryShaderSource([shaderCode UTF8String]); static std::string gregoryBasisShaderSource([shaderCode UTF8String]); static std::string gregoryTriangleShaderSource([shaderCode UTF8String]); +#else // 0 +static std::string commonShaderSource(""); +static std::string commonTessShaderSource(""); +static std::string patchLegacyShaderSource(""); +static std::string patchBasisTypesShaderSource(""); +static std::string patchBasisShaderSource(""); +static std::string bsplineShaderSource(""); +static std::string boxSplineTriangleShaderSource(""); +static std::string gregoryShaderSource(""); +static std::string gregoryBasisShaderSource(""); +static std::string gregoryTriangleShaderSource(""); +#endif static std::string GetPatchTypeDefine( Far::PatchDescriptor::Type type, diff --git a/Sources/OpenSubdiv/osd/hlslPatchShaderSource.cpp b/Sources/OpenSubdiv/osd/hlslPatchShaderSource.cpp index 2a2d2565..3c77222f 100644 --- a/Sources/OpenSubdiv/osd/hlslPatchShaderSource.cpp +++ b/Sources/OpenSubdiv/osd/hlslPatchShaderSource.cpp @@ -22,12 +22,14 @@ // language governing permissions and limitations under the Apache License. // -#if __has_include("GPUShaders/GPUShaders-Swift.h") +#if 0 +# if __has_include("GPUShaders/GPUShaders-Swift.h") #include "GPUShaders/GPUShaders-Swift.h" -#else +# else #define GPU_SHADERS_INC #include GPU_SHADERS_INC -#endif +# endif +#endif // 0 #include "OpenSubdiv/OSDAdaptiveError.h" #include "OpenSubdiv/OSDSurfaceHLSLPatchShaderSource.h" @@ -40,6 +42,7 @@ namespace OPENSUBDIV_VERSION { namespace Osd { +#if 0 /* and here, we use our Swift implementation right out of the box, in cxx. magic. */ static GPUShaders::GPUShaders hlslShaders = GPUShaders::GPUShaders::init(); static swift::String hlslCode = hlslShaders.setupMetal(); @@ -52,7 +55,6 @@ static const char *getShaderCode() { ss.str().copy(source, bufSize); return &source[bufSize]; } - static const char *commonShaderSource = getShaderCode(); static const char *commonTessShaderSource = getShaderCode(); static const char *patchLegacyShaderSource = getShaderCode(); @@ -63,6 +65,18 @@ static const char *bsplineShaderSource = getShaderCode(); static const char *gregoryShaderSource = getShaderCode(); static const char *gregoryBasisShaderSource = getShaderCode(); static const char *gregoryTriangleShaderSource = getShaderCode(); +#else // 0 +static const char *commonShaderSource = ""; +static const char *commonTessShaderSource = ""; +static const char *patchLegacyShaderSource = ""; +static const char *patchBasisTypesShaderSource = ""; +static const char *patchBasisShaderSource = ""; +static const char *boxSplineTriangleShaderSource = ""; +static const char *bsplineShaderSource = ""; +static const char *gregoryShaderSource = ""; +static const char *gregoryBasisShaderSource = ""; +static const char *gregoryTriangleShaderSource = ""; +#endif // 0 /*static*/ std::string HLSLPatchShaderSource::GetPatchDrawingShaderSource() {