amethyst / amethyst/rendy

Uniform buffer in vertex shader "disappears" when adding uniforms to fragment shader

Đang mở
#220 7 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Rust
Star
812
Fork
94
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I'm currently trying to "port" [glium's incomplete tutorial](https://github.com/glium/glium/blob/master/book/SUMMARY.md) to rendy by looking at rendy's examples and API docs. I've unfortunately hit a roadblock on [part 6 "Uploading a texture"](https://github.com/glium/glium/blob/master/book/tuto-06-texture.md). The uniform buffer I was already using successfully "dissapears" when I add `uniform texture2D` and `uniform sampler colorsampler` to the fragment shader. `ShaderReflection.layout().unwrap()` returns
```Rust
Layout {
sets: [
SetLayout {
bindings: [
DescriptorSetLayoutBinding {
binding: 1,
ty: SampledImage,
count: 1,
stage_flags: FRAGMENT,
immutable_samplers: false,
},
DescriptorSetLayoutBinding {
binding: 2,
ty: Sampler,
count: 1,
stage_flags: FRAGMENT,
immutable_samplers: false,
},
],
},
],
push_constants: [],
}
```
even though I haven't removed the uniform buffer that on its own is detected as
```Rust
Layout {
sets: [
SetLayout {
bindings: [
DescriptorSetLayoutBinding {
binding: 0,
ty: UniformBuffer,
count: 1,
stage_flags: VERTEX,
immutable_samplers: false,
},
],
},
],
push_constants: [],
}
```
It doesn't work properly when I set the descriptor layout manually either.
The relevant code can be found [here](https://github.com/maroider/glium_tutorial_but_its_rendy/blob/b55aa5fac7ac7957b7855e14cae133e9631e3e00/src/bin/06.rs) along with the [vertex](https://github.com/maroider/glium_tutorial_but_its_rendy/blob/b55aa5fac7ac7957b7855e14cae133e9631e3e00/src/bin/06.shader.vert) and [fragment](https://github.com/maroider/glium_tutorial_but_its_rendy/blob/b55aa5fac7ac7957b7855e14cae133e9631e3e00/src/bin/06.shader.frag) shaders. The bits that make it break in various ways are commented out.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.