Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved osd patch basis compatibility #1321

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions opensubdiv/osd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,18 @@ set(PUBLIC_HEADER_FILES
types.h
)

list(APPEND KERNEL_FILES
patchBasisCommonTypes.h
patchBasisCommon.h
patchBasisCommonEval.h
set(DOXY_HEADER_FILES ${PUBLIC_HEADER_FILES})

# These are public but excluded from doxygen
list(APPEND PUBLIC_HEADER_FILES
patchBasisTypes.h
patchBasis.h
)

set(DOXY_HEADER_FILES ${PUBLIC_HEADER_FILES})
list(APPEND KERNEL_FILES
patchBasisTypes.h
patchBasis.h
)

#-------------------------------------------------------------------------------
set(OPENMP_PUBLIC_HEADERS
Expand Down
10 changes: 3 additions & 7 deletions opensubdiv/osd/clEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,10 @@ static const char *clSource =
#include "clKernel.gen.h"
;
static const char *patchBasisTypesSource =
#include "patchBasisCommonTypes.gen.h"
#include "patchBasisTypes.gen.h"
;
static const char *patchBasisSource =
#include "patchBasisCommon.gen.h"
;
static const char *patchBasisEvalSource =
#include "patchBasisCommonEval.gen.h"
#include "patchBasis.gen.h"
;

// ----------------------------------------------------------------------------
Expand Down Expand Up @@ -175,9 +172,8 @@ CLEvaluator::Compile(BufferDescriptor const &srcDesc,
const char *sources[] = { defineStr.c_str(),
patchBasisTypesSource,
patchBasisSource,
patchBasisEvalSource,
clSource };
_program = clCreateProgramWithSource(_clContext, 5, sources, 0, &errNum);
_program = clCreateProgramWithSource(_clContext, 4, sources, 0, &errNum);
if (errNum != CL_SUCCESS) {
Far::Error(Far::FAR_RUNTIME_ERROR,
"clCreateProgramWithSource (%d)", errNum);
Expand Down
4 changes: 1 addition & 3 deletions opensubdiv/osd/cpuEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@

#include "../osd/cpuEvaluator.h"
#include "../osd/cpuKernel.h"
#include "../osd/patchBasisCommonTypes.h"
#include "../osd/patchBasisCommon.h"
#include "../osd/patchBasisCommonEval.h"
#include "../osd/patchBasis.h"

#include <cstdlib>

Expand Down
5 changes: 2 additions & 3 deletions opensubdiv/osd/cudaKernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@

#include <assert.h>
#define OSD_PATCH_BASIS_CUDA
#include "../osd/patchBasisCommonTypes.h"
#include "../osd/patchBasisCommon.h"
#include "../osd/patchBasisCommonEval.h"
#include "../osd/patchBasisTypes.h"
#include "../osd/patchBasis.h"

// -----------------------------------------------------------------------------
template<int N> struct DeviceVertex {
Expand Down
8 changes: 2 additions & 6 deletions opensubdiv/osd/glslPatchShaderSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,10 @@ static const char *patchLegacyShaderSource =
#include "glslPatchLegacy.gen.h"
;
static const char *patchBasisTypesShaderSource =
#include "patchBasisCommonTypes.gen.h"
#include "patchBasisTypes.gen.h"
;
static const char *patchBasisShaderSource =
#include "patchBasisCommon.gen.h"
;
static const char *patchBasisEvalShaderSource =
#include "patchBasisCommonEval.gen.h"
#include "patchBasis.gen.h"
;
static const char *boxSplineTriangleShaderSource =
#include "glslPatchBoxSplineTriangle.gen.h"
Expand Down Expand Up @@ -84,7 +81,6 @@ GLSLPatchShaderSource::GetPatchBasisShaderSource() {
#endif
ss << std::string(patchBasisTypesShaderSource);
ss << std::string(patchBasisShaderSource);
ss << std::string(patchBasisEvalShaderSource);
return ss.str();
}

Expand Down
8 changes: 2 additions & 6 deletions opensubdiv/osd/hlslPatchShaderSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,10 @@ static const char *patchLegacyShaderSource =
#include "hlslPatchLegacy.gen.h"
;
static const char *patchBasisTypesShaderSource =
#include "patchBasisCommonTypes.gen.h"
#include "patchBasisTypes.gen.h"
;
static const char *patchBasisShaderSource =
#include "patchBasisCommon.gen.h"
;
static const char *patchBasisEvalShaderSource =
#include "patchBasisCommonEval.gen.h"
#include "patchBasis.gen.h"
;
static const char *boxSplineTriangleShaderSource =
#include "hlslPatchBoxSplineTriangle.gen.h"
Expand Down Expand Up @@ -86,7 +83,6 @@ HLSLPatchShaderSource::GetPatchBasisShaderSource() {
#endif
ss << std::string(patchBasisTypesShaderSource);
ss << std::string(patchBasisShaderSource);
ss << std::string(patchBasisEvalShaderSource);
return ss.str();
}

Expand Down
8 changes: 2 additions & 6 deletions opensubdiv/osd/mtlPatchShaderSource.mm
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,10 @@
#include "mtlPatchLegacy.gen.h"
);
static std::string patchBasisTypesShaderSource(
#include "patchBasisCommonTypes.gen.h"
#include "patchBasisTypes.gen.h"
);
static std::string patchBasisShaderSource(
#include "patchBasisCommon.gen.h"
);
static std::string patchBasisEvalShaderSource(
#include "patchBasisCommonEval.gen.h"
#include "patchBasis.gen.h"
);
static std::string bsplineShaderSource(
#include "mtlPatchBSpline.gen.h"
Expand Down Expand Up @@ -171,7 +168,6 @@
#endif
ss << patchBasisTypesShaderSource;
ss << patchBasisShaderSource;
ss << patchBasisEvalShaderSource;
return ss.str();
}

Expand Down
4 changes: 1 addition & 3 deletions opensubdiv/osd/ompEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@

#include "../osd/ompEvaluator.h"
#include "../osd/ompKernel.h"
#include "../osd/patchBasisCommonTypes.h"
#include "../osd/patchBasisCommon.h"
#include "../osd/patchBasisCommonEval.h"
#include "../osd/patchBasis.h"
#include <omp.h>

namespace OpenSubdiv {
Expand Down
Loading
Loading