Table of Contents

Class Sm3StageReservationRewriter

Namespace
ShadowDusk.HLSL
Assembly
ShadowDusk.HLSL.dll

Rewrites D3D9 stage-scoped register reservations for a single-stage SM1–3 compile. D3D9-era HLSL can scope a register bind to one shader stage — float4 Color : register(vs, c0); / : register(ps, c1); / sampler s : register(ps, s0); — but vkd3d 1.17's HLSL compiler fails with E5017 "Reservation shader target" on that stage-scoped form while fully honoring the plain : register(c0) form. The FNA fx_2_0 pipeline therefore rewrites the source PER STAGE before each vkd3d compile (once for vs_3_0, once for ps_3_0).

public static class Sm3StageReservationRewriter
Inheritance
Sm3StageReservationRewriter
Inherited Members

Methods

Rewrite(string, ShaderStage)

Rewrites stage-scoped register reservations for a single-stage compile: the compiling stage's register(vs|ps, X) loses its stage prefix; the other stage's reservation is removed entirely (vkd3d then auto-assigns; the CTAB reports the actual register, which is what the fx_2_0 parameter binding consumes).

public static string Rewrite(string source, ShaderStage stage)

Parameters

source string

The HLSL source to rewrite.

stage ShaderStage

The stage about to be compiled.

Returns

string