Skip to content

Instantly share code, notes, and snippets.

@jacres
Created August 13, 2013 16:53
Show Gist options
  • Save jacres/6223194 to your computer and use it in GitHub Desktop.
Save jacres/6223194 to your computer and use it in GitHub Desktop.
clEnqueueReadBuffer(m_clCmdQueue, m_clDeviceLightsPerTile, CL_TRUE, 0, sizeof(cl_int) * skMaxLightsPerTile * globalWorkSize[0] *globalWorkSize[1], m_clHostLightsPerTile, 0, NULL, NULL);
/*
for (int y=0; y<globalWorkSize[1]; ++y) {
for (int x=0; x<globalWorkSize[0]; ++x) {
int tile_index = y * globalWorkSize[0] + x;
for (int i=0; i<skMaxLightsPerTile; ++i) {
int lightIndex = m_clHostLightsPerTile[tile_index * skMaxLightsPerTile + i];
if (lightIndex != -1) {
if (i==0) {
cout << "Lights in tile " << tile_index << " -> ";
}
cout << lightIndex << ", ";
} else {
if (i > 0) {
cout << endl;
}
break;
}
}
}
}
cout << endl;*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment