llpc/util/llpcCacheAccessor.cpp
bool CacheAccessor::lookUpInShaderCache(const MetroHash::Hash &hash, bool allocateOnMiss, ShaderCache *cache) {
  CacheEntryHandle currentEntry;
  ShaderEntryState cacheEntryState = cache->findShader(hash, allocateOnMiss, &currentEntry);
  if (cacheEntryState == ShaderEntryState::Ready) {
    Result result = cache->retrieveShader(currentEntry, &m_elf.pCode, &m_elf.codeSize);
    if (result == Result::Success) {
      m_shaderCacheEntryState = ShaderEntryState::Ready;
      return true;
    }
  } else if (cacheEntryState == ShaderEntryState::Compiling) {
    m_shaderCache = cache;
    m_shaderCacheEntry = currentEntry;
    m_shaderCacheEntryState = ShaderEntryState::Compiling;
    return true;
  }
  return false;
}
// =====================================================================================================================
// Looks for the given hash in the given shader cache and sets the cache accessor state with the results.  A new entry
// will be allocated if there is a cache miss and allocateOnMiss is true.
//
// @param hash : The hash to look up.
// @param allocateOnMiss : Will add an entry to the cache on a miss if true.
// @param cache : The cache in with to look.
Looks for the given hash in the given shader cache and sets the cache accessor state with the results.  A new entry
will be allocated if there is a cache miss and allocateOnMiss is true.
Looks for the given hash in the given shader cache and sets the cache accessor state with the results . A new entry will be allocated if there is a cache miss and allocateOnMiss is true .
bool CacheAccessor::lookUpInShaderCache(const MetroHash::Hash &hash, bool allocateOnMiss, ShaderCache *cache) {
  CacheEntryHandle currentEntry;
  ShaderEntryState cacheEntryState = cache->findShader(hash, allocateOnMiss, &currentEntry);
  if (cacheEntryState == ShaderEntryState::Ready) {
    Result result = cache->retrieveShader(currentEntry, &m_elf.pCode, &m_elf.codeSize);
    if (result == Result::Success) {
      m_shaderCacheEntryState = ShaderEntryState::Ready;
      return true;
    }
  } else if (cacheEntryState == ShaderEntryState::Compiling) {
    m_shaderCache = cache;
    m_shaderCacheEntry = currentEntry;
    m_shaderCacheEntryState = ShaderEntryState::Compiling;
    return true;
  }
  return false;
}
bool CacheAccessor :: lookUpInShaderCache ( const MetroHash :: Hash & hash , bool allocateOnMiss , ShaderCache * cache ) { CacheEntryHandle currentEntry ; ShaderEntryState cacheEntryState = cache -> findShader ( hash , allocateOnMiss , & currentEntry ) ; if ( cacheEntryState == ShaderEntryState :: Ready ) { Result result = cache -> retrieveShader ( currentEntry , & m_elf . pCode , & m_elf . codeSize ) ; if ( result == Result :: Success ) { m_shaderCacheEntryState = ShaderEntryState :: Ready ; return true ; } } else if ( cacheEntryState == ShaderEntryState :: Compiling ) { m_shaderCache = cache ; m_shaderCacheEntry = currentEntry ; m_shaderCacheEntryState = ShaderEntryState :: Compiling ; return true ; } return false ; }
Looks for the given hash in the given shader cache and sets the cache accessor state with the results.
Looks for the given hash in the given shader cache and sets the cache accessor state with the results .