If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
|
|
|
|
#1 |
|
Registered
Join Date: Mar 2008
Posts: 5
|
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... |
|
|
|
| Thread Tools | |
| Display Modes | |
|
|