当前位置: 首页>>代码示例>>C++>>正文


C++ DeviceVector::getDevicePtr方法代码示例

本文整理汇总了C++中DeviceVector::getDevicePtr方法的典型用法代码示例。如果您正苦于以下问题:C++ DeviceVector::getDevicePtr方法的具体用法?C++ DeviceVector::getDevicePtr怎么用?C++ DeviceVector::getDevicePtr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DeviceVector的用法示例。


在下文中一共展示了DeviceVector::getDevicePtr方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: updateValues

void updateValues( BorderSubdType i_BorderSubdType, const DeviceVector< T >& i_Src, const subd::TopologyData& i_Topo, int i_Stride, int i_Offset, DeviceVector< T >& o_Dst  )
{
	assert( o_Dst.size() != 0 );

	grind::subd::genFacePointsDevice( i_Topo.faceList.size(), i_Topo.faceList.getDevicePtr(), i_Src.getDevicePtr(), i_Topo.facePointsOffset, i_Topo.vertPointsOffset, i_Stride, i_Offset, o_Dst.getDevicePtr() );
	grind::subd::tweakVertPointsDevice( i_Topo.srcVertCount, i_Topo.vertFaceValence.getDevicePtr(), i_Topo.vertEdgeValence.getDevicePtr(), i_Topo.vertPointsOffset, i_Stride, i_Offset, o_Dst.getDevicePtr() );
	grind::subd::genEdgePointsDevice( i_Topo.edgeList.size(), i_Topo.edgeList.getDevicePtr(), i_Src.getDevicePtr(), i_Topo.vertFaceValence.getDevicePtr(), i_Topo.vertEdgeValence.getDevicePtr(), i_Topo.edgePointsOffset, i_Topo.vertPointsOffset, i_Stride, i_Offset, o_Dst.getDevicePtr() );
	grind::subd::genVertPointsDevice( i_BorderSubdType, i_Topo.srcVertCount, i_Src.getDevicePtr(), i_Topo.vertFaceValence.getDevicePtr(), i_Topo.vertEdgeValence.getDevicePtr(), i_Topo.vertPointsOffset, i_Stride, i_Offset, o_Dst.getDevicePtr() );
}
开发者ID:achayan,项目名称:anim-studio-tools,代码行数:9,代码来源:mesh_subdivide.cpp

示例2: updateTopology

//-------------------------------------------------------------------------------------------------
void updateTopology(	size_t i_SrcVertCount,
                    	const DeviceVector<int>& i_MeshConnectivity,
						const DeviceVector<int>& i_PolyVertCounts,
						subd::TopologyData& o_Topo,
						DeviceVector<int>* o_Id )
{
	o_Topo.srcVertCount = i_SrcVertCount;

	meshSanityCheck( i_PolyVertCounts );

	o_Topo.cumulativePolyVertCounts.resize( i_PolyVertCounts.size() );
	inclusiveScan( i_PolyVertCounts, o_Topo.cumulativePolyVertCounts );

	o_Topo.vertEdgeValence.resize( o_Topo.srcVertCount );
	setAllElements( 0, o_Topo.vertEdgeValence );
	o_Topo.vertFaceValence.resize( o_Topo.srcVertCount );
	setAllElements( 0, o_Topo.vertFaceValence );

	int face_count = i_PolyVertCounts.size();

	o_Topo.faceList.resize( face_count );

	buildFaceListDevice( face_count, i_MeshConnectivity.getDevicePtr(), o_Topo.cumulativePolyVertCounts.getDevicePtr(), o_Topo.faceList.getDevicePtr(), o_Topo.vertFaceValence.getDevicePtr() );

	int non_unique_edge_count = reduce( i_PolyVertCounts );

	DeviceVector< grind::subd::Edge > d_edges;
	d_edges.resize( non_unique_edge_count );
	int actual_edge_count = buildEdgeListDevice( face_count, i_MeshConnectivity.getDevicePtr(), o_Topo.cumulativePolyVertCounts.getDevicePtr(), d_edges.getDevicePtr(), o_Topo.vertEdgeValence.getDevicePtr() );
	o_Topo.edgeList.setValueDevice( d_edges.getDevicePtr(), actual_edge_count );

	int subd_quad_count = non_unique_edge_count;
	DRD_LOG_INFO( L, "faces before subd: " << face_count );
	DRD_LOG_INFO( L, "faces after subd: " << subd_quad_count );

	o_Topo.facePointsOffset = 0;
	o_Topo.edgePointsOffset = o_Topo.faceList.size();
	o_Topo.vertPointsOffset = o_Topo.faceList.size() + o_Topo.edgeList.size();

	if( o_Id != NULL ){
		o_Id->resize( subd_quad_count * 4, -1 );
		buildSubdFaceTopologyDevice( o_Topo.edgeList.size(), o_Topo.edgeList.getDevicePtr(), i_MeshConnectivity.getDevicePtr(), o_Topo.cumulativePolyVertCounts.getDevicePtr(), o_Topo.facePointsOffset, o_Topo.edgePointsOffset, o_Topo.vertPointsOffset, o_Id->getDevicePtr() );
	}
}
开发者ID:achayan,项目名称:anim-studio-tools,代码行数:45,代码来源:mesh_subdivide.cpp


注:本文中的DeviceVector::getDevicePtr方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。