Skip to content
Discussion options

You must be logged in to vote

I'll point out that this issue list is for problems with the specs, not questions about using the API.

That being said, this is intended WGSL behavior. The workaround is to use a phony assignment to indicate to WGSL that the variable is still "in use".

 @fragment
	fn main(@builtin(position) fragCoord : vec4f,
					@location(0) color: vec3f) -> @location(0) vec4<f32>
	{
		var uv = fragCoord.xy/U.resolution ;//* 2. -1.;
		//uv*= vec2f(1, -1);
                
                // Do a phony assignment to ensure that these variables are not removed from the autogenerated bind group layout.
                _ = myTexture;
                _ = mySampler;
		//var col:vec4f =  textureSample(myTextur…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Rus-Abd
Comment options

@toji
Comment options

toji Apr 18, 2024
Maintainer

@Johnrobmiller
Comment options

@dj2
Comment options

dj2 Jun 5, 2025
Maintainer

Answer selected by kainino0x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #4577 on April 17, 2024 18:49.