Skip to content

Commit

Permalink
[test] Limit texture samples in graphics shader to 16.
Browse files Browse the repository at this point in the history
Check if this fixes the `Too many fragment shader texture samplers` error.
  • Loading branch information
ayosec committed Feb 5, 2021
1 parent 80193cb commit 387a224
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions alacritty/res/graphics.f.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ flat in int texId;
in vec2 texCoords;

// Array with graphics data.
uniform sampler2D textures[32];
uniform sampler2D textures[16];

void main() {
// The expression `textures[texId]` can't be used in OpenGL 3.3.
Expand All @@ -31,10 +31,6 @@ void main() {
TEX( 4) TEX( 5) TEX( 6) TEX( 7)
TEX( 8) TEX( 9) TEX(10) TEX(11)
TEX(12) TEX(13) TEX(14) TEX(15)
TEX(16) TEX(17) TEX(18) TEX(19)
TEX(20) TEX(21) TEX(22) TEX(23)
TEX(24) TEX(25) TEX(26) TEX(27)
TEX(28) TEX(29) TEX(30) TEX(31)
default:
discard;
}
Expand Down
2 changes: 1 addition & 1 deletion alacritty/src/renderer/graphics/shader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::renderer;
/// Number of elements of the `textures[]` uniform.
///
/// If the file `graphics.f.glsl` is modified, this value has to be updated.
pub(super) const TEXTURES_ARRAY_SIZE: usize = 32;
pub(super) const TEXTURES_ARRAY_SIZE: usize = 16;

/// Sides where the vertex is located.
///
Expand Down

0 comments on commit 387a224

Please sign in to comment.