a185cd297b
Previously TransferToOpenGL would rely on every array handle implementing the CopyInto method for transferring to work properly. This was problematic as most Implicit arrays don't implement CopyInto. Now we use the Devices built in Copy infrastructure to facilitate moving data from an implicit array to concrete memory which we can be passed to OpenGL. As an additional optimization, the temporary memory for this interop is cached in the bufferstate.
36 lines
1.3 KiB
C++
36 lines
1.3 KiB
C++
//============================================================================
|
|
// Copyright (c) Kitware, Inc.
|
|
// All rights reserved.
|
|
// See LICENSE.txt for details.
|
|
// This software is distributed WITHOUT ANY WARRANTY; without even
|
|
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
// PURPOSE. See the above copyright notice for more information.
|
|
//
|
|
// Copyright 2014 Sandia Corporation.
|
|
// Copyright 2014 UT-Battelle, LLC.
|
|
// Copyright 2014 Los Alamos National Security.
|
|
//
|
|
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
|
|
// the U.S. Government retains certain rights in this software.
|
|
//
|
|
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
|
|
// Laboratory (LANL), the U.S. Government retains certain rights in
|
|
// this software.
|
|
//============================================================================
|
|
|
|
#include <vtkm/interop/testing/TestingTransferFancyHandles.h>
|
|
#include <vtkm/rendering/CanvasEGL.h>
|
|
|
|
int UnitTestFancyTransferEGL(int, char* [])
|
|
{
|
|
//get egl canvas to construct a context for us
|
|
vtkm::rendering::CanvasEGL canvas(1024, 1024);
|
|
canvas.Initialize();
|
|
canvas.Activate();
|
|
|
|
//get glew to bind all the opengl functions
|
|
glewInit();
|
|
|
|
return vtkm::interop::testing::TestingTransferFancyHandles::Run();
|
|
}
|