Skip to content

Commit

Permalink
shader_file: add .glsl to the list of recognized extensions
Browse files Browse the repository at this point in the history
In the default resource pack, recent Minecraft versions (namely, 1.17)
have additional shader files at assets/minecraft/shaders/include with
the .glsl extension, which contain GLSL code that can be imported in
other fragment and vertex shaders via the #moj_import preprocessor
directive.

PackSquash didn't recognize .glsl as a valid shader extension, so it
skipped those files and broke resource packs which modified .glsl files
and included shaders which relied on those modified files.

Let's treat .glsl as a valid shader extension, alongside .fsh and .vsh.
  • Loading branch information
AlexTMjugador committed Oct 17, 2021
1 parent 0547ab6 commit eb02545
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pack_file/shader_file.rs
Expand Up @@ -148,7 +148,7 @@ impl<T: AsyncRead + Unpin + 'static> PackFileConstructor<T> for ShaderFile<T> {
) -> Option<Self> {
let extension = to_ascii_lowercase_extension(args.path.as_ref());

if matches!(&*extension, "fsh" | "vsh") {
if matches!(&*extension, "fsh" | "vsh" | "glsl") {
file_read_producer().map(|(read, file_length_hint)| Self {
read,
// The file is too big to fit in memory if this conversion fails anyway
Expand Down

0 comments on commit eb02545

Please sign in to comment.