Sign in to follow this  
BuraCULa

RWTexture2D problem with half4

Recommended Posts

BuraCULa    153
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
MJP    19755
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
BuraCULa    153
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this