[Webkit-unassigned] [Bug 262346] New: [WGSL] Overrides with default values have initializers which doesn't compile

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 28 16:46:03 PDT 2023


https://bugs.webkit.org/show_bug.cgi?id=262346

            Bug ID: 262346
           Summary: [WGSL] Overrides with default values have initializers
                    which doesn't compile
           Product: WebKit
           Version: Other
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebGPU
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: mwyrzykowski at apple.com

[WGSL] Overrides with default values have initializers which doesn't compile

Opening https://webgpu.github.io/webgpu-samples/samples/shadowMapping

results in the following error:

program_source:58:47: error: an attribute list cannot appear here
  constant float shadowDepthTextureSize = 1024. [[function_constant(0)]];

as the generated metal looks like:
  constant float shadowDepthTextureSize = 1024. [[function_constant(0)]];

instead it should be:
  constant float shadowDepthTextureSize [[function_constant(0)]];

and the default value of 1024 should be returned in likely SpecializationConstant:

  struct SpecializationConstant {
      String mangledName;
      SpecializationConstantType type;
      String value; // <-- new member, or alternatively, std::variant<bool, float, int, unsigned, __fp16>
  };

Also it would be nice to add "Half" to SpecializationConstantType, that could be done separately.


Then the default can be used in:

  MTLFunctionConstantValues *createConstantValues(uint32_t constantCount, const WGPUConstantEntry* constants, const WGSL::Reflection::EntryPointInformation& entryPointInformation)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230928/b17b0a0e/attachment.htm>


More information about the webkit-unassigned mailing list