Welcome, Unregistered.

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.

 
Prev Previous Post   Next Post Next
Old 07-Mar-2008, 14:08   #1
hunter3738
Registered
 
Join Date: Mar 2008
Posts: 5
Default hlsl flowcontrol & texture lookups

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...
hunter3738 is offline   Reply With Quote

 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 00:26.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.