1Conformance Test 2 3 CTS_ARB_sparse_texture_clamp 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 December 19, 2016 (version 1) 20 21Dependencies 22 23 OpenGL 4.5 is required. 24 25 ARB_sparse_texture2 extension is required. 26 27 This specification is written against: 28 - ARB_sparse_texture_clamp specification, 29 - OpenGL 4.5 (core) specification. 30 31Overview 32 33 This test verifies if functionality provided by ARB_sparse_texture_clamp 34 works as expected: 35 36 * Check if new built-in GLSL texture lookup functions that are provided 37 by this extension could specify a minimum level of detail to use for 38 lookups where level of detail is computed automatically. 39 40New Tests 41 42 Shader Extension Test 43 44 * Create shader that require ARB_sparse_texture_clamp extension 45 and check if ARB_sparse_texture_clamp is defined and equal 1. 46 Check if shader compiles with no error. 47 48 Sparse Texture Clamp Lookup Residency Tests 49 50 * Iterate through all sparse supported targets. 51 Allocate sparse texture for current <target> with committed and 52 uncommitted regions. 53 Create multiple fragment shaders that enable ARB_sparse_texture_clamp 54 extension and each uses one of the function from list below 55 (if supported by <target>): 56 57 - sparseTextureClampARB 58 - sparseTextureOffsetClampARB 59 - sparseTextureGradClampARB 60 - sparseTextureGradOffsetClampARB 61 62 Shaders should check texture access residency information and pass 63 vec4(1, 1, 1, 1) to the output if access committed region and 64 vec4(0, 0, 0, 1) otherwise. 65 66 Iterate through shaders, create and use program for current iteration 67 and draw a full screen quad. 68 69 Read back the contents of the color attachment on the CPU side. The test expects 70 that the texels will be filled with (1, 1, 1, 1) if the areas of the sparse texture accessed 71 in the shader would be in committed regions, (0, 0, 0, 1) otherwise. 72 73 Run the test for different values of <lodClamp> argument. 74 75 Sparse and Non-sparse Texture Clamp Lookup Color Tests 76 77 * Iterate through all sparse and non-sparse supported targets. 78 Allocate texture for current <target>. 79 Fill the texture with different values for miplevels [0, lodClamp) that for miplevels [lodClamp, lastMipLevel]. 80 81 Create multiple fragment shaders that enables ARB_sparse_texture_clamp 82 extension and each use one of the function from list below 83 (if supported by <target>): 84 85 - textureClampARB 86 - textureOffsetClampARB 87 - textureGradClampARB 88 - textureGradOffsetClampARB 89 - sparseTextureClampARB 90 - sparseTextureOffsetClampARB 91 - sparseTextureGradClampARB 92 - sparseTextureGradOffsetClampARB 93 94 Iterate through shaders, create and use program for current iteration 95 and draw a full screen quad. In the shader sample the texture with the value lodClamp as <lodClamp> argument. 96 97 Verify that the <lodClamp> argument was taken into account during automatic lod computations 98 by reading pixels from framebuffer and checking if their values are as equal to the ones 99 from the region [lodClamp, lastMipLevel]. 100 101 Run the test for different values of <lodClamp> argument. 102 103Revision History 104 105 Revision 1, 19th December, 2016 (Adam Czupryna) 106 - Intial version; 107