浏览代码

HLSLcc: workaround NaN issue on iOS

/main
Antti Tapaninen 7 年前
当前提交
eb5294a1
共有 2 个文件被更改,包括 10 次插入8 次删除
  1. 9
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Resources/scrbound.compute
  2. 9
      Assets/ScriptableRenderPipeline/fptl/scrbound.compute

9
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Resources/scrbound.compute


// hopefully the compiler takes zeros into account
// should be the case since the transformation in TransformPlaneToPostSpace()
// is done using multiply-adds and not dot product instructions.
float4 planeX0 = TransformPlaneToPostSpace(InvProjection, float4(planeX.x, 0, planeX.y, 0));
float4 planeX1 = TransformPlaneToPostSpace(InvProjection, float4(planeX.z, 0, planeX.w, 0));
float4 planeY0 = TransformPlaneToPostSpace(InvProjection, float4(0, planeY.x, planeY.y, 0));
float4 planeY1 = TransformPlaneToPostSpace(InvProjection, float4(0, planeY.z, planeY.w, 0));
const float bZero = 0.000000001;
float4 planeX0 = TransformPlaneToPostSpace(InvProjection, float4(planeX.x, bZero, planeX.y, bZero));
float4 planeX1 = TransformPlaneToPostSpace(InvProjection, float4(planeX.z, bZero, planeX.w, bZero));
float4 planeY0 = TransformPlaneToPostSpace(InvProjection, float4(bZero, planeY.x, planeY.y, bZero));
float4 planeY1 = TransformPlaneToPostSpace(InvProjection, float4(bZero, planeY.z, planeY.w, bZero));
// convert planes to the forms (1,0,0,D) and (0,1,0,D)

9
Assets/ScriptableRenderPipeline/fptl/scrbound.compute


// hopefully the compiler takes zeros into account
// should be the case since the transformation in TransformPlaneToPostSpace()
// is done using multiply-adds and not dot product instructions.
float4 planeX0 = TransformPlaneToPostSpace(InvProjection, float4(planeX.x, 0, planeX.y, 0));
float4 planeX1 = TransformPlaneToPostSpace(InvProjection, float4(planeX.z, 0, planeX.w, 0));
float4 planeY0 = TransformPlaneToPostSpace(InvProjection, float4(0, planeY.x, planeY.y, 0));
float4 planeY1 = TransformPlaneToPostSpace(InvProjection, float4(0, planeY.z, planeY.w, 0));
const float bZero = 0.000000001;
float4 planeX0 = TransformPlaneToPostSpace(InvProjection, float4(planeX.x, bZero, planeX.y, bZero));
float4 planeX1 = TransformPlaneToPostSpace(InvProjection, float4(planeX.z, bZero, planeX.w, bZero));
float4 planeY0 = TransformPlaneToPostSpace(InvProjection, float4(bZero, planeY.x, planeY.y, bZero));
float4 planeY1 = TransformPlaneToPostSpace(InvProjection, float4(bZero, planeY.z, planeY.w, bZero));
// convert planes to the forms (1,0,0,D) and (0,1,0,D)

正在加载...
取消
保存