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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Detecting the (Shader) Program Binary Cache

Hi,
I'm trying to use the new program binary cache feature on Android, which is enabled by default.
At game startup, I wait for the shaders to finish compiling by checking FShaderPipelineCache::NumPrecompilesRemaining()==0.
I was expecting this not to go through all the precompilation a second time if there was a valid ProgramBinaryCache. But it does.

So, questions:
1. how do I detect a missing/valid ProgramBinaryCache, so I can pop up an 'Optimizing Content' dialog for the first run?
2. is it necessary to restart the game (which is by default done automatically, but can be turned off with r.ProgramBinaryCache.RestartAndroidAfterPrecompile) once the ProgramBinaryCache is created?
3. what is the recommended sequence of events on startup?
4. is there a way to show a progress bar for the binary cache compilation?

Thanks!

Product Version: UE 4.21
Tags:
more ▼

asked Jan 11 '19 at 02:25 AM in Using UE4

avatar image

Steve McCrea
6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

To make this work I had to add a function to the engine like so:

 // ARMATURE MOD: added this to get the state of the ProgramBinaryCache
 bool FOpenGLDynamicRHI::IsProgramBinaryCacheValid() const
 {
     return FOpenGLProgramBinaryCache::IsEnabled() && !FOpenGLProgramBinaryCache::IsBuildingCache();
 }

Then in our initial map I check this, and if false, loop while FShaderPipelineCache::NumPrecompilesRemaining() > 0 (with a progress dialog labeled 'optimizing content'). The game automatically restarts when done.

more ▼

answered Jan 19 '19 at 12:18 AM

avatar image

Steve McCrea
6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
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