void OsdCudaComputeController::ApplyVertexEdits( FarKernelBatch const &batch, void * clientdata) const { OsdCudaComputeContext * context = static_cast<OsdCudaComputeContext*>(clientdata); assert(context); const OsdCudaHEditTable *edit = context->GetEditTable(batch.GetTableIndex()); assert(edit); const OsdCudaTable * primvarIndices = edit->GetPrimvarIndices(); const OsdCudaTable * editValues = edit->GetEditValues(); if (edit->GetOperation() == FarVertexEdit::Add) { OsdCudaEditVertexAdd( context->GetCurrentVertexBuffer(), context->GetVertexDescriptor().numVertexElements-3, edit->GetPrimvarOffset(), edit->GetPrimvarWidth(), batch.GetVertexOffset(), batch.GetTableOffset(), batch.GetStart(), batch.GetEnd(), static_cast<int*>(primvarIndices->GetCudaMemory()), static_cast<float*>(editValues->GetCudaMemory())); } else if (edit->GetOperation() == FarVertexEdit::Set) { // XXXX TODO } }
void OsdCudaKernelDispatcher::ApplyVertexEdits( FarMesh<OsdVertex> *mesh, int offset, int level, void * clientdata) const { OsdCudaComputeContext * context = static_cast<OsdCudaComputeContext*>(clientdata); assert(context); int numEditTables = context->GetNumEditTables(); for (int i=0; i < numEditTables; ++i) { const OsdCudaHEditTable * edit = context->GetEditTable(i); assert(edit); const OsdCudaTable * primvarIndices = edit->GetPrimvarIndices(); const OsdCudaTable * editValues = edit->GetEditValues(); if (edit->GetOperation() == FarVertexEdit::Add) { OsdCudaEditVertexAdd( context->GetCurrentVertexBuffer(), context->GetCurrentVertexNumElements()-3, edit->GetPrimvarOffset(), edit->GetPrimvarWidth(), primvarIndices->GetNumElements(level-1), static_cast<int*>(primvarIndices->GetCudaMemory()) + primvarIndices->GetMarker(level-1), static_cast<float*>(editValues->GetCudaMemory()) + editValues->GetMarker(level-1)); } else if (edit->GetOperation() == FarVertexEdit::Set) { // XXXX TODO } } }
void OsdCudaComputeController::ApplyVertexEdits( FarKernelBatch const &batch, OsdCudaComputeContext const *context) const { assert(context); const OsdCudaHEditTable *edit = context->GetEditTable(batch.GetTableIndex()); assert(edit); const OsdCudaTable * primvarIndices = edit->GetPrimvarIndices(); const OsdCudaTable * editValues = edit->GetEditValues(); float *vertex = _currentBindState.GetOffsettedVertexBuffer(); if (edit->GetOperation() == FarVertexEdit::Add) { OsdCudaEditVertexAdd( vertex, _currentBindState.vertexDesc.length, _currentBindState.vertexDesc.stride, edit->GetPrimvarOffset(), edit->GetPrimvarWidth(), batch.GetVertexOffset(), batch.GetTableOffset(), batch.GetStart(), batch.GetEnd(), static_cast<int*>(primvarIndices->GetCudaMemory()), static_cast<float*>(editValues->GetCudaMemory())); } else if (edit->GetOperation() == FarVertexEdit::Set) { // XXXX TODO } }
void OsdCudaKernelDispatcher::ApplyVertexEdits(FarMesh<OsdVertex> *mesh, int offset, int level, void * clientdata) const { for (int i=0; i<(int)_edits.size(); ++i) { const VertexEditArrayInfo &info = _edits[i]; if (info.operation == FarVertexEdit::Add) { OsdCudaEditVertexAdd(_deviceVertices, _numVertexElements-3, info.primVarOffset, info.primVarWidth, info.numEdits[level-1], (int*)_editTables[i*2+0].devicePtr + info.offsetOffsets[level-1], (float*)_editTables[i*2+1].devicePtr + info.valueOffsets[level-1]); } else if (info.operation == FarVertexEdit::Set) { // XXXX TODO } } }