eval grid over patch and stich edges when required */
| 213 | |
| 214 | /* eval grid over patch and stich edges when required */ |
| 215 | BBox3fa evalGridBounds(const SubdivPatch1Base& patch, |
| 216 | const unsigned x0, const unsigned x1, |
| 217 | const unsigned y0, const unsigned y1, |
| 218 | const unsigned swidth, const unsigned sheight, |
| 219 | const SubdivMesh* const geom) |
| 220 | { |
| 221 | BBox3fa b(empty); |
| 222 | const unsigned dwidth = x1-x0+1; |
| 223 | const unsigned dheight = y1-y0+1; |
| 224 | const unsigned M = dwidth*dheight+VSIZEX; |
| 225 | const unsigned grid_size_simd_blocks = (M-1)/VSIZEX; |
| 226 | dynamic_large_stack_array(float,grid_u,M,64*64*sizeof(float)); |
| 227 | dynamic_large_stack_array(float,grid_v,M,64*64*sizeof(float)); |
| 228 | |
| 229 | if (unlikely(patch.type == SubdivPatch1Base::EVAL_PATCH)) |
| 230 | { |
| 231 | const bool displ = geom->displFunc; |
| 232 | dynamic_large_stack_array(float,grid_x,M,64*64*sizeof(float)); |
| 233 | dynamic_large_stack_array(float,grid_y,M,64*64*sizeof(float)); |
| 234 | dynamic_large_stack_array(float,grid_z,M,64*64*sizeof(float)); |
| 235 | dynamic_large_stack_array(float,grid_Ng_x,displ ? M : 0,64*64*sizeof(float)); |
| 236 | dynamic_large_stack_array(float,grid_Ng_y,displ ? M : 0,64*64*sizeof(float)); |
| 237 | dynamic_large_stack_array(float,grid_Ng_z,displ ? M : 0,64*64*sizeof(float)); |
| 238 | |
| 239 | if (geom->patch_eval_trees.size()) |
| 240 | { |
| 241 | feature_adaptive_eval_grid<PatchEvalGrid> |
| 242 | (geom->patch_eval_trees[geom->numTimeSteps*patch.primID()+patch.time()], patch.subPatch(), patch.needsStitching() ? patch.level : nullptr, |
| 243 | x0,x1,y0,y1,swidth,sheight, |
| 244 | grid_x,grid_y,grid_z,grid_u,grid_v, |
| 245 | displ ? (float*)grid_Ng_x : nullptr, displ ? (float*)grid_Ng_y : nullptr, displ ? (float*)grid_Ng_z : nullptr, |
| 246 | dwidth,dheight); |
| 247 | } |
| 248 | else |
| 249 | { |
| 250 | GeneralCatmullClarkPatch3fa ccpatch(patch.edge(),geom->getVertexBuffer(patch.time())); |
| 251 | |
| 252 | feature_adaptive_eval_grid <FeatureAdaptiveEvalGrid,GeneralCatmullClarkPatch3fa> |
| 253 | (ccpatch, patch.subPatch(), patch.needsStitching() ? patch.level : nullptr, |
| 254 | x0,x1,y0,y1,swidth,sheight, |
| 255 | grid_x,grid_y,grid_z,grid_u,grid_v, |
| 256 | displ ? (float*)grid_Ng_x : nullptr, displ ? (float*)grid_Ng_y : nullptr, displ ? (float*)grid_Ng_z : nullptr, |
| 257 | dwidth,dheight); |
| 258 | } |
| 259 | |
| 260 | /* call displacement shader */ |
| 261 | if (unlikely(geom->displFunc)) |
| 262 | { |
| 263 | RTCDisplacementFunctionNArguments args; |
| 264 | args.geometryUserPtr = geom->userPtr; |
| 265 | args.geometry = (RTCGeometry)geom; |
| 266 | //args.geomID = patch.geomID(); |
| 267 | args.primID = patch.primID(); |
| 268 | args.timeStep = patch.time(); |
| 269 | args.u = grid_u; |
| 270 | args.v = grid_v; |
| 271 | args.Ng_x = grid_Ng_x; |
| 272 | args.Ng_y = grid_Ng_y; |
nothing calls this directly
no test coverage detected