Sign in to follow this  

RWTexture2D problem with half4

This topic is 2133 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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? [img]http://public.gamedev.net//public/style_emoticons/default/unsure.png[/img]

[code]


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);
}
[/code]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 [url="http://aras-p.info/texts/CompactNormalStorage.html"]http://aras-p.info/texts/CompactNormalStorage.html[/url].
Thanks for your reply MJP.

Share this post


Link to post
Share on other sites
Sign in to follow this