浏览代码

textureQueryLevels added for OpenGL mipCount

/feature-ReflectionProbeFit
lyndon homewood 7 年前
当前提交
0f09f2be
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 9
      ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/Common.hlsl

9
ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/Common.hlsl


width = height = depth = mipCount = 0;
tex.GetDimensions(width, height, depth, mipCount);
return mipCount;
#elif defined(SHADER_API_OPENGL) || defined(SHADER_API_VULKAN)
// OpenGL only supports textureSize for width, height, depth
// textureQueryLevels (GL_ARB_texture_query_levels) needs OpenGL 4.3 or above and doesn't compile in compute shaders
#if SHADER_STAGE_COMPUTE
return 0;
#else
return textureQueryLevels(tex);
#endif
// SHADER_API_OPENGL only supports textureSize for width, height, depth
return 0;
#endif
}

正在加载...
取消
保存