Skip to content

Commit

Permalink
Fix inclusion of GPUShaders for OSD.
Browse files Browse the repository at this point in the history
  • Loading branch information
furby-tm committed Nov 12, 2023
1 parent de654aa commit 4963948
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 36 deletions.
2 changes: 1 addition & 1 deletion Sources/OpenSubdiv/include/OpenSubdiv/OSDBoundBilinear.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define OPENSUBDIV3_HBRBILINEAR_H

/*#define HBR_DEBUG */
#include "../OpenSubdiv/OSDBoundsubdivision.h"
#include "../OpenSubdiv/OSDBoundSubdivision.h"

#include "OpenSubdiv/OSDVersion.h"

Expand Down
2 changes: 1 addition & 1 deletion Sources/OpenSubdiv/include/OpenSubdiv/OSDBoundCatmark.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define OPENSUBDIV3_HBRCATMARK_H

/*#define HBR_DEBUG */
#include "../OpenSubdiv/OSDBoundsubdivision.h"
#include "../OpenSubdiv/OSDBoundSubdivision.h"

#include "OpenSubdiv/OSDVersion.h"

Expand Down
2 changes: 1 addition & 1 deletion Sources/OpenSubdiv/include/OpenSubdiv/OSDBoundLoop.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <assert.h>
#include <cmath>

#include "../OpenSubdiv/OSDBoundsubdivision.h"
#include "../OpenSubdiv/OSDBoundSubdivision.h"

#include "OpenSubdiv/OSDVersion.h"

Expand Down
35 changes: 35 additions & 0 deletions Sources/OpenSubdiv/include/OpenSubdiv/OSDSurfaceGpuShaders.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//
// Copyright 2013 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//

#ifndef OPENSUBDIV3_OSD_GPU_SHADERS_H
#define OPENSUBDIV3_OSD_GPU_SHADERS_H

/* sly workaround, since SwiftPM doesn't yet know how
* to automatically include the autogenerated Swift header. */
#define GPU_SHADERS_INC <GPU_SHADERS_SWIFT_OSD_H>

/* shaders (HLSL, GLSL, METAL). */
#include GPU_SHADERS_INC

#endif /* OPENSUBDIV3_OSD_GPU_SHADERS_H */
15 changes: 1 addition & 14 deletions Sources/OpenSubdiv/include/OpenSubdiv/OpenSubdiv.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,6 @@
#ifndef __OPENSUBDIV_H__
#define __OPENSUBDIV_H__

#include <Foundation/Foundation.h>
#include <Metal/Metal.h>

FOUNDATION_EXPORT double OpenSubdivVersionNumber;

FOUNDATION_EXPORT const unsigned char OpenSubdivVersionString[];

/* sly workaround, since SwiftPM doesn't yet know how
* to automatically include the autogenerated Swift header. */
#define GPU_SHADERS_INC <GPU_SHADERS_SWIFT_OSD_H>

/* shaders (HLSL, GLSL, METAL). */
#include GPU_SHADERS_INC

/* version. */
#include <OpenSubdiv/OSDVersion.h>

Expand Down Expand Up @@ -132,6 +118,7 @@ FOUNDATION_EXPORT const unsigned char OpenSubdivVersionString[];
#include <OpenSubdiv/OSDSurfaceOpenCLGLVertexBuffer.h>
#include <OpenSubdiv/OSDSurfaceOpenCLPatchTable.h>
#include <OpenSubdiv/OSDSurfaceOpenCLVertexBuffer.h>
#include <OpenSubdiv/OSDSurfaceGpuShaders.h>
#ifdef __CUDA__
#include <OpenSubdiv/OSDSurfaceCudaGLVertexBuffer.h>
#include <OpenSubdiv/OSDSurfaceCudaPatchTable.h>
Expand Down
5 changes: 1 addition & 4 deletions Sources/OpenSubdiv/osd/GLComputeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@
// language governing permissions and limitations under the Apache License.
//

/* sly workaround, since SwiftPM doesn't yet know how
* to automatically include the autogenerated Swift header. */
#define GPU_SHADERS_INC <GPU_SHADERS_SWIFT_OSD_H>

#include "glLoader.h"

#include "OpenSubdiv/OSDSurfaceGLComputeEvaluator.h"
#include "OpenSubdiv/OSDSurfaceGLSLPatchShaderSource.h"
#include "OpenSubdiv/OSDSurfaceGpuShaders.h"

#include "OpenSubdiv/OSDAdaptiveError.h"
#include "OpenSubdiv/OSDAdaptiveStencilTable.h"
Expand Down
4 changes: 1 addition & 3 deletions Sources/OpenSubdiv/osd/GLSLPatchShaderSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@
// language governing permissions and limitations under the Apache License.
//

/* sly workaround, since SwiftPM doesn't yet know how
* to automatically include the autogenerated Swift header. */
#define GPU_SHADERS_INC <GPU_SHADERS_SWIFT_OSD_H>

#include "OpenSubdiv/OSDSurfaceGLSLPatchShaderSource.h"
#include "OpenSubdiv/OSDSurfaceGpuShaders.h"
#include <sstream>
#include <string>

Expand Down
5 changes: 1 addition & 4 deletions Sources/OpenSubdiv/osd/GLXFBEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@
// language governing permissions and limitations under the Apache License.
//

/* sly workaround, since SwiftPM doesn't yet know how
* to automatically include the autogenerated Swift header. */
#define GPU_SHADERS_INC <GPU_SHADERS_SWIFT_OSD_H>

#include "glLoader.h"

#include "OpenSubdiv/OSDSurfaceGLXFBEvaluator.h"
#include "OpenSubdiv/OSDSurfaceGLSLPatchShaderSource.h"
#include "OpenSubdiv/OSDSurfaceGpuShaders.h"

#include <cstdio>
#include <sstream>
Expand Down
5 changes: 1 addition & 4 deletions Sources/OpenSubdiv/osd/MTLPatchShaderSource.mm
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@
// language governing permissions and limitations under the Apache License.
//

/* sly workaround, since SwiftPM doesn't yet know how
* to automatically include the autogenerated Swift header. */
#define GPU_SHADERS_INC <GPU_SHADERS_SWIFT_OSD_H>

#include "OpenSubdiv/OSDAdaptiveError.h"
#include "OpenSubdiv/OSDSurfaceMTLPatchShaderSource.h"
#include "OpenSubdiv/OSDSurfaceGpuShaders.h"

#include <TargetConditionals.h>
#include <sstream>
Expand Down
5 changes: 1 addition & 4 deletions Sources/OpenSubdiv/osd/hlslPatchShaderSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@
// language governing permissions and limitations under the Apache License.
//

/* sly workaround, since SwiftPM doesn't yet know how
* to automatically include the autogenerated Swift header. */
#define GPU_SHADERS_INC <GPU_SHADERS_SWIFT_OSD_H>

#include "OpenSubdiv/OSDAdaptiveError.h"
#include "OpenSubdiv/OSDSurfaceHLSLPatchShaderSource.h"
#include "OpenSubdiv/OSDSurfaceGpuShaders.h"

#include <sstream>
#include <string>
Expand Down

0 comments on commit 4963948

Please sign in to comment.