OpenSubdiv/opensubdiv/osd/neonComputeContext.cpp
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

54 lines
1.7 KiB
C++

// Copyright 2014 Google Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "../far/dispatcher.h"
#include "../far/subdivisionTables.h"
#include "../osd/cpuKernel.h"
#include "../osd/neonComputeContext.h"
#include "../osd/vertexDescriptor.h"
#include "../osd/error.h"
#include <algorithm>
namespace OpenSubdiv {
namespace OPENSUBDIV_VERSION {
OsdNeonComputeContext::OsdNeonComputeContext(
FarSubdivisionTables const *subdivisionTables,
FarVertexEditTables const *vertexEditTables)
: OsdCpuComputeContext(subdivisionTables, vertexEditTables)
{
// Calculate the maximum vertex valence.
_maxVertexValence = 0;
const std::vector<int>& V_ITa = subdivisionTables->Get_V_ITa();
for (int i = 0; i < (int)V_ITa.size(); i += 5) {
int vertexValence = V_ITa[i + 1];
_maxVertexValence = std::max(_maxVertexValence, vertexValence);
}
}
OsdNeonComputeContext::~OsdNeonComputeContext()
{
}
OsdNeonComputeContext * OsdNeonComputeContext::Create(
FarSubdivisionTables const *subdivisionTables,
FarVertexEditTables const *vertexEditTables)
{
return new OsdNeonComputeContext(subdivisionTables, vertexEditTables);
}
} // end namespace OPENSUBDIV_VERSION
} // end namespace OpenSubdiv