sdlBindGpuComputeSamplers function gpu

void sdlBindGpuComputeSamplers(
  1. Pointer<SdlGpuComputePass> computePass,
  2. int firstSlot,
  3. Pointer<SdlGpuTextureSamplerBinding> textureSamplerBindings,
  4. int numBindings,
)

Binds texture-sampler pairs for use on the compute shader.

The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER.

Be sure your shader is set up according to the requirements documented in SDL_CreateGPUShader().

\param compute_pass a compute pass handle. \param first_slot the compute sampler slot to begin binding from. \param texture_sampler_bindings an array of texture-sampler binding structs. \param num_bindings the number of texture-sampler bindings to bind from the array.

\since This function is available since SDL 3.2.0.

\sa SDL_CreateGPUShader

extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputeSamplers( SDL_GPUComputePass *compute_pass, Uint32 first_slot, const SDL_GPUTextureSamplerBinding *texture_sampler_bindings, Uint32 num_bindings)

Implementation

void sdlBindGpuComputeSamplers(
  Pointer<SdlGpuComputePass> computePass,
  int firstSlot,
  Pointer<SdlGpuTextureSamplerBinding> textureSamplerBindings,
  int numBindings,
) {
  final sdlBindGpuComputeSamplersLookupFunction = _libSdl
      .lookupFunction<
        Void Function(
          Pointer<SdlGpuComputePass> computePass,
          Uint32 firstSlot,
          Pointer<SdlGpuTextureSamplerBinding> textureSamplerBindings,
          Uint32 numBindings,
        ),
        void Function(
          Pointer<SdlGpuComputePass> computePass,
          int firstSlot,
          Pointer<SdlGpuTextureSamplerBinding> textureSamplerBindings,
          int numBindings,
        )
      >('SDL_BindGPUComputeSamplers');
  return sdlBindGpuComputeSamplersLookupFunction(
    computePass,
    firstSlot,
    textureSamplerBindings,
    numBindings,
  );
}