Commit Graph

38 Commits

Author SHA1 Message Date
Matt Larsen
ffdb33f727 follow coding conventions 2021-03-05 08:47:58 -08:00
Matt Larsen
a778af8bc9 make scalar normilization consistent across rendering 2021-03-05 08:32:10 -08:00
Matt Larsen
168952a0ce correct a potential divide by zero 2021-03-05 08:15:56 -08:00
Kenneth Moreland
c55d15f397 Deprecate ArrayHandle::ExecutionTypes
The newer version of `ArrayHandle` no longer supports different types of
portals for different devices. Thus, the `ReadPortalType` and
`WritePortalType` are sufficient for all types of portals across all
devices.

This significantly simplifies supporting execution objects on devices,
and thus this change also includes many changes to various execution
objects to remove their dependence on the device adapter tag.
2021-02-08 12:17:37 -07:00
Kenneth Moreland
7df5c39358 Remove device template argument from AtomicArrayExecutionObject
The actual code for AtomicArrayExecutionObject does not need to be
specialized by the device. The functionality is implemented by calling
the vtkm::Atomic* methods, which are properly implemented on each
device.
2021-02-04 08:47:28 -07:00
Kenneth Moreland
3f5193d231 Consolidate getting a scalar field array
There are several places in the ray casting library that require
operating on a field that we know is a scalar field. Previously, these
were all independently cast to an uncertain array of the limited types.
Rather than have independent calls everywere, make a consolidated
function that does the same operation for everyone.

This fixes an issue with using a deprecated version of a method. It also
makes it possible to quickly change types in the future.
2021-01-25 15:25:11 -07:00
Kenneth Moreland
28ecf3636d Change interface of atomic compare and swap
The old atomic compare and swap operations (`vtkm::AtomicCompareAndSwap`
and `vtkm::exec::AtomicArrayExecutionObject::CompareAndSwap`) had an
order of arguments that was confusing. The order of the arguments was
shared pointer (or index), desired value, expected value. Most people
probably assume expected value comes before desired value. And this
order conflicts with the order in the `std` methods, GCC atomics, and
Kokkos.

Change the interface of atomic operations to be patterned off the
`std::atomic_compare_exchange` and `std::atomic<T>::compare_exchange`
methods. First, these methods have a more intuitive order of parameters
(shared pointer, expected, desired). Second, rather than take a value
for the expected and return the actual old value, they take a pointer to
the expected value (or reference in `AtomicArrayExecutionObject`) and
modify this value in the case that it does not match the actual value.
This makes it harder to mix up the expected and desired parameters.
Also, because the methods return a bool indicating whether the value was
changed, there is an additional benefit that compare-exchange loops are
implemented easier.

For example, consider you want to apply the function `MyOp` on a
`sharedValue` atomically. With the old interface, you would have to do
something like this.

```cpp
T oldValue;
T newValue;
do
{
  oldValue = *sharedValue;
  newValue = MyOp(oldValue);
} while (vtkm::AtomicCompareAndSwap(sharedValue, newValue, oldValue) != oldValue);
```

With the new interface, this is simplfied to this.

```cpp
T oldValue = *sharedValue;
while (!vtkm::AtomicCompareExchange(sharedValue, &oldValue, MyOp(oldValue));
```
2020-10-20 08:39:22 -06:00
Kenneth Moreland
ad0a53af71 Convert execution preparation to use tokens
Marked the old versions of PrepareFor* that do not use tokens as
deprecated and moved all of the code to use the new versions that
require a token. This makes the scope of the execution object more
explicit so that it will be kept while in use and can potentially be
reclaimed afterward.
2020-02-25 09:39:19 -07:00
Kenneth Moreland
cd302effb3 Update lists in TypeListTag.h
A new header named TypeList.h and the type lists have been redefined in
this new file. All the types have been renamed from `TypeListTag*` to
`TypeList*`. TypeListTag.h has been gutted to provide deprecated
versions of the old type list names.

There were also some other type lists that were changed from using the
old `ListTagBase` to the new `List`.
2019-12-05 11:05:19 -07:00
Robert Maynard
031407443d Provide simplified way to construct point and cell fields 2019-08-15 11:03:41 -04:00
Kenneth Moreland
0be50c119d Update VTK-m code to use new Vec aliases
Should make the code easier to read.
2019-07-31 12:55:40 -06:00
nadavi
fbcea82e78 conslidate the license statement 2019-04-17 10:57:13 -06:00
Kenneth Moreland
b2e20bf90e Fix issues from removing field type templates
The script fixed up most of the issues. However, there were some
instances that the script was not able to pick up on. There were
also some instances that still needed a means to select types.
2019-01-11 12:23:19 -07:00
Kenneth Moreland
2e426ad547 Run the update-control-signature-tags.sh script 2019-01-11 12:23:10 -07:00
Robert Maynard
09383ceb52 Update vtkm/rendering to work with vtkm::cont::ArrayHandleVariant 2018-12-27 14:35:56 -05:00
mclarsen
1c2f78ca92 refactoring ray tracing 2018-09-10 19:25:42 -07:00
Kenneth Moreland
d879188de0 Make DispatcherBase invoke using a TryExecute
Rather than force all dispatchers to be templated on a device adapter,
instead use a TryExecute internally within the invoke to select a device
adapter.

Because this removes the need to declare a device when invoking a
worklet, this commit also removes the need to declare a device in
several other areas of the code.
2018-08-29 19:18:54 -07:00
Matthew Letter
25d1403615 fix bad rabse for wireframer
applied master to wireframmer and applied my changes back over it to fix a possible bad rebase
2018-07-03 15:52:53 -06:00
Matthew Letter
db1c9bfeee Change the namespacing of atomic array
moved the execution object to vtkm::exec and AtomicArray to vtkm::cont
2018-07-02 16:25:48 -06:00
Matthew Letter
6b9cb536a8 added new lines at the end of bot recommended files 2018-07-02 16:21:00 -06:00
Matthew Letter
3c9e7f049f updated Atomic array to use new excution object paradigm 2018-07-02 16:21:00 -06:00
Allison Vacanti
ec0791e941 Add a swap implementation that works on all backend.
Calling std::swap isn't legal from CUDA code, but the new vtkm::Swap
method is safe. It currently does a naive swap when compiling CUDA
code, and falls back to an ADL swap
2018-06-01 14:13:46 -04:00
Allison Vacanti
93506d25e2 Change function signatures to use 'using' aliases.
Also cleaned up some lingering type typedefs.
2018-05-25 17:18:41 -04:00
Haocheng LIU
5c797169ec Use the strong typed enums for vtkm::cont::Field
Since Field association is used either when creating or working
with 'vtkm::cont::Field', it's put in the class itself.
2018-05-22 11:44:51 -04:00
Sujin Philip
70fcd1d1cc Update CoordinateSystem to use the Virtual Array 2018-01-10 10:19:19 -05:00
Robert Maynard
a81919999a Merge topic 'vtkm_host_device_warnings'
93bc0198 Suppress false positive warnings about calling host device functions.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sujin Philip <sujin.philip@kitware.com>
Merge-request: !1042
2018-01-02 14:10:54 -05:00
Robert Maynard
93bc0198fe Suppress false positive warnings about calling host device functions. 2018-01-02 10:40:49 -05:00
Sujin Philip
3e10b504e6 Replace ExecutionWholeArray with WholeArray 2018-01-02 10:30:16 -05:00
mclarsen
f473974310 Fixing error with uninitialized variable 2017-10-26 14:17:49 -07:00
Matt Larsen
aeeb954fd0 correcting typo 2017-10-26 08:38:21 -07:00
Matt Larsen
14b7789fd6 fixing ambiguous min max call 2017-10-26 08:32:06 -07:00
Matt Larsen
035814a4a7 adding 2d ortho support to ray tracing and updating WireFramer to support 2d lines and 1D line plots 2017-10-26 07:58:02 -07:00
Kenneth Moreland
c3a3184d51 Update copyright for Sandia
Sandia National Laboratories recently changed management from the
Sandia Corporation to the National Technology & Engineering Solutions
of Sandia, LLC (NTESS). The copyright statements need to be updated
accordingly.
2017-09-20 15:33:44 -06:00
Manish Mathai
bbf84c11d8 Clear framebuffer to black instead of white.
This change updates the framebuffer clear logic, relying on the canvas
to blend with the background instead of eagerly doing it at the start.
2017-08-29 15:03:00 -07:00
Manish Mathai
3210e50209 Adds an small Z offset to the wireframe edges to solve z-fights
This commit solved z-fighting issues with two changes:
- A small offset, proportional to distance between near and far planes, is
applied in camera space to the edges.
- The minimum screenspace offset is increased as well for the same reason.
A new test case is added for uniform grids.
Additionally, the line plotting algorithm is changed to round off the
edge endpoints to fill in empty pixels seen on uniform grids.
2017-08-29 14:55:24 -07:00
Manish Mathai
8e0a0308f0 Handles the case when the passed canvas has rendered data.
This change adds a option via `SetIsOverlay` which causes the
`MapperWireframer` to use the existing depth buffer instead of
generating a new one.
This change refactors the line color blending to
retain the alpha value separately instead of pre-multiplying it.
2017-08-23 14:51:05 -07:00
Manish Mathai
b727377fd5 Refactoring 2017-08-21 18:21:44 -07:00
Manish Mathai
7e95269ce0 Refactoring wireframing code 2017-08-21 18:21:44 -07:00