Home | History | Annotate | Download | only in specs
      1 Conformance Test
      2 
      3     GL_ARB_shader_draw_parameters
      4 
      5 Contributors
      6 
      7     Adam Czupryna, Mobica
      8 
      9 Contacts
     10 
     11     Adam Czupryna, Mobica (adam.czupryna 'at' mobica.com)
     12 
     13 Status
     14 
     15     In review
     16 
     17 Version
     18 
     19     March 22, 2017 (version 1)
     20 
     21 Dependencies
     22 
     23     OpenGL 3.1 is required.
     24 
     25     ARB_shader_draw_parameters extension is required.
     26 
     27     This specification is written against:
     28     - OpenGL 4.3 Core Profile Specification,
     29     - version 4.30 Shading Language Specification,
     30     - ARB_shader_draw_parameters extension Specification.
     31 
     32     The ARB_multi_draw_indirect and ARB_indirect_parameters affects
     33     definition of this test.
     34 
     35 Overview
     36 
     37     This test verifies if new GLSL built-in variables added by this
     38     extension contain correct data.
     39 
     40     It is expected that:
     41     gl_BaseVertexARB - contain value passed in baseVertex parameter,
     42     gl_BaseInstanceARB - contain value passed in baseInstance parameter.
     43     gl_DrawIDARB - contain the index of the draw currently being
     44       processed by a Multi* variant of drawing command.
     45 
     46 Tests
     47 
     48     Shader Extension Test
     49 
     50       * Create shader that require ARB_shader_draw_parameters extension
     51         and check if ARB_shader_draw_parameters is defined and equal 1.
     52         Check if shader compiles with no error.
     53 
     54     Draw Paramaters Test
     55 
     56       * Create vertex shader that adds offset to currently processed
     57         vertex using gl_baseVertexARB and gl_baseInstanceARB for x and y
     58         dimensions respectively. Additionally color variable which components
     59         are function of gl_DrawIDARB value should be passed to the fragment
     60         shader.
     61 
     62         Color components function could be:
     63         color.r = (gl_DrawIDARB % 3 == 0 ? 1.0 : 0.0);
     64         color.g = (gl_DrawIDARB % 3 == 1 ? 1.0 : 0.0);
     65         color.b = (gl_DrawIDARB % 3 == 2 ? 1.0 : 0.0);
     66 
     67       * Create fragment shader that puts out color passed by vertex shader.
     68 
     69       * Set clear color to black, enable blending and perform different
     70         drawing commands to draw triangle strips. Use different parameters
     71         values for each command. Create separated test cases for each drawing
     72         command.
     73 
     74         List of drawing commands:
     75 
     76           - drawArrays/drawElements
     77           - drawArraysIndirect/drawElementsIndirect
     78           - drawArraysInstanced/drawElementsInstanced
     79           - multiDrawArrays/multiDrawElements
     80           - multiDrawArraysIndirect/multiDrawElementsIndirect
     81           - multiDrawArraysIndirectCountARB/multiDrawElementsIndirectCountARB
     82 
     83         Verify if drawing result is as expected by reading pixels from the
     84         framebuffer. Make sure that each triangle is drawn with correct offset
     85         and with proper color value.
     86 
     87 Revision History
     88 
     89     Revision 1, 22 March, 2017 (Adam Czupryna)
     90      - Initial version.
     91 
     92     Revision 2, 3 April, 2017 (Adam Czupryna)
     93      - Changed Draw Parameters Test definition,
     94      - Updated list of drawing commands.
     95 
     96