1Conformance Test 2 3 CTS_ARB_shader_ballot 4 5Contributors 6 7 Filip Demczewski, Mobica 8 9Contacts 10 11 Filip Demczewski, Mobica (filip.demczewski 'at' mobica.com) 12 13Status 14 15 In review 16 17Version 18 19 January 4, 2017 (version 1) 20 21Dependencies 22 23 ARB_shader_ballot extension is required. 24 ARB_gpu_shader_int64 extension is required. 25 26 This specification is written against: 27 - ARB_shader_ballot specification, 28 - Revision 5 of the version 4.50 of the OpenGL Shading Language Specification 29 30Overview 31 32 This tests verifies if functionality provided by ARB_shader_ballot 33 works as expected: 34 35 * Verify new GLSL built-in variables: 36 - gl_SubGroupInvocationARB 37 - gl_SubGroup*MaskARB 38 * Verify gl_SubGroupSizeARB uniform 39 * Verify new GLSL built-in functions: 40 - ballotARB 41 - readInvocationARB 42 - readFirstInvocationARB 43 44New Tests 45 46 Availability test 47 48 * Iterate through all supported shaders. 49 Compile shader containing calls to all new built-in features 50 just to check if those are available. 51 Render primitive. 52 Expect no error. 53 54 Bitmasks verification test 55 56 * Iterate through all supported shaders. 57 Check each bitmask value according to the equation provided 58 in the specification (each bitmask contains bit values related 59 to the gl_SubGroupInvocationARB variable) 60 61 Function ballotARB test 62 63 * Iterate through all supported shaders. 64 a) Call ballotARB(false) - verify that returned value equals 0. 65 66 b) Call ballotARB(true) - verify that returned value is a bitfield 67 where the corresponding bits are set for all active invocations 68 in the sub-group. 69 70 c) Call ballotARB(X), where X is not dynamically uniform expression 71 that return true in some invocations and false in others. Perform 72 many calls for some practical distributions of true/false values 73 across invocations. Verify returned value. 74 75 Read functions test 76 77 * Iterate through all supported shaders. 78 a) Calculate color value for primitive dependent on invocation index. 79 Call readFirstInvocationARB with calculated color as a default value 80 passed as parameter. Final color should be same for all invocations - 81 first invocation completed dictates result for other invocations. 82 83 b) Save first invocation index to the SSBO. Calculate color value for 84 primitive dependent on invocation index. Call readInvocationARB with 85 calculated color as a default value passed as first parameter and 86 the saved invocation index as second. Final color should be same 87 for all invocations - first invocation completed dictates result 88 for other invocations. 89 90Revision History 91 92 Revision 1, 4 January, 2017 (Filip Demczewski) 93 - Initial version; 94 95 Revision 2, 3 February, 2017 (Filip Demczewski) 96 - Tweaks to ballotARB and read functions tests;