Jump to content
  • Advertisement
Sign in to follow this  
BuraCULa

RWTexture2D problem with half4

This topic is 2291 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? unsure.png




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);
}

Share this post


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

Share this post


Link to post
Share on other sites
The conversion happens in dedicated hardware units, so there is no performance penalty.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!