Improve shader version selection
This commit is contained in:
parent
afdf3e799a
commit
e31566d430
17 changed files with 179 additions and 69 deletions
|
|
@ -25,20 +25,39 @@ pub struct Pipeline {
|
|||
}
|
||||
|
||||
impl Pipeline {
|
||||
pub fn new(gl: &glow::Context) -> Pipeline {
|
||||
pub fn new(
|
||||
gl: &glow::Context,
|
||||
(vertex_version, fragment_version): &(String, String),
|
||||
) -> Pipeline {
|
||||
let program = unsafe {
|
||||
program::create(
|
||||
gl,
|
||||
&[
|
||||
(
|
||||
glow::VERTEX_SHADER,
|
||||
include_str!("../shader/compatibility/quad.vert"),
|
||||
&format!(
|
||||
"{}\n{}",
|
||||
vertex_version,
|
||||
include_str!("../shader/compatibility/quad.vert")
|
||||
),
|
||||
),
|
||||
(
|
||||
glow::FRAGMENT_SHADER,
|
||||
include_str!("../shader/compatibility/quad.frag"),
|
||||
&format!(
|
||||
"{}\n{}",
|
||||
fragment_version,
|
||||
include_str!("../shader/compatibility/quad.frag")
|
||||
),
|
||||
),
|
||||
],
|
||||
&[
|
||||
(0, "i_Pos"),
|
||||
(1, "i_Scale"),
|
||||
(2, "i_Color"),
|
||||
(3, "i_BorderColor"),
|
||||
(4, "i_BorderRadius"),
|
||||
(5, "i_BorderWidth"),
|
||||
],
|
||||
)
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -20,20 +20,39 @@ pub struct Pipeline {
|
|||
}
|
||||
|
||||
impl Pipeline {
|
||||
pub fn new(gl: &glow::Context) -> Pipeline {
|
||||
pub fn new(
|
||||
gl: &glow::Context,
|
||||
(vertex_version, fragment_version): &(String, String),
|
||||
) -> Pipeline {
|
||||
let program = unsafe {
|
||||
program::create(
|
||||
gl,
|
||||
&[
|
||||
(
|
||||
glow::VERTEX_SHADER,
|
||||
include_str!("../shader/core/quad.vert"),
|
||||
&format!(
|
||||
"{}\n{}",
|
||||
vertex_version,
|
||||
include_str!("../shader/core/quad.vert")
|
||||
),
|
||||
),
|
||||
(
|
||||
glow::FRAGMENT_SHADER,
|
||||
include_str!("../shader/core/quad.frag"),
|
||||
&format!(
|
||||
"{}\n{}",
|
||||
fragment_version,
|
||||
include_str!("../shader/core/quad.frag")
|
||||
),
|
||||
),
|
||||
],
|
||||
&[
|
||||
(0, "i_Pos"),
|
||||
(1, "i_Scale"),
|
||||
(2, "i_Color"),
|
||||
(3, "i_BorderColor"),
|
||||
(4, "i_BorderRadius"),
|
||||
(5, "i_BorderWidth"),
|
||||
],
|
||||
)
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue