这是indexloc提供的服务,不要输入任何密码
Skip to content

Using unsigned integers for textureLoad and friends? #1257

@Kangz

Description

@Kangz

Currently the textureLoad family of function use signed integer for coordinates, for example this is one of the overloads:

vec4<type> textureLoad(texture_1d , i32 coords, i32 level_of_detail)

My understanding is that if any of the components of coords is negative or if level_of_detail is negative, then the access is an out-of-bounds access that will need some form of handling. In a similar spirit to making array indices unsigned because it saves a comparison, what do you think of making any texture coordinate that can cause OOB an unsigned integer?

Metadata

Metadata

Labels

wgslWebGPU Shading Language Issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions