Skip to content

Commit

Permalink
corrected data retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
101001000 committed Sep 13, 2023
1 parent 689a11b commit 95608f1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Managers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,10 @@ RenderingManager::RenderInfo RenderingManager::get_render_info() {
LOG(debug) << "Getting render info";

unsigned int sample_count = 0;
unsigned int* dev_samples;

d_q.memcpy(&sample_count, dev_scene->dev_samples, 1 * sizeof(unsigned int));
d_q.wait();
d_q.memcpy(&dev_samples, &(dev_scene->dev_samples), sizeof(unsigned int*)).wait();
d_q.memcpy(&sample_count, dev_samples, 1 * sizeof(unsigned int)).wait();

RenderInfo render_info;
render_info.samples = sample_count;
Expand Down Expand Up @@ -285,8 +286,9 @@ float* RenderingManager::get_pass(std::string pass) {

float* pass_result = new float[rd.pars.width * rd.pars.height * 4];

d_q.memcpy(pass_result, dev_scene->dev_passes + n, rd.pars.width * rd.pars.height * 4 * sizeof(float));
d_q.wait();
float* dev_passes;
d_q.memcpy(&dev_passes, &(dev_scene->dev_passes), sizeof(float*)).wait();
d_q.memcpy(pass_result, dev_passes + n, rd.pars.width * rd.pars.height * 4 * sizeof(float)).wait();

LOG(debug) << "Pass retrieved!";

Expand Down

0 comments on commit 95608f1

Please sign in to comment.