Hash :
f10bf6bf
Author :
Date :
2019-09-26T10:27:18
Vulkan: Implement multi-threaded GL. The main component of this change is to make vk::BufferHelper, vk::ImageHelper and vk::SyncHelper use a common path. We introduce a new "vk::SharedGarbage" helper class that stores small lists of garbage from individual objects like an ImageHelper or BufferHelper. The SharedGarbage is stored in the RendererVk with the ResourceUse of the helper object. The ResourceUse tells RendererVk when it is safe to destroy the GarbageObjects. New "onGraphAccess" commands are added in a few places to enable the common garbage collection path. A couple Context-only resources like default attributes now are referenced where they were not before. Also reorganizes some functions so we can add a few helpful ASSERTs to our graph dependencies. Added "updateCurrentAccessNodes" for this. Also adds a "RendererScoped" helper to replace many uses of "ContextScoped". The multithreading EGL tests mostly pass but have some remaining flakiness so cannot yet be enabled. Bug: angleproject:2464 Change-Id: Ia3e3ae8848d731abf3f21ebe04c33e381e130be0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1808444 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
//
// Copyright 2016 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.
//
// ImageVk.h:
// Defines the class interface for ImageVk, implementing ImageImpl.
//
#ifndef LIBANGLE_RENDERER_VULKAN_IMAGEVK_H_
#define LIBANGLE_RENDERER_VULKAN_IMAGEVK_H_
#include "libANGLE/renderer/ImageImpl.h"
#include "libANGLE/renderer/vulkan/vk_helpers.h"
namespace rx
{
class ExternalImageSiblingVk : public ExternalImageSiblingImpl
{
public:
ExternalImageSiblingVk() {}
~ExternalImageSiblingVk() override {}
virtual vk::ImageHelper *getImage() const = 0;
virtual void release(RendererVk *renderer) = 0;
};
class ImageVk : public ImageImpl
{
public:
ImageVk(const egl::ImageState &state, const gl::Context *context);
~ImageVk() override;
void onDestroy(const egl::Display *display) override;
egl::Error initialize(const egl::Display *display) override;
angle::Result orphan(const gl::Context *context, egl::ImageSibling *sibling) override;
vk::ImageHelper *getImage() const { return mImage; }
gl::TextureType getImageTextureType() const { return mImageTextureType; }
uint32_t getImageLevel() const { return mImageLevel; }
uint32_t getImageLayer() const { return mImageLayer; }
private:
gl::TextureType mImageTextureType;
uint32_t mImageLevel;
uint32_t mImageLayer;
bool mOwnsImage;
vk::ImageHelper *mImage;
std::vector<vk::Shared<vk::Fence>> mImageLastUseFences;
const gl::Context *mContext;
};
} // namespace rx
#endif // LIBANGLE_RENDERER_VULKAN_IMAGEVK_H_