Commit Graph

554 Commits

Author SHA1 Message Date
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
ff13665a02 Introduced Far::TopologyLevel methods in place of TopologyRefiner in Osd 2015-05-21 20:20:16 -07:00
Takahito Tejima
2e26f932e1 implements Osd::CpuEvaluator::EvalPatches function.
- it takes number and pointer for the input PatchCoords.
- add derivative evaluations.
- enhance glEvalLimit example to see the derivative evaluation works.
2015-05-21 17:45:13 -07:00
David G Yu
f4a8cafe86 Sync'ed up GLSL and HLSL patch shader source.
Cleaned up the Legacy Gregory shader source by accessing buffer
data through helper functions.

Switched to performing tessellation in untransformed (object) space.
2015-05-21 09:56:25 -07:00
David G. Yu
d1452a02cf Fixed HLSL shader compile error. 2015-05-20 21:48:52 -07:00
George ElKoura
a7d9d6a9b4 Merge pull request #504 from davidgyu/cleanup
Comment cleanups discovered while reviewing Far
2015-05-20 19:40:49 -07:00
David G Yu
c82b3d551d Merge pull request #502 from barfowl/patch_eval
Refactor public patch evaluation methods exposed by Far::PatchTables
2015-05-20 19:39:32 -07:00
Takahito Tejima
a1424ae163 Fix gregory patch tesslevel computation
- flipping UV
- using limit position in legacy gregory shader.
2015-05-20 18:27:32 -07:00
David G Yu
11e987a7d8 Fixed the misspellings of Ignacio Castano's name. 2015-05-20 17:39:06 -07:00
barfowl
be50309752 Fixed missing qualification of IndexArray 2015-05-20 17:21:02 -07:00
Takahito Tejima
109a3f5383 osd layer: Add GLPatchTable and retire DrawContext
In osd layer, we use GLPatchTable (D3D11PatchTable) as a
device-specific representation of FarPatchTables instead of
DrawContext. GLPatchTable may be used not only for drawing
but also for GPU eval APIs (not yet supported though.
We may add CudaPatchTable etc as needed).

The legacy gregory patch drawing buffers are carved out to
the separate class, named GLLegacyGregoryPatchTable.

Also face-varying data are split into client side for now, until
we add new and more robust face-varying drawing structure
(scheduled at 3.1 release)

Tentatively replicate PatchArray structure in GLPatchTables. It will
be revised in the upcoming change.

Shifting hard-coded SRV locations of legacy gregory buffers in HLSL shaders.
2015-05-20 15:55:06 -07:00
barfowl
891772f58b Refactor public patch evalations methods exposed by Far::PatchTables:
- changes completely deprecate AddWithWeight(T, float, float, float)
    - added new EvaluateBasis() method to PatchTables
    - replaced usage of old Evaluate...<T,U>() methods with EvaluateBasis()
    - removed old Evaluate...<T,U>() methods
    - removed now unused Interpolate...<T,U>() functions in far/interpolate.h
    - moved low-level basis code from far/interpolate.* to patchBasis.*
2015-05-20 15:44:29 -07:00
David G. Yu
00ce36433f Fixed handedness flip in Gregory{Basis} shaders
There was an unnecessary double-flip in the shading calculations.
2015-05-20 14:17:31 -07:00
David G Yu
0811046c2f Merge pull request #497 from jcowles/dev-remove-pragma
Remove #pragma once
2015-05-20 12:57:21 -07:00
Takahito Tejima
8d9ae550ff Add a HLSL version of GregoryBasis patch shader.
hlslPatchGregoryBasis.hlsl is an equivalent to glslPatchGregoryBasis.
Update dxViewer to be able to switch among bspline, gregorybasis, legacy
end capping.

also fixes a bug of GLSL legacy gregory shader which had an inconsistent
resource naming with example codes.

It looks like there's still an issue of D3D11 patchParam data fetching.
we'll come back to that bug.
2015-05-20 10:49:45 -07:00
jcowles
392e5e8bed Remove #pragma once
While this may be worth revisiting, we should first quantify the benefits and
identify the compilers that support it. Ultimately, we may never use pragma
once in favor of strictly using standard C++.
2015-05-20 09:59:18 -07:00
Takahito Tejima
2f90e3799a Merge pull request #488 from jcowles/dev-size
Prefix header guards and add pragma once.
2015-05-19 13:18:18 -07:00
jcowles
9d32712ec4 Prefix header guards and add pragma once. 2015-05-19 11:22:37 -07:00
Takahito Tejima
c3aa00e706 remove SupportsAdaptiveTessellation from OsdDrawContext, and example cleanups
As a preparation for retiring DrawContext, move SupportsAdaptiveTessellation
method to examples/common/glUtils, which is renamed and namespaced
from gl_common.{cpp,h} to be consistent to other files.
Same renamings applied to other example files.
2015-05-19 10:30:16 -07:00
jcowles
7b4aa33a1f Change stencils sizes from unsigned char to int. 2015-05-19 10:16:56 -07:00
David G Yu
8716a8eebf Fixed example code use of single crease patches
Also made a couple minor changes to true up the GLSL patch shaders.
2015-05-15 11:52:41 -07:00
Takahito Tejima
4a4322983f Osd drawing API refactoring.
Remove DrawRegistry from osd layer and put a simple shader caching
utility into examples/common. osd layer only provides patch shader
snippet and let client configure and compile the code. Clients also
maintain the lifetime of shader object, which is preferable for the
actual application integration.

update all examples to use the new scheme.
2015-05-13 17:35:46 -07:00
David G Yu
fb009f41b2 Removed BOUNDARY and CORNER patch types
These are now redundant since all bspline patches are encoded in
the patch tables consistently using 16 point indices with boundary
and corner edges indicated in the boundary mask of the patch params.
2015-05-13 11:31:02 -07:00
David G Yu
1c91945d10 Added stronger guards for OSD_MAX_VALENCE 2015-05-12 11:15:51 -07:00
Takahito Tejima
917974f7d1 fix typo in the include guard. 2015-05-11 18:07:26 -07:00
Takahito Tejima
b66380ee52 Refactor Osd::DrawContext
Since unified shading work already removed subPatch info from
Osd::PatchDescriptor, the difference between Far::PatchDescriptor and
Osd::PatchDescriptor is just maxValence and numElements. They are used
for legacy gregory patch drawing.

Both maxValence and numElements are actually constant within a topology
(drawContext). This change move maxValence to DrawContext and let client
manage numElements, then we can eliminate Osd::PatchDescriptor and simply
use Far::PatchDescritor instead.

This is still an intermediate step toward further DrawRegistry refactoring.
For the time being, adding EffectDesc struct to include maxValence and
numValence to be maintained by the clients. They will be cleaned up later.

The side benefit of this change is we no longer need to recompile regular b-spline
shaders for the different max-valences.
2015-05-11 18:06:46 -07:00
Takahito Tejima
94d6eb6491 cleanup remaining ptex specific code in osd layer
- Remove MeshPtexData bit from Osd::MeshBits. It's not used any more
- Rename ptexIndexBuffer in D3D11DrawContext to paramParamBuffer
- Remove Is/SetPtexEnabled from D3D11DrawRegistry
2015-05-11 10:59:16 -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
1a37da1c26 osd refactor: split the vertex buffer argument into src and dst
Changing all device kernels to take two buffer identifiers for
source and destination separately.
This change is an intermediate step toward upcoming context/controller
refactoring.

Previously we have a limitation that the source and destination
vertex buffer has to be a single buffer, since the subdivision
kernels are iteratively applied by level.
With stencil tables, we don't have such a limitation any more,
so we may want to apply stencils from seprate source buffer to
another.

To specifiy the output location within the destination buffer,
we can use VertexBufferDescriptor.offset. This allows us not only
configuring arbitrary batching scheme, but also relaxing the
limitation that source and destination buffers are in same
interleaved layout. For examples, we could include derivatives only
in the destination buffer, which doesn't need to be allocated in
the source buffer.
2015-05-07 16:11:00 -07:00
Takahito Tejima
8fc0e5db93 Move Ptex code from osd to examples.
we're teasing out ptex specific data from core osd entities,
so there's no reason to keep ptex texturing utilities in core osd.
move them into example libs and let clients assemble shader snippets
as needed.

Also removing older ptex texturing code (without mipmap)
2015-05-07 13:56:48 -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
David G Yu
8b4ef28116 Updated handling of patchParam and patchCoord
Each patch has a corresponding patchParam. This is a set of three values
specifying additional information about the patch:

   faceId    -- topological face identifier (e.g. Ptex FaceId)
   bitfield  -- refinement-level, non-quad, boundary, transition, uv-offset
   sharpness -- crease sharpness for a single-crease patch

These are stored in OsdPatchParamBuffer indexed by the value returned
from OsdGetPatchIndex() which is a function of the current PrimitiveID
along with an optional client provided offset.

Accessors are provided to extract values from a patchParam. These are
all named OsdGetPatch*().

While drawing patches, the patchParam is condensed into a patchCoord which
has four values (u, v, faceLevel, faceId). These patchCoords are treated
as int values during per-prim processing but are converted to float values
during per-vertex processing where the values are interpolated.

Also, cleaned up more of the shader namespace by giving an Osd prefix
to public functions, and consolidated boundary and transition handling
code into the PatchCommon shader files. The functions determining
tessellation levels are now all named OsdGetTessLevel*().
2015-05-06 13:47:33 -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
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
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
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
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
David G. Yu
9f1da077e8 Updated HLSL shaders for unified patch drawing 2015-04-18 14:08:53 -07:00
David G. Yu
cb689194ab Fixed windows build errors. 2015-04-17 18:29:56 -07:00
Takahito Tejima
c58e63c8d5 Refactor single crease patch to be in unfined shader. 2015-04-17 16:26:57 -07:00
David G Yu
336fbb6748 Removed some more obsolete transition patch state
Temporarily disabled fractional tessellation for Gregory patches.
2015-04-17 15:24:48 -07:00
David G Yu
759513d2dc Fixed adaptive tessellation and removed debug code 2015-04-17 12:04:21 -07:00
David G Yu
010a31efc4 Checkpoint changes to unify adaptive patch drawing. 2015-04-17 07:42:53 -07:00
Takahito Tejima
3b748e3b8d Fixes a gregory basis evaluation bug. 2015-04-10 17:44:33 -07:00
Takahito Tejima
7b37eb8cd6 #version 410 for XFB kernel and then OSX can run the XFB kernel. 2015-04-10 15:42:25 -07:00
Takahito Tejima
1e9ca564b0 remove subroutines from GLSL kernels. 2015-04-10 15:34:04 -07:00
Takahito Tejima
1ec0b2b1f2 add includes 2015-04-10 11:09:14 -07:00
Takahito Tejima
24a435da01 avoid lauching stencil kernel and not to allocate device tables if the stencil table is empty. 2015-04-10 11:08:51 -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
Takahito Tejima
24f9dc154b Enable GregoryBasis patch.
PatchTablesFactory fills 20 indices topology into patchtable, and use it for eval and draw.

note: currently screen-space adaptive tessellation of gregory basis patches is
broken and cracks appear around them.
2015-04-08 17:07:10 -07:00
barfowl
9222c9e169 Removed use of "full topology" flag with Far::AdaptiveOptions:
- it was always ignored as full topology is required for PatchTables
    - it will soon be removed from AdaptiveOptions entirely
2015-04-01 14:57:28 -07:00
manuelk
d0a624f373 Add "smooth UVs" to Far
- extend Far::PatchTables data structures & interfaces to store requisite
  information for channels of face-varying bi-cubic patches
- implement gather function in Far::PatchTablesFactory to populate face-varying
  channels with adaptive patches
- extend accessor interface in Vtr::Level
- propagate code fall-out throughout OpenSubdiv code base, examples & tutorials
- extend vtrViewer code to visualize tessellated bi-cubic face-varying patches
2015-02-26 13:57:47 -08:00
manuelk
866b88b7c9 Add support for single-crease patches to D3D draw context & controller
- also updated the dxViewer code example

note: dxPtexViewer still needs to be updated
2015-02-08 17:31:55 -08:00
manuelk
c646ac2e3c Refactor & cleanup patch interpolation
- move patch interpolation code out of Far::PatchTables into far/interpolate
- add bilinear quad interpolation function with derivatives
- switch OsdCpuEvalLimitController to far/interpolate
- add support for bilinear quad interpolation & clean varying interpolation
2015-01-27 15:38:30 -08:00
Manuel Kraemer
558733298b Merge pull request #375 from hsdk/gregory_optimizations
Minor gregory patch shader optimizations
2015-01-13 16:03:49 -08:00
Manuel Kraemer
2071123148 Merge pull request #378 from hsdk/FixComputeBoundaryBug
Fix boundary bug of DX/CL kernels.
2015-01-13 09:55:19 -08:00
Henry Schaefer
eb8abc0da6 Optimize GL/DX compute dispatches. 2015-01-13 10:59:06 +01:00
Henry Schaefer
19aad3cd54 Fixing boundary bug of DX/CL kernels. 2015-01-13 10:40:51 +01:00
Takahito Tejima
d1863eea12 fix batching bug of GLSL/GLSLXFB compute controllers. 2015-01-12 17:03:21 -08:00
Takahito Tejima
0178b09a38 fix boundary bug of GLSL/GLSLXFB kernels. 2015-01-12 17:02:54 -08:00
Henry Schaefer
18440e2f08 Fix GLTransformFeedback crash in computeStencil
- changed loop counter names in addWithWeight and readVertex that have overwritten the outer loop counter due to unrolling
2015-01-11 02:55:06 +01:00
Henry Schaefer
1b05cd8ee2 gregory patch shader optimization
- reduces instruction count by ~1/5
 - improves readability
2015-01-10 21:28:54 +01:00
manuelk
974462e3db Fix 'single-crease' crash bug in OsdGLDrawContext
- unset sharpness indices are -1, which should not be used to look up into the sharpness values vector...
2015-01-09 19:50:12 -08:00
Henry Schaefer
7c73cf0128 dxPtexViewer fixes:
- changed ptex layout data types in shaders to match srv format
 - changed ptex srv type to unorm format for uchar data
 - fixed hlsl compiler warning: initialized edgeDistance of OutputVertex struct in domain shader even if we are not in wireframe mode
 - added directx debug device and enabled automatic break points to easily spot dx errors
2015-01-09 02:03:42 +01:00
manuelk
bfbd868fe2 Modify Far::TopologyRefiner refinement options
- move level of refinement / isolation into the Options structs
- fix splash damage in rest of the code

note 1: this is less than ideal, because most compilers accept the previous
        call to these functions with an incorrect parameter list (ie. passing
        the level instead of the struct issues no warnings and compiles...)
        caveat emptor...

note 2: the level parameter names may not be final for adaptive modes
        as we will likely want independent controls over crease vs.
        extraordinary vertex isolation.
2014-12-30 14:07:24 -08:00
manuelk
7954fbab37 Fix tangents in Osd::EvalLimitController
- don't rotate (s,t) coordinates but rotate the patch instead !

- refactor osd/cpuEvalLimitKernels to share Far::PatchTables cubic spline
  interpolation functions : this replaces tensor product formulation with
  weight matrices, which does not really impact performance here, but would
  have to be replaced when implementing regular gridding functions.

- fix OsdCpuEvalLimitController to not rotate coordinates and pass the rotation bitfields

- expose Far::PatchTables spline interpolation API (protected -> public)

- fix glEvalLimit tangent buffers (remove empty padding - see below)

- change policy for tangent buffers : the output buffer descriptor is
  **NO LONGER APPLIED** to tangent output buffers. Tangent primvar data
  buffers are no longer applying the offset and stride from the descriptor
  (because it doesn't make sense to share it). If more flexiblity is
  required, we will consider adding independent descriptors for the tangent
  buffers. This change will impact existing code that generates tangents
  with the EvalLimit controller.

fixes #370
2014-12-25 13:22:27 -08:00
manuelk
5944ada0f9 Add Options structs to Far::TopologyRefiner refinement methods
- fix all splash damage to tutorials / examples...
2014-12-23 10:07:24 -08:00
manuelk
48cf4b6528 Refactor Vtr::Array for better "const" safety
Const' declared instances of Vtr::Array do not protect the pointer held
privately by the class properly. In order to force the compiler to
protect this pointer, we removed all non-const accessors from Vtr::Array
(now renamed Vtr::ConstArray) and moved them to a child class (Vtr::Array),
which requires const_cast<> operators internally to allow access.

The change & renaming is then propagated to all internal dependencies.
2014-12-15 10:23:13 -08:00
manuelk
0ff7b15711 Fix Win build
- make sure we don't get conflicting enums (CODE_ERROR)
- fix template specialization for Far::TopologyRefinerFactory in regression/common/vtr_utils
- fix remaining error reporting code around osd
2014-12-03 20:04:35 -08:00
manuelk
cc6c0925a3 Refactor error reporting system
- change error codes from situational to general (fatal / coding / run-time...)
- pull error functions from Osd into Far
- add a templated topology validation reporting system to Far::TopologyRefinerFactory
- fix fallout on rest of code-base
2014-12-03 17:19:07 -08:00
manuelk
538c13f394 Fix Windows build 2014-11-25 14:14:59 -08:00
manuelk
b27b55e4a8 Refactor Far::PatchTables
- split Far::PatchDescriptor into its own class (mirrors Far::PatchParam)
- hide PatchArray as a private internal structure
- add public accessors patterned after Far::TopologyRefiner (returning Vtr::Arrays)
- propagate new API to all dependent code

note: some direct table accessors have not been removed *yet* - see code for details
2014-11-25 12:41:19 -08:00
manuelk
9158a430ac Fix Far::PatchTables control vertex indexing to use 4 CVs to represent the 0-ring
- we were allocating 20 CVs for the Gregory basis, but only need 4
 (the 20 CVs are stored in the stencil table)
2014-11-12 13:20:55 -08:00
manuelk
e8210886a8 Extend stencil-driven Gregory basis code support to Osd::EvalLimit (cpu) 2014-11-11 17:35:52 -08:00
manuelk
82a53c4278 Fix bug in cpuEvalLimitKernel.cpp
apparently an offset to a basis vertex was incorrectly set
2014-10-31 17:06:34 -07:00
David G Yu
1e00056d8a Improved stability on OSX drivers by not declaring unused shader in/out vars. 2014-10-23 15:59:05 -07:00
David G. Yu
b11d5e22f0 Fixed d3d11 and gl mesh wrappers to be
consistent wrt the MeshInterface API.
2014-10-23 13:45:57 -07:00
David G. Yu
6cc24d32fd Fixed missing namespace closing brace. 2014-10-23 13:43:45 -07:00
David G. Yu
fce3dcca00 Fixed vec array initializer. 2014-10-23 13:41:27 -07:00
manuelk
f4c2f8d9e1 Fix Windows build of Osd OMP CPU kernel
note: we #include <vector> instead malloc.h for portability
2014-10-23 12:07:12 -07:00
manuelk
f145f70fd2 Refactor Far::StencilTablesFactory
- re-implement the pool allocator
    - use templates to remove code redundancy between regular & limit stencils
    - leverage [] operator overloading to simplify stencil factorization
    - add the ability to treat subdivision levels independently (see below)

- refactor Far::TopologyRefiner::Interpolate<>() methods to pass buffers by reference
  (allows overloading of [] operator)

- rename some of the stencil factory options
- propagate changes to Osd / examples / tutorials...
2014-10-21 16:36:26 -07:00
manuelk
a16d558a3e Fix GLSL compute code version defintion
- remove #version declaration from the kernel code
- move it in front of shader sources before compiling to prevent some drivers from throwing errors

fixes #360
2014-10-20 18:09:30 -07:00
Takahito Tejima
c0907c7bc1 Introduces 'single-crease patch' : implements "Efficient Evaluation of Semi-Smooth Creases in
Catmull-Clark Subdivision Surfaces", Niessner et al, Eurographics 2012.

This change includes;
-topology identification for single-crease patch during adaptive refinement.
-patch array population (similar to boundary)
-sharpness buffer generation
-glsl shader

Eval stuffs will be coming.
2014-10-13 08:52:09 -07:00
manuelk
cea1dd1880 Change FarStencilTables indices from 'unsigned int' to Far::Index type 2014-10-09 16:36:23 -07:00
manuelk
a79832b3a1 Far::PatchTables re-factor & clean-up
- remove Descriptor iterators
- switch 'unsigned int' indices to typed Far::Index

We aren't done yet... but its a step in the right direction
2014-10-09 14:48:50 -07:00
manuelk
639788abbe Fix vec array initialization in GLSL & HLSL (should fix some DX compiler problems)
Fixes #354
2014-10-04 16:22:43 -07:00
manuelk
d3fa91deaa Fix incorrect assert in Osd::DrawContext 2014-10-03 10:35:00 -07:00
manuelk
82e7a1bcc5 Minor EvalLimit naming refactor
- also added some additional animation to the glEvalLimit code example
2014-09-22 16:01:43 -07:00
manuelk
ad402d3623 Fix inconsistent file access permissions 2014-09-17 13:45:50 -07:00
Nathan Litke
78ae830794 Fixed Osd::Mesh constructors that initialize member variables from user variables. 2014-09-17 13:41:45 -07:00
Manuel Kraemer
8fc5371ec9 Merge pull request #350 from nathan-at-digitalfish/build_android
Fix build for Android
2014-09-12 17:27:57 -07:00
manuelk
c66ee724a8 WIP limit stencils factory
todo:
- fix rotated tangents on patches
- add "end-caps" (bilinear or Gregory ?)
- add pure bilinear stencil mode
2014-09-12 16:59:16 -07:00
manuelk
e538261f7d Fix Cuda compile warning in osd/cudaKernel.cu 2014-09-12 10:43:18 -07:00
Julien Demouth
29b2d033e3 Introduces a kernel for NUM_ELEMENTS=4. It's faster and not buggy,
anymore.
2014-09-12 10:22:30 -07:00
Julien Demouth
cf0fe60ab4 Add a first pass of optimization in CUDA kernels
Conflicts:
	opensubdiv/osd/cudaKernel.cu
2014-09-12 10:21:46 -07:00
Nathan Litke
d7311801c1 Fix compiler errors for OpenGL-ES. 2014-09-11 16:30:50 -07:00
Takahito Tejima
b3f6f52bb9 Fixes the bug of glShareTopology. This example mutates patchDescriptor in drawcontext, so it needs a write access.
Adding another GetPatchArray() returning non-const reference. We should think about better API for this.
2014-09-10 15:24:16 -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
Nathan Litke
0128417447 Allow NEON to be disabled on Android. Works similar to GCD on Mac OS X. 2014-08-07 13:10:54 -07:00
Rachid El Guerrab
035e58f44a Added subdivision kernels for ARM NEON
* assembler kernels are based on the C implementation in neonKernel.cpp
* enable assembler kernel functions in neonComputeController.cpp with #define USE_ASM_KERNELS 1
2014-08-05 22:09:12 -07:00
Manuel Kraemer
df719eb9ed Revert "added memcpyasync and streams to cuda backend"
This reverts commit 84212cd725.
2014-08-02 12:40:08 -07:00
Frost
84212cd725 added memcpyasync and streams to cuda backend 2014-07-24 10:18:09 -04:00
Sergey Sharybin
1ebf2449dd Fix mismatch in declaration and usage of OsdCudaComputeRestrictedVertexA
Unused argument `pass` was defined in the CUDA kernel and it was never
passed to this function from the C++ code. This argument is also wasn't
used by the function itself.
2014-07-03 16:54:15 +06:00
Sergey Sharybin
7ac06db165 Fix crashes when using rather low-end cards like Intel ones
Solved by checking on run-time whether texture buffer objects
are supported.

When building with GLEW library doing compile-time check is
not enough, because actual information about existing features
is only known on runtime.

This only makes ti so CPU backend works, GLSL backends still
requires some work if we want them to make working. Not sure
it worth doing this now.
2014-07-02 22:17:58 +06:00
Nathan Litke
e4d7f3d495 Fixed omissions in osd/mesh.h.
* added `OsdMeshInterface::GetFarMesh` and `OsdMesh::GetFarMesh` to match `OsdGLMesh` and `OsdD3D11Mesh`
* added `interleaved` argument to `OsdMesh::Refine` to match `OsdMeshInterface::Refine`
2014-06-27 02:15:27 -07:00
Nathan Litke
299966fd5c Fixed an error in createCLBuffer that occurs when the buffer size is zero. 2014-06-24 12:14:41 -07:00
Nathan Litke
b7a763853c Added the CATMARK_RESTRICTED_VERT_VERTEX_A, CATMARK_RESTRICTED_VERT_VERTEX_B1, and CATMARK_RESTRICTED_VERT_VERTEX_B2 kernels which compute vertices resulting from the refinement of a smooth or (fully) sharp vertex.
* CATMARK_RESTRICTED_VERT_VERTEX_A handles k_Crease and k_Corner rules
* CATMARK_RESTRICTED_VERT_VERTEX_B1 handles regular k_Smooth and k_Dart rules
* CATMARK_RESTRICTED_VERT_VERTEX_B2 handles irregular k_Smooth and k_Dart rules
2014-06-23 15:59:43 -07:00
Nathan Litke
634187f6c5 Fixed a bug in the CUDA kernel. 2014-06-23 14:49:10 -07:00
Nathan Litke
a6e179367b Fixed an error in the DirectCompute shader. This resolves https://github.com/PixarAnimationStudios/OpenSubdiv/issues/313. 2014-06-09 19:43:02 -07:00
Nathan Litke
94c2a4293c Fixed a compiler error in tbbKernel.cpp. Addressed comments from https://github.com/PixarAnimationStudios/OpenSubdiv/pull/310. 2014-06-03 14:49:30 -07:00
Nathan Litke
0af14f8ac6 Added the CATMARK_RESTRICTED_EDGE_VERTEX kernel which computes vertices resulting from the refinement of a smooth or (fully) sharp edge. 2014-05-30 17:44:25 -07:00
Manuel Kraemer
626921d82e Merge pull request #308 from nathan-at-digitalfish/new_face_vertex_kernels
New face vertex kernels
2014-05-30 10:56:12 -07:00
Nathan Litke
24b4aea686 Fixed a compiler error in the GLSL Transform Feedback kernels on OS X/Mavericks. 2014-05-30 00:55:25 -07:00
Nathan Litke
29b51d80af Implemented CATMARK_QUAD_FACE_VERTEX and CATMARK_TRI_QUAD_FACE_VERTEX kernels for DirectX 11, OpenMP, and TBB platforms. Fixed a bug in the GLSL Transform Feedback kernels. Minor changes for consistent formatting. 2014-05-29 23:20:04 -07:00
Nathan Litke
b769f4f60d Implemented CATMARK_QUAD_FACE_VERTEX and CATMARK_TRI_QUAD_FACE_VERTEX kernels for CUDA, GLSL Transform Feedback, and GLSL Compute platforms. 2014-05-28 17:21:37 -07:00
manuelk
de57f43db1 Fix doxygen generation errors 2014-05-28 16:19:49 -07:00
Nathan Litke
064115bbe8 Added the CATMARK_QUAD_FACE_VERTEX and CATMARK_TRI_QUAD_FACE_VERTEX kernels.
* The CATMARK_QUAD_FACE_VERTEX kernel calculates the face-vertex for a quadrilateral face.  It applies to every face after the first subdivision step, and may be applied for the first subdivision step of a quadrilateral coarse mesh.

* The CATMARK_TRI_QUAD_FACE_VERTEX kernel calculates the face-vertex for a triangle or quadrilateral face.  It may be applied for the first subdivision step of a coarse mesh composed of triangles and/or quadrilaterals.

* Both kernels calculate each face-vertex using four vertex indices (triangles are specified by repeating the third index).  Therefore neither kernel uses the F_ITa codex table, and instead the first vertex offset in the F_IT index table is stored in the FarKernelBatch's table offset.
2014-05-28 13:52:12 -07:00
Nathan Litke
95aca6ed21 Minor changes to fix typographical errors, and for consistency across class method prototypes. 2014-05-28 13:40:51 -07:00
Takahito Tejima
7f2b65ba46 Reordering includes to address a compile error on mac/glew environment 2014-05-23 13:23:24 -07:00
Sergey Sharybin
6ef232c95a Integrate CLEW into osd library and examples
If the system has CLEW installed (which is detected by recently
added FindCLEW routines) then OpenSubduv would be compiled against
this library.

It makes binaries and libraries more portable across the systems,
so it's possible to run the same binary on systems with and without
OpenCL SDK installed.

The most annoying part of the change is updating examples to load
OpenCL libraries, but ideally code around controllers and interface
creation is to be de-duplicated anyway.

Based on the pull request #303 from Martijn Berger
2014-05-22 09:10:59 +02:00
manuelk
d7afc82133 Fix compiler warnings in OsdClVertexBuffer 2014-05-16 14:52:43 -07:00
manuelk
b74f45f68d Decrease compiler warning thresholds and fix outstanding warnings (continued)
- turn off some of icc's remarks (mostly because of tbb)
- fix many of icc -w3 remarks (more to fix once i can work around icc 14.0 linker barfing)
2014-05-15 18:03:44 -07:00
manuelk
5ff9edf4f9 Decrease compiler warning thresholds and fix outstanding warnings.
Note: this round fixes clang / gcc -Wetra warnings. More fixing remains for icc -w3 errors.
2014-05-15 13:34:32 -07:00
Manuel Kraemer
827efd14e3 Reorganize EvalLimitContext and EvalLimitController
Moved transient states (current vertex buffer etc) to controller.
ComputeContext becomes constant so that it's well suited for coarse-grain
parallelism on cpu.

Client-facing API has changed slightly - limitEval example has been adjusted
2014-05-10 17:55:50 -07:00
Manuel Kraemer
ec89f76038 EvalStencil Context & Controller code cleanup
- fix some variable names (private vs. public)
    - implement constructors to guarantee initialized pointers (d'oh)
    - add a 'Reset' method to unbind buffers

Note: while the new contexts have been cleaned up, we now have a fair amount of duplicated code in the controllers...
2014-05-10 16:38:13 -07:00
Manuel Kraemer
e9b4006a56 Reorganize EvalStencilContext and EvalStencilController
Moved transient states (current vertex buffer etc) to controller.
ComputeContext becomes constant so that it's well suited for coarse-grain
parallelism on cpu.
2014-05-10 14:49:15 -07:00
Takahito Tejima
727077a8e0 Fix mistakenly deleted memory barrier in glsl compute kernel. 2014-05-09 21:16:04 -07:00
manuelk
9424784fe5 Change EvalLimit Gregory patch kernels to the large weights table to accomodate higher valences.
This change matches this CPU kernel more closely to our GPU patch shaders.

fixes #298
2014-05-09 17:26:03 -07:00
Takahito Tejima
ee061291b7 Interleaved buffer support in OsdCompute. Removed OsdVertexDescriptor and replaced with OsdVertexBufferDescriptor.
All kernels take offset/length/stride to apply subdivision partially in each vertex elements.

Also the offset can be used for client-based VBO aggregation, without modifying index buffers.
This is useful for topology sharing, in conjunction with glDrawElementsBaseVertex etc.
However, gregory patch shader fetches vertex buffer via texture buffer, which index should also
be offsetted too. Although gl_BaseVertexARB extension should be able to do that job, it's a
relatively new extension. So we use OsdBaseVertex() call to mitigate the compatibility
issue as clients can provide it in their way at least for the time being.
2014-05-09 15:44:52 -07:00
Takahito Tejima
a57dd034e7 Reorganize ComputeContext and ComputeController.
Moved transient states (current vertex buffer etc) to controller.
ComputeContext becomes constant so that it's well suited for coarse-grain
parallelism on cpu. The prims sharing same topology (ComputeContext) can
be refined simultaneously by having mutiple compute controllers.
Client facing API doesn't change.
2014-05-06 08:53:36 -07:00
David G. Yu
02da793be4 Fixed calculation of screen space LOD tess factors for transition corner patches.
fixes #296
2014-05-02 15:59:30 -07:00
Takahito Tejima
d937580b02 temporary workaround for the synchronization bug of glsl compute kernel.
closes #295
2014-05-02 15:46:03 -07:00
manuelk
69755c6f22 Fix OsdUtilAdaptiveEvaluator concurrency issue
- add a limit evaluation method to EvalLimitController that allows
  client code to directly pass the output buffer without binding it
  to the Context (the call only computes vertex interpolation of a
  single sample)

- switch the OsdUtilAdaptiveEvaluator to use the new method from the controller
  and stop stomping member

- cleanup buffer and member variables no longer used

- cleanup initialization logic to be better aware of uniform / adaptive

- add some assert sanity checks in the cpuEvalLimitKernels

fixes #293
2014-04-29 18:27:04 -07:00
Manuel Kraemer
808aabfbc5 Merge pull request #284 from nathan-at-digitalfish/add_far_triangulate
Generate triangle patches for a uniformly subdivided mesh
2014-04-22 11:42:56 -07:00
Nathan Litke
d5deab632c Changes to address comments in #284.
* rolled getNumFVarVertices into allocateTables
* renamed tessellate to triangulateQuads (technically speaking, Loop scheme uses a trivial triangulation)
* condensed the pointer arithmetic used for triangulating the data tables
2014-04-21 17:59:46 -07:00
Nathan Litke
0c837b73b2 Added a public constructor to OsdMesh that initializes the members objects from its arguments, allowing those members to be created by a subclass or an external function.
* maintainance work on the D3D11 specialization of OsdMesh to bring it in line with the other template specializations
* updated the facePartition example to derive PartitionedMesh from OsdMesh in order to allow other vertex buffer and compute controller configurations
2014-04-18 20:52:13 -07:00
Nathan Litke
5195d93947 Added an option to FarMeshFactory to generate triangle patches instead of quadrilateral patches for a uniformly subdivided mesh. This option is applicable to GL-ES, which does not support quadrilateral primitives. 2014-04-18 16:19:13 -07:00
Nathan Litke
2a463b5c83 Draw contexts do not fully initialize patch arrays #281
* added the numVertexElements argument to Osd*DrawContext::Create, which is used to initialize the patch arrays when calling OsdDrawContext::ConvertPatchArrays
* removed the unused level argument from Osd*DrawContext::_initialize
* maintenance work on CL/D3D11 bindings to get them to compile
2014-04-17 18:55:07 -07:00
manuelk
50980cea5a Fix access rights to d3d11ComputeController.h 2014-04-16 10:27:48 -07:00
takahito-tejima
7363049472 Fixing a crash on Marvericks w/glew 2014-04-11 21:54:35 -07:00
manuelk
7bdbf0c8a2 One more fix for the Linux cmake build
fixes #258
2014-04-11 18:33:11 -07:00
Takahito Tejima
f65c746294 Use DSA APIs for GL buffer update (if available).
Fix some inappropriate usage hints.
2014-04-11 18:03:36 -07:00
David G. Yu
d426d6f07c One more fix for the windows cmake build
fixes #258
2014-04-09 15:16:13 -07:00
mkraemer
0f687c4c62 Fix Windows build following CMake changes
Add conditionals testing for non-empty OPENGL_INCLUDE_DIR path

fixes #258
2014-04-09 18:09:53 -04:00
mkraemer
05a7db5e14 Make CMake path variables more robust
Add quotes around variables containing paths - this might require a second pass...

fixes #258
2014-04-09 16:43:38 -04:00
mkraemer
e011fa34af Fix typo (and Doxygen warning) 2014-04-09 15:20:01 -04:00
manuelk
99c34d2aec Adding functionality to store uniform face-varying data across multiple levels of subdivision
- switch FVarDataTable to a class
- add offsets to keep track of level
- modify dependent code
- rename 'totalFVarWidth' to 'fvarWidth'

fixes #271
2014-04-04 19:10:34 -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
Takahito Tejima
84bc05ac9f more refactoring on FarMesh and move FarMultiMeshFactory to OsdUtil. 2014-03-24 19:13:40 -07:00
Takahito Tejima
76818e630b Refactor FarSubdivisionTables.
Delete scheme specialized subdivision tables. The base class FarSubdivisionTables
already has all tables, so we just need scheme enum to identify which scheme
the subdivision tables belong to.
This brings a lot of code cleanups around far factory classes.
2014-03-19 17:19:08 -07:00
takahito-tejima
e5c54cc9eb fix typo in gcdComputeController 2014-03-19 11:51:54 -07:00
Takahito Tejima
44a7cb6a45 Refactor Far API.
* replace void* of all kernel applications with CONTEXT template parameter.
  It eliminates many static_casts from void* for both far and osd classes.
* move the big switch-cases of far default kernel launches out of Refine so
  that osd controllers can arbitrary mix default kernels and custom kernels.
* change FarKernelBatch::kernelType from enum to int, clients can add
  custom kernel types.
* remove a back-pointer to farmesh from subdivision table.
* untemplate all subdivision table classes and template their compute methods
  instead. Those methods take a typed vertex storage.
* remove an unused argument FarMesh from the constructor of subdivision
  table factories.
2014-03-19 11:44:51 -07:00
manuelk
90a21ca74b Fix doxygen parameter documentation for OsdCPUSmoothNormalContext 2014-03-17 11:39:45 -07:00
David G. Yu
ead34f1662 Added 'static' specifiers for non-kernel CL funcs at program scope. 2014-02-23 21:25:47 -08:00
David G Yu
ff4fe169bb Removed address space qualifiers from OpenCL kernel functions
These aren't needed and will raise errors on some implementations.
2014-02-22 22:35:36 +00:00
manuelk
f1518a5f59 Fix Gregory Boundary patch buffer overrun
Prevent boundaryEdgeNeighbors[2] from being overrun when an interior
vertex has more than 2 boundary neighbor vertices. The fix is applied
to the GLSL / HLSL and CPU implementations.

Note: this appears to fix long-standing problems with Gregory patches,
but i am not entirely convinced that this fixes the general case.

fixes #259
2014-02-13 11:30:33 -08:00
Takahito Tejima
75c02c6043 Fixes black texels when the resolution of a ptex face is less than 4.
Closes #253
2014-02-03 12:03:17 -08:00
manuelk
ec98c7fe03 Move VBO buffer allocation out of allocate() and into BindVBO()
fixes #256
2014-01-30 17:29:14 -08:00
manuelk
89e18fb179 Adding OpenMP SmoothNormal Context & Controller 2014-01-10 15:31:48 -08:00
manuelk
dabaac8187 Adding a TBB SmoothNormal Context & Controller
Also:
    - Add a _numVertices member to cpuSmoothNormalContext (for memory reset function)
    - Fix memory reset function in cpuSmoothNormalContext (was performing redundant memsets)
    - Add a resetMemory boolean to cpuSmoothNormalContext to make reset step optional (default is off)
2014-01-10 14:56:59 -08:00
manuelk
6465d3594c Adding a Context / Controller pair for CPU evaluation of smooth normals 2014-01-09 17:36:35 -08:00
manuelk
8918173fda Improve stringification of shaders & kernels in build.
- added a _stringify function to top CMakeLists
- switched all stringification tasks to use the macro
- all suffixes are now .gen.h instead of .inc (to help cmake track dependencies)
2014-01-03 16:59:26 -08:00
jcowles
eb09b9e14c Use obj targets for faster CPU/GPU lib builds
Further leverage cmake object libraries to share object files for CPU
and GPU OSD libraries, avoiding duplicate complation for dynamic/static
build passes.

CMake restricts object library inputs to header and source files, so the
.inc files were renamed to .gen.h (which seems like a better name
anyway) to make CMake happy.

Also updated the .gitignore file to ignore .gen.h files.

Conflicts:
	opensubdiv/osd/CMakeLists.txt
2014-01-03 14:52:35 -08:00
manuelk
00b0d95058 Remove CMake compiling redundancies
- set OBJECT targets for osd cpu & gpu libs, and use the obj target for
  static and dynamic linking

- add a new examples_common_obj OBJECT target
- replace direct source dependencies to obj target in all examples CMakeLists

This change makes it possible to not re-compile the same source files
multiple times when they are used in multiple targets. Thanks to jcowles
for uncovering the CMake functionality.

Note: it seems that multi-process build is working again (gmake -j <x>)
2014-01-03 13:39:48 -08:00
jcowles
e8a25c511a Make osd a cmake object library.
An object library allows other build targets to use the object files
from this library.

The change introduces osd_static_cpu_obj which is consumed by
osd_static_cpu.

This will be useful for emscripten integration where we cant use the
compiled library, rather it will use the object files, targeting
osd_static_cpu_obj.
2014-01-03 11:02:51 -08:00
manuelk
1a8b41287e Fix OsdCpuEvalLimitKernel
Correct some vertex buffer descriptor mixups between length & stride

fixes #248
2013-12-20 15:40:52 -08:00
David G Yu
8990d5712f Fixed iOS build 2013-12-15 23:39:32 -08:00
Manuel Kraemer
a565526977 Fix unused variable build warnings (gcc 4.8.2 - Fedora 19) 2013-12-08 13:47:14 -08:00
Takahito Tejima
f7f2ca2581 Move uniform block definitions out of osd common shader into client shader.
Important notice: all client shader code must have following functions and compose them to osd intrinsic shaders (vertex/tessEval/tessControl)

mat4 OsdModelViewMatrix()
mat4 OsdProjectionMatrix()
mat4 OsdModelViewProjectionMatrix()
float OsdTessLevel()
int OsdGreogryQuadOffsetBase()
int OsdPrimitiveIdBase()

We probably should write a utility class for basic binding of them, to make client code simpler.
2013-12-03 15:59:38 -08:00
manuelk
8484d1e318 Adding stdlib.h include to fix OSX build. 2013-11-22 15:23:40 -08:00
manuelk
791995cf32 Refactoring Ptex Mipmap and Analytic Displacement code
Moving Takahito's implementation into the core API:
- added <gl/d3d11>PtexCommon.<glsl/hlsl> shader code
- added control to enable Ptex common trunk in <gl/d3d11>DrawRegistryBase classes
- fixed GL & D3D11 ptexViewer examples to use the new API
2013-11-20 15:47:59 -08:00
manuelk
691253a0e7 Fix OSX build: stdlib.h needs to be included in glPtexMipmapTexture.h for size_t typedef 2013-11-11 13:18:43 -08:00
Takahito Tejima
81099f32ad Returns the common shader config for all non-tess patcharrays. 2013-11-08 10:46:41 -08:00
manuelk
fe0d2bdec5 Fix return value of allocate function for OsdCPUGLVertxBuffer 2013-11-06 10:46:36 -08:00
manuelk
2a825b9d1c Removing some glGetError checks that are causing problems for Autodesk. 2013-11-05 18:17:02 -08:00
David G. Yu
20a3b0f5bb Fixed WIN32 build error when no DXSDK installed. 2013-11-04 15:19:14 -08:00
manuelk
c8d490e292 Fix some warnings that are failing VC++ builds 2013-10-28 15:48:51 -07:00
Takahito Tejima
dd8cc1a3b7 improve ptex guttering. 2013-10-15 17:47:58 -07:00
Takahito Tejima
72eb4750a9 Ptex loader : Add memory usage limiting. Clean code styles. 2013-10-07 19:05:19 -07:00
Takahito Tejima
f26c457bac Add fractional partitioning, normal derivatives computation into hlsl shaders. 2013-10-07 19:02:41 -07:00
Takahito Tejima
ff65a3efb8 Add a DX11 version of ptex mipmap loader 2013-10-04 18:27:06 -07:00
Takahito Tejima
d8defd42d3 Fix patch parambuffer generation in OsdD3D11DrawContext. Also fixes hlsl shader bug. 2013-10-04 18:26:22 -07:00
Takahito Tejima
28356dae40 Optimize a bit of ptex mipmap lookup. 2013-10-04 18:23:20 -07:00
David G Yu
e977614461 Adjusted include order for clKernelBundle.cpp
Avoids GL declaration conflicts w/ OpenCL on OS X
2013-09-28 10:39:24 -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
c018aa1fc6 fix the file permission on osd/ptexMipmapTextureLoader.cpp 2013-09-23 13:22:09 -07:00
Takahito Tejima
52a0224d05 Add face varying macros for loop subdivision 2013-09-23 12:52:27 -07:00
Takahito Tejima
173dc4d33b Add an error check on updating cuda buffer. 2013-09-23 09:06:22 -07:00
Takahito Tejima
c2e0d06f56 Second derivatives computation, fix tangent/bitangent length 2013-09-20 18:23:28 -07:00
Takahito Tejima
d4579a8f85 Add a new ptex mipmap loader. very slow... 2013-09-20 18:22:09 -07:00
Nathan Litke
cf34b6ead9 Fixed clKernelBundle.cpp to build on Android. 2013-09-16 13:37:25 -07:00
Manuel Kraemer
35a6a4afaf Remove some cast warnings that are triggered in gcc 4.7 (seen in Fedora 18)
fixes #223
2013-09-13 23:00:23 -07:00
Manuel Kraemer
cf61fbc08a Fix Doxygen comments 2013-09-13 09:28:20 -07:00
manuelk
7d4999c46e Adding support for subdivision stencils.
- Adding FarStencilTables and FarStencilTablesFactory classes
- Adding Osd EvalStencil context & controllers for CPU, OMP and TBB backends
- Adding the code example glStencilViewer
- Adding reST documentation
- Changing version to 2.2.0_dev
- Fix HbrMesh::Unrefine function
- Fix "CanEval" function in OsdVertexBufferDescriptor

Note 0: there is no stencil support for hierarchical edits

Note 1: there is no support for face-varying data stencils yet

Note 2: the current stencil factory is lazy but the caching system is not re-entrant
2013-09-11 16:05:14 -07:00
Takahito Tejima
a907450229 Adding null checks 2013-09-05 13:09:54 -07:00
manuelk
2f8ba5b7e7 Fix cpuEvalLimitController crash bug
Properly check that derivative data is bound before passing pointers to the kernels.

fixes #218
2013-09-05 10:48:46 -07:00
Takahito Tejima
0f6f0b8148 Fixed invalid initialization of glslTransformFeedback kernel. 2013-09-04 10:41:23 -07:00
manuelk
e05e46f070 Modify CMake to name and sym-link DSO's based on Linux ABI versioning spec.
Fixes #209
2013-09-03 15:38:24 -07:00
Takahito Tejima
f1a1dbba3d Removed unnecessary cudaThreadSynchronize calls. 2013-08-28 17:11:45 -07:00