次の方法で共有


texdepth - ps

このピクセルの深度バッファー比較テストで使用する深度値を計算します。

構文

texdepth dst

 

where

  • dst は宛先レジスタです。

注釈

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

 

この命令では、このピクセルの深度バッファー比較テストで r5.r/ r5.g を使用します。 青チャネルとアルファ チャネルのデータは無視されます。 r5.g = 0 の場合、r5.r / r5.g = 1.0 の結果。

この命令で使用できる唯一のレジスタは、一時レジスタ r5 です。

この命令を実行すると、一時レジスタ r5 はシェーダーで追加使用できなくなります。

マルチサンプリングの場合、この命令を使用すると、解像度の高い深度バッファーの利点の大部分が排除されます。 ピクセル シェーダーはピクセルごとに 1 回実行されるため、サブピクセル深度比較テストごとに texm3x2depth - ps または texdepth によって出力される単一の深度値が使用されます。

texdepth の使用例を次に示します。

ps_1_4              
texld  r0, t0        // Sample texture from texture stage 0 (dest 
                     //   register number) into r0
                     // Use texture coordinate data from t0
texcrd r1.rgb, t1    // Load a second set of texture coordinate data into r1
add    r5.rg, r0, r1 // Add the two sets of texture coordinate data
phase                // Phase marker, required when using texdepth instruction
texdepth  r5         // Calculate pixel depth as r5.r / r5.g
                     // Do other color calculations with shader output r0

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