x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Trouble with getting data from compute shader

Hello everyone! I try to develop compute shader for Marching Cubes algorithm. I setup all using Temaran guide https://github.com/Temaran/UE4ShaderPluginDemo

I successfully setup shader but have the problem data exchange between shader and C++ program.

I upload around 700 Mb voxel data to shader but when I try to get more 31 Kb data from shader I get only zeros. When I get less data, all fine.

I actually need to take more 10 Mb data back. How can I achieve this?

Data is stored in AppendStructuredBuffer and I copy it with this code:

     srcPtr = (uint8*)RHILockStructuredBuffer(shaderOutDataBuffer, 0, sizeof(FOutTriangle) * total_size, EResourceLockMode::RLM_ReadOnly);
     // Reference pointer to first element for our destination ComputedColors
     uint8* dstPtr = (uint8*)_meshData.GetData();
     // Copy from GPU to main memory
     FMemory::Memcpy(dstPtr, srcPtr, sizeof(FOutTriangle) * total_size);
     //Unlock texture
     RHIUnlockStructuredBuffer(shaderOutDataBuffer);


If total_size less than 450, all works fine but I have much more triangles in out.

Product Version: UE 4.18
Tags:
more ▼

asked May 10 '18 at 10:32 AM in Rendering

avatar image

Angel Phosphoros
26 4 7

(comments are locked)
10|2000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question