Hash :
1301402c
Author :
Date :
2023-03-23T21:56:45
Vulkan: improve etc to bc grident texture precison. ETC has gradient modes. Two endpoints in BC are RGB565; the color depth is lower than ETC. Two endpoints in RGB888 space may be quite different, but after conversion to RGB565 they may be projected to the same point. This conversion loses quite a lot of details. This change tries to change one endpoint to an adjacent one (not optimal) in RGB565, so that all the colors are interpolated from these two endpoints. With this change, the arknight image in b/259327729 improved PSNR from 39 to 49. This change includes some of work by @gregschlom 1) Use look up table instead of bit operation. 2) Use more vector operations. This may not improve the performance but makes the code short and neat. bug: b/259327729 Change-Id: Ic0720aff17af5d466e5598dc38ba953dc084a3cc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4368021 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Hailin Zhang <hailinzhang@google.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643
// GENERATED FILE - DO NOT EDIT.
// Generated by gen_vk_internal_shaders.py.
//
// Copyright 2018 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// shaders/gen/EtcToBc.comp.00000001.inc:
// Pre-generated shader for the ANGLE Vulkan back-end.
#pragma once
constexpr uint8_t kEtcToBc_comp_00000001[] = {
0x1f,0x8b,0x08,0x00,0x00,0x00,0x00,0x00,0x02,0xff,0x6d,0x59,0x69,0x90,0x55,0xd5,
0x11,0xbe,0xa7,0xcf,0x61,0x06,0x90,0xb8,0x1b,0xd7,0x88,0x8a,0x55,0x56,0x14,0x70,
0x0a,0x11,0x06,0x18,0xd4,0x8c,0xcb,0x58,0x81,0x52,0xc3,0xb8,0x11,0x17,0x16,0x67,
0x52,0x6a,0x4a,0x4c,0x04,0x05,0x65,0x15,0x05,0x91,0x45,0x88,0x18,0x93,0xa0,0xfe,
0x88,0x29,0x51,0x5c,0x71,0xc1,0xad,0x34,0x61,0x1d,0x04,0x37,0x12,0x31,0x8e,0x80,
0x14,0xd1,0x10,0xa3,0x65,0x2c,0x0b,0x63,0x89,0x46,0x9d,0x9c,0x7e,0xdf,0xd7,0xbc,
0x7e,0xcf,0x79,0x55,0xb7,0xee,0xed,0xaf,0x97,0xd3,0xa7,0x4f,0x9f,0xee,0x73,0xef,
0x8b,0xd2,0xab,0xb6,0x88,0xa1,0xe8,0x5e,0x74,0x2d,0xd6,0xa7,0xa2,0xf4,0xdb,0xaf,
0x90,0x22,0xf0,0xde,0x97,0xf7,0xa1,0xbc,0x9f,0x9e,0xef,0x7b,0x15,0x35,0x25,0x7e,
0xd3,0xf0,0xe6,0xe1,0x7d,0xc7,0x4f,0x68,0xe9,0xdb,0xff,0xe4,0x3a,0xd5,0xdb,0xbb,
0x88,0x25,0x7d,0xe5,0xed,0x53,0xd4,0x16,0x5d,0xf2,0x5d,0x4d,0x5e,0x33,0xe6,0xaa,
0x71,0x8a,0xbf,0x9d,0xaf,0x6d,0xf9,0xda,0x37,0xeb,0xa7,0x92,0xbd,0xa2,0x38,0x8d,
0xf2,0x7a,0x9d,0x9d,0x35,0x4e,0x86,0x0b,0x45,0x2f,0xde,0x0d,0x0b,0xc4,0x92,0xc3,
0x84,0x58,0x57,0x87,0x45,0x62,0x3d,0x1c,0x96,0x88,0xed,0xeb,0xb0,0x2e,0xc4,0x0e,
0x74,0x58,0x0d,0xb1,0x43,0x1c,0x56,0x4b,0xec,0x08,0x9d,0x6f,0xb6,0x6e,0xe3,0x36,
0x65,0xab,0x6f,0x97,0x62,0x51,0x14,0x87,0x91,0xde,0x46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0e,0xc8,0x76,0x85,0x39,
0x51,0x30,0x57,0x76,0x67,0xa4,0x0b,0x73,0x52,0xf7,0xd3,0x99,0x11,0x7b,0xca,0xe8,
0xfb,0xa4,0x4c,0x6b,0xee,0xfe,0x2d,0x54,0xd2,0x3b,0x48,0x7f,0x99,0xad,0xf5,0x65,
0x3c,0xfe,0x97,0x9f,0x35,0xaf,0x4e,0x14,0xd8,0xd7,0xfb,0x50,0xee,0x99,0x41,0x82,
0x7d,0x71,0x6e,0xd6,0x52,0xbd,0xc1,0x02,0x6c,0x90,0x94,0xd7,0xf4,0x56,0xc6,0xa9,
0x41,0xc0,0xd7,0x78,0xfd,0x24,0x63,0xba,0x47,0x86,0x0a,0xf6,0x8d,0xda,0x1f,0xca,
0xb8,0x9f,0x22,0xc0,0x57,0x67,0x19,0xa5,0x4f,0x15,0x60,0xba,0x7f,0xd6,0x13,0x6b,
0x24,0xb6,0xd3,0x61,0x67,0x08,0x64,0x1b,0x39,0xa6,0x62,0x67,0x52,0x4f,0x79,0x3f,
0x23,0xd6,0x24,0xf0,0xa5,0x28,0xd5,0x2a,0x60,0x67,0x0b,0x70,0x95,0x1f,0x91,0x11,
0xf5,0xf7,0xca,0x04,0xdc,0x64,0x6d,0x9c,0x61,0x1c,0xe7,0x53,0x37,0xce,0x70,0xd2,
0xc3,0xdc,0x38,0xe7,0x50,0x37,0xb8,0x71,0xce,0x15,0xe0,0xc3,0xdd,0x38,0xbf,0x4c,
0xc0,0xaf,0x4c,0x90,0xb5,0x71,0x46,0x08,0xe6,0xa9,0x75,0xc0,0x62,0x71,0x3e,0x31,
0xcd,0xab,0xf3,0x18,0xd7,0x0b,0x04,0xb2,0xca,0x9b,0x41,0xec,0x22,0x81,0x5d,0xe5,
0x4d,0xe1,0x39,0x6b,0xa4,0x00,0xd7,0xd8,0xeb,0xf9,0xe6,0xce,0x80,0x33,0x50,0x9d,
0x8b,0xfd,0xe2,0x00,0x7c,0x0a,0x73,0xed,0xae,0x00,0xcc,0x74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xff,0x6a,0x12,0xc6,0xf7,0x75,0xe0,0xec,0x04,0xb9,0x26,0x27,
0xf7,0x53,0xca,0xf9,0x3a,0x30,0x2c,0x41,0x56,0x79,0x56,0x07,0xbe,0x09,0xa8,0x01,
0xc3,0x52,0xf9,0xff,0x29,0xab,0x03,0x1a,0x2f,0xdb,0xf3,0x9f,0xf3,0x3c,0xa1,0x3a,
0xeb,0x12,0xea,0x87,0xd6,0x52,0xd5,0xd7,0x58,0x3e,0xcc,0x3d,0xfc,0x1d,0xcf,0x13,
0x76,0x7e,0x2b,0xdc,0x77,0x0e,0xe5,0x75,0x70,0x00,0xb5,0xd9,0xe1,0xfe,0x47,0x09,
0xfc,0xc6,0x38,0xdf,0x9d,0xd3,0x45,0x80,0xcf,0xe6,0x9c,0xa2,0x00,0xdb,0xe1,0xce,
0xb0,0x49,0x80,0x9b,0x9d,0x2e,0xb4,0x33,0xd5,0xd9,0xa9,0x11,0xe0,0x66,0xa7,0x56,
0x80,0x79,0x3b,0x5d,0x05,0xb8,0xfd,0x47,0xd3,0x4d,0x60,0xbb,0x2b,0xbf,0x93,0x28,
0xb6,0x97,0xe0,0xbf,0x83,0x6e,0x3c,0x7b,0xeb,0x7f,0xa5,0xfb,0xf0,0x7f,0xd2,0x2b,
0x32,0xad,0xcf,0x2a,0xb3,0x8e,0xb9,0x66,0xf3,0x2c,0xa4,0xf2,0xff,0x19,0xbd,0x7f,
0x9b,0x23,0x5d,0x9f,0xaf,0xff,0x03,0xa4,0xb0,0x5e,0xa3,0x0c,0x26,0x00,0x00
};
// Generated from:
//
// #version 450 core
//
// #extension GL_GOOGLE_include_directive : require
//
// #extension GL_KHR_shader_subgroup_clustered : enable
// #extension GL_KHR_shader_subgroup_shuffle : enable
//
// layout(local_size_x = 64, local_size_y = 1, local_size_z = 1)in;
// layout(binding = 0)uniform highp usamplerBuffer uInputBuffer;
// layout(binding = 1, rgba32ui)writeonly uniform uimage2D uOutput;
//
// layout(push_constant)uniform imagInfo {
//
// uint offsetX;
// uint offsetY;
// int texelOffset;
// uint width;
// uint height;
// uint alphaBits;
// uint isSigned;
// uint isEacRg;
// };
//
// #line 1 "shaders/src/third_party/etc_decoder/etc_decoder.h"
//
// const ivec2 etc1_color_modifier_table[8]= ivec2[](
// ivec2(2, 8),
// ivec2(5, 17),
// ivec2(9, 29),
// ivec2(13, 42),
// ivec2(18, 60),
// ivec2(24, 80),
// ivec2(33, 106),
// ivec2(47, 183));
//
// const ivec4 etc2_alpha_modifier_table[16]= ivec4[](
// ivec4(2, 5, 8, 14),
// ivec4(2, 6, 9, 12),
// ivec4(1, 4, 7, 12),
// ivec4(1, 3, 5, 12),
// ivec4(2, 5, 7, 11),
// ivec4(2, 6, 8, 10),
// ivec4(3, 6, 7, 10),
// ivec4(2, 4, 7, 10),
// ivec4(1, 5, 7, 9),
// ivec4(1, 4, 7, 9),
// ivec4(1, 3, 7, 9),
// ivec4(1, 4, 6, 9),
// ivec4(2, 3, 6, 9),
// ivec4(0, 1, 2, 9),
// ivec4(3, 5, 7, 8),
// ivec4(2, 4, 6, 8)
// );
//
// const int etc2_distance_table[8]= int[](3, 6, 11, 16, 23, 32, 41, 64);
//
// int decode_etc2_alpha(uvec2 payload, int linear_pixel)
// {
// int bit_offset = 45 - 3 * linear_pixel;
//
// int base = isSigned != 0 ? bitfieldExtract(int(payload . y), 24, 8): int(bitfieldExtract(payload . y, 24, 8));
//
// int multiplier = int(bitfieldExtract(payload . y, 20, 4));
// int table = int(bitfieldExtract(payload . y, 16, 4));
//
// int lsb_index = int(bitfieldExtract(payload[bit_offset >> 5], bit_offset & 31, 2));
// bit_offset += 2;
// int msb = int((payload[bit_offset >> 5]>>(bit_offset & 31))& 1u);
// int mod = etc2_alpha_modifier_table[table][lsb_index]^(msb - 1);
//
// int a = base * 8 + 4;
// a += multiplier != 0 ? mod * multiplier * 8 : mod;
// int minValue = isSigned != 0 ? - 1023 : 0;
// int maxValue = isSigned != 0 ? 1023 : 2047;
// a = clamp(a, minValue, maxValue);
// float scale = isSigned != 0 ? 127.0f : 255.0f;
// return int(a / float(maxValue)* scale + 0.5f);
//
// }
//
// ivec4 DecodeRGB(ivec2 pixel_coord, uvec2 color_payload, int linear_pixel, inout bool punchthrough){
// int alpha_result = 0xff;
// ivec3 rgb_result;
// ivec3 base_rgb;
// uint flip = color_payload . y & 1u;
// uint subblock = uint((pixel_coord[flip]& 2)>> 1);
// bool etc1_compat = false;
//
// if(alphaBits != 1 &&(color_payload . y & 2u)== 0u)
// {
//
// etc1_compat = true;
// base_rgb = ivec3(color_payload . yyy >>(uvec3(28, 20, 12)- 4u * subblock));
// base_rgb &= 0xf;
// base_rgb *= 0x11;
// }
// else
// {
// int r = int(bitfieldExtract(color_payload . y, 27, 5));
// int rd = bitfieldExtract(int(color_payload . y), 24, 3);
// int g = int(bitfieldExtract(color_payload . y, 19, 5));
// int gd = bitfieldExtract(int(color_payload . y), 16, 3);
// int b = int(bitfieldExtract(color_payload . y, 11, 5));
// int bd = bitfieldExtract(int(color_payload . y), 8, 3);
//
// int r1 = r + rd;
// int g1 = g + gd;
// int b1 = b + bd;
//
// if(uint(r1)> 31u)
// {
// int r1 = int(bitfieldExtract(color_payload . y, 56 - 32, 2))|
// (int(bitfieldExtract(color_payload . y, 59 - 32, 2))<< 2);
// int g1 = int(bitfieldExtract(color_payload . y, 52 - 32, 4));
// int b1 = int(bitfieldExtract(color_payload . y, 48 - 32, 4));
// int r2 = int(bitfieldExtract(color_payload . y, 44 - 32, 4));
// int g2 = int(bitfieldExtract(color_payload . y, 40 - 32, 4));
// int b2 = int(bitfieldExtract(color_payload . y, 36 - 32, 4));
// uint da =(bitfieldExtract(color_payload . y, 34 - 32, 2)<< 1)|
// (color_payload . y & 1u);
// int dist = etc2_distance_table[da];
//
// int msb = int((color_payload . x >>(15 + linear_pixel))& 2u);
// int lsb = int((color_payload . x >> linear_pixel)& 1u);
// int index = msb | lsb;
//
// if(punchthrough)
// punchthrough = index == 2;
//
// if(index == 0)
// {
// rgb_result = ivec3(r1, g1, b1);
// rgb_result *= 0x11;
// }
// else
// {
// int mod = 2 - index;
// ivec3 rgb = ivec3(r2, g2, b2)* 0x11 + mod * dist;
// rgb_result = ivec3(clamp(rgb, ivec3(0), ivec3(255)));
// }
// }
// else if(uint(g1)> 31u)
// {
// int r1 = int(bitfieldExtract(color_payload . y, 59 - 32, 4));
// int g1 =(int(bitfieldExtract(color_payload . y, 56 - 32, 3))<< 1)|
// int((color_payload . y >> 20u)& 1u);
// int b1 = int(bitfieldExtract(color_payload . y, 47 - 32, 3))|
// int((color_payload . y >> 16u)& 8u);
// int r2 = int(bitfieldExtract(color_payload . y, 43 - 32, 4));
// int g2 = int(bitfieldExtract(color_payload . y, 39 - 32, 4));
// int b2 = int(bitfieldExtract(color_payload . y, 35 - 32, 4));
// uint da = color_payload . y & 4u;
// uint db = color_payload . y & 1u;
// uint d = da + 2u * db;
// d += uint((r1 * 0x10000 + g1 * 0x100 + b1)>=(r2 * 0x10000 + g2 * 0x100 + b2));
// int dist = etc2_distance_table[d];
// int msb = int((color_payload . x >>(15 + linear_pixel))& 2u);
// int lsb = int((color_payload . x >> linear_pixel)& 1u);
//
// if(punchthrough)
// punchthrough =(msb + lsb)== 2;
//
// ivec3 base = msb != 0 ? ivec3(r2, g2, b2): ivec3(r1, g1, b1);
// base *= 0x11;
// int mod = 1 - 2 * lsb;
// base += mod * dist;
// rgb_result = ivec3(clamp(base, ivec3(0), ivec3(0xff)));
// }
// else if(uint(b1)> 31u)
// {
//
// int r = int(bitfieldExtract(color_payload . y, 57 - 32, 6));
// int g = int(bitfieldExtract(color_payload . y, 49 - 32, 6))|
// (int(color_payload . y >> 18)& 0x40);
// int b = int(bitfieldExtract(color_payload . y, 39 - 32, 3))|
// (int(bitfieldExtract(color_payload . y, 43 - 32, 2))<< 3)|
// (int(color_payload . y >> 11)& 0x20);
// int rh = int(color_payload . y & 1u)|
// (int(bitfieldExtract(color_payload . y, 2, 5))<< 1);
// int rv = int(bitfieldExtract(color_payload . x, 13, 6));
// int gh = int(bitfieldExtract(color_payload . x, 25, 7));
// int gv = int(bitfieldExtract(color_payload . x, 6, 7));
// int bh = int(bitfieldExtract(color_payload . x, 19, 6));
// int bv = int(bitfieldExtract(color_payload . x, 0, 6));
//
// r =(r << 2)|(r >> 4);
// rh =(rh << 2)|(rh >> 4);
// rv =(rv << 2)|(rv >> 4);
// g =(g << 1)|(g >> 6);
// gh =(gh << 1)|(gh >> 6);
// gv =(gv << 1)|(gv >> 6);
// b =(b << 2)|(b >> 4);
// bh =(bh << 2)|(bh >> 4);
// bv =(bv << 2)|(bv >> 4);
//
// ivec3 rgb = ivec3(r, g, b);
// ivec3 dx = ivec3(rh, gh, bh)- rgb;
// ivec3 dy = ivec3(rv, gv, bv)- rgb;
// dx *= int(pixel_coord . x);
// dy *= int(pixel_coord . y);
// rgb = rgb +((dx + dy + 2)>> 2);
// rgb = clamp(rgb, ivec3(0), ivec3(255));
// rgb_result = ivec3(rgb);
//
// punchthrough = false;
//
// }
// else
// {
//
// etc1_compat = true;
// base_rgb = ivec3(r, g, b)+ int(subblock)* ivec3(rd, gd, bd);
// base_rgb =(base_rgb << 3)|(base_rgb >> 2);
// }
// }
//
// if(etc1_compat)
// {
// uint etc1_table_index = bitfieldExtract(color_payload . y, 5 - 3 * int(subblock != 0u), 3);
// int msb = int((color_payload . x >>(15 + linear_pixel))& 2u);
// int lsb = int((color_payload . x >> linear_pixel)& 1u);
// int sgn = 1 - msb;
//
// if(punchthrough)
// {
// sgn *= lsb;
// punchthrough =(msb + lsb)== 2;
// }
//
// int offset = etc1_color_modifier_table[etc1_table_index][lsb]* sgn;
// base_rgb = clamp(base_rgb + offset, ivec3(0), ivec3(255));
// rgb_result = ivec3(base_rgb);
// }
//
// if(alphaBits == 1 && punchthrough)
// {
// rgb_result = ivec3(0);
// alpha_result = 0;
// }
//
// return ivec4(rgb_result . r, rgb_result . g, rgb_result . b, alpha_result);
// }
// #line 77 "shaders/src/EtcToBc.comp"
//
// ivec2 build_coord()
// {
// uvec2 base =(gl_WorkGroupID . xy)* 8;
// uint blockid = gl_LocalInvocationID . x >> 4u;
// uint blockxy = gl_LocalInvocationID . x & 0xfu;
// base . x += 4 *(blockid & 0x1);
// base . y += 2 *(blockid & 0x2);
// base += uvec2(blockxy & 0x3, blockxy >> 0x2);
// return ivec2(base);
// }
//
// uint flip_endian(uint v)
// {
// uvec4 words = uvec4(v)>> uvec4(0, 8, 16, 24);
// words &= 0xffu;
// return(words . x << 24u)|(words . y << 16u)|(words . z << 8u)|(words . w << 0u);
// }
//
// uvec2 flip_endian(uvec2 v)
// {
// return uvec2(flip_endian(v . y), flip_endian(v . x));
// }
//
// uint GetIndicesRGB(vec3 color, vec3 minColor, vec3 maxColor, bool transparent)
// {
// vec3 dir = maxColor - minColor;
// float distMin = dot(minColor, dir);
// float distMax = dot(maxColor, dir);
// float dist = dot(color, dir);
// int ind = int(round(clamp((dist - distMin)/(distMax - distMin), 0.0, 1.0)*(transparent ? 2.0 : 3.0)));
//
// return bitfieldExtract(transparent ? 0x18u : 0x2du, ind * 2, 2);
// }
//
// void ComputeMaxMinColor(uvec3 rgbColor, inout uvec3 minColor, inout uvec3 maxColor){
// ivec3 dx;
// if(alphaBits == 1){
// int count = subgroupClusteredAdd(1, 16);
// ivec3 avg = ivec3((subgroupClusteredAdd(rgbColor, 16)* 2 + count)/(2 * count));
// dx = ivec3(rgbColor)- avg;
// }
// else {
// dx = ivec3(rgbColor)- ivec3(subgroupClusteredAdd(rgbColor, 16)+ 8 >> 4);
// }
// vec3 cov0 = vec3(subgroupClusteredAdd(dx . r * dx, 16));
// vec3 cov1 = vec3(subgroupClusteredAdd(dx . ggb * dx . gbb, 16));
// vec3 vg = vec3(subgroupClusteredMax(rgbColor, 16)- subgroupClusteredMin(rgbColor, 16));
//
// mat3 covMat = mat3(cov0,
// vec3(cov0 . y, cov1 . xy),
// vec3(cov0 . z, cov1 . yz));
//
// float eigenvalue = 0.0f;
// for(int i = 0;i < 4;i ++){
// vg = covMat * vg;
// eigenvalue = sqrt(dot(vg, vg));
// if(eigenvalue > 0.0f){
// float invNorm = 1.0f / eigenvalue;
// vg *= invNorm;
// }
// }
// const float kDefaultLuminanceThreshold = 4.0f * 255;
// const float kQuantizeRange = 0.512f;
//
// if(eigenvalue < kDefaultLuminanceThreshold){
// vg = vec3(0.299f, 0.587f, 0.114f);
// }
// else {
// float magn = max(max(abs(vg . r), abs(vg . g)), abs(vg . b));
// vg *= kQuantizeRange / magn;
// }
// float dist = dot(vec3(rgbColor), vg);
// float min_dist = subgroupClusteredMin(dist, 16);
// float max_dist = subgroupClusteredMax(dist, 16);
// uvec2 indices = uvec2(dist == min_dist ? gl_SubgroupInvocationID : 0,
// dist == max_dist ? gl_SubgroupInvocationID : 0);
// uvec2 minMaxIndex = subgroupClusteredMax(indices, 16);
// minColor = subgroupShuffle(rgbColor, minMaxIndex . x);
// maxColor = subgroupShuffle(rgbColor, minMaxIndex . y);
// }
//
// uint GetIndicesAlpha(int alpha, int minAlpha, int maxAlpha)
// {
// float dist = float(maxAlpha - minAlpha);
// int ind = int(round(clamp((alpha - minAlpha)/ dist * 7.0f, 0.0, 7.0)));
//
// return bitfieldExtract(0x2345671u, ind * 4, 4);
// }
//
// void ComputeMaxMin(int alpha, inout int minAlpha, inout int maxAlpha){
// minAlpha = subgroupClusteredMin(alpha, 16);
// maxAlpha = subgroupClusteredMax(alpha, 16);
// }
// uvec2 EncodeBC4(int value, uint pid){
// int minValue, maxValue;
// ComputeMaxMin(value, minValue, maxValue);
// uint indices = 0;
// if(minValue != maxValue)
// indices = GetIndicesAlpha(value, minValue, maxValue);
//
// uvec2 mask = uvec2(pid <= 5 ? indices <<(16 + 3 * pid): 0x0,
// pid >= 5 ?(indices << 29)>>(45 - 3 * pid): 0x0);
//
// mask = subgroupClusteredOr(mask, 16);
// return uvec2((maxValue & 0xff)|((minValue & 0xff)<< 8)| mask . x, mask . y);
// }
//
// uvec3 scaleColorToRGB565(uvec3 color){
// return uvec3(round(vec3(color)* vec3(31.0 / 255.0, 63.0 / 255.0, 31.0 / 255.0)));
// }
//
// uvec3 convertRGB565ToRGB888(uvec3 color){
// return uvec3(color . x << 3 |(color . x >> 2),
// color . y << 2 |(color . y >> 4),
// color . z << 3 |(color . z >> 2));
// }
//
// uint packRGB565(uvec3 color565){
// return color565 . r << 11 |(color565 . g << 5)| color565 . b;
// }
//
// void modifyMinMax(inout uvec3 minColor, inout uvec3 maxColor){
// uvec3 minColor565 = scaleColorToRGB565(minColor);
// uvec3 maxColor565 = scaleColorToRGB565(maxColor);
// if(all(equal(minColor565, maxColor565))){
// uvec3 simulatedColor = convertRGB565ToRGB888(minColor565);
// ivec3 signMax = sign(ivec3(maxColor)- ivec3(simulatedColor));
// ivec3 signMin = sign(ivec3(minColor)- ivec3(simulatedColor));
// bvec3 needCorrect = greaterThan(signMax * signMin, ivec3(0, 0, 0));
// bvec3 positive = greaterThan(signMin, ivec3(0, 0, 0));
// maxColor565 . r += needCorrect . r && positive . r ? 1 : 0;
// maxColor565 . g += needCorrect . g && positive . g ? 1 : 0;
// maxColor565 . b += needCorrect . b && positive . b ? 1 : 0;
// minColor565 . r -= needCorrect . r && ! positive . r ? 1 : 0;
// minColor565 . g -= needCorrect . g && ! positive . g ? 1 : 0;
// minColor565 . b -= needCorrect . b && ! positive . b ? 1 : 0;
// }
// minColor = minColor565;
// maxColor = maxColor565;
// }
//
// void swap(inout uint a, inout uint b){
// uint t = a;
// a = b;
// b = t;
// }
//
// void main()
// {
// ivec2 coord = build_coord();
// if(any(greaterThanEqual(coord, ivec2(width, height))))
// return;
//
// ivec2 tile_coord = coord >> 2;
// ivec2 pixel_coord = coord & 3;
// int linear_pixel = 4 * pixel_coord . x + pixel_coord . y;
// int pid = 4 * pixel_coord . y + pixel_coord . x;
// uvec4 payload = texelFetch(uInputBuffer, tile_coord . y * int((width + 3)>> 2)+ tile_coord . x + texelOffset);
//
// ivec4 result;
//
// result . r = decode_etc2_alpha(flip_endian(payload . xy), linear_pixel);
// if(isEacRg != 0){
// result . g = decode_etc2_alpha(flip_endian(payload . zw), linear_pixel);
// }
//
// uvec4 finalResult;
//
// finalResult . rg = EncodeBC4(result . r, pid);
// if(isEacRg != 0)
// finalResult . ba = EncodeBC4(result . g, pid);
//
// if(pid == 0){
// tile_coord += ivec2(offsetX / 4, offsetY / 4);
// imageStore(uOutput, tile_coord, finalResult);
// }
//
// }