1#version 450 2 3#extension GL_EXT_fragment_shading_rate : enable 4 5layout(location = 0) in int id; 6 7void main() 8{ 9 switch (id) 10 { 11 case 0: 12 // V2 | H2 => 5 13 gl_PrimitiveShadingRateEXT = gl_ShadingRateFlag2VerticalPixelsEXT | gl_ShadingRateFlag2HorizontalPixelsEXT; 14 break; 15 case 1: 16 // V2 | H4 => 9 17 gl_PrimitiveShadingRateEXT = gl_ShadingRateFlag2VerticalPixelsEXT | gl_ShadingRateFlag4HorizontalPixelsEXT; 18 break; 19 case 2: 20 // V4 | H2 => 6 21 gl_PrimitiveShadingRateEXT = gl_ShadingRateFlag4VerticalPixelsEXT | gl_ShadingRateFlag2HorizontalPixelsEXT; 22 break; 23 case 3: 24 // V4 | H4 => 10 25 gl_PrimitiveShadingRateEXT = gl_ShadingRateFlag4VerticalPixelsEXT | gl_ShadingRateFlag4HorizontalPixelsEXT; 26 break; 27 } 28}