mirror of
https://github.com/MobileGL-Dev/MobileGlues.git
synced 2025-09-23 19:22:35 -04:00
[Optimization] (multidraw: compute): why bisect still not working???
This commit is contained in:
parent
a0bcd91257
commit
e3c7bab0af
@ -280,11 +280,11 @@ void main() {
|
||||
int high = draws.length();
|
||||
while (low < high) {
|
||||
int mid = low + (high - low) / 2;
|
||||
if (prefixSums[mid] <= outIdx) {
|
||||
low = mid + 1; // next [mid + 1, high)
|
||||
if (prefixSums[mid] > outIdx) {
|
||||
high = mid; // next [low, mid)
|
||||
}
|
||||
else {
|
||||
high = mid; // next [low, mid)
|
||||
low = mid + 1; // next [mid + 1, high)
|
||||
}
|
||||
}
|
||||
|
||||
@ -294,7 +294,8 @@ void main() {
|
||||
uint inIndex = localIdx + cmd.firstIndex;
|
||||
|
||||
// Write out
|
||||
out_indices[outIdx] = uint(int(in_indices[inIndex]) + cmd.baseVertex);
|
||||
out_indices[outIdx] = uint(in_indices[inIndex] + uint(cmd.baseVertex));
|
||||
// out_indices[outIdx] = uint(cmd.baseVertex);
|
||||
}
|
||||
|
||||
)";
|
||||
|
@ -33,11 +33,11 @@ void main() {
|
||||
int high = draws.length();
|
||||
while (low < high) {
|
||||
int mid = low + (high - low) / 2;
|
||||
if (prefixSums[mid] <= outIdx) {
|
||||
low = mid + 1; // next [mid + 1, high)
|
||||
if (prefixSums[mid] > outIdx) {
|
||||
high = mid; // next [low, mid)
|
||||
}
|
||||
else {
|
||||
high = mid; // next [low, mid)
|
||||
low = mid + 1; // next [mid + 1, high)
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,5 +47,6 @@ void main() {
|
||||
uint inIndex = localIdx + cmd.firstIndex;
|
||||
|
||||
// Write out
|
||||
out_indices[outIdx] = uint(int(in_indices[inIndex]) + cmd.baseVertex);
|
||||
out_indices[outIdx] = uint(in_indices[inIndex] + uint(cmd.baseVertex));
|
||||
// out_indices[outIdx] = uint(cmd.baseVertex);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user