This extension enables support for the chromium_experimental_framebuffer_fetch WGSL extension.
The extension is experimental and might change for example to gain new validation rules (with extension struct) in the future.
It is available on tiler Metal GPUs and Vulkan with the InputAttachment capability.
In Device::CreateRenderPipeline or Device::CreateRenderPipelineAsync:
@color(N) in : T fragment in:enable chromium_experimental_framebuffer_fetchi32, u32, f32, f16 or vec{2,3,4}{i,u,f,h}.N to be unique per colorN value must be in the range of [0..7]@color(N) entries translate directly to [[color(N)]] annotations on the input data.Requires a group, binding value provided for each color N value from Host
Add the OpCapability InputAttachment
For each color(N) entry
Create an OpTypeImage %type SubpassData 0 0 0 2 Unknown where %type is f32, i32 or u32. For f16, the %type will be f32 and the OpImageRead will be decorated with RelaxedPrecision.
Create a OpTypePointer UniformConstant %image
Create a OpVariable %ptr_uniform_image UniformConstant
Decorate the var with OpDecorate %inputVar InputAttachmentIndex N
We will then replace the value of the input variable with the value read from the attachment
OpImageRead %v4float %img %zero where %zero is OpConstantComposite %v2int %int_0 %int_0f16, the result of the RelaxedPrecision-decorated OpImageRead is converted to f16.For Dawn, this would probably map to creating the image in ShaderIO and then calling the image_read intrinsic for SPIR-V