Texture2D<float> InputTex : register( t0 );
RWTexture2D<float> OutputTex : register( u0 );
// Group size
#define size_x 20
#define size_y 20
// Declare one thread fo r each texel of the input texture.
[numthreads(size_x, size_y, 1)]
void CSMAIN( uint3 DispatchThreadID : SV_DispatchThreadID )
{
int3 texturelocation = int3( 0,0, 0 );
texturelocation.x = DispatchThreadID.x;
texturelocation.y = DispatchThreadID.y;
float Value = InputTex.Load( texturelocation );
OutputTex[DispatchThreadID.xy] = 2.0f * Value;
}
最初の質問:
このコードでは、x のスレッド 17 と y のスレッド 17 のように、 と は同じ値ですかDispatchThreadID.x
?DispatchThreadID.y
2 番目の質問:
これ書いてもいいですか?
OutputTex[ texturelocation ] = 2.0f * Value;
はいまたはいいえで十分ですが、いいえの場合はその理由を簡単に説明してください。