| 59 | } |
| 60 | |
| 61 | void MPIDistribBase::PerformRenderTest() |
| 62 | { |
| 63 | SetLights(); |
| 64 | |
| 65 | if (!instances.empty()) { |
| 66 | world.setParam("instance", cpp::CopiedData(instances)); |
| 67 | |
| 68 | // Determine the bounds of this rank's region in world space |
| 69 | const vec3f regionDims = worldBounds.size() / vec3f(rankGridDims); |
| 70 | box3f localRegion(rankBrickId * regionDims + worldBounds.lower, |
| 71 | rankBrickId * regionDims + regionDims + worldBounds.lower); |
| 72 | |
| 73 | // Special case for the ospray test data: we might have geometry right at |
| 74 | // the region bounding box which will z-fight with the clipping region. If |
| 75 | // we have a region at the edge of the domain, apply some padding |
| 76 | for (int i = 0; i < 3; ++i) { |
| 77 | if (localRegion.lower[i] == worldBounds.lower[i]) { |
| 78 | localRegion.lower[i] -= 0.001; |
| 79 | } |
| 80 | if (localRegion.upper[i] == worldBounds.upper[i]) { |
| 81 | localRegion.upper[i] += 0.001; |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | world.setParam("region", cpp::CopiedData(localRegion)); |
| 86 | } |
| 87 | |
| 88 | camera.commit(); |
| 89 | world.commit(); |
| 90 | renderer.commit(); |
| 91 | |
| 92 | framebuffer.resetAccumulation(); |
| 93 | |
| 94 | RenderFrame(); |
| 95 | |
| 96 | if (mpiRank == 0) { |
| 97 | auto *framebuffer_data = (uint32_t *)framebuffer.map(OSP_FB_COLOR); |
| 98 | |
| 99 | if (ospEnv->GetDumpImg()) { |
| 100 | EXPECT_EQ(imageTool->saveTestImage(framebuffer_data), OsprayStatus::Ok); |
| 101 | } else { |
| 102 | EXPECT_EQ(imageTool->compareImgWithBaseline(framebuffer_data), |
| 103 | OsprayStatus::Ok); |
| 104 | } |
| 105 | |
| 106 | framebuffer.unmap(framebuffer_data); |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | MPIFromOsprayTesting::MPIFromOsprayTesting() |
| 111 | { |
nothing calls this directly
no test coverage detected