@@ -379,12 +379,10 @@ PSInput main(uint vertexID : SV_VertexID)
379379 curveBox.curveMax[i] = vk::RawBufferLoad<float32_t2>(drawObj.geometryAddress + sizeof (double2 ) * 2 + sizeof (float32_t2) * (3 + i), 4u);
380380 }
381381
382- // TODO: better name?
383- // TODO: can we use floats instead of doubles for every dilation and ndc things except the main box values
384- const double2 ndcBoxAxisX = transformVectorNdc (clipProjectionData.projectionToNDC, double2 (curveBox.aabbMax.x, curveBox.aabbMin.y) - curveBox.aabbMin);
385- const double2 ndcBoxAxisY = transformVectorNdc (clipProjectionData.projectionToNDC, double2 (curveBox.aabbMin.x, curveBox.aabbMax.y) - curveBox.aabbMin);
382+ const float2 ndcBoxAxisX = (float2 )transformVectorNdc (clipProjectionData.projectionToNDC, double2 (curveBox.aabbMax.x, curveBox.aabbMin.y) - curveBox.aabbMin);
383+ const float2 ndcBoxAxisY = (float2 )transformVectorNdc (clipProjectionData.projectionToNDC, double2 (curveBox.aabbMin.x, curveBox.aabbMax.y) - curveBox.aabbMin);
386384
387- const double2 screenSpaceAabbExtents = double2 (length (ndcBoxAxisX * double2 (globals.resolution)) / 2.0 , length (ndcBoxAxisY * double2 (globals.resolution)) / 2.0 );
385+ const float2 screenSpaceAabbExtents = float2 (length (ndcBoxAxisX * float2 (globals.resolution)) / 2.0 , length (ndcBoxAxisY * float2 (globals.resolution)) / 2.0 );
388386
389387 // we could use something like this to compute screen space change over minor/major change and avoid ddx(minor), ddy(major) in frag shader (the code below doesn't account for rotation)
390388 outV.setCurveBoxScreenSpaceSize (float2 (screenSpaceAabbExtents));
@@ -474,7 +472,7 @@ PSInput main(uint vertexID : SV_VertexID)
474472 const float2 corner = float2 (bool2 (vertexIdx & 0x1u, vertexIdx >> 1 )); // corners of square from (0, 0) to (1, 1)
475473 const float2 undilatedCornerNDC = corner * 2.0 - 1.0 ; // corners of square from (-1, -1) to (1, 1)
476474
477- const double2 screenSpaceAabbExtents = double2 (length (screenDirU * double2 (globals.resolution)) / 2.0 , length (screenDirV * double2 (globals.resolution)) / 2.0 );
475+ const float2 screenSpaceAabbExtents = float2 (length (screenDirU * float2 (globals.resolution)) / 2.0 , length (screenDirV * float2 (globals.resolution)) / 2.0 );
478476 const float pixelsToIncreaseOnEachSide = globals.antiAliasingFactor + 1.0 ;
479477 const float2 dilateRate = (float2 )(pixelsToIncreaseOnEachSide / screenSpaceAabbExtents);
480478
0 commit comments