PcloudStimProducer,OClCollMeshEngn: Produce ambience stim feature
The collation kernel now also produces the ambience stim feature values into the ambience stimbuff frames.
This commit is contained in:
@@ -25,6 +25,8 @@ __kernel void collate(
|
||||
__global uchar* assembly,
|
||||
__global float* collation,
|
||||
__global float* intensityBuffer,
|
||||
__global uint* ambienceBuffer,
|
||||
uint ambienceHighVal,
|
||||
uint slotStride,
|
||||
uint nPointsPerSlot,
|
||||
uint nDgramsPerFrame)
|
||||
@@ -53,6 +55,9 @@ __kernel void collate(
|
||||
uint intensityBaseOffset = slotIndex * nPointsPerSlot;
|
||||
DBG_PRINTF("Running kernel: about to process points in slot.\n");
|
||||
|
||||
// Initialize ambience counter for this work item
|
||||
uint ambienceCount = 0;
|
||||
|
||||
// Process based on data type using nested ifs (outer) with loops (inner)
|
||||
if (dataType == 0)
|
||||
{
|
||||
@@ -92,6 +97,10 @@ __kernel void collate(
|
||||
if (intensityBuffer != NULL) {
|
||||
intensityBuffer[intensityBaseOffset + i] = intensity;
|
||||
}
|
||||
// Count high intensity values for ambience buffer
|
||||
if (intensity >= ambienceHighVal) {
|
||||
++ambienceCount;
|
||||
}
|
||||
// Don't write intensity to collation buffer
|
||||
}
|
||||
}
|
||||
@@ -134,6 +143,10 @@ __kernel void collate(
|
||||
if (intensityBuffer != NULL) {
|
||||
intensityBuffer[intensityBaseOffset + i] = intensity;
|
||||
}
|
||||
// Count high intensity values for ambience buffer
|
||||
if (intensity >= ambienceHighVal) {
|
||||
++ambienceCount;
|
||||
}
|
||||
// Don't write intensity to collation buffer
|
||||
}
|
||||
}
|
||||
@@ -177,6 +190,10 @@ __kernel void collate(
|
||||
if (intensityBuffer != NULL) {
|
||||
intensityBuffer[intensityBaseOffset + pointIndex] = intensity1;
|
||||
}
|
||||
// Count high intensity values for ambience buffer
|
||||
if (intensity1 >= ambienceHighVal) {
|
||||
++ambienceCount;
|
||||
}
|
||||
// Don't write intensity to collation buffer
|
||||
++pointIndex;
|
||||
|
||||
@@ -208,6 +225,10 @@ __kernel void collate(
|
||||
if (intensityBuffer != NULL) {
|
||||
intensityBuffer[intensityBaseOffset + pointIndex] = intensity2;
|
||||
}
|
||||
// Count high intensity values for ambience buffer
|
||||
if (intensity2 >= ambienceHighVal) {
|
||||
++ambienceCount;
|
||||
}
|
||||
// Don't write intensity to collation buffer
|
||||
++pointIndex;
|
||||
}
|
||||
@@ -252,6 +273,10 @@ __kernel void collate(
|
||||
if (intensityBuffer != NULL) {
|
||||
intensityBuffer[intensityBaseOffset + pointIndex] = intensity1;
|
||||
}
|
||||
// Count high intensity values for ambience buffer
|
||||
if (intensity1 >= ambienceHighVal) {
|
||||
++ambienceCount;
|
||||
}
|
||||
// Don't write intensity to collation buffer
|
||||
++pointIndex;
|
||||
|
||||
@@ -283,6 +308,10 @@ __kernel void collate(
|
||||
if (intensityBuffer != NULL) {
|
||||
intensityBuffer[intensityBaseOffset + pointIndex] = intensity2;
|
||||
}
|
||||
// Count high intensity values for ambience buffer
|
||||
if (intensity2 >= ambienceHighVal) {
|
||||
++ambienceCount;
|
||||
}
|
||||
// Don't write intensity to collation buffer
|
||||
++pointIndex;
|
||||
|
||||
@@ -314,9 +343,18 @@ __kernel void collate(
|
||||
if (intensityBuffer != NULL) {
|
||||
intensityBuffer[intensityBaseOffset + pointIndex] = intensity3;
|
||||
}
|
||||
// Count high intensity values for ambience buffer
|
||||
if (intensity3 >= ambienceHighVal) {
|
||||
++ambienceCount;
|
||||
}
|
||||
// Don't write intensity to collation buffer
|
||||
++pointIndex;
|
||||
}
|
||||
}
|
||||
// Unsupported data types are silently ignored
|
||||
|
||||
// Write ambience count for this work item (once at the end)
|
||||
if (ambienceBuffer != NULL) {
|
||||
ambienceBuffer[slotIndex] = ambienceCount;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user