Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converting sampler2d to texture_depth_2d #3479

Open
ragarg opened this issue Jan 15, 2024 · 0 comments
Open

Converting sampler2d to texture_depth_2d #3479

ragarg opened this issue Jan 15, 2024 · 0 comments
Labels

Comments

@ragarg
Copy link

ragarg commented Jan 15, 2024

When working with glslang and webgpu I had a problem when working with depth textures.
On webgl used sampler2D, but for webgpu need to use the texture_deptkh_2d format.

For color textures I change the line:
uniform sampler2D texture ;

into these lines:

layout(set = 0, binding = 0) uniform sampler sampler ;
layout(set = 0, binding = 1) uniform texture2D texture2d ;
#define texture samplerCube(texture2d, sampler )

I tried using sampler2DShadow and it didn't do anything

Is there some way in glslang that the texture is used as a depth texture?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants