Skip to content
This repository was archived by the owner on Jun 18, 2021. It is now read-only.

WGSL shader conversion for the examples#679

Merged
bors[bot] merged 1 commit intogfx-rs:masterfrom
kvark:wgsl-examples
Jan 30, 2021
Merged

WGSL shader conversion for the examples#679
bors[bot] merged 1 commit intogfx-rs:masterfrom
kvark:wgsl-examples

Conversation

@kvark
Copy link
Copy Markdown
Member

@kvark kvark commented Dec 17, 2020

Copy link
Copy Markdown

@monocodus monocodus bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an autogenerated code review.

Checker summary (by rust_clippy):
The tool has found 12 warnings, 0 errors.

The .monocodus config not found in your repo. Default config is used.
Check config documentation here

@kvark kvark changed the title WGSL shaders in cube and skybox examples WGSL shader conversion for the examples Dec 19, 2020
@kvark kvark force-pushed the wgsl-examples branch 2 times, most recently from 64b647f to d68868a Compare January 24, 2021 05:45
@kvark kvark marked this pull request as ready for review January 24, 2021 05:45
@baptistemanson
Copy link
Copy Markdown

I tested all examples on develop and on this branch on Windows 10 using a RTX 2080 SUPER.
I have 3 regressions:

Cube seems to have some coords issues:
image

Hello triangle
thread 'main' panicked at 'Failed to find an appropriate adapter', examples\hello-triangle\main.rs:19:10

MipMap doesn't display
image

They all work properly on origin/develop.

I'll dig more into those later!

@baptistemanson
Copy link
Copy Markdown

Thanks for the force push, it solved the hello-triangle issue.
When removing the projection matrix from the cube example, everything works as expected. I suspect changing from GLSL to WGSL has maybe change the convention around matrices (row first <> column first or something similar?)
image

Copy link
Copy Markdown
Collaborator

@grovesNL grovesNL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome 👍 great to see this coming along

@kvark kvark marked this pull request as draft January 25, 2021 14:08
@kvark kvark force-pushed the wgsl-examples branch 2 times, most recently from f429e07 to 6b82d87 Compare January 27, 2021 04:46
@kvark
Copy link
Copy Markdown
Member Author

kvark commented Jan 29, 2021

Going to land this right after #734

Validate example shaders in tests

Support WGSL on the Web via Naga

Port the shadow WGSL partially

Convert hello-compute and boids to WGSL

Conver the shadow's fragment shader to WGSL

Shader entry point refactor
@kvark
Copy link
Copy Markdown
Member Author

kvark commented Jan 30, 2021

A little functional changes here

  • switched "boids" to use read-only storage for the source array
  • switched "shadow" to use the storage with runtime-sized array instead of a uniform structure

bors r=grovesNL

@bors
Copy link
Copy Markdown
Contributor

bors bot commented Jan 30, 2021

@bors bors bot merged commit f882abc into gfx-rs:master Jan 30, 2021
@kvark kvark deleted the wgsl-examples branch January 30, 2021 18:43

// fragment shader

[[block]]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI. It's invalid to declare an array of block-decorated struct.
WGSL doesn't have array-of-buffers, but Vulkan SPIR-V does

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. At the time this was written, our [[block]] semantics was a bit different. Today, there is no [[block]] on it

data: [[stride(96)]] array<Light>;

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants