mirror of
https://github.com/KhronosGroup/SPIRV-Cross.git
synced 2024-11-15 00:11:06 +00:00
Use texel fetch instead of normalized sampling for subpass.
Cleaner output code, and matches more directly to how subpass reads work.
This commit is contained in:
parent
926916d745
commit
9d4b5c0c59
@ -9,6 +9,6 @@ layout(location = 0) out vec4 FragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
FragColor = (texture(uSubpass0, gl_FragCoord.xy / vec2(textureSize(uSubpass0, 0).xy)) + texture(uSubpass1, gl_FragCoord.xy / vec2(textureSize(uSubpass1, 0).xy)));
|
||||
FragColor = (texelFetch(uSubpass0, ivec2(gl_FragCoord.xy), 0) + texelFetch(uSubpass1, ivec2(gl_FragCoord.xy), 0));
|
||||
}
|
||||
|
||||
|
@ -3104,8 +3104,8 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
|
||||
{
|
||||
// Implement subpass loads via texture barrier style sampling.
|
||||
// Fairly ugly, but should essentially work as a fallback for desktop.
|
||||
imgexpr = join("texture(", to_expression(ops[2]),
|
||||
", gl_FragCoord.xy / vec2(textureSize(", to_expression(ops[2]), ", 0).xy))");
|
||||
imgexpr = join("texelFetch(", to_expression(ops[2]),
|
||||
", ivec2(gl_FragCoord.xy), 0)");
|
||||
pure = true;
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user