From 19c8c4a1e3d3ec12bb693e962570f02b51d92bba Mon Sep 17 00:00:00 2001 From: Alex G Rice Date: Mon, 6 Jul 2020 17:24:46 -0600 Subject: [PATCH 1/2] Clarify what the wgpu-rs's vulkan feature does on Mac OS and other platforms. Closes #62 --- docs/beginner/tutorial1-window/README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/beginner/tutorial1-window/README.md b/docs/beginner/tutorial1-window/README.md index 9f5856ab..7bbe58cf 100644 --- a/docs/beginner/tutorial1-window/README.md +++ b/docs/beginner/tutorial1-window/README.md @@ -14,7 +14,14 @@ wgpu = "0.5.0" futures = "0.3.4" ``` -If you're on MacOS, you can specify Vulkan (MoltenVK) as your desired backend instead of Metal by removing the `wgpu = "0.5.0"` and adding the following. +### Vulkan Portability Layer + +You may also want to make the Vulkan backend available on platforms where it is by default not, e.g. Mac OS. The reason +you might want to enable the Vulkan backend is if you are doing cross-platform development and you need the +Vulkan validation layers output. + +To enable the Vulkan backend, add this new section to `Cargo.toml`, and do not forget to remove `wgpu` from the earlier +`[dependencies]` section. ``` toml [dependencies.wgpu] @@ -22,6 +29,10 @@ version = "0.5.0" features = ["vulkan"] ``` +- This may not be necessary because normally `wgpu-rs` validation will catch problems. In fact that is one of it's + design goals. +- This is not intended for shipping code. +- See also [gfx-portability](https://github.com/gfx-rs/portability). ## The code There's not much going on here yet, so I'm just going to post the code in full. Just paste this into you're `main.rs` or equivalent. From e9ea5854caf41a5d7cf0acc3134ecf80495d7bba Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Thu, 9 Jul 2020 16:37:40 -0400 Subject: [PATCH 2/2] Fix a mismatch in light VS versus FS varying of v_color --- code/intermediate/tutorial11-normals/src/light.vert | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/intermediate/tutorial11-normals/src/light.vert b/code/intermediate/tutorial11-normals/src/light.vert index 6c7b937c..1f0ca333 100644 --- a/code/intermediate/tutorial11-normals/src/light.vert +++ b/code/intermediate/tutorial11-normals/src/light.vert @@ -2,7 +2,7 @@ layout(location=0) in vec3 a_position; -layout(location=0) out vec4 v_color; +layout(location=0) out vec3 v_color; layout(set=0, binding=0) uniform Uniforms { @@ -23,5 +23,5 @@ void main() { vec3 v_position = a_position * scale + u_position; gl_Position = u_view_proj * vec4(v_position, 1); - v_color = vec4(u_color, 0); -} \ No newline at end of file + v_color = u_color; +}