Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
ColorSpaceConvertBindings.h File Reference

Bind group indices of the sRGB-to-linear color space conversion program. More...

#include <array>
#include <cmath>
#include <cstdint>
#include <string_view>
Include dependency graph for ColorSpaceConvertBindings.h:
This graph shows which files directly or indirectly include this file:

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Enumerations

enum class  donner::gpu::shader::programs::ColorSpaceConvertBinding : uint32_t {
  InputTexture = 0 ,
  OutputTexture = 1 ,
  TransferTable = 3 ,
  Params = 2
}
 Bind group indices of the color space conversion program, shared by the IR builder and every host that creates its bind group layout. More...

Functions

const std::array< float, 2 *kColorTransferSampleCount > & donner::gpu::shader::programs::ColorTransferSamples ()
 Returns process-lifetime samples of both standard transfer functions, rounded once to float. The first half maps sRGB to linear light; the second half maps linear light to sRGB.

Variables

constexpr std::string_view donner::gpu::shader::programs::kColorSpaceConvertEntryPoint = "cs_main"
 Name of the compute entry point, as the IR declares it and the emitted source spells it.
constexpr uint32_t donner::gpu::shader::programs::kColorSpaceConvertWorkgroupSize = 8
 Workgroup size the entry point declares.
constexpr uint32_t donner::gpu::shader::programs::kColorSpaceConvertSrgbToLinear = 0
 Value of the direction parameter that converts sRGB-encoded channels to linear light.
constexpr uint32_t donner::gpu::shader::programs::kColorSpaceConvertLinearToSrgb = 1
 Value of the direction parameter that converts linear-light channels to sRGB encoding.
constexpr uint32_t donner::gpu::shader::programs::kColorTransferSampleCount = 4096
 Samples per direction, including both endpoints of the unit interval.

Detailed Description

Bind group indices of the sRGB-to-linear color space conversion program.

Split out from the program header so a host can build the program's bind group layout without linking the shader IR. The pipeline that does so consumes build-time emitted WGSL, and pulling in the IR for an enum would put the emitters back in binaries that exist to avoid them.

Enumeration Type Documentation

◆ ColorSpaceConvertBinding

Bind group indices of the color space conversion program, shared by the IR builder and every host that creates its bind group layout.

Enumerator
InputTexture 

Sampled texture_2d<f32> source.

OutputTexture 

texture_storage_2d<rgba32float, write> destination.

TransferTable 

Read-only float transfer samples, both directions.

Params 

Uniform buffer selecting the direction of the transfer.

Variable Documentation

◆ kColorSpaceConvertWorkgroupSize

uint32_t donner::gpu::shader::programs::kColorSpaceConvertWorkgroupSize = 8
inlineconstexpr

Workgroup size the entry point declares.

One definition, read by the IR builder that writes the shader and by every host that creates the pipeline or sizes a dispatch from it. A host restating it could drift, and a larger stale copy would silently under-dispatch, leaving the tail of the destination unwritten.