Commit Graph

499 Commits

Author SHA1 Message Date
manuelk
8d877d720b Update release notes for release 2.5.0 2014-05-28 16:35:05 -07:00
manuelk
de57f43db1 Fix doxygen generation errors 2014-05-28 16:19:49 -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
David G. Yu
b28d470e9b Fixed build warnings/errors with VS2010 Pro 2014-05-19 09:23:22 -07:00
Sergey Sharybin
f6d45a6de0 Fix compilation error on windows+msvc2013
- Some missing includes of <algorithms> in order to have
  stdd::min() and similar functions.
- Need to cast numIndices and numNVerts to int explicitly
  in order to solve warning treated as an error about
  precision loss.
- Can't do vector[0] for an empty vector, it'll generate
  a runtime range check error.
- MSVC only works fine with make_pair(foo, bar) syntax,
  without explicit template substitution here. Otherwise
  weird 'can't cast int to int&&' errors are happening.
2014-05-17 12:52:02 -07: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
Sergey Sharybin
f410190cde Fix some meory leaks in adaptive evaluator
- It used to create _computeContext twice.
- Ownership of refiner didn't set properly, because
  Initialize() forces evaluator to drop ownership.
  So now ownership sets after initialization from
  topology.
2014-05-11 13:37:03 +02:00
gelder
b85324dbf9 Merge pull request #299 from Nazg-Gul/dev
Implement C-API accessor to evaluator topology
2014-05-11 00:23:45 -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
Sergey Sharybin
c70daced19 Code cleanup: no need to use struct keyword in C++ code
It's only required for anonymous structures in C.

Also made a bit of whitespace cleanup.
2014-05-10 21:55:38 +02:00
Sergey Sharybin
c1dbc50527 Add getter of topology object to evaluator C-API
Useful for cases when some parts of the pipeline needs to know the
topology object. Simply helps saving memory so topology from the
evaluatgor can be re-used for stuff like HbrMesh creation.
2014-05-10 21:53:39 +02:00
Sergey Sharybin
8b627c1c73 Implement C-API accessor to evaluator topology
This way external application might check whether it need to
re-create evaluator from scratch or it might re-use existing
one without storing extra data from it's side.

TODO: Tags are still not accessible via C-API, it's marked as
to be solved later when it becomes more clear what is the best
way to expose them and when there'll be a real application to
test the tags.
2014-05-10 21:45:05 +02: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
gelder
2e02892216 Remove debugging std::cout calls as these classes get used in Presto. 2014-05-06 09:25:55 -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
bba6cda858 Fix incorrect FarMeshFactory logic for isolating multiple corner vertices in corner patches.
- the previous fix omitted to use the corner count which might have caused trouble with certain topologies

fixes #294
2014-04-30 19:02:28 -07:00
manuelk
ac04e124be Fix file permissions on farPatchTablesFactory.h 2014-04-30 16:10:32 -07:00
manuelk
42cd37e060 Fix adaptive isolation of sharp corner vertices
- fix the vertesIsBSpline logic to correctly recognize these sharp corner vertices
- fix another bug where a loop was missing vertices from from quad faces with 2
  non-consecutive boundaries

fixes #294
2014-04-30 14:37:21 -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
manuelk
6b6fa11447 Fix OsdUtilRefiner incorrect "Invalid size of patch array" error reporting.
The size of the patch array can only be checked in uniform mode. An argument can be
made that this should be an assert...

fixes #292
2014-04-29 10:21:38 -07:00
Nathan Litke
180c1804cc Fixes a bug introduced in 808aabf that causes OsdUtilPatchPartitioner to fail to rebuild the face-varying data table correctly for triangle patches. 2014-04-22 18:52:11 -07:00
manuelk
068035c26a Fix Windows build warning in FarPatchTablesFactory 2014-04-22 14:45:43 -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
Manuel Kraemer
d4b85556b8 Merge pull request #280 from Nazg-Gul/dev
Return success status from openSubdiv_finishEvaluatorDescr()
2014-04-21 17:14:31 -07:00
gelder
96baf03c68 Add missing third parameter to templated OsdDrawContext usage, caught in Presto build. 2014-04-21 16:14:35 -07:00
Manuel Kraemer
2dbf93f90c Merge pull request #285 from nathan-at-digitalfish/add_osd_mesh_ctor
Add a public constructor to OsdMesh
2014-04-21 14:34:12 -07:00
manuelk
4747dd84e7 Release 2.4.1 2014-04-21 12:28:17 -07:00
manuelk
b643c28b99 Update release notes for release 2.4.1 2014-04-21 12:18:16 -07:00
gelder
2545306e21 Add correct OpenSubdiv namespace begin/end blocks. 2014-04-21 10:25:38 -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
gelder
feb74f51f0 Compile osdutil with -fPIC for correct linking in Presto. 2014-04-18 16:19:09 -07:00
Takahito Tejima
ea2421843b Merge pull request #282 from nathan-at-digitalfish/issue281
Draw contexts do not fully initialize patch arrays #281
2014-04-18 14:24:29 -07:00
Takahito Tejima
5c5c7e2ab1 Fix a bug of OsdUtilMeshBatch, the varying buffer isn't computed with CL kernel. 2014-04-18 14:01:19 -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
Sergey Sharybin
43bb3b64f6 Return success status from openSubdiv_finishEvaluatorDescr()
Before this change the given function used to fail silently in
cases topology is bad or uniform evaluator initialization failed.
This used to leave evaluator in a state which is not usable for
further processing but callee function would never know this and
will likely crash later when evaluating subdivision limit surface.

Ideally error message or code need to be passed to the calle, but
that's marked as TODO for now.
2014-04-18 00:55:43 +06:00
manuelk
3405e952ba Release 2.4.0 2014-04-16 11:38:47 -07:00
manuelk
88c2448db0 Update release notes for release 2.4.0 2014-04-16 11:29:10 -07:00
manuelk
50980cea5a Fix access rights to d3d11ComputeController.h 2014-04-16 10:27:48 -07:00
Sergey Sharybin
0d349c57ed Remove debug print from adaptive evaluator's initialization
That's not good at all if an application which uses OpenSubdiv
library will suddenly have more console output coming from the
OpenSubdiv library.
2014-04-16 16:41:47 +06:00