Skip to content

Texture SRV Component Mapping #209

@Hydr10n

Description

@Hydr10n

Default component mapping is fine in most cases, but, for example, when a texture format is actually single channel, and shader always treats textures as Texture2D<float4>, the sampled value is float4(r, 0, 0, 0) instead of float4(r, r, r, r), it would be convenient if add component mapping in TextureView or just create SRV in backends like this:

mapping = DEFAULT_SHADER_COMPONENT_MAPPING;
if (GetNumComponents(format) == 1) {
    mapping = ENCODE_SHADER_COMPONENT_MAPPING(R, R, R, R);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions