Vulkan 是否支持 gl_FragCoord 的 pixel_center_integer 布局限定符?
Is pixel_center_integer layout qualifier for gl_FragCoord supported in Vulkan?
我正在尝试在 gl_FragCoord 上使用 pixel_center_integer 限定符,但保存返回的坐标使其看起来像是 Vulkan 中的空操作 - 坐标始终偏移 .5对于片段中心。
我的片段着色器代码(简化版)如下所示:
layout(pixel_center_integer) in vec4 gl_FragCoord;
layout(location = 0) out vec2 outVal;
void main()
{
outVal = gl_FragCoord.xy;
}
这是使用 1.0.37 Vulkan SDK,Windows10,NVidia 驱动程序 376.53。
这当然很容易解决,但我找不到任何表明 Vulkan 不支持它的信息 - glslangvalidator.exe 愉快地将它编译为 SPIR-V。
在appendix A: validation rules for a module中:
The OriginLowerLeft execution mode must not be used; fragment entry points must declare OriginUpperLeft.
The PixelCenterInteger execution mode must not be used. Pixels are always centered at half-integer coordinates.
我正在尝试在 gl_FragCoord 上使用 pixel_center_integer 限定符,但保存返回的坐标使其看起来像是 Vulkan 中的空操作 - 坐标始终偏移 .5对于片段中心。
我的片段着色器代码(简化版)如下所示:
layout(pixel_center_integer) in vec4 gl_FragCoord;
layout(location = 0) out vec2 outVal;
void main()
{
outVal = gl_FragCoord.xy;
}
这是使用 1.0.37 Vulkan SDK,Windows10,NVidia 驱动程序 376.53。
这当然很容易解决,但我找不到任何表明 Vulkan 不支持它的信息 - glslangvalidator.exe 愉快地将它编译为 SPIR-V。
在appendix A: validation rules for a module中:
The OriginLowerLeft execution mode must not be used; fragment entry points must declare OriginUpperLeft.
The PixelCenterInteger execution mode must not be used. Pixels are always centered at half-integer coordinates.