Hash :
4f86d053
Author :
Date :
2017-06-05T12:59:26
Introduce MemoryProgramCache. This class will manage GPU binary programs in memory. It will be owned by the Display, and shared between Contexts. Currently this CL just refactors the Program binary saving and loading into static members of this new class. BUG=angleproject:1897 Change-Id: I34f5afb2c02416f6fd80dd65ba3827a8637ce190 Reviewed-on: https://chromium-review.googlesource.com/522873 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
//
// Copyright 2017 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// MemoryProgramCache: Stores compiled and linked programs in memory so they don't
// always have to be re-compiled. Can be used in conjunction with the platform
// layer to warm up the cache from disk.
#ifndef LIBANGLE_MEMORY_PROGRAM_CACHE_H_
#define LIBANGLE_MEMORY_PROGRAM_CACHE_H_
#include "common/MemoryBuffer.h"
#include "libANGLE/Error.h"
namespace gl
{
class Context;
class InfoLog;
class Program;
class ProgramState;
class MemoryProgramCache final : angle::NonCopyable
{
public:
// Writes a program's binary to the output memory buffer.
static void Serialize(const Context *context,
const Program *program,
angle::MemoryBuffer *binaryOut);
// Loads program state according to the specified binary blob.
static LinkResult Deserialize(const Context *context,
const Program *program,
ProgramState *state,
const uint8_t *binary,
size_t length,
InfoLog &infoLog);
};
} // namespace gl
#endif // LIBANGLE_MEMORY_PROGRAM_CACHE_H_