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

Disallow implicit LOD texture methods in Compute shaders. #1221

@dj2

Description

@dj2

Using an implicit LOD in a compute shader in SPIR-V causes shader validation errors as it requires extra capabilities.

[[stage(compute)]] fn main() -> void { 
  result0.value = textureSample(tex0, samp, vec2<f32>(0.5, 0.5)).x;
  result1.value = textureLoad(tex1, vec2<i32>(0, 0), 0).x;
  return;
}
error: line 61: OpEntryPoint Entry Point <id> '20[%main]'s callgraph contains function <id> 20[%main], which cannot be used with the current execution modes:
ImplicitLod instructions require DerivativeGroupQuadsNV or DerivativeGroupLinearNV execution mode for GLCompute execution model: ImageSampleImplicitLod

Given the extra capabilities required, I think we should disallow the use of the implicit LOD texture methods in compute shaders.

Metadata

Metadata

Assignees

No one assigned

    Labels

    wgslWebGPU Shading Language Issues

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions