Commit Graph

1414 Commits

Author SHA1 Message Date
David G. Yu
421e60f8c5 A couple more DX / OpenCL changes for AMD 2015-04-30 10:01:01 -07:00
David G Yu
0d0f6210ac Merge pull request #454 from takahito-tejima/dev
Fix DX-OpenCL/CUDA interop.
2015-04-29 23:11:16 -07:00
Takahito Tejima
9316852e69 use OPENSUBDIV_HAS_DX11SDK
replace OPENSUBDIV_HAS_DX of the previous change with
OPENSUBDIV_HAS_DX11SDK since we already have that.
2015-04-29 17:06:42 -07:00
takahito-tejima
04009e8a80 fix mac build. 2015-04-29 14:14:41 -07:00
Takahito Tejima
bfe0be5226 CMakeLists: remove unnecessary lines 2015-04-29 14:00:52 -07:00
Takahito Tejima
dcb022e1db Fix DX-OpenCL/CUDA interop.
- resolves DX-CL interop functions in Osd::ClD3D11VertexBuffer.
- enable CL kernels in DX build.
- more cleanup in test harnesses, adding D3D11 initializations into DeviceContext.
- add new defines OPENSUBDIV_HAS_OPENGL and OPENSUBDIV_HAS_DX for convenience.
2015-04-29 11:51:12 -07:00
George ElKoura
766ed5b316 Merge pull request #453 from takahito-tejima/travis
Add some comments into .travis.yml
2015-04-28 18:40:26 -07:00
barfowl
abce99950d Minor improvements to definition and use of Vtr::StackBuffer:
- removed default value for its <SIZE> parameter
    - updated all usage to specify a value for <SIZE>
    - added explicit element destruction missing from destructor
    - corrected comment regarding VLA's being non-standard
2015-04-28 17:31:43 -07:00
Takahito Tejima
8233e9d258 Add some comments into .travis.yml
(also triggerring the first test build)
2015-04-28 17:31:04 -07:00
Jeremy Cowles
917bfa0c85 Merge pull request #451 from takahito-tejima/travis
Travis CI configuration
2015-04-28 16:55:32 -07:00
David G Yu
5d7147c358 Merge pull request #452 from takahito-tejima/dev
cleanup CL/CUDA example harnesses.
2015-04-28 16:18:17 -07:00
Takahito Tejima
dc137283dd removing unnecessary cuda includes from examples. 2015-04-28 16:13:48 -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
2a543ee9a8 Travis CI configuration
add NO_GLTESTS option to cmake.
2015-04-28 14:44:07 -07:00
Takahito Tejima
99f1b57ba5 Merge pull request #448 from davidgyu/patcheval
Fixed gathering of patches near non-manifold topo
2015-04-27 13:34:18 -07:00
David G Yu
6b884ec1ae Merge pull request #447 from takahito-tejima/refactor
Simplify Osd::MeshInterface.
2015-04-27 13:22:17 -07:00
David G Yu
46b2cac54b Fixed gathering of patches near non-manifold topo
The previous change to the gathering of patch points went
a bit too far. Near non-manifold features it is important
to be careful when traversing the faces in a level to avoid
assumptions that are valid only for manifold topology.

Also, removed Vtr::Level::gatherQuadRegularPatchPoints().
This method was added in my previous change, but it is
unsafe to use in the presence of non-manifold topology.
2015-04-27 12:40:18 -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
e604da58e9 Merge pull request #445 from c64kernal/dev_fix
Fix an out-of-bounds read.
2015-04-27 10:30:08 -07:00
George ElKoura
ce0cdf1a90 Fix an out-of-bounds read.
Fixed a bad read from a std::vector.  It's normally harmless, but at least makes
debug runtimes cry.
2015-04-26 20:32:34 -07:00
barfowl
ce223949f2 Introduced StackBuffer class to replace/extend usage of alloca():
- add Vtr::StackBuffer to allocate from heap beyond local arena size
    - replaced usage of alloca() with Vtr
2015-04-26 17:04:18 -07:00
Jeremy Cowles
551c2ab319 Merge pull request #444 from c64kernal/dev_winfix
Fix for windows build in regression shapes.
2015-04-25 19:57:26 -07:00
Jeremy Cowles
160c0cf379 Merge pull request #443 from c64kernal/dev_doc
Minor fixes to building docs and doc links.
2015-04-25 19:57:02 -07:00
George ElKoura
7d323517ee Fix for windows build in regression shapes.
MSVC has a 64k limit for string literals.  We should also probably move away from storing shapes in string literals.
2015-04-25 11:53:01 -07:00
Takahito Tejima
1fab11b2b4 Merge pull request #441 from davidgyu/patch-drawing
Fixed orientation of boundary and corner patches
2015-04-24 23:00:51 -07:00
Takahito Tejima
4d0bd75067 Merge pull request #440 from asluk/dev
retain vertex 0 for lefthanded meshes
2015-04-24 22:27:36 -07:00
George ElKoura
8456c703fa Minor fixes to building docs and doc links.
- Upped minimum required version of docutils from 0.6 to 0.9.
- Fixed link to pygments in build documentation
- Fixed link to doxygen in build documentation
2015-04-24 19:16:34 -07:00
David G Yu
47181dc483 Merge pull request #442 from c64kernal/dev_ptex
Fix ptex indices computations for loop.
2015-04-24 16:47:02 -07:00
George ElKoura
63dd4f7f40 Fix ptex indices computations for loop.
The only method not yet implemented for loop in PtexIndices is GetAdjacency(), fix code accordingly.
2015-04-24 16:08:37 -07:00
David G Yu
f19a41105d Fixed orientation of boundary and corner patches
Now a boundary and corner patch remains
aligned with its underlying parametric
orientation. This simplifies both the
gathering of patch vertices and downstream
evaluation of patches.

Added a method to Vtr::Level which gathers
the 16 patch points for a B-spline patch
even if the patch has boundary or corner
edges.  The undefined patch vertex index
values along boundary and corner edges are
assigned Vtr::INDEX_INVALID.

In order to simplifiy the process of drawing
B-spline patches with boundary or corner
edges, the Far::PatchTablesFactory will
replace any invalid vertex indices with
a known good value, i.e. the index of the
first patch face vertex.

Single-crease patches are still a slightly
special case, which will be resolved later.
2015-04-24 15:33:04 -07:00
barfowl
0608230c7b Completed general limit tangent masks for Catmark:
- added general formulae for both Smooth and Crease tangent masks
    - further documented expectations of tangent masks in sdc/scheme.h
2015-04-24 14:36:38 -07:00
asluk
4e22fe0f69 Fix new off-by-one error in facevarying channels for lefthanded meshes. 2015-04-24 11:42:58 -07:00
David G Yu
5edde65063 Merge pull request #438 from takahito-tejima/refactor4
Refactor again FarPatchTableFactory.
2015-04-24 09:12:15 -07:00
asluk
bc316b3f06 Fix bad merge for left/righthanded mesh examples. 2015-04-23 21:35:29 -07:00
asluk
ed07ed6a8f Merge remote-tracking branch 'upstream/dev' into dev 2015-04-23 21:23:29 -07:00
asluk
343e2217f6 Scaled down left/righthanded meshes for regression testing
to avoid precision issues-- thanks to barfowl for
tracking this down.
2015-04-23 21:10:27 -07:00
Takahito Tejima
74b78b3d17 Refactor again FarPatchTableFactory.
- rename "Regular end cap" to "BSplineBasis end cap"
- revert templating and add EndCapType into PatchTablesFactory::Options.
- make EndCapFactories internal in PatchTablesFactory.
- move end cap stencils into PatchTables, keep them relative to the max level.
- add a utility StencilTablesFactory::AppendEndCapStencilTables to splice and factorize endcap stencil tables.
2015-04-23 16:58:56 -07:00
asluk
c813d4b3a9 Retain initial vertex when reversing winding order for lefthanded meshes.
Add lefthanded mesh to vtr regression suite.
2015-04-23 12:01:15 -07:00
Jeremy Cowles
9f88363d07 Merge pull request #436 from takahito-tejima/dev
Fixes far_tutorial_6 crash
2015-04-22 20:30:47 -07:00
Jeremy Cowles
51e3126c0e Merge pull request #433 from c64kernal/dev_ptex
Separating out Ptex API from TopologyRefiner.
2015-04-22 20:27:15 -07:00
George ElKoura
0371a3aa5f Renamed methods on Far::PtexIndices.
GetNumPtexFaces() became GetNumFaces()
GetPtexIndex() became GetFaceId()
GetPtexAdjacency() became GetAdjacency()
2015-04-21 22:23:22 -07:00
George ElKoura
bded4cb075 Small clean up to how we validate the refiner when we build a PtexIndices. 2015-04-21 22:08:26 -07:00
George ElKoura
fcc1971767 Added an informative error check when passing in a refiner with an incompatible scheme to build PtexIndices. Also fixed an assert to not check for an explicit scheme type, and use traits instead. 2015-04-21 21:06:52 -07:00
George ElKoura
1ea3ec7958 Fixing comments. 2015-04-21 17:46:55 -07:00
George ElKoura
420473b45b Experiment separating out Ptex from TopologyRefiner.
Remove the ptex-specific code from the Far::TopologyRefiner and instead provide it in a separate class Far::PtexIndices.  Clients who need to use the Ptex API need to first build a Far::PtexIndices object by providing it with a refiner.

This has the advantage of keeping the API on the TopologyRefiner a little cleaner.  The ptex methods were const but were mutating state with const_casts.  The new mechanism still achieves the same lazy initialization behavior by forcing clients to instantiate them exactly when needed.

A disadvantage of this approach is that the PatchTablesFactory creates its own PtexIndices and throws it out after the patch tables are created.  This is great if you're never going to need the ptex indices again, but not so great if you will need them again.
2015-04-21 17:34:02 -07:00
takahito-tejima
c4acb578f2 Fixes far_tutorial_6 crash 2015-04-21 15:38:51 -07:00
Jeremy Cowles
7e3bd65432 Merge pull request #435 from davidgyu/patch-drawing
Limit position screen-space tessellation level metric
2015-04-21 14:43:40 -07:00
David G Yu
7d9dcf8c03 Added a new screen-space adaptive tessellation metric which
computes edge lengths using limit surface points. Made this
the default screen-space metric so that we avoid cracks when
using Gregory Basis or Regular B-spline end caps.

The alternative method which computes edge lengths using the
distance between B-spline control points is still available.

Added a diagram and comments to explain how the control
points and limit points are organized.
2015-04-21 14:17:29 -07:00
David G Yu
1bdf70973b Merge pull request #432 from takahito-tejima/refactor3
Refactor Far::PatchTablesFactory
2015-04-21 13:08:39 -07:00
Takahito Tejima
43aa2500c4 Refactor far factories.
This change moves all gregory patch generation from Far::PatchTablesFactory
so that we can construct patch tables without stencil tables as well as client
can chose any end patch strategies (we have 3 options for now: legacy 2.x style
gregory patch, gregory basis patch and experimental regular patch approximation).

Also Far::EndCapGregoryBasisPatchFactory provides index mapping from patch index
to vtr face index, which can be used for single gregory patch evaluation on top
of refined points, without involving heavier stencil tables generation.
2015-04-20 18:59:07 -07:00