Unity Bug:Incompatible min precision type for operand #1 of opcode #39 (counts are 1-based).

打包时提示报错

Shader error in ‘Sprites/Diffuse-HueShift’: Program ‘frag_surf’, error X8000: D3D11 Internal Compiler Error: Invalid Bytecode: Incompatible min precision type for operand #1 of opcode #39 (counts are 1-based). Expected int or uint. (on gles3)

在编辑器下运行和打包windows平台正常,但安卓平台就报错。
Shader中有下面这几句。

half min = 0.5 - halfWidth;
half max = 0.5 + halfWidth;
color.a *= step(min, IN.texcoord.y) * step(IN.texcoord.y, max);

Unity官方说是HLSL编译器的bug,将half改为float就可以了。

更改后,安卓打包一切正常。

float min = 0.5 - halfWidth;
float max = 0.5 + halfWidth;
color.a *= step(min, IN.texcoord.y) * step(IN.texcoord.y, max);

原问题链接见这里

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值