hunter3738
Newcomer
Hi
I'm using hlsl with dx9 and ps3.0 and have a problem with my pixelshader when i turn on flow control: the tex2Dlod function doesn't return correct values. The code looks something like this:
float4 pedata = tex2D(texPeDataSampler, float2(colpos, rowpos));
for (int i = 0; i < pedata[3] && i < 6; i++)
{
// following call goes OK
dendata = tex2Dlod(texDenSampler, float4(float2(dencolpos, denrowpos),0,0));
// here's where it starts failing
if (srcreadtime1 == 0){ srcpedata = tex2Dlod(samparr[0],float4(float2(srcpecolpos, srcperowpos), 0, 0)); }
if (srcreadtime1 == 1){ srcpedata = tex2Dlod(samparr[1],float4(float2(srcpecolpos, srcperowpos), 0, 0)); }
.
.
.
if (srcreadtime1 == 13){ srcpedata = tex2Dlod(samparr[13],float4(float2(srcpecolpos, srcperowpos), 0, 0)); }
}
The code compiles well and the problem disappears when i turn off flow control (making my app 10* slower). The values returned are [infinity, 0, 0, 0] (at all times) and i tested this on 2 sm3.O cards (nvidia & ati). I also tried to write it all with slightly different syntax, without succes.
My questions:
- Is there a better way of doing this? How?
- Is there any hope this will work with dx10 & sm4.0?
- Should I delve into the asm to solve this or are there other options?
any help and comments are highly appreciated...
I'm using hlsl with dx9 and ps3.0 and have a problem with my pixelshader when i turn on flow control: the tex2Dlod function doesn't return correct values. The code looks something like this:
float4 pedata = tex2D(texPeDataSampler, float2(colpos, rowpos));
for (int i = 0; i < pedata[3] && i < 6; i++)
{
// following call goes OK
dendata = tex2Dlod(texDenSampler, float4(float2(dencolpos, denrowpos),0,0));
// here's where it starts failing
if (srcreadtime1 == 0){ srcpedata = tex2Dlod(samparr[0],float4(float2(srcpecolpos, srcperowpos), 0, 0)); }
if (srcreadtime1 == 1){ srcpedata = tex2Dlod(samparr[1],float4(float2(srcpecolpos, srcperowpos), 0, 0)); }
.
.
.
if (srcreadtime1 == 13){ srcpedata = tex2Dlod(samparr[13],float4(float2(srcpecolpos, srcperowpos), 0, 0)); }
}
The code compiles well and the problem disappears when i turn off flow control (making my app 10* slower). The values returned are [infinity, 0, 0, 0] (at all times) and i tested this on 2 sm3.O cards (nvidia & ati). I also tried to write it all with slightly different syntax, without succes.
My questions:
- Is there a better way of doing this? How?
- Is there any hope this will work with dx10 & sm4.0?
- Should I delve into the asm to solve this or are there other options?
any help and comments are highly appreciated...