FyroxEngine / Fyrox

3D and 2D game engine written in Rust
https://fyrox.rs
MIT License
7.49k stars 339 forks source link

Use layout instead of the deprecated gl_FragColor #595

Closed Esption closed 5 months ago

Esption commented 5 months ago

Fixes this error on macos

[ERROR]: Failed to compile EdgeDetectShader_FragmentShader shader: ERROR: 0:398: Use of undeclared identifier 'gl_FragColor'

thread 'main' panicked at editor/src/highlight.rs:163:62:
called `Result::unwrap()` on an `Err` value: ShaderCompilationFailed { shader_name: "EdgeDetectShader_FragmentShader", error_message: "ERROR: 0:398: Use of undeclared identifier 'gl_FragColor'\n" }

I couldn't even run the editor on macos with it using gl_FragColor. This patch lets it run just fine. AFAIK gl_FragColor was deprecated in OpenGL 3.0. Layout defined at the top of the shader same as the vertex shader below it.

I would assume that windows/linux compiled but threw a deprecation warning before, but I don't have a machine to test that atm. If so, this would fix that, too.