1Conformance Test 2 3 GL_ARB_fragment_shader_interlock 4 5Contributors 6 7 Adam Czupryna, Mobica 8 9Contacts 10 11 Adam Czupryna, Mobica (adam.czupryna 'at' mobica.com) 12 13Status 14 15 In review 16 17Version 18 19 January 31, 2017 (version 1) 20 21Dependencies 22 23 OpenGL 4.5 is required. 24 25 ARB_fragment_shader_interlock extension is required. 26 27 This specification is written against: 28 - OpenGL 4.5 Core Profile Specification, 29 - version 4.50 (revision 5) Shading Language Specification, 30 - ARB_fragment_shader_interlock extension Specification. 31 32Overview 33 34 This test verifies if new GLSL built-in functions 35 beginInvocationInterlockARB() and endInvocationInterlockARB() provides 36 functionality for pairs of shader invocations with "overlapping" 37 coverage in a given pixel, which guarantee that the critical section of 38 the fragment shader will be executed for only one fragment at a time. 39 Test verifies also two ordered interlock modes supported by this 40 extension because testing unordered interlock modes would be 41 undeterministic. 42 43Tests 44 45 Shader Extension Test 46 47 * Create shader that require GL_ARB_fragment_shader_interlock extension 48 and check if GL_ARB_fragment_shader_interlock is defined and equal 1. 49 Check if shader compiles with no error. 50 51 Shader Execution Ordering Test 52 53 * Create 8x8 R8 texture and clear it. 54 55 * Create fragment shader for ordered layout qualifiers added by this 56 extension. Shader should read pixel value from the texture at current 57 position and compare it with gl_PrimitiveID value. If value read from 58 texture is lower then gl_PrimitiveID write (1, 1, 1, 1) into 59 renderbuffer and store gl_PrimitiveID in the texture at current 60 position, otherwise write (0, 0, 0, 0) into renderbuffer and value 255 61 into texture at current position. All operations should be executed 62 between beginInvocationInterlockARB and endInvocationInterlockARB 63 functions calls. 64 65 * Iterate through the fragment shaders, clear texture and for each shader 66 draw three triangles at once in the same position. 67 68 Expected result for ordered layout qualifires is renderbuffer filled with 69 (1, 1, 1, 1) if test passed. 70 71 In case of sample_interlock_* qualifier multisampled texture has to be 72 used. 73 74 There is no method to test if unordered qualifiers works correctly 75 because for those qualifiers fragment shader invocations are generally 76 executed in undefined order, which means that it could be either 77 ordered or unordered. Tests for unordered qualifiers would be 78 undeterministic. 79 80 Shader Critical Section Execution Test 81 82 * Create 1x1 R8UI texture. 83 84 * Create two fragment shaders for all layout qualifiers added by this 85 extension. Shader should read pixel value from the texture, increase it 86 and store. In first fragment shader all operations should be executed 87 between beginInvocationInterlockARB and endInvocationInterlockARB 88 functions calls, in second one those calls should be missed. 89 90 * Clear texture and draw 8x8 pixel sized polygon to the renderbuffer. 91 92 The expected result is value 64 stored in the texture if 93 beginInvocationInterlockARB and endInvocationInterlockARB functions were 94 used. 95 96 In case of sample_interlock_* qualifier multisampled texture has to be 97 used. 98 99Revision History 100 101 Revision 1, 31 January, 2016 (Adam Czupryna) 102 - Initial version. 103 104