Commit Graph

504 Commits

Author SHA1 Message Date
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
Takahito Tejima
9c6d963d38 use osd/opengl.h 2013-08-28 17:11:45 -07:00
manuelk
d57df0eae0 Enable TBB for Linux builds
- Fix FindTBB.cmake
- Add TBB logic to various CMakeLists
- Update documentation
2013-08-15 16:11:33 -07:00
manuelk
d28dad10e5 Update TBB C&C's with Sheng's (shengfuintel) latest code
Git cherry-picking of the original pull request missed a few changes to these files.

Thanks again to Sheng for this most excellent contribution !
2013-08-15 15:24:42 -07:00
manuelk
22b1cddfc9 Protect Intel icc specific pragmas behind #define's 2013-08-15 15:23:12 -07:00
manuelk
b227443390 Fix compiler warnings in osd/ptexTextureLoader caused by incorrect const declarations 2013-08-15 10:32:08 -07:00
Manuel Kraemer
1ee304a6f3 Merge pull request #214 from shengfuintel/dev
Dev
2013-08-15 10:17:19 -07:00
David G Yu
6f8bfdfcbf Fixed implicit int to float warnings in xform feedback kernel 2013-08-15 10:06:16 +01:00
Sheng Fu
7fac2935fa Optimize CPU kernel 2013-08-14 16:41:35 -07:00
Sheng Fu
f2baa81249 Changed license header 2013-08-14 10:45:23 -07:00
Sheng Fu
7aa2d3009e initial checking in TBB kernel. 2013-08-14 10:43:48 -07:00
manuelk
5fc10338df Add OsdMesh constructor with FarMesh * as input
This allows client code to own the FarMesFactory if necessary.
2013-08-08 13:11:16 -07:00
David G Yu
7fdd82ba76 A few build fixes for Android and iOS 2013-08-07 11:16:00 -07:00
manuelk
695b09a169 fix incorrect transition pattern 3 in GLSL / HLSL shaders
some patch rotations need to be fixed

fixes #200
2013-07-30 14:16:39 -07:00
manuelk
cd17c87cb1 fixing CMake build to not link GPU-based libraries into libosdCPU
fixes #198
2013-07-26 14:07:14 -07:00
takahito-tejima
dd91b2de8c Fix some portability issues on OSX. (GLEW will be used if exists) 2013-07-18 19:49:00 -07:00
Takahito Tejima
51a45b598d Updating EULA 2013-07-18 14:19:50 -07:00
Takahito Tejima
a13c0565e4 Renamed texture buffers and uniforms
g_VertexBuffer -> OsdVertexBuffer
g_ValenceBuffer -> OsdValenceBuffer
g_QuadOffsetBuffer -> OsdQuadOffsetBuffer
g_ptexIndicesBuffer -> OsdPatchParamBuffer
g_uvFVarBuffer -> OsdFVarDataBuffer
LevelBase -> PrimitiveIdBase
2013-07-18 12:57:26 -07:00
manuelk
500defee4c - adding new build flag options (NO_LIB, NO_CUDA...)
- move python build section into the python directory (cleaning up)

- fix some broken dependencies

- remove the public_headers targets if doxygen was not found

TODO :
- fix MSVC targets for public headers (wbn if MSVC didn't require the pro version
  in order to support solution folders)
- fix osd_regression to not build if -DNO_LIB is present (ie. fix the broken dependency)
2013-07-11 18:55:17 -07:00
takahito-tejima
5fe71a18d1 Fix a texture buffer binding bug 2013-07-10 16:06:34 -07:00
Takahito Tejima
de3e706379 Potential fix for the shader compilation problem.
Replace face varying computation functions with equivalent macros
to avoid gl_PrimitiveID undefined error.
2013-07-08 16:16:28 -07:00
manuelk
36236a4143 fix doxygen comment in osd/cpuVertexBuffer.h 2013-07-08 13:18:56 -07:00
manuelk
9712b44239 Documentation build modifications:
- add macro "_add_doxy_headers" in order to track all header files elligible for
  doxygen documenation. This captures public header files that would otherwise be
  excluded from installation because they are not supported by the OS. Private
  header files remain excluded though.

- add custom targets and commands so that documentation build produces functioning
  RST and Doxygen documentation both in the build and install stages

- switched to Doxygen 1.8 (because markdown will make in-lined documentation easier)

- added build switches to disable examples, regression and python-SWIG targets

- fixed doxygen link in the nav bar

- modified python html processing tool to match Cmake changes
2013-07-05 15:36:54 -07:00
manuelk
efb1a5fe44 fix doxygen warning from comments in d3d11ComputeContext.h and d3d11DrawContext.h
fixes #138
2013-07-05 15:35:06 -07:00
Takahito Tejima
e21f7d98ca Remove debugging remnant. 2013-07-03 13:53:15 -07:00
Takahito Tejima
2b4dd1cb0a Add convenient functions to compute face varying attributes.
closes #171
2013-07-03 12:08:10 -07:00
David G Yu
1b6026a1a2 A few minor changes to sync up GLSL and HLSL 2013-07-02 10:06:24 -07:00
David G Yu
84de67295c Unified HLSL Gregory patch shaders 2013-07-02 00:26:09 -07:00
David G Yu
838e43fed1 True up the HLSL Gregory patch shader source
Mostly just whitespace changes and variable renaming.
2013-07-01 22:54:44 -07:00
David G Yu
6b7a41d4db Unified GLSL Gregory patch shaders 2013-07-01 11:58:28 -07:00
David G Yu
03b5b329d3 True up the GLSL Gregory patch shader source
Mostly just whitespace changes and variable renaming.
2013-07-01 11:47:21 -07:00
Takahito Tejima
b9086b4686 Fix OsdGLSLTransformFeedbackComputeContext to bind vertex/varying buffer correctly.
Closes #186
2013-06-28 16:09:04 -07:00
David G Yu
d2abf61c56 Added adaptive tess of user varying values
This isn't necessarily a final design, but
it gets enough of the pieces in place to move
forward.
2013-06-28 14:05:47 -07:00
manuelk
61c71c77c0 fix ComputeContext functions that copy subdivision table data from possibly empty STL vectors
fixes #185
2013-06-28 13:53:14 -07:00
David G Yu
15b467dda9 Fixed preprocessor syntax for shader portability 2013-06-28 10:10:25 -07:00
David G Yu
8fae6511f7 Continued bicubic patch shader cleanup
Removed superfluous vertex and fragment/pixel shaders
2013-06-27 17:26:22 -07:00
David G Yu
b5d182b7be Add fractional spacing for boundary gregory 2013-06-27 17:08:19 -07:00
Takahito Tejima
184e90f9a1 Add fractional spacing mode for patch rendering. 2013-06-27 13:34:25 -07:00
Takahito Tejima
59cdf85a5b Merge branch 'dev' of https://github.com/PixarAnimationStudios/OpenSubdiv into dev 2013-06-27 12:58:22 -07:00
Takahito Tejima
e030157f73 Add varying buffer handling to OsdMesh.
Fix a bug that breaks varying interpolation on cuda kernel
Clean up glViewer with some new functions : varying color, screen space lod, patch culling
2013-06-27 12:57:21 -07:00
manuelk
aababd42a6 fix build warnigns (oddly, gcc shows nothing, despite having -Wall...)
fixes #184
2013-06-27 10:11:47 -07:00
Takahito Tejima
11b644a06e Fix a indexing bug in hierarchical edit kernel of Cuda, GLSLcompute and GLSLTransformFeedback
Closes #183
2013-06-26 16:10:26 -07:00
David G Yu
7d16bffccb Continued cleanup of OpenGL dependencies 2013-06-26 00:52:57 -07:00
David G Yu
09f6f9e2d5 Fixed num verts tested for patch frustum culling 2013-06-24 12:43:02 -07:00
David G Yu
9bab9185ab Partial cleanup of bicubic patch shader source
- Added OSD_ prefix to preprocessor symbols
- Adjusted transition sub-patch parameterization to be
  consistent with non-transition patches
- Unified BSpline shader code
- Removed duplicate Boundary, Corner, and Transition shader source
- Fixed a few discrepancies in the remaining duplicate code paths
2013-06-24 12:03:57 -07:00
manuelk
f89d3614ba fix OsdMash to catch up with some of the 1.2 code refactoring - thanks Sheng for digging this one up.
fixes #178
2013-06-19 14:53:03 -07:00
manuelk
a419830ee8 OsdGLDrawRegistry : fixing an OSD error message prefix when program linking fails 2013-06-19 12:59:43 -07:00
manuelk
85be47a135 OsdGlMesh : adding accessors for the FarMesh and the VertexBuffer for Scot 2013-06-19 12:55:12 -07:00
Takahito Tejima
043044827f Fix a bug of patch level computation for non-quad faces. 2013-06-18 19:17:41 -07:00
Takahito Tejima
047a943bf2 Added an #ifdef around glew.h to avoid a conflict with gl.h in a client code. 2013-06-18 16:16:38 -07:00
manuelk
12f572946e fix read/write permissions on files 2013-06-18 15:02:46 -07:00
manuelk
bbe4435b19 minor API refactor of for EvalLimit :
- Replaced EvalData and EvalVertexData classes with a simpler DataStream class that only
  accesses a single data stream, binds and unbinds it

- DataStream has both an input and an output version which avoids much of the const-ness
  const-related ambiguity of the previous design pattern

- Vertex, varying and face-varying data now all have a dedicate struct (VertexData, VaryingData, FaceVaryingData)
  as a way of gathering the various data-streams required to perform sampling

- renamd some "Buffers" into "Tables" for better naming consistency with Far
2013-06-17 18:13:13 -07:00
manuelk
54bef92aab switch cpuEvalLimitController to use a quad-tree based patch access map :
- remove PatchMap from FarPatchTables

- add a new FarPatchMap quad-tree class (constructed from FarPatchTables)

- refactor the EvalLimitController to use the quad-tree search instead of a
  serial loop access

fixes #174
2013-06-13 14:01:23 -07:00
manuelk
fab0527f91 minor FarPatchTables::PatchMap code refactor :
- replace use of std::multimap with an std::sort
- refactor some methods into PatchParam
2013-06-11 15:59:43 -07:00
David G Yu
61b8fb4713 Removed extraneous clipFlag declaration. 2013-06-10 23:00:38 -07:00
David G Yu
2b972f3117 Consolidated OpenGL includes into osd/opengl.h 2013-06-10 16:32:45 -07:00
David G Yu
967fc4db72 Fixed glsl shader portability edgeDistance
Moved all edgeDistance declarations to client shader code.
2013-06-10 16:32:45 -07:00
David G Yu
1461deb308 Fixed glsl shader portability (input,output) 2013-06-10 16:31:30 -07:00
David G Yu
ffe427dc65 Fixed glsl unsigned conversions in Gregory shaders 2013-06-10 16:21:48 -07:00
David G Yu
2551c32448 Fixed glsl shader portability
- defined a fallback value for ROTATE
- made GetPatchLevel() a macro to avoid
  referencing gl_PrimitiveID from vertex shaders
- fixed float array initializers
2013-06-10 16:21:47 -07:00
David G Yu
e1930e58cd Fixed some glsl preprocessor tests
Changed #if --> #ifdef for OSD_ENABLE_SCREENSPACE_TESSELLATION
2013-06-10 16:21:47 -07:00
David G Yu
c185968809 Updated glsl code texelFetchBuffer -> texelFetch
This allows us to remove unnecessary directives
to require GL_EXT_gpu_shader4
2013-06-10 16:21:47 -07:00
manuelk
c18cf5bff2 first pass at face-varying interpolation for CpuEvalLimit - still
a couple of kinks to be worked out...
2013-06-06 18:07:46 -07:00
manuelk
043369485c - adding varying data interpolation to the EvalLimit module
- minor refactoring of the LimitEvalContext to accomodate all the data buffers

- pushing some minor sub-patch functionality back to FarPatchParams

- extend example code with randomly generated varying vertex colors
2013-06-05 11:44:30 -07:00
Takahito Tejima
a6bf169344 Fix fvardata interpolation on adaptive patches. 2013-06-04 11:02:27 -07:00
manuelk
b270f99ea0 - prevent corner gutter texels from going into an infinite loop by
adding an arbitrary break if vertex valence is > 256

- add a Warning function to Osd error reporting

- minor cleanup /refactor / document of OsdError

fixes #167
2013-06-03 17:33:02 -07:00
Takahito Tejima
b037fc3307 Added early exit to Refine method to avoid unnecessary interop. 2013-06-03 17:06:33 -07:00
manuelk
21b9fbbb95 Moving some member variables of OsdGlDrawContext from public to protected
and adding the requisite accessors

Note : all our example code goes through the same boiler-plate texture
binding code - we might want to move it as a member function of the DrawContext.
2013-05-31 17:11:16 -07:00
manuelk
bcc31df715 doc fix for EvalLimitSample 2013-05-31 14:17:23 -07:00
manuelk
e52af3660e fix cpuEvalLimitController : some samples were being dropped because
of bad parameterization on non-quad faces
2013-05-31 13:51:21 -07:00
manuelk
87188355f1 fix the last bugs in the GregoryBoundary EvalLimit CPU kernel 2013-05-30 18:12:09 -07:00
manuelk
49b710ee77 bug fixes to cpuEvalLimitKernel.cpp (use unsinge ivalence in the correct places)
minor code cleanup

Note : there is still a resilient bug in the Gregory Boundary patch case
2013-05-28 16:37:45 -07:00
manuelk
2849965f59 bug fixes for Gregory Boundary patches in cpuEvelLimitKernel.cpp 2013-05-28 13:54:37 -07:00
manuelk
262a0d43a1 fix some MSVC++ build warnings (mostly float precision literals) 2013-05-24 16:51:13 -07:00
manuelk
85a3001120 Work in progress on EvalLimit : added Gregory & GregoryBoundary kernels.
Note : GregoryBoundary does not generate the correct surface yet (bug to be squashed soon)
2013-05-24 16:29:28 -07:00
manuelk
f617cdd6ed Work in Progress : checkin in function kernels for boundary and corner patches.
Casual testing doesn't reveal any bug within our sample shapes.

Remaining : gregory & gregory boundary patches.
2013-05-22 18:56:27 -07:00
manuelk
f25e89b745 Work-in-progress check-in for EvalLimit :
- added boundary / corner kernel code

- bug fixes for Gregory patch kernel

- wired the new kernels in the controller class

Note 1 : corner / gregory kernels are not working yet

Note 2 : the vertex mirroring solution used for boundary / corner kernels could be incorrect...
2013-05-22 12:10:49 -07:00
Takahito Tejima
0e99d69b40 Added cuda runtime error check. 2013-05-21 19:19:00 -07:00
manuelk
2a298442f4 minor refactor : move PatchMap and PatchHandles into FarPatchTables where they belong (instead of OsdLimitEval) 2013-05-17 15:46:29 -07:00
David G Yu
17199885f1 Updated GCD kernel interfaces. 2013-05-17 15:29:05 -07:00
manuelk
209239c7c0 adding a missing 'static' to an internal function 2013-05-17 14:56:39 -07:00
manuelk
5dd23e8e27 more doxy comment fixes 2013-05-17 14:39:07 -07:00
manuelk
5ed3488493 more doxy / comment fixes 2013-05-17 14:07:53 -07:00
Takahito Tejima
317962697a fix d3d11DrawContext and dxViewer to follow API changes 2013-05-17 13:30:43 -07:00
manuelk
1b80f01ee3 style cleanup + doxy comments 2013-05-17 10:21:38 -07:00
manuelk
3869be18b7 Renaming PtexCoord as PatchParam and general cleanup of the ptex name where it
doesn't belong
2013-05-17 09:47:44 -07:00
manuelk
c2cec239cd removing osd/patch.h (and cleaning up attending dependencies) 2013-05-17 09:06:40 -07:00
manuelk
dbdde33bef make the use of OsdVertexDescriptor consistent across all classes (and doxy / typo fixes) 2013-05-16 19:53:49 -07:00
manuelk
6256010296 re-factoring the EvalLimit portion of the code (and other minor comment / typo fixes) 2013-05-16 14:21:11 -07:00
manuelk
ad3bacbbbb remove topology data from FarMesh and refactor uniform / adaptive
code paths using FarPatchTables for all serialized topological data.
2013-05-15 17:53:40 -07:00
Takahito Tejima
b16272d6a5 more msvc fixes. make dxViewer working. 2013-05-14 10:48:48 -07:00
Takahito Tejima
d8734690b7 msvc build fixes 2013-05-13 18:43:05 -07:00
Takahito Tejima
1a2b71d929 Refactor OsdGLDrawContext to be constructed from FarPatchTables, instead of FarMesh.
Removed reference to FarMesh from OsdUtilMeshBatch.
Added const qualifier to ComputeContext constructor.
2013-05-10 19:35:25 -07:00
manuelk
8d8e0e9a24 - doxy doc
- inlining critical operators
2013-05-10 11:18:41 -07:00
Takahito Tejima
b7814266c9 Add OpenCL specialized batching class 2013-05-10 09:20:45 -07:00
Takahito Tejima
7632489758 bug fix of OsdGLVertexBuffer::UpdateData. the starting index was wrong. 2013-05-10 08:53:06 -07:00
Takahito Tejima
1b879d706f fix FarMultiMeshFactory to work with refactored FarPatchTables. 2013-05-09 19:16:51 -07:00
Takahito Tejima
42f84b78d0 add levelBaseUniform and gregoryQuadOffsetBaseUniform locations as default member 2013-05-09 19:15:50 -07:00
Takahito Tejima
7b6630cf40 fix simpleCpu and ptexViewer to be compilable with new patch tables. 2013-05-09 13:48:00 -07:00
Takahito Tejima
3eaf0362bd split patch descriptor into two parts, far intrinsic properties and osd's.
more OsdGLDrawContext clean up.
2013-05-09 13:14:02 -07:00
Takahito Tejima
ecced51814 factor out createPatchArray function into drawContext.
cleanup glDrawContext
2013-05-09 10:53:58 -07:00
Takahito Tejima
f592e90067 fix OsdGLDrawContext to follow far patchtables refactoring. 2013-05-09 09:23:01 -07:00
manuelk
cd380e0a1a Refactoring :
- moving the SubdivisionTables enum from osd/tables.h to FarSubdivisionTables

- renaming various buffer names to _devicePtr for consistency
2013-05-07 15:25:49 -07:00
manuelk
5ec2320d9a adding doxy comments to Compute Controllers
fixes #138
2013-05-07 13:55:14 -07:00
David G Yu
9e371e4e89 Fixed DX11 build errors from KernelBatch refactoring 2013-05-06 23:59:58 -07:00
David G Yu
6b96d531bd Fixed GCD build errors from KernelBatch refactoring 2013-05-06 23:59:54 -07:00
manuelk
3ea2a3e472 fixing / adding doxy comments
fixes #138
2013-05-06 19:05:50 -07:00
manuelk
aed197628c KernelBatch tables refactor / cleanup :
- FarKernelBatch becomes a class w/ accessors
- split the FarKernelBatchFactory to its own header file
- add doxy doc
- propagate fallout to the rest of the code base
2013-05-06 17:50:58 -07:00
manuelk
65c92bbe72 oops : osd_dynamic_gpu and osd_dynamic_cpu don't always build under windows, so they
don't always have an install target.

fixes #154
2013-05-02 12:02:52 -07:00
manuelk
b815aff333 First pass at fixing the installation part of the Cmake build : now CMAKE_INSTALL_PREFIX can
be used as intended to specify an installation directory, which can be located anywhere on the
file system.

Also improved the doxygen target and made the doxy build "quiet".

fixes #154
2013-04-22 19:35:41 -07:00
manuelk
eadd1b3ce4 fixing some doxygen @param tags not matching variable names in the code
fixes #138
2013-04-22 18:26:53 -07:00
manuelk
4bf24d9b95 First pass at our "Eval" API : this checkin is a mileston and is still missing
code paths for certain types of feature adaptive patches.

The check-in adds a new "limitEval" code example.

More to come soon...

fixes #45
2013-04-18 19:55:05 -07:00
manuelk
24356cc680 making MSVC++ happy...
fixes #153
2013-04-18 19:22:20 -07:00
manuelk
7e63b20c58 Small refactoring of the DrawContext code to remove duplication of vertex / patch counting code.
fixes #153
2013-04-18 17:54:12 -07:00
David G Yu
4a6ba2de64 Fixed function proto mismatch in d3d11DrawContext
Fixes #143
2013-03-25 10:54:40 -07:00
manuelk
e6e7c96a52 We need to leverage our per-patch ptex indexing scheme in the EvalLimit API.
- replace ptex indexing with the FarPtexCoord structure as a way to pass per-patch
  ptex data to the shaders.

  We are replacing a vector<int> arranged as :
  int[0] : ptex face index
  int[1] : (u,v) as 16 bits encoding the log2 coordinate of the top left corner

  Instead we are now using a struct arranged as :
  int[0] : ptex face index
  int[1] : is a bit-field containing u,v, rotation, depth and non-quad

  The u,v coordinates have been reduced to 10 bits instead of 16, which still
  gives us a lot of margin.

- Replace OsdVertexBufferDescriptor with something more adequate for general
  primvar representation (this name will probably eventually change...)

- Improve OsdPatchDescriptor
    - add a "loop" boolean (true if the patch is of loop type)
    - add a GetPatchSize() accessor

- OsdPatchArray :
    - remove some redundant elements (still more to do there)

- Fix all shader / examples / regressions & stuff to make this all work.

fixes #143
2013-03-22 18:20:50 -07:00
Manuel Kraemer
95f326eed1 add OpenCL include directories when Cmake detects CL for the OSD build 2013-03-16 18:41:49 -07:00
Manuel Kraemer
5c9ae5537c fix build error : size_t requires stdlib.h 2013-03-16 18:40:53 -07:00
Takahito Tejima
f745aa2807 add paint test example 2013-03-15 12:39:44 -07:00
David G Yu
500bebefb4 Fixed VS2010 build warnings/errors 2013-03-08 12:07:09 -08:00
Takahito Tejima
291debd4a9 change access permissions on files 2013-03-08 08:57:42 -08: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
Takahito Tejima
ced00bf107 fix crash bug when non-quad boundary face exists. 2013-03-07 14:56:14 -08:00
Andrew Wong
60d81afd02 ptexTextureLoader: Fix a few compiler warnings 2013-02-25 22:29:50 -05:00
David G Yu
452b30f72f OsdMesh no longer owns its ComputeController
Now a ComputeController is passed as an
argument to OsdMesh::Create(). This is
a better match to the underlying object
model and can be much more efficient for
compute controllers that have expensive
resources, e.g. compiled shader kernels.

Fixes #103
2013-02-19 17:33:32 -08:00
Andrew Wong
d4c62d4aef osd: fix conversion warnings in glDrawContext
warning C4242: 'argument' : conversion from 'int' to 'unsigned char', possible loss of data
2013-02-09 23:35:02 -05:00
Manuel Kraemer
6d4565e6b8 Merge pull request #109 from aras-p/glvbo-fixes
CpuGLVertexBuffer performance fix + glViewer fixes

reviewed, approved & much appreciated : thank you

takahito + manuelk
2013-02-06 18:27:48 -08:00
Takahito Tejima
4738916173 Fix ptex guttering on corner pixels.
Fixes #114
2013-02-05 18:06:19 -08:00
manuelk
6f5d1e34be partial solution to run-time environment configuration :
- add bool OsdGLDrawContext::SupportsAdaptiveTessellation() method
- modify glViewer to use that instead of #ifdefs

Note : this is not the final word on this as OSD really needs a more comprehensive
system to provide run-time information about available features to the client code.

fixes #111
2013-02-05 15:04:07 -08:00
Aras Pranckevicius
0d5b543c4a CpuGLVB: code review changes 2013-02-04 22:10:36 +02:00
Aras Pranckevicius
58cb40ec5c CpuGLVB: dirty flag to not keep on uploading if data did not change 2013-02-04 20:57:19 +02:00
Aras Pranckevicius
a4a8cd122d CpuGLVB: reading data back from the GPU each time model is changed is not very efficient.
Model the GL VB after D3D11 one, where there are no data read backs, however this means
an extra memory copy of the buffer. 4th level uniform subdiv on Car, glGetBufferSubData
was taking 50% of CPU time before (actual subdiv 22%), now that is gone. Full CPU Draw
62ms -> 54ms, looks like most of overhead now is just waiting on GL queries).
2013-02-04 07:55:42 +02:00
Aras Pranckevicius
a379ec2b9a gcd: cleanup 2013-02-03 10:15:31 +02:00
Aras Pranckevicius
8b59d99d20 gcd: cleanup CMakeLists 2013-02-03 10:12:29 +02:00
Aras Pranckevicius
e8ceaba176 gcd: convert face loop to work in 32 item size batches.
MBP6,2 (2 core 4 thread), catmark_car Lv4: 31.2ms CPU, 15.8ms GCD (was 22ms)
2013-02-03 10:05:58 +02:00
Aras Pranckevicius
c4b463668a gcd: convert most of loops to submit work in 32 item size batches.
MBP6,2 (2 core 4 thread), catmark_car Lv3: 6.9ms CPU, 5.2ms GCD; Lv4: 31.2ms CPU, 22.ms GCD
2013-02-03 09:38:33 +02:00
Aras Pranckevicius
b556e9d6cd gcd: naive implementation using dispatch_apply for all loops. Not faster, dispatch overhead too high 2013-02-02 23:22:04 +02:00
Aras Pranckevicius
54c7329ba4 gcd: files for GCD dispatcher (right now just copy of OMP one), add items to glViewer 2013-02-02 22:53:33 +02:00
Nathan Litke
68488d86b0 Fixed a buffer overrun error in OsdCLGLVertexBuffer::UpdateData. 2013-01-30 00:20:37 -08:00
Takahito Tejima
ab4f79c128 Remove deprecated GL calls, comply with 4.2/3.3 core profile. Use VAO, update glsl shaders, remove immediate draws, etc.
In example code, GLUT has been replaced with GLFW so that glViewer/ptexViewer can run on OSX (10.7 or later).

OSX note: still have some problem with clang, may need to explicitly specify gcc on cmake cmdline
 -DCMAKE_CXX_COMPILE=/usr/bin/g++

fixes #98
2013-01-29 15:54:18 -08:00
manuelk
d03a04d088 Fix OSD crash bug within CUDA & CL compute modules :
- remove the GL error check in cudaGLVertexBuffer :
  * unrelated GL errors left on the stack were triggering erroneous
  vertexBuffer allocation errors
  * we should not be checking for GL errors here anyway (as most other
  buffer allocations aren't checked either)

- add some pointer checking in the GL / D3D drawContexts in case the
  vertexBuffer pointers passed are NULL

- add some additional typedefs in OsdError to report some of the new
  CUDA / GL related errors
2013-01-25 18:31:40 -08:00
manuelk
9ed6ac7da8 - clean up all unused variables / constructors...
- add a -Wall flag, but leave it commented out for now until the same is done for other compilers

fixes #96
2013-01-22 14:47:46 -08:00
manuelk
54dff770d4 clean access permissions on files (rw-rw-r--) 2013-01-18 13:40:39 -08:00
Manuel Kraemer
ba7bf7b41c fix compiler warnings on class constructors 2013-01-18 13:30:31 -08:00
manuelk
2baa3c82c1 removing some crusty tabs & other minor formatting 2013-01-10 11:14:41 -08:00
David G Yu
95c84b8f56 Adaptive tess using projected bounding sphere
This avoids adaptive tessellation artifacts near silhouette edges
by using the projected diameter of an edge's bounding sphere
rather than the length of the projected edge itself.

There is a nice writeup of this by Bryan Dudash of NVIDIA at:
https://developer.nvidia.com/content/dynamic-hardware-tessellation-basics
2013-01-04 19:15:24 -08:00
David G Yu
1547b59570 Updated to support GLES 2.0 on iOS and Android 2012-12-20 10:25:41 -08:00
David G Yu
ce2f29d368 Upload only the coarse vertex data from CPU to GPU 2012-12-19 23:30:36 -08:00
manuelk
9ac6c3081e - fix broken ptex block allocation : iterates over all faces to find the longest edge
- code style fixes

fixes #89
2012-12-17 10:31:55 -08:00
manuelk
607b62337a Switching ptex coordinates structures to centroid based interpolation. This does not fix completely the problem though and we will have to revisit our guttering.
fixes #88
2012-12-17 10:26:14 -08:00