Comments (5)
Not ingesting SPIR-V by default will make the web slower, one of the most painful parts of video-game development is the shader compilation
We actually have to kickoff compilation in multiple threads and how the CPU for a number of seconds to get all of the shaders in the scene to compile and optimize.
Some platforms (Mali) didn't use to do optimization to save on load times and power-usage, that ended up with sub-optimal framerates and mobile developers such as Aras P. had to write their own optimizers to make sure that the shipped shaders actually received optimization on mobile!
from gpuweb.
Today I saw a warning on the OpenGL wiki:
Warning: Implementations sometimes get the std140 layout wrong for vec3 components. You are advised to manually pad your structures/arrays out and avoid using vec3 at all.
which made me think of another way in which SPIR-V is more simply specified: SPIR-V has no such concept as memory layout algorithms (std140/std430) - the offsets are explicitly specified for every member (OpMemberDecorate _ _ Offset _
, etc.) The overlap rules are validatable offline (and are no more complex than the layout(offset=x)
overlap rules in GLSL).
from gpuweb.
I think SPIR-V is the only formally specified binary shader language.
HLSL does not have a thorough and formal specification.
You will be open to less bugs and issues, especially security bugs when using a binary intermediate representation for which there are multiple compilers available including cross-compilers.
You need an AST CFG anyway to reason about a shader's security, frankly I think it would be far easier to transform a SPIR-V shader's AST CFG to prevent out-of-bounds reads and writes for robustness.
HLSL to SPIR-V compilation is currently badly broken ( by ShaderConductor, SPIRV-Cross does a better job), ask any graphics developer who's looked into it.
The WebGPU working group is expected to own specification, conformance, and development of HLSL or an evolution thereof.
Lawsuits anyone?
from gpuweb.
One thing we didn't really discuss above: we also think that the WebGPU group should bless HLSL and fully maintain a complete development path to enable development with HLSL. We will revise the document to express this more clearly.
from gpuweb.
Revision posted. Changes marked with [R2].
from gpuweb.
Related Issues (20)
- Validation for setViewport should be `minDepth <= maxDepth` HOT 5
- for dispatchWorkgroups, the workgroupCountY and workgroupCountZ default to 1 HOT 2
- Compat: can not copy multisample textures HOT 7
- [wgsl] Functions section defines WGSL builtins as always being available.
- relax absolute error bound for asin f32: too tight for Intel f32 with DXC HOT 2
- Remove "update the rendering" hook for service/shared worker HOT 2
- Texture types with f16, e.g. `texture_2d<f16>` HOT 2
- [editorial] Consistency of built-in function overloads HOT 3
- Compatibility mode: provoking vertex differs between OpenGL and WebGPU HOT 13
- Compat: Dealing with overflow for `drawIndexedIndirect` HOT 2
- Spec is unclear about 3D texture mipmap support HOT 1
- Y orientation of viewport coordinates vs. NDC
- Add in a way to manually commit the canvas texture HOT 2
- Difference between alignment of struct with size 8 vs `vec2<f32>` in uniform buffers. HOT 2
- Provide a kind of memory layout mapping in BufferDescriptor/BufferInitDescriptor HOT 2
- Allow using a (float32-filterable 2d single level) texture view for an externalTexture binding. HOT 4
- Use enum tokens when they are the only possible grammar usage. HOT 15
- Should alphaToCoverageEnabled require a blendable format? HOT 10
- Will function overloading be supported in the future? HOT 1
- Issues in "validating GPUDepthStencilState" algorithm HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gpuweb.