Commit Graph

50 Commits

Author SHA1 Message Date
David G Yu
28f2574bc5 Moved GLEW dependencies to glLoader wrapper
This introduces an internal glLoader library which allows
most of the implementation to be agnostic about the
implementation of the GL loading library.  Specifically,
this removes references to the GLEW headers and libraries
from the rest of the source code and build system.
2020-03-03 17:10:30 -08:00
barry
c424594625 Major step towards consistent use of include paths in source files:
- changed the main OPENSUBDIV_INCLUDE_DIR to exclude ./opensubdiv
    - updated CMakeLists.txt files in non-examples to use only this path
    - updated CMakeLists.txt files in examples to append ./opensubdiv to path
    - updated source in regression/common to use #include <opensubdiv/...>
    - updated source in examples/common to use #include <opensubdiv/...>
    - deferred source in examples to be updated on a case-by-case basis
2018-10-09 10:51:31 -07:00
George ElKoura
4383d2b5ac Several improvements to CI building and testing
- Added support for OSX CI builds and tests
- Cleaned up build scripts and moved to $ROOT/build_scripts
- On Linux: moved to trusty distro
- On Linux: enabled OpenMP, TBB and PTex build options
- On Linux: install and setup xvfb with newer mesa drivers to run our GL tests
- On Linux: enable GL tests
2017-06-30 12:52:01 -07:00
Thomas Thomassen
72610a3043 Glean up GLEW and GLFW. 2016-06-25 10:29:59 +02:00
barfowl
db3fe9a8e8 Reduced warnings resulting from GCC's -Wshadow option
- eliminated warnings from core libraries and regression code
2015-07-29 18:46:18 -07:00
George ElKoura
5a51f31104 Remove mention of vtr from tests and examples.
- Renamed common/vtr_utils to common/far_utils.
- Renamed all mentions of Vtr in the sources of tests and examples.
2015-05-30 22:10:07 -07:00
Takahito Tejima
f9523f916f osdlayer: rename Osd::VertexBufferDescriptor to Osd::BufferDescriptor.
A mechanical substitution of VertexBufferDescriptor with BufferDescriptor.
Also removing unused files from osd.
2015-05-29 09:21:14 -07:00
Takahito Tejima
89dcea57c2 Fix CMakeLists: make project-relative include path overridable
All examples, regression tests and tutorials directly looked into
opensubdiv source directory to grab the header files. This is somewhat
convenient during development but they can mistakenly access private
header files.

With this change, when OPENSUBDIV_INCLUDE_DIR is given to cmake,
it will be used as an include search path to build examples etc.
Otherwise it follows the same behavior as before.

Also replaces include references to the files in regression dir
to be relative, and cleanups some copy-paste patterns.
2015-05-28 17:32:33 -07:00
Takahito Tejima
a7c5179ef9 renaming (2/2) PatchTables and StencilTables to PatchTable and StencilTable
replace all occurrences reffering PatchTables, StencilTables, and their factories.
2015-05-22 11:50:01 -07:00
barfowl
6d5b29c2dc Replacing use of old Far::TopologyRefiner methods with Far::TopologyLevel 2015-05-21 19:52:25 -07:00
Takahito Tejima
33bfbf699b Refurbish osd layer API.
In OpenSubdiv 2.x, we encapsulated subdivision tables into
compute context in osd layer since those tables are order-dependent
and have to be applied in a certain manner. In 3.0, we adopted stencil
table based refinement. It's more simple and such an encapsulation is
no longer needed. Also 2.0 API has several ownership issues of GPU
kernel caching, and forces unnecessary instantiation of controllers
even though the cpu kernels typically don't need instances unlike GPU ones.

This change completely revisit osd client facing APIs. All contexts and
controllers were replaced with device-specific tables and evaluators.
While we can still use consistent API across various device backends,
unnecessary complexities have been removed. For example, cpu evaluator
is just a set of static functions and also there's no need to replicate
FarStencilTables to ComputeContext.

Also the new API delegates the ownership of compiled GPU kernels
to clients, for the better management of resources especially in multiple
GPU environment.

In addition to integrating ComputeController and EvalStencilController into
a single function Evaluator::EvalStencils(), EvalLimit API is also added
into Evaluator. This is working but still in progress, and we'll make a followup
change for the complete implementation.

-some naming convention changes:
GLSLTransformFeedback to GLXFBEvaluator
GLSLCompute to GLComputeEvaluator

-move LimitLocation struct into examples/glEvalLimit.
We're still discussing patch evaluation interface. Basically we'd like
to tease all ptex-specific parametrization out of far/osd layer.

TODO:
-implments EvalPatches() in the right way
-derivative evaluation API is still interim.
-VertexBufferDescriptor needs a better API to advance its location
-synchronization mechanism is not ideal (too global).
-OsdMesh class is hacky. need to fix it.
2015-05-08 17:31:26 -07:00
Takahito Tejima
f3aec9eb31 Remove osd/vertex.h
OsdVertex was used in 2.x FarMesh as a placeholder for Hbr template parameter.
We don't need such a class any more.
2015-05-07 12:34:09 -07:00
Takahito Tejima
82a0513326 cleanup CL/CUDA example harnesses.
refactor CL/CUDA specific initialization stuffs into
examples/common/clDeviceContext and cudaDeviceContext, and
update examples to use those structs.

also
- remove CL/CUDA tests from osd_regression. The tests for those kernels will be covered by glImaging.
- update cuda initialization to use the GL-interoperable device if available.
- remove CL specialization from glShareTopology, following the same pattern as we took in the previous OsdGLMesh refactoring. (still something strange with XFB kernels though)
- fix file permissions.
2015-04-28 15:46:37 -07:00
Takahito Tejima
de0082ba95 Simplify Osd::MeshInterface.
Removed OpenCL/D3D11 specialization and add DEVICE_CONTEXT as a template
parameter. For the kernels which don't need a context object (e.g.
CPU, OpenGL, cuda) just ignore the context, and for the kernels which
use a context (e.g. OpenCL, DirectX) takes a context or a user-defined
class as which encapsulates device contexts. Note that OpenCL requires
two objects, cl_context and cl_command_queue. The user-defined
class must provide GetContext() and GetCommandQueue() for strongly typed
binding to osd VertexBuffers and ComputeContexts.

Osd::Mesh and MeshInterface have been used as a handy harness to host
multiple GPU kernels and graphics APIs. However it has CL/DirectX
specializations and duplicates large amount of plubming code. With this
change, glMesh.h and d3d11Mesh.h become just typedefs and all logic is
put into mesh.h without specializations.

Also cleaned up unused header files and code formatting.
2015-04-27 11:27:05 -07:00
Takahito Tejima
8da827336d Removes FarKernelBatch.
This is the first step to tease off Osd compute controller/contexts
from Far API.
Currently FarStencilTable only creates a kernelbatch for the entire range,
so we can use [0, numStencils) for all cases instead of KernelBatch.
This might not be true if we apply non-factorized level-wise stencils,
then we'll add another modular utility to serve those cases.
2015-04-10 11:08:24 -07:00
George ElKoura
8766155831 Re-enable loop tests in osd_regression. 2015-04-03 17:48:27 -07:00
Jeremy Cowles
28e39bf86f Enable osd_regression and suppress warnings. 2015-03-30 22:18:18 -07:00
George ElKoura
e9b34b596c CL backend now compiles. 2015-03-29 02:07:00 -07:00
George ElKoura
e06debc4e8 Many more fix-ups to the osd_regression tests:
- CPU, CPUGL backends both updated
 - CL backend still needs work
 - Loop subdivision tests disabled because they don't work
 - Hedit tests disbaled because they don't work
2015-03-29 01:27:20 -07:00
C64Kernal
38b079d4ea Compilation fixes for gcc. 2015-03-28 23:53:12 -07:00
George ElKoura
f53964ead1 osd_regression regression now compiles. There was a first attempt at
getting the CPU backend converted.  Still not ready for prime-time by a long
shot.
2015-03-28 11:18:00 -07:00
manuelk
c399655dcc Landing 3.0.0.alpha
Sync'ing the 'dev' branch with the 'feature_3.0dev' branch at commit 68c6d11fc36761ae1a5e6cdc3457be16f2e9704a

The branch 'feature_3.0dev' is now locked and preserved for historical purposes.
2014-09-05 15:07:46 -07:00
Takahito Tejima
d960990063 Remove FarMesh dependency from Osd*Context. The context constructor takes
subdivision tables and vertex edit tables directly.
2014-03-28 12:10:13 -07:00
manuelk
3ae50d1c50 Amending Apache license language & file headers.
New text:

     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.
2013-09-26 12:04:57 -07:00
Takahito Tejima
51a45b598d Updating EULA 2013-07-18 14:19:50 -07:00
David G Yu
7d16bffccb Continued cleanup of OpenGL dependencies 2013-06-26 00:52:57 -07:00
manuelk
30ec963112 fix example code to work with GLFW 3.0
- fix FindGLFW.cmake to match the new locations

- fix all viewer & examples to build with 3.0, 3.0.1 and 3.0.2

Note : ptxViewer and paintTest do not work with 3.0.1 and 3.0.2 (yet)
2013-06-20 11:53:33 -07:00
manuelk
fbcb02d39e Fixed dyu's fix (we do need the window title in Osd Regression with GLFW 3.0) 2013-05-07 14:25:37 -07:00
David G Yu
2a12b21ab2 Removed mutex implementation.
We added this to support earlier versions
of hbr, but it is no longer needed.
2013-05-07 11:27:14 -07:00
David G Yu
93476a368d Fixed a few OS X build errors. 2013-05-06 23:59:58 -07:00
manuelk
20d61cd93c A quad face with 2 non-consecutive boundary edges causes the 4 vertices
of this quad to be tagged as boundary. These vertices will cause the
feature adaptive pass to generate sub-faces where appropriate, however
the face itself will not be identified as "non-patch", which causes the
FarPatchTables factory to mis-identify it and fall-back on an assert.

This fix flags these particular quad faces in the first adaptive pass.

The particular shape that caused the crash has also been addded to our
regression suite.

fixes #159
2013-05-02 19:37:34 -07:00
Takahito Tejima
d026aca006 use std::string instead of char* for regression shapes definition,
to avoid MSVC's literal length limitation on some big shapes.
2013-03-19 14:43:21 -07:00
Takahito Tejima
fbc139d39c fix compile errors on gcd kernel 2013-03-07 22:43:47 -08:00
Takahito Tejima
8efecb0fca Batching stuffs: generalized kernel batches, table/dispatcher refactoring, multiMeshFactory, drawContext, etc.
2 client APIs are changed.
- VertexBuffer::UpdateData() takes start vertex offset
- ComputeController::Refine() takes FarKernelBatchVector

Also, ComputeContext no longer holds farmesh.
Client can free farmesh after OsdComputeContext is created.
(but still need FarKernelBatchVector to apply subdivision kernels)
2013-03-07 17:50:15 -08:00
manuelk
ef408fc67c - remove the now obsolete glutViewer (replaced by glViewer)
- remove some glut-era callbacks in glViewer / ptexViewer
- fix OSX includes in osd_regression

fixes #117
2013-02-08 14:06:44 -08:00
manuelk
c53f973651 - fixed GL context crashes for Linux / GLFW 3.0
- refactored CLI arguments parsing
- minor code style cleanups
2013-02-06 14:07:47 -08:00
Manuel Kraemer
758a788b32 Merge pull request #110 from aras-p/osd_regression_work
osd_regression: add "CL" backend that tests OpenCL kernel
2013-02-06 08:00:09 -08:00
David G Yu
88679ce187 Fixed WIN32 build breakage.
GLFW tries to avoid including windows.h, but by hijacking
macro definitions provided by windows.h GLFW actually
further pollutes the global namespace.
2013-02-05 17:05:59 -08:00
Aras Pranckevicius
663a62cb08 osd_regression: add "CL" backend that tests OpenCL kernel with GL buffer backing 2013-02-04 22:01:59 +02:00
Aras Pranckevicius
660fd15e3b osd_regression: implement raw CPU and CPU with GL VBO backing tests. Actually count test failures; they were not counted before ;) 2013-02-03 19:25:22 +02:00
Aras Pranckevicius
e0b231424f osd_regression: towards running all test cases per backend (checkBackend function) 2013-02-03 19:07:04 +02:00
Aras Pranckevicius
1fbdf77bb4 osd_regression: towards testing multiple backends; adding cmdline arg parsing 2013-02-03 19:00:28 +02:00
manuelk
055ab17357 migrate osd_regression from GLUT to GLFW (this regression still needs work)
fixes #98
2013-01-31 18:19:56 -08:00
manuelk
10c687ecd5 Release Candidate 1.0 :
- [Feature Adaptive GPU Rendering of Catmull-Clark Surfaces](http://research.microsoft.com/en-us/um/people/cloop/tog2012.pdf).

- New API architecture : we are planning to lock on to this new framework as the basis for backward compatibility, which we will enforce from Release 1.0 onward. Subsequent releases of OpenSubdiv should not break client code.

- DirectX 11 support

- and much more...
2012-12-10 17:15:13 -08:00
manuelk
5f5207999f Refactoring far (cliff notes):
- All data representation classes are now single-templated for a vertex class 'U'

    - All constructors / instancing code has been moved into "Factory" functions that are dual-templated
      for two vertex classes <class T, class U=T>. This allows hbr specialization with a placeholder
      vertex flass 'T' for faster analysis without paying interpolation costs, while far can still specialize
      a fully implemented vertex class 'U' with full subdivision functionality.

    - Some preliminary clean-up work on FarVertexEditTables with the addition of a FarVertexEdit class
      as a replacement for the former HbrVertedEdit which was introducing back dependencies on hbr. The
      implementation is very lightweight. Some slight renaming / cleanup of the code, with some more to
      be done.

    - there are no more dependencies on hbr (not even #include) from far's data structure !

Notes :
    - the FarDispatcher mechanism has become somewhat awkward and should be re-evaluated when refactoring osd.

    - the "Factory" pattern survives this round of refactoring until we can find something better.

Closes #34
2012-09-17 18:41:48 -07:00
manuelk
783eed920a Remove IlmBase dependencies for now as we are not using any of the features.
Leaving cmake/FindIlmBase.cmake in case we need the API in the future.

Closes #36
2012-08-10 16:40:22 -07:00
manuelk
e2217e182c From now on, hbr assumes that its clients will provide the defition of a
mutex class with Lock / Unlock public functions.

- remove Mutex implementation from Hbr (and revert to original PRman code)
- provide a Mutex class stub in osd
- add some forward declarations in OsdMesh to limit some of the mutex spills
- #include <osd/mutex.h> where needed (little hackish until we can refactor
some of far better)
- remove ILM_BASE from some CMakeLists

Closes #48
2012-08-10 15:14:02 -07:00
manuelk
a1552cfe82 Siggrpah 2012 - rolling over all of prepro work into beta 1.1 2012-08-03 19:51:27 -07:00
manuelk
b6b2a0aadd Defaulting the regression to kCPU type kernels until an automatic
regression system is implemented.

Closes #26.
2012-06-20 16:18:58 -07:00
manuelk
7dc52d2a64 Actual regression code (currently hard-locked in single CPU mode - need to branch for all kernel types)
Closes #18.
2012-06-19 19:01:01 -07:00