toji / rosetta

Comparisons of shaders across multiple APIs
https://toji.github.io/rosetta/
Other
22 stars 0 forks source link

The GLSL and ESSL samples are for OpenGL, not Vulkan: unified sampler+texture, no bindings #2

Open dneto0 opened 1 year ago

dneto0 commented 1 year ago

For example:

uniform sampler2D baseColorTexture;

That's fine for OpenGL. But Vulkan needs to split the sampler from the texture, and use the sampler2D builtin to combine them at sampling time. Also Vulkan needs descriptor set and binding in the layout spec.

If anything, I'm requesting that the GLSL and ESSL examples be labeled as being for OpenGL / WebGL.

toji commented 1 year ago

Good point! Wondering if the tabs should be labeled as "WebGPU", "GLES 2", "D3D", etc. instead of by language? That's not really accurate, because you could, for example, use Vulkan perfectly well with HLSL or run GLES 2 shaders without issue on GLES 3 contexts, but at least it would offer more context.