stdlib updates to take advantage of pointers

The packed_{load,store}_active now functions take a pointer to a
location at which to start loading/storing, rather than an array
base and a uniform index.

Variants of the prefetch functions that take varying pointers 
are now available.

There are now variants of the various atomic functions that take
varying pointers (issue #112).
This commit is contained in:
Matt Pharr
2011-11-29 15:41:38 -08:00
parent bbb32c0c5d
commit 11547cb950
12 changed files with 126 additions and 53 deletions

View File

@@ -238,7 +238,7 @@ IntersectLightsWithTileMinMax(
// Pack and store intersecting lights
cif (inFrustum) {
tileNumLights += packed_store_active(tileLightIndices, tileNumLights,
tileNumLights += packed_store_active(&tileLightIndices[tileNumLights],
lightIndex);
}
}
@@ -692,21 +692,21 @@ SplitTileMinMax(
// Pack and store intersecting lights
// TODO: Experiment with a loop here instead
cif (inFrustum[0])
subtileLightOffset[0] += packed_store_active(subtileIndices,
subtileLightOffset[0],
lightIndex);
subtileLightOffset[0] +=
packed_store_active(&subtileIndices[subtileLightOffset[0]],
lightIndex);
cif (inFrustum[1])
subtileLightOffset[1] += packed_store_active(subtileIndices,
subtileLightOffset[1],
lightIndex);
subtileLightOffset[1] +=
packed_store_active(&subtileIndices[subtileLightOffset[1]],
lightIndex);
cif (inFrustum[2])
subtileLightOffset[2] += packed_store_active(subtileIndices,
subtileLightOffset[2],
lightIndex);
subtileLightOffset[2] +=
packed_store_active(&subtileIndices[subtileLightOffset[2]],
lightIndex);
cif (inFrustum[3])
subtileLightOffset[3] += packed_store_active(subtileIndices,
subtileLightOffset[3],
lightIndex);
subtileLightOffset[3] +=
packed_store_active(&subtileIndices[subtileLightOffset[3]],
lightIndex);
}
subtileNumLights[0] = subtileLightOffset[0] - 0 * subtileIndicesPitch;