Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your feedback on a survey! Each completed response supports our community and gives you a chance to win a $25 Amazon gift card!


RWTexture2D problem with half4


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 BuraCULa   Members   -  Reputation: 105

Like
0Likes
Like

Posted 15 March 2012 - 07:14 PM

Hi.I can't compile following code.Compiler says "typed UAV stores must write all declared components.".But when I use float4 instead of half4 it works well.
What does that error mean? Posted Image



RWTexture2D<half4> gTexture : register(u0);


[numthreads(TILE_SIZE,TILE_SIZE,1)]
void CS(uint3 groupId   : SV_GroupID,
						 uint3 dispatchThreadId : SV_DispatchThreadID,
						 uint3 groupThreadId : SV_GroupThreadID
						 )
{
gTexture[dispatchThreadId.xy] = half4(1,1,1,1);
}


Sponsor:

#2 MJP   Moderators   -  Reputation: 11859

Like
2Likes
Like

Posted 15 March 2012 - 11:52 PM

SM5.0 doesn't actually support half precision operations. You should just declare your RWTexture2D with a float4 type, and set float values. If you're using a half-precision texture format, then the hardware will automatically handle conversion between half precision and full precision floats.

#3 BuraCULa   Members   -  Reputation: 105

Like
0Likes
Like

Posted 16 March 2012 - 03:03 AM

I am trying to create a output texture for compute shader and copy this texture to render target after CS finished working.Actually I am just trying to start working on deferred shading. Does that conversion cause a performance penalty ? Because my hw doesn't support 128 bit textures for render targets and so i can't create swap chain with R32G32B32A32 etc.

--Edit--

After some researches i got some informations like half is not so important and 32 bits surfaces are pretty enough for deferred shading techniques.So i should look for some packing algorithms like this http://aras-p.info/texts/CompactNormalStorage.html.
Thanks for your reply MJP.

#4 MJP   Moderators   -  Reputation: 11859

Like
1Likes
Like

Posted 16 March 2012 - 01:14 PM

The conversion happens in dedicated hardware units, so there is no performance penalty.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS