diff options
-rw-r--r-- | android/cts/master/gles3-master.txt | 16 | ||||
-rw-r--r-- | data/gles3/shaders/large_constant_arrays.test | 687 | ||||
-rw-r--r-- | modules/gles3/functional/es3fFunctionalTests.cpp | 1 | ||||
-rw-r--r-- | modules/gles3/scripts/gen-large-constant-arrays.py | 119 |
4 files changed, 823 insertions, 0 deletions
diff --git a/android/cts/master/gles3-master.txt b/android/cts/master/gles3-master.txt index 946870b62..26259167a 100644 --- a/android/cts/master/gles3-master.txt +++ b/android/cts/master/gles3-master.txt @@ -4443,6 +4443,22 @@ dEQP-GLES3.functional.shaders.arrays.invalid.constructor_c_style3_vertex dEQP-GLES3.functional.shaders.arrays.invalid.constructor_c_style3_fragment dEQP-GLES3.functional.shaders.arrays.invalid.constructor_c_style4_vertex dEQP-GLES3.functional.shaders.arrays.invalid.constructor_c_style4_fragment +dEQP-GLES3.functional.shaders.large_constant_arrays.indexing.float_16_vertex +dEQP-GLES3.functional.shaders.large_constant_arrays.indexing.float_16_fragment +dEQP-GLES3.functional.shaders.large_constant_arrays.indexing.float_32_vertex +dEQP-GLES3.functional.shaders.large_constant_arrays.indexing.float_32_fragment +dEQP-GLES3.functional.shaders.large_constant_arrays.indexing.float_64_vertex +dEQP-GLES3.functional.shaders.large_constant_arrays.indexing.float_64_fragment +dEQP-GLES3.functional.shaders.large_constant_arrays.indexing.float_128_vertex +dEQP-GLES3.functional.shaders.large_constant_arrays.indexing.float_128_fragment +dEQP-GLES3.functional.shaders.large_constant_arrays.indexing.vec4_16_vertex +dEQP-GLES3.functional.shaders.large_constant_arrays.indexing.vec4_16_fragment +dEQP-GLES3.functional.shaders.large_constant_arrays.indexing.vec4_32_vertex +dEQP-GLES3.functional.shaders.large_constant_arrays.indexing.vec4_32_fragment +dEQP-GLES3.functional.shaders.large_constant_arrays.indexing.vec4_64_vertex +dEQP-GLES3.functional.shaders.large_constant_arrays.indexing.vec4_64_fragment +dEQP-GLES3.functional.shaders.large_constant_arrays.indexing.vec4_128_vertex +dEQP-GLES3.functional.shaders.large_constant_arrays.indexing.vec4_128_fragment dEQP-GLES3.functional.shaders.keywords.keywords.const_vertex dEQP-GLES3.functional.shaders.keywords.keywords.const_fragment dEQP-GLES3.functional.shaders.keywords.keywords.uniform_vertex diff --git a/data/gles3/shaders/large_constant_arrays.test b/data/gles3/shaders/large_constant_arrays.test new file mode 100644 index 000000000..52fa3b61e --- /dev/null +++ b/data/gles3/shaders/large_constant_arrays.test @@ -0,0 +1,687 @@ +# WARNING: This file is auto-generated. Do NOT modify it manually, but rather +# modify the generating script file. Otherwise changes will be lost! + +group indexing "Large constant array indexing" + + case float_16 + version 300 es + values + { + input int in0 = [ 13 | 5 | 3 | 1 | 14 | 12 | 9 | 8 | 7 | 10 ]; + output float out0 = [ 0.468418 | 0.886325 | 0.625848 | -0.419144 | 0.091143 | -0.549422 | -0.818481 | 0.844853 | -0.916329 | -0.430844 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + const float array[16] = float[]( + 0.820844, + -0.419144, + -0.977806, + 0.625848, + -0.879658, + 0.886325, + 0.920155, + -0.916329, + 0.844853, + -0.818481, + -0.430844, + -0.102321, + -0.549422, + 0.468418, + 0.091143, + -0.391751); + + ${SETUP} + out0 = array[in0]; + ${OUTPUT} + } + "" + end + + case float_32 + version 300 es + values + { + input int in0 = [ 21 | 27 | 30 | 26 | 24 | 14 | 28 | 1 | 3 | 13 ]; + output float out0 = [ 0.889334 | 0.03372 | 0.542691 | 0.947655 | 0.464199 | 0.971569 | 0.697548 | 0.130332 | 0.811221 | 0.135418 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + const float array[32] = float[]( + 0.051622, + 0.130332, + -0.545011, + 0.811221, + -0.133496, + -0.747309, + -0.232863, + -0.989304, + -0.383455, + -0.64868, + -0.007918, + -0.440069, + -0.805934, + 0.135418, + 0.971569, + -0.84199, + -0.84687, + -0.818401, + -0.20169, + 0.397021, + 0.900357, + 0.889334, + 0.913348, + 0.282212, + 0.464199, + -0.300277, + 0.947655, + 0.03372, + 0.697548, + -0.904883, + 0.542691, + -0.00454); + + ${SETUP} + out0 = array[in0]; + ${OUTPUT} + } + "" + end + + case float_64 + version 300 es + values + { + input int in0 = [ 24 | 51 | 33 | 58 | 23 | 26 | 49 | 36 | 29 | 9 ]; + output float out0 = [ -0.165325 | 0.915027 | -0.93891 | -0.720483 | 0.630692 | -0.183465 | -0.091696 | 0.271041 | 0.000966 | 0.043076 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + const float array[64] = float[]( + -0.155153, + -0.691893, + -0.621229, + 0.760603, + 0.088916, + -0.524295, + 0.113903, + 0.476223, + -0.876719, + 0.043076, + 0.226183, + 0.793424, + 0.975524, + 0.356928, + -0.091224, + -0.115697, + 0.211775, + -0.156547, + 0.109569, + -0.008558, + -0.399851, + 0.041094, + -0.215708, + 0.630692, + -0.165325, + 0.133704, + -0.183465, + -0.693101, + 0.165356, + 0.000966, + 0.325663, + -0.949325, + -0.641681, + -0.93891, + -0.382354, + -0.336639, + 0.271041, + -0.555445, + 0.634963, + 0.208943, + 0.04329, + -0.408225, + -0.188936, + -0.495692, + -0.660485, + -0.023267, + 0.342354, + -0.304884, + 0.994079, + -0.091696, + 0.104488, + 0.915027, + -0.778301, + 0.015887, + -0.309334, + 0.047039, + -0.874582, + 0.412231, + -0.720483, + 0.773809, + -0.965339, + -0.712545, + 0.680373, + -0.468491); + + ${SETUP} + out0 = array[in0]; + ${OUTPUT} + } + "" + end + + case float_128 + version 300 es + values + { + input int in0 = [ 74 | 100 | 64 | 110 | 37 | 98 | 40 | 2 | 60 | 125 ]; + output float out0 = [ -0.761249 | -0.069156 | 0.226429 | 0.601557 | 0.371274 | 0.215692 | -0.674008 | 0.615323 | 0.190409 | 0.212482 ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + const float array[128] = float[]( + -0.606065, + 0.585311, + 0.615323, + 0.605568, + 0.325339, + 0.582551, + 0.202606, + 0.114549, + 0.191475, + 0.374646, + 0.960984, + -0.292771, + 0.956747, + 0.734036, + 0.096515, + 0.535036, + -0.98915, + -0.191685, + -0.106254, + -0.643042, + -0.454891, + -0.315775, + 0.110321, + 0.64039, + 0.900433, + 0.013303, + 0.446101, + -0.724773, + 0.872389, + 0.967503, + -0.286729, + 0.604424, + -0.248435, + -0.663876, + -0.401537, + -0.008831, + 0.332312, + 0.371274, + 0.838556, + -0.505901, + -0.674008, + 0.651268, + 0.305334, + 0.043057, + -0.846835, + 0.465127, + 0.13647, + -0.933798, + 0.245198, + -0.448103, + -0.830984, + -0.595662, + 0.932601, + 0.941371, + -0.552377, + -0.565168, + 0.094688, + 0.227978, + -0.048074, + 0.859927, + 0.190409, + -0.40713, + -0.207751, + -0.730053, + 0.226429, + -0.304911, + -0.340919, + -0.237864, + -0.141297, + 0.740117, + 0.327007, + 0.931855, + -0.966676, + -0.405333, + -0.761249, + 0.414494, + -0.625865, + -0.822929, + 0.852507, + 0.63237, + 0.117329, + 0.251459, + -0.892533, + -0.861027, + 0.474994, + 0.15425, + 0.410844, + 0.252524, + 0.59348, + -0.384798, + 0.887143, + -0.60691, + -0.867488, + 0.86186, + 0.179197, + -0.61976, + -0.627032, + -0.517259, + 0.215692, + 0.247583, + -0.069156, + 0.27504, + -0.416217, + -0.601742, + 0.005733, + -0.85614, + 0.173415, + 0.044441, + -0.04449, + 0.409629, + 0.601557, + -0.696671, + -0.154054, + -0.436629, + 0.791761, + 0.800219, + 0.669122, + 0.905657, + 0.053525, + -0.379138, + -0.970811, + 0.933257, + 0.777627, + -0.7471, + 0.888404, + 0.212482, + -0.340208, + -0.521818); + + ${SETUP} + out0 = array[in0]; + ${OUTPUT} + } + "" + end + + case vec4_16 + version 300 es + values + { + input int in0 = [ 6 | 2 | 4 | 3 | 7 | 14 | 10 | 11 | 9 | 5 ]; + output vec4 out0 = [ vec4(0.378924, -0.127814, 0.330945, -0.27653) | vec4(-0.247838, -0.090046, 0.141822, -0.946729) | vec4(-0.096116, 0.684352, -0.761391, -0.576026) | vec4(-0.020481, 0.68827, -0.465826, 0.021883) | vec4(0.773114, 0.865765, 0.336626, -0.153597) | vec4(0.151689, 0.702867, -0.74982, -0.817309) | vec4(-0.988044, -0.973138, -0.378991, 0.959731) | vec4(-0.335106, -0.996349, -0.091219, 0.257548) | vec4(0.761714, 0.487718, 0.880316, 0.168774) | vec4(0.218481, 0.833123, 0.405688, 0.097803) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + const vec4 array[16] = vec4[]( + vec4(0.702379, 0.931642, 0.571117, 0.741301), + vec4(-0.964841, -0.979497, -0.360118, -0.600566), + vec4(-0.247838, -0.090046, 0.141822, -0.946729), + vec4(-0.020481, 0.68827, -0.465826, 0.021883), + vec4(-0.096116, 0.684352, -0.761391, -0.576026), + vec4(0.218481, 0.833123, 0.405688, 0.097803), + vec4(0.378924, -0.127814, 0.330945, -0.27653), + vec4(0.773114, 0.865765, 0.336626, -0.153597), + vec4(-0.566026, -0.282675, -0.698072, 0.440076), + vec4(0.761714, 0.487718, 0.880316, 0.168774), + vec4(-0.988044, -0.973138, -0.378991, 0.959731), + vec4(-0.335106, -0.996349, -0.091219, 0.257548), + vec4(0.108932, 0.902995, 0.18808, -0.627335), + vec4(-0.832395, 0.44453, 0.552096, 0.950837), + vec4(0.151689, 0.702867, -0.74982, -0.817309), + vec4(-0.445073, 0.936425, 0.895915, 0.288802)); + + ${SETUP} + out0 = array[in0]; + ${OUTPUT} + } + "" + end + + case vec4_32 + version 300 es + values + { + input int in0 = [ 4 | 13 | 20 | 10 | 23 | 12 | 19 | 2 | 30 | 11 ]; + output vec4 out0 = [ vec4(0.234251, -0.965779, 0.158729, -0.965185) | vec4(-0.132707, 0.610324, 0.116332, 0.816963) | vec4(0.37494, 0.211193, 0.079682, -0.573136) | vec4(-0.926896, -0.193718, 0.919353, -0.261054) | vec4(-0.224023, -0.116632, -0.705967, 0.328828) | vec4(-0.966802, 0.892944, 0.350637, -0.000857) | vec4(0.219963, 0.520628, 0.267869, 0.845337) | vec4(0.386404, 0.849264, 0.678119, 0.729645) | vec4(0.111928, 0.213155, -0.872381, 0.72469) | vec4(0.45802, 0.729006, 0.156691, 0.931424) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + const vec4 array[32] = vec4[]( + vec4(0.746262, 0.047635, 0.1152, 0.95654), + vec4(-0.980698, 0.866032, -0.016573, -0.68077), + vec4(0.386404, 0.849264, 0.678119, 0.729645), + vec4(0.610655, 0.250881, 0.738948, -0.867151), + vec4(0.234251, -0.965779, 0.158729, -0.965185), + vec4(-0.327633, 0.832239, 0.745245, -0.695431), + vec4(-0.028568, -0.98534, -0.840921, -0.071501), + vec4(0.818859, -0.609353, -0.902915, 0.743332), + vec4(-0.647141, -0.164404, -0.00065, 0.340666), + vec4(0.630666, 0.648155, -0.793757, 0.9653), + vec4(-0.926896, -0.193718, 0.919353, -0.261054), + vec4(0.45802, 0.729006, 0.156691, 0.931424), + vec4(-0.966802, 0.892944, 0.350637, -0.000857), + vec4(-0.132707, 0.610324, 0.116332, 0.816963), + vec4(0.922649, 0.823922, -0.023737, 0.862443), + vec4(-0.587344, -0.028909, -0.384425, -0.292115), + vec4(0.466302, 0.681084, -0.418924, -0.955053), + vec4(0.642952, 0.663277, -0.658365, 0.503144), + vec4(-0.868831, -0.791933, 0.008615, 0.621668), + vec4(0.219963, 0.520628, 0.267869, 0.845337), + vec4(0.37494, 0.211193, 0.079682, -0.573136), + vec4(-0.302229, 0.867697, -0.261632, -0.099338), + vec4(-0.291822, -0.611533, 0.791703, -0.961155), + vec4(-0.224023, -0.116632, -0.705967, 0.328828), + vec4(-0.826241, 0.073009, -0.563931, -0.564878), + vec4(-0.001856, 0.668955, 0.773383, 0.572741), + vec4(0.851707, 0.44545, 0.216004, 0.565875), + vec4(-0.261423, 0.519932, -0.25264, 0.817994), + vec4(-0.314797, -0.517587, 0.226457, 0.629556), + vec4(-0.280022, 0.018478, 0.269514, 0.361096), + vec4(0.111928, 0.213155, -0.872381, 0.72469), + vec4(0.890298, 0.016925, 0.864494, -0.736341)); + + ${SETUP} + out0 = array[in0]; + ${OUTPUT} + } + "" + end + + case vec4_64 + version 300 es + values + { + input int in0 = [ 4 | 21 | 57 | 59 | 34 | 55 | 44 | 39 | 10 | 31 ]; + output vec4 out0 = [ vec4(0.413679, -0.588393, -0.917377, -0.945484) | vec4(0.529861, 0.595711, -0.37219, -0.663102) | vec4(0.95924, -0.862079, -0.968311, 0.536199) | vec4(0.997116, 0.589927, 0.349899, 0.604469) | vec4(0.079967, -0.817781, -0.00389, 0.038084) | vec4(0.894091, -0.23182, 0.653183, -0.849151) | vec4(-0.596059, -0.650775, -0.122874, -0.673995) | vec4(-0.284478, 0.429867, 0.090923, -0.3685) | vec4(-0.889621, 0.262221, -0.601158, -0.165562) | vec4(-0.398228, 0.281876, -0.282784, -0.256016) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + const vec4 array[64] = vec4[]( + vec4(-0.480146, 0.488133, -0.596212, 0.0368), + vec4(0.111078, 0.509359, -0.235293, -0.578438), + vec4(0.135706, 0.648087, 0.441842, 0.116671), + vec4(0.124006, -0.059068, -0.606559, 0.050443), + vec4(0.413679, -0.588393, -0.917377, -0.945484), + vec4(0.422634, -0.441916, 0.107329, -0.273781), + vec4(0.425519, -0.038142, -0.023987, 0.992765), + vec4(0.857748, -0.828656, -0.987976, -0.389911), + vec4(-0.869591, 0.048031, -0.367579, -0.025289), + vec4(0.363748, -0.413528, 0.723353, -0.017295), + vec4(-0.889621, 0.262221, -0.601158, -0.165562), + vec4(-0.609124, -0.342082, -0.268213, 0.050068), + vec4(0.828537, -0.183152, 0.408507, 0.007535), + vec4(0.408017, -0.115262, 0.393138, 0.024297), + vec4(0.97793, 0.555998, -0.220581, 0.011588), + vec4(-0.886087, 0.425181, 0.868147, -0.549629), + vec4(-0.50603, -0.246514, -0.037877, 0.657885), + vec4(0.611792, 0.550694, 0.399424, 0.903954), + vec4(0.148127, 0.628768, -0.935913, 0.087541), + vec4(-0.658525, -0.533425, -0.635972, 0.810969), + vec4(0.156667, 0.178831, -0.115309, -0.303525), + vec4(0.529861, 0.595711, -0.37219, -0.663102), + vec4(0.533462, 0.680434, 0.376217, 0.533146), + vec4(0.861562, 0.806064, -0.980503, 0.395841), + vec4(-0.081845, -0.140139, 0.897804, 0.283262), + vec4(0.135971, 0.719622, -0.54009, -0.570697), + vec4(-0.658123, -0.390202, -0.393324, 0.048424), + vec4(-0.445823, 0.463386, 0.066676, 0.138665), + vec4(0.00455, 0.547296, 0.81213, -0.725805), + vec4(0.79715, 0.651829, 0.04855, 0.854804), + vec4(0.350284, 0.561782, -0.214693, -0.224041), + vec4(-0.398228, 0.281876, -0.282784, -0.256016), + vec4(-0.315469, -0.932084, 0.663378, 0.298112), + vec4(-0.288229, -0.128671, 0.147874, 0.475918), + vec4(0.079967, -0.817781, -0.00389, 0.038084), + vec4(-0.69381, -0.966723, 0.823463, 0.046353), + vec4(0.031383, -0.948433, 0.232904, -0.592879), + vec4(0.351552, -0.046135, 0.668205, -0.489609), + vec4(0.809815, -0.036727, -0.75659, -0.669761), + vec4(-0.284478, 0.429867, 0.090923, -0.3685), + vec4(0.640377, -0.775249, 0.650625, 0.442851), + vec4(0.468475, -0.175155, -0.473131, 0.910253), + vec4(-0.858185, -0.682824, -0.170344, -0.132026), + vec4(0.296971, 0.846515, 0.086111, -0.339669), + vec4(-0.596059, -0.650775, -0.122874, -0.673995), + vec4(-0.381965, 0.882521, -0.393034, 0.059749), + vec4(0.807728, -0.560089, -0.716643, 0.608183), + vec4(-0.836518, 0.721956, 0.881924, -0.914307), + vec4(0.782346, -0.564062, 0.948654, 0.907281), + vec4(0.449519, -0.460615, -0.180337, -0.565051), + vec4(-0.833486, -0.992801, 0.754353, -0.792533), + vec4(-0.323334, -0.999663, -0.43783, 0.903025), + vec4(-0.747918, 0.807199, -0.629008, 0.474276), + vec4(0.087617, 0.113212, 0.495957, 0.497932), + vec4(-0.175527, -0.927756, -0.43963, 0.178476), + vec4(0.894091, -0.23182, 0.653183, -0.849151), + vec4(-0.732546, -0.69909, 0.173024, -0.148884), + vec4(0.95924, -0.862079, -0.968311, 0.536199), + vec4(-0.563604, 0.854396, -0.917465, -0.060678), + vec4(0.997116, 0.589927, 0.349899, 0.604469), + vec4(-0.557417, 0.292507, 0.01601, -0.671221), + vec4(-0.647461, -0.423871, 0.329662, -0.817252), + vec4(-0.756303, -0.570313, -0.98811, 0.870433), + vec4(-0.607177, 0.486721, -0.364198, 0.40236)); + + ${SETUP} + out0 = array[in0]; + ${OUTPUT} + } + "" + end + + case vec4_128 + version 300 es + values + { + input int in0 = [ 29 | 32 | 55 | 86 | 36 | 111 | 47 | 24 | 41 | 35 ]; + output vec4 out0 = [ vec4(0.185822, -0.913471, -0.575667, -0.007955) | vec4(0.498087, 0.236408, 0.333385, -0.460987) | vec4(-0.345533, -0.37199, -0.411307, -0.795871) | vec4(0.653324, 0.742875, 0.100787, -0.730804) | vec4(-0.793916, -0.826062, 0.373936, 0.747619) | vec4(-0.621498, 0.924617, -0.249821, 0.537011) | vec4(-0.476626, 0.599014, 0.741966, 0.770093) | vec4(-0.275002, -0.525221, -0.015751, -0.056602) | vec4(-0.053926, 0.818767, 0.972056, -0.820966) | vec4(0.512801, 0.481098, 0.118826, -0.862755) ]; + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + const vec4 array[128] = vec4[]( + vec4(0.842836, -0.363564, 0.520257, 0.10905), + vec4(-0.903618, 0.037251, 0.911375, -0.441012), + vec4(0.166032, -0.30338, -0.668911, -0.479533), + vec4(0.380743, 0.469773, 0.544907, 0.659974), + vec4(0.281295, -0.066993, 0.642936, 0.069625), + vec4(0.986712, -0.515945, 0.444003, 0.032566), + vec4(-0.397769, 0.000779, -0.443045, -0.546691), + vec4(0.582351, -0.620597, 0.632682, -0.817857), + vec4(0.765554, 0.158256, -0.957538, 0.285925), + vec4(-0.866527, -0.967477, -0.766937, 0.965938), + vec4(0.01059, 0.782249, 0.241295, -0.188475), + vec4(-0.85145, -0.470437, 0.506059, -0.3513), + vec4(-0.867736, 0.183432, 0.06569, -0.63488), + vec4(0.988198, -0.051591, -0.991153, -0.997269), + vec4(-0.729309, -0.821781, 0.329051, -0.419516), + vec4(0.491436, 0.830255, 0.894415, 0.441036), + vec4(-0.219224, 0.262158, -0.869032, -0.736425), + vec4(-0.657224, 0.406889, -0.635384, 0.669912), + vec4(-0.787681, 0.850956, -0.521237, -0.028796), + vec4(-0.38085, 0.119221, 0.157224, 0.012491), + vec4(-0.370375, 0.416307, -0.424604, -0.026106), + vec4(-0.506551, 0.111284, -0.307273, 0.634551), + vec4(0.687287, -0.46419, 0.110053, 0.69171), + vec4(0.110063, 0.235795, 0.970394, -0.31602), + vec4(-0.275002, -0.525221, -0.015751, -0.056602), + vec4(-0.750295, 0.175323, 0.009521, -0.386032), + vec4(-0.652183, -0.820997, 0.035078, -0.0278), + vec4(-0.465724, 0.983265, 0.827534, -0.005277), + vec4(-0.004708, -0.885227, -0.536755, -0.585531), + vec4(0.185822, -0.913471, -0.575667, -0.007955), + vec4(0.44255, 0.209638, -0.329841, 0.886842), + vec4(-0.203633, 0.641963, 0.744789, 0.635332), + vec4(0.498087, 0.236408, 0.333385, -0.460987), + vec4(0.705059, -0.255996, -0.773135, -0.389827), + vec4(0.50557, 0.582894, -0.913518, 0.809565), + vec4(0.512801, 0.481098, 0.118826, -0.862755), + vec4(-0.793916, -0.826062, 0.373936, 0.747619), + vec4(-0.75007, 0.09755, 0.281934, 0.210534), + vec4(0.78102, 0.867441, -0.702406, -0.001592), + vec4(0.43672, -0.404394, 0.411154, -0.505835), + vec4(0.383875, -0.752196, -0.084493, -0.024631), + vec4(-0.053926, 0.818767, 0.972056, -0.820966), + vec4(0.7769, 0.612362, 0.864866, 0.18249), + vec4(-0.872748, 0.930558, -0.401342, -0.549771), + vec4(0.479798, -0.013824, 0.922094, -0.678146), + vec4(-0.443224, -0.106084, 0.779373, 0.267014), + vec4(0.127066, -0.388646, -0.079058, -0.801055), + vec4(-0.476626, 0.599014, 0.741966, 0.770093), + vec4(0.027274, 0.431394, -0.234384, 0.341312), + vec4(-0.564585, 0.267136, -0.752188, 0.177374), + vec4(0.274006, 0.561503, 0.018388, 0.298662), + vec4(-0.193345, -0.884309, -0.30153, -0.276064), + vec4(-0.280861, -0.153023, 0.01675, 0.185445), + vec4(-0.690369, 0.509338, -0.846314, 0.345576), + vec4(0.068857, 0.950949, 0.285692, -0.605988), + vec4(-0.345533, -0.37199, -0.411307, -0.795871), + vec4(0.37715, -0.981474, 0.399323, -0.040061), + vec4(0.945189, -0.417953, -0.402613, 0.137985), + vec4(-0.703233, 0.317338, 0.010111, -0.95507), + vec4(0.787971, -0.451228, -0.428692, 0.175322), + vec4(0.656471, 0.137505, -0.581568, 0.563938), + vec4(0.334699, -0.528726, 0.622861, 0.564449), + vec4(-0.678301, -0.380204, -0.957709, 0.053429), + vec4(-0.597281, 0.722759, -0.71853, -0.865472), + vec4(-0.886436, 0.237729, -0.139967, -0.341931), + vec4(-0.938893, 0.659686, -0.143541, -0.509807), + vec4(-0.708534, -0.248793, -0.517719, 0.06884), + vec4(0.161891, -0.356068, -0.658876, 0.598824), + vec4(0.516694, 0.613815, -0.259727, -0.103706), + vec4(-0.774757, -0.599329, -0.811326, -0.245557), + vec4(0.963414, 0.675019, -0.071324, -0.361359), + vec4(0.696972, -0.930883, -0.212146, 0.183298), + vec4(0.547432, 0.486902, 0.25397, -0.846169), + vec4(0.507235, 0.980468, 0.613327, 0.167817), + vec4(-0.232448, 0.366919, 0.909552, -0.302138), + vec4(0.852591, 0.26435, -0.962982, -0.167924), + vec4(0.850581, 0.531167, -0.880981, -0.836251), + vec4(-0.298502, 0.47741, -0.568424, -0.186629), + vec4(0.433289, -0.107088, -0.431082, 0.348714), + vec4(0.312214, 0.941496, 0.512817, 0.723704), + vec4(0.366237, 0.263534, 0.944327, 0.53526), + vec4(-0.809848, 0.690145, -0.67335, 0.129199), + vec4(0.274245, 0.331532, -0.523098, 0.823656), + vec4(-0.016114, -0.185143, -0.514904, -0.330019), + vec4(-0.981275, 0.513983, -0.719175, 0.447463), + vec4(0.798987, -0.144184, 0.359325, -0.96724), + vec4(0.653324, 0.742875, 0.100787, -0.730804), + vec4(-0.381067, 0.341247, -0.958466, 0.573912), + vec4(0.306367, -0.154333, -0.549316, -0.833556), + vec4(0.793927, -0.974721, 0.136743, 0.139208), + vec4(-0.744128, 0.951207, -0.060684, -0.705715), + vec4(0.009366, 0.824768, -0.750502, 0.315864), + vec4(0.513749, 0.753087, 0.153459, -0.69295), + vec4(0.800838, 0.110549, 0.109575, 0.662356), + vec4(-0.293183, -0.088746, 0.577868, 0.269121), + vec4(-0.085005, 0.922185, -0.131908, 0.342865), + vec4(0.54346, 0.038911, -0.978638, 0.567109), + vec4(0.738807, 0.694076, 0.080795, 0.61307), + vec4(-0.471535, 0.490946, -0.052903, -0.334397), + vec4(0.829076, 0.758111, 0.335747, -0.260365), + vec4(-0.798087, -0.874586, 0.731774, 0.641365), + vec4(-0.860042, -0.244401, 0.447415, 0.149045), + vec4(0.379891, -0.107563, -0.899203, 0.962102), + vec4(0.034895, -0.389343, -0.160569, 0.730961), + vec4(-0.818613, -0.929147, -0.661238, -0.725143), + vec4(-0.904621, 0.829872, -0.354523, 0.039496), + vec4(-0.177426, 0.305898, 0.273389, -0.326031), + vec4(0.798147, 0.352917, 0.404206, 0.982926), + vec4(0.63269, -0.587404, 0.404303, 0.173164), + vec4(-0.41732, 0.841763, 0.752854, -0.765204), + vec4(-0.311183, 0.873934, 0.138971, 0.742761), + vec4(-0.621498, 0.924617, -0.249821, 0.537011), + vec4(0.505364, 0.651079, 0.251369, -0.780289), + vec4(-0.751458, -0.410518, 0.338219, 0.8951), + vec4(0.763002, 0.154308, 0.303164, 0.103052), + vec4(0.380686, 0.691856, -0.16408, -0.315851), + vec4(0.062813, 0.056525, -0.682853, -0.212878), + vec4(-0.06117, -0.774491, 0.424474, -0.682144), + vec4(-0.365712, -0.829378, -0.314134, -0.4523), + vec4(-0.998439, -0.441518, -0.125719, -0.713296), + vec4(0.014668, 0.948852, -0.760891, 0.657154), + vec4(0.498474, 0.958696, -0.742513, 0.054638), + vec4(-0.3969, -0.310351, -0.48657, -0.942015), + vec4(0.798607, 0.325691, -0.253755, 0.296882), + vec4(-0.010759, -0.316011, -0.906818, -0.455447), + vec4(-0.631907, 0.292569, -0.193719, -0.771571), + vec4(0.72405, 0.371067, -0.846457, 0.280322), + vec4(0.840775, 0.260059, 0.23114, -0.7314)); + + ${SETUP} + out0 = array[in0]; + ${OUTPUT} + } + "" + end + + +end # indexing diff --git a/modules/gles3/functional/es3fFunctionalTests.cpp b/modules/gles3/functional/es3fFunctionalTests.cpp index 8315c8b0c..5a57831ab 100644 --- a/modules/gles3/functional/es3fFunctionalTests.cpp +++ b/modules/gles3/functional/es3fFunctionalTests.cpp @@ -201,6 +201,7 @@ public: addChild(new ShaderLibraryTest (m_context, "swizzle_math_operations", "Swizzle Math Operations Tests")); addChild(new ShaderLibraryTest (m_context, "functions", "Function Tests")); addChild(new ShaderLibraryTest (m_context, "arrays", "Array Tests")); + addChild(new ShaderLibraryTest (m_context, "large_constant_arrays", "Large Constant Array Tests")); addChild(new ShaderLibraryTest (m_context, "keywords", "Keyword Tests")); addChild(new ShaderLibraryTest (m_context, "qualification_order", "Order Of Qualification Tests")); addChild(new ShaderLibraryTest (m_context, "scoping", "Scoping of Declarations")); diff --git a/modules/gles3/scripts/gen-large-constant-arrays.py b/modules/gles3/scripts/gen-large-constant-arrays.py new file mode 100644 index 000000000..1ae4f7e5b --- /dev/null +++ b/modules/gles3/scripts/gen-large-constant-arrays.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- + +#------------------------------------------------------------------------- +# drawElements Quality Program utilities +# -------------------------------------- +# +# Copyright 2017 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +#------------------------------------------------------------------------- + +import random +from genutil import * + +random.seed(0x1234) + +DATA_TYPES = ["float", "vec4"] +ARRAY_SIZES = [16, 32, 64, 128] + +s_largeArrayCaseTemplate = """ +case ${{NAME}} + version 300 es + values + { + ${{VALUES}} + } + + both "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${{ARRAY_DECL}} + + ${SETUP} + ${{OP}} + ${OUTPUT} + } + "" +end +"""[1:] + + +class LargeConstantArrayCase(ShaderCase): + def __init__(self, name, array, inputs, outputs): + self.name = name + self.array = array + self.inputs = inputs + self.outputs = outputs + self.op = "out0 = array[in0];" + + def __str__(self): + params = { + "NAME": self.name, + "VALUES": genValues(self.inputs, self.outputs), + "ARRAY_DECL": self.array, + "OP": self.op + } + return fillTemplate(s_largeArrayCaseTemplate, params) + + +def genArray(dataType, size): + elements = [] + for i in xrange(size): + if dataType == "float": + elements.append(Scalar(round(random.uniform(-1.0, 1.0), 6))) + if dataType == "vec4": + elements.append(Vec4(*[round(random.uniform(-1.0, 1.0), 6) for x in range(4)])) + + return elements + + +def arrayToString(elements): + array = ('const {TYPE} array[{LENGTH}] = {TYPE}[](\n' + .format(TYPE=elements[0].typeString(), LENGTH=len(elements))) + + array += "\n".join(str(e) + ',' for e in elements[:-1]) + array += "\n" + str(elements[-1]) + array += ");" + + return array + +allCases = [] +largeConstantArrayCases = [] + +for dataType in DATA_TYPES: + for arraySize in ARRAY_SIZES: + indexes = random.sample(range(arraySize-1), 10) + array = genArray(dataType, arraySize) + outputs = [array[index] for index in indexes] + outType = outputs[0].typeString() + caseName = "%s_%s" % (dataType, arraySize) + + case = LargeConstantArrayCase(caseName, + arrayToString(array), + [("int in0", indexes)], + [("%s out0" % outType, outputs)]) + + largeConstantArrayCases.append(case) + +allCases.append(CaseGroup("indexing", "Large constant array indexing", largeConstantArrayCases)) + +if __name__ == "__main__": + print "Generating shader case files." + writeAllCases("large_constant_arrays.test", allCases) |