1st question
Current code:
sampler samp0 : register(s0) = sampler_state
{
...//set filtering, address modes...
};
sampler samp1 : register(s1) = sampler_state
{
...//set filtering, address modes...
};
...and so on
Is it possible and how to do that with array of samplers?
sampler arrSamp[4];
2nd question
Is this the correct way to clear 4 render targets:
dev->SetRenderTarget(0, rt0);
dev->SetRenderTarget(1, rt1);
dev->SetRenderTarget(2, rt2);
dev->SetRenderTarget(3, rt3);// all rts are of the same size
D3DRECT rcs[4];
rcs[0].x1 = 0;
rcs[0].x2 = rtSize;
rcs[0].y1 = 0;
rcs[0].y2 = rtSize;
rcs[1].x1 = 0;
rcs[1].x2 = rtSize;
rcs[1].y1 = 0;
rcs[1].y2 = rtSize;
rcs[2].x1 = 0;
rcs[2].x2 = rtSize;
rcs[2].y1 = 0;
rcs[2].y2 = rtSize;
rcs[3].x1 = 0;
rcs[3].x2 = rtSize;
rcs[3].y1 = 0;
rcs[3].y2 = rtSize;
HRESULT hr = dev->Clear(4, rcs, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00FFFFFF, 1.0f, 0L);