naga::back::hlsl

Module help

source
Expand description

Helpers for the hlsl backend

Important note about Expression::ImageQuery/Expression::ArrayLength and hlsl backend:

Due to implementation of GetDimensions function in hlsl (https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-to-getdimensions) backend can’t work with it as an expression. Instead, it generates a unique wrapped function per Expression::ImageQuery, based on texture info and query function. See WrappedImageQuery struct that represents a unique function and will be generated before writing all statements and expressions. This allowed to works with Expression::ImageQuery as expression and write wrapped function.

For example:

let dim_1d = textureDimensions(image_1d);
int NagaDimensions1D(Texture1D<float4>)
{
   uint4 ret;
   image_1d.GetDimensions(ret.x);
   return ret.x;
}

int dim_1d = NagaDimensions1D(image_1d);

Structs§

Enums§

  • ImageQuery πŸ”’
    HLSL backend requires its own ImageQuery enum.