我一直在研究计算着色器并尝试在手机(android)上对其进行测试。但它总是抛出错误。
Kernel 'CSMain' not found
UnityEngine.ComputeShader:FindKernel(String)
计算着色器没有代码。
// Each #kernel tells which function to compile; you can have many kernels
#pragma kernel CSMain
[numthreads(8,8,1)]
void CSMain (uint3 id : SV_DispatchThreadID)
{
}
这是编译后的版本:
**** Platform OpenGL ES 3:
Compiled code for kernel CSMain:
#version 310 es
layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
void main()
{
return;
}
**** Platform OpenGL ES 2:
no variants for this platform (no compute support, or no kernels)
在编辑器中它工作正常,但在 android 上它似乎根本不起作用。我错过了什么吗?
编辑:
在 BlueStacks 上测试
项目是用 URP 创建的
OpenGL 2.0 被删除