16 bit float buffer read problem details + repro code

I have three simple compute shaders reading and writing to two float buffers.

  • Init - fills them in
  • Float4RW - reads and writes as float4s
  • Float16RW - reads and writes as 16 bit floats (half)

The first two shaders work fine. The third shader writes fine, but for the read gets 0s for the second half of the buffer.

Pix (2507.11) is inconsistent about how it shows these buffers. It almost never shows the full 128 bytes worth of data, and is inconsistent how much it does show between different captures.

Either that’s a pix bug, or is showing us that the views are being made incorrectly in engine.

Because pix was inconsistent, the code does a readback of both buffers after every step. Images attached of what is expected vs what actually came out.

I’ve tried various things, including setting the view format to PF_R16F, but haven’t been able to get this to work.

Applying Files.zip to reproduce it:

I’m working against the latest in GitHub (5.6.1), on windows (pix shows the engine is using DX12)

Here’s where the files go, to reproduce:

  • The 3 .usf shader files go in Engine\Shaders\Private\Strides\
  • StridesTechnique.h goes in Engine\Source\Runtime\Renderer\Public
  • StridesTechnique.cpp goes in Engine\Source\Runtime\Renderer\Private

Engine\Source\Runtime\Renderer\Private\PostProcess\PostProcessing.cpp needs a

include “StridesTechnique.h”

and in AddPostProcessingPasses() right after where FScreenPassTexture SceneColor is declared, these 2 lines go:

Strides::FTechniqueParams params;

Strides::AddTechnique(GraphBuilder, View, params);

Then just building / running development editor, doing a pix capture or setting a breakpoint in the function and looking at the readback data shows the final buffer2 data is wrong.

BTW it would be really great to have a “vis” command to be able to see the contents of buffers, like we can see the contents of textures, without having to do this readback in code :slight_smile:

Thanks!

Steps to Reproduce

Hi Romain,

Would it be possible for you to package this code in a project file? That would make it a lot easier to compile and iterate over to test any changes to your code. If you go into the editor under File > Zip Project and send me the resulting Zip file, that would be really helpful.

Cheers,

Tim

[Image Removed]

Would that include the changes in the engine specified in the description as well? The project itself does not contain anything.

Hi Romain,

I started to look at your code, and I think it might be best if we have a short Zoom call. You can walk me through the code, and you can rubber duck it to me. Would you be available for a call sometime this week? I am in the CEST time zone, so depending on the time, I can be pretty flexible.

Cheers,

Tim