Skip to content

Running the sample app on .NET 9 throws MissingFieldException "Field not found: '{Shader}.<buffer>P'" #893

@Peter-Juhasz

Description

@Peter-Juhasz

Reproduction Steps

Run "Hello world" based on https://github.com/Sergio0694/ComputeSharp/wiki/3.-Getting-started-%F0%9F%93%96 to multiply numbers in an array at once.

Or the sample app: https://github.com/Sergio0694/ComputeSharp/blob/120aff270539996ef9fc52fe46561d12da0b89d4/samples/ComputeSharp.Sample/Program.cs

Expected Behavior

The sample runs without any error just like on .NET 8.0.

Actual Behavior

Unhandled exception. System.MissingFieldException: Field not found: 'GpuLinq.MultiplyByTwo.<buffer>P'.
   at ComputeSharp.Generated.<GpuLinq_MultiplyByTwo_g>FBE22A9B254E8C5B4C31CB0BF8C793133B000321365754432B0E19EFB843B68E0__GraphicsResourcesLoader.buffer(MultiplyByTwo& value)
   at GpuLinq.MultiplyByTwo.global::ComputeSharp.Descriptors.IComputeShaderDescriptor<GpuLinq.MultiplyByTwo>.LoadGraphicsResources[TLoader](MultiplyByTwo& shader, TLoader& loader) in S:\git\disposable\GpuLinq\obj\Debug\net9.0\ComputeSharp.SourceGenerators\ComputeSharp.SourceGenerators.ComputeShaderDescriptorGenerator\GpuLinq.MultiplyByTwo.g.cs:line 102
   at ComputeSharp.ComputeContext.Run[T](Int32 x, Int32 y, Int32 z, T& shader) in /_/src/ComputeSharp/Shaders/ComputeContext.cs:line 178
   at ComputeSharp.ComputeContext.Run[T](Int32 x, T& shader) in /_/src/ComputeSharp/Shaders/ComputeContext.cs:line 127
   at ComputeSharp.GraphicsDeviceExtensions.For[T](GraphicsDevice device, Int32 x, T& shader) in /_/src/ComputeSharp/Graphics/Extensions/GraphicsDeviceExtensions.Dispatching.cs:line 26
   at GpuLinq.Program.Main(String[] args) in S:\git\disposable\GpuLinq\Program.cs:line 15

System info

This section should contain useful info such as:

  • ComputeSharp NuGet version (or branch/commit, if building from source): 3.1.0
  • Operating system version: 26100.2605
  • CPU/GPU model (the latter is especially useful for shader issues): NVIDIA GeForce RTX 4060 TI
  • Visual Studio version, or .NET SDK/runtime version: 17.13 P2.1 + .NET 9.0.100

Metadata

Metadata

Assignees

No one assigned

    Labels

    regression 💥A (breaking) change or behavioral difference in a new release

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions