dcl_samplerType (sm2, sm3 - ps asm)

ピクセル シェーダー サンプラーを宣言します。

構文

dcl_samplerType s#

 

ここで、

  • _samplerTypeは、サンプラーのデータ型を定義します。 これにより、サンプリング時に各テクスチャ座標に必要な座標の数が決まります。 次のテクスチャ座標寸法が定義されています。
    • _2d
    • _キューブ
    • _ボリューム
  • s# はサンプラーを識別します。s はサンプラーの省略形、# はサンプラー番号です。 サンプラーは、直接読み取りまたは書き込みができないため、擬似レジスタです。

解説

ピクセル シェーダーのバージョン 1_1 1_2 1_3 1_4 2_0 2_x 2_sw 3_0 3_sw
dcl_samplerType x x x x x

 

すべてのdcl_samplerType命令は、最初の実行可能命令の前に指定する必要があります。

dcl_cube t0.rgb;  // Define a 3D texture map.

add r0, r0, t0;   // Perturb texture coordinates. 
texld r0, s0, r0; // Load r0 with a color sampled from stage0
                  //   at perturbed texture coordinates r0.
                  // This is a dependent texture read.

ピクセル シェーダーの手順