gl: don't rename inputs/outputs
This commit is contained in:
parent
6d11323520
commit
cb8af115c7
|
@ -702,21 +702,18 @@ impl CompileShader<GLSL> for CrossReflect<glsl::Target> {
|
||||||
let fragment_resources = self.fragment.get_shader_resources()?;
|
let fragment_resources = self.fragment.get_shader_resources()?;
|
||||||
|
|
||||||
for res in &vertex_resources.stage_inputs {
|
for res in &vertex_resources.stage_inputs {
|
||||||
let location = self.vertex.get_decoration(res.id, Decoration::Location)?;
|
|
||||||
self.vertex
|
|
||||||
.set_name(res.id, &format!("LIBRA_ATTRIBUTE_{location}"))?;
|
|
||||||
self.vertex.unset_decoration(res.id, Decoration::Location)?;
|
self.vertex.unset_decoration(res.id, Decoration::Location)?;
|
||||||
}
|
}
|
||||||
for res in &vertex_resources.stage_outputs {
|
for res in &vertex_resources.stage_outputs {
|
||||||
let location = self.vertex.get_decoration(res.id, Decoration::Location)?;
|
// let location = self.vertex.get_decoration(res.id, Decoration::Location)?;
|
||||||
self.vertex
|
// self.vertex
|
||||||
.set_name(res.id, &format!("LIBRA_VARYING_{location}"))?;
|
// .set_name(res.id, &format!("LIBRA_VARYING_{location}"))?;
|
||||||
self.vertex.unset_decoration(res.id, Decoration::Location)?;
|
self.vertex.unset_decoration(res.id, Decoration::Location)?;
|
||||||
}
|
}
|
||||||
for res in &fragment_resources.stage_inputs {
|
for res in &fragment_resources.stage_inputs {
|
||||||
let location = self.fragment.get_decoration(res.id, Decoration::Location)?;
|
// let location = self.fragment.get_decoration(res.id, Decoration::Location)?;
|
||||||
self.fragment
|
// self.fragment
|
||||||
.set_name(res.id, &format!("LIBRA_VARYING_{location}"))?;
|
// .set_name(res.id, &format!("LIBRA_VARYING_{location}"))?;
|
||||||
self.fragment
|
self.fragment
|
||||||
.unset_decoration(res.id, Decoration::Location)?;
|
.unset_decoration(res.id, Decoration::Location)?;
|
||||||
}
|
}
|
||||||
|
|
|
@ -381,14 +381,16 @@ impl FilterChain {
|
||||||
gl::AttachShader(program, vertex);
|
gl::AttachShader(program, vertex);
|
||||||
gl::AttachShader(program, fragment);
|
gl::AttachShader(program, fragment);
|
||||||
|
|
||||||
for res in &vertex_resources.stage_inputs {
|
for res in vertex_resources.stage_inputs {
|
||||||
let loc = glsl
|
let loc = glsl
|
||||||
.context
|
.context
|
||||||
.compiler
|
.compiler
|
||||||
.vertex
|
.vertex
|
||||||
.get_decoration(res.id, Decoration::Location)?;
|
.get_decoration(res.id, Decoration::Location)?;
|
||||||
let loc_name = format!("LIBRA_ATTRIBUTE_{loc}\0");
|
let mut name = res.name;
|
||||||
gl::BindAttribLocation(program, loc, loc_name.as_str().as_ptr().cast())
|
name.push('\0');
|
||||||
|
|
||||||
|
gl::BindAttribLocation(program, loc, name.as_str().as_ptr().cast())
|
||||||
}
|
}
|
||||||
gl::LinkProgram(program);
|
gl::LinkProgram(program);
|
||||||
gl::DeleteShader(vertex);
|
gl::DeleteShader(vertex);
|
||||||
|
|
|
@ -27,7 +27,7 @@ mod tests {
|
||||||
fn triangle_gl() {
|
fn triangle_gl() {
|
||||||
let (glfw, window, events, shader, vao) = hello_triangle::setup();
|
let (glfw, window, events, shader, vao) = hello_triangle::setup();
|
||||||
let mut filter =
|
let mut filter =
|
||||||
FilterChain::load_from_path("../test/slang-shaders/crt/crt-royale.slangp")
|
FilterChain::load_from_path("../test/slang-shaders/vhs/VHSPro.slangp")
|
||||||
.unwrap();
|
.unwrap();
|
||||||
hello_triangle::do_loop(glfw, window, events, shader, vao, &mut filter);
|
hello_triangle::do_loop(glfw, window, events, shader, vao, &mut filter);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue