Commit: dfd834c4c23e90108067ee642f2be1a3592669c4
Parent: 59c5ac37beff2ea3a82a0beefff08c5cd2f52d33
Author: Randy Palamar
Date: Tue, 7 Oct 2025 17:54:45 -0600
shaders/filter: 4% performance boost in 4X sampling mode
indexing directly into a constant 2 element array saves a few
instructions per sample over a conditional mov
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/shaders/filter.glsl b/shaders/filter.glsl
@@ -48,8 +48,8 @@ vec2 rotate_iq(vec2 iq, int index)
// arg = PI * index
// cos -> 1 -1 1 -1
// sin -> 0 0 0 0
- const float scale = bool(index & 1) ? -1 : 1;
- result = scale * iq;
+ const float scales[2] = {1, -1};
+ result = scales[index & 1] * iq;
}break;
case SamplingMode_2X:{
// fs = fd