MCPcopy Create free account
hub / github.com/GPUOpen-Tools/compressonator / Partition

Function Partition

cmp_core/shaders/bc6_encode_kernel.cpp:652–698  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

650}
651
652void Partition(CGU_INT shape,
653 CGU_FLOAT in[][MAX_DIMENSION_BIG],
654 CGU_FLOAT subsets[MAX_SUBSETS][MAX_SUBSET_SIZE][MAX_DIMENSION_BIG], //[3][16][4]
655 CGU_INT count[MAX_SUBSETS],
656 CGU_INT8 ShapeTableToUse,
657 CGU_INT dimension)
658{
659 int i, j;
660 int insubset = -1, inpart = 0;
661
662 // Dont use memset: this is better for now
663 for (i = 0; i < MAX_SUBSETS; i++)
664 count[i] = 0;
665
666 switch (ShapeTableToUse)
667 {
668 case 0:
669 case 1:
670 insubset = 0;
671 inpart = 0;
672 break;
673 case 2:
674 insubset = 1;
675 inpart = shape;
676 break;
677 default:
678 break;
679 }
680
681 // Nothing to do!!: Must indicate an error to user
682 if (insubset == -1)
683 return; // Nothing to do!!
684
685 for (i = 0; i < MAX_SUBSET_SIZE; i++)
686 {
687 int subset = get_partition_subset(insubset, inpart, i);
688 for (j = 0; j < dimension; j++)
689 {
690 subsets[subset][count[subset]][j] = in[i][j];
691 }
692 if (dimension < MAX_DIMENSION_BIG)
693 {
694 subsets[subset][count[subset]][j] = 0.0;
695 }
696 count[subset]++;
697 }
698}
699
700void GetEndPoints(CGU_FLOAT EndPoints[MAX_SUBSETS][MAX_END_POINTS][MAX_DIMENSION_BIG],
701 CGU_FLOAT outB[MAX_SUBSETS][MAX_SUBSET_SIZE][MAX_DIMENSION_BIG],

Callers 1

FindBestPatternFunction · 0.70

Calls 1

get_partition_subsetFunction · 0.70

Tested by

no test coverage detected