mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 18:59:21 +00:00
Adds pipeline cache and implementation for Vulkan backend.
- Adds testing for Vulkan pipeline caching.
- Removed redundant VK_NULL_HANDLE and use explicit {} initialization for 0 handles when necessary.
- Adds some const qualifiers where applicable and useful.
- Removes overloaded GetCacheKey (const/non-const) versions and exposed the cache key member directly for modifiers in derived classes.
Bug: dawn:549
Change-Id: I5e8ab9716eebc916b813c9d032f8dc1f3f5261bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86581
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
#include "dawn/native/Instance.h"
|
||||
#include "dawn/native/InternalPipelineStore.h"
|
||||
#include "dawn/native/ObjectType_autogen.h"
|
||||
#include "dawn/native/PipelineCache.h"
|
||||
#include "dawn/native/QuerySet.h"
|
||||
#include "dawn/native/Queue.h"
|
||||
#include "dawn/native/RenderBundleEncoder.h"
|
||||
@@ -968,6 +969,10 @@ void DeviceBase::UncacheAttachmentState(AttachmentState* obj) {
|
||||
ASSERT(removedCount == 1);
|
||||
}
|
||||
|
||||
Ref<PipelineCacheBase> DeviceBase::GetOrCreatePipelineCache(const CacheKey& key) {
|
||||
return GetOrCreatePipelineCacheImpl(key);
|
||||
}
|
||||
|
||||
// Object creation API methods
|
||||
|
||||
BindGroupBase* DeviceBase::APICreateBindGroup(const BindGroupDescriptor* descriptor) {
|
||||
@@ -1377,6 +1382,11 @@ ResultOrError<Ref<CommandEncoder>> DeviceBase::CreateCommandEncoder(
|
||||
return CommandEncoder::Create(this, descriptor);
|
||||
}
|
||||
|
||||
// Overwritten on the backends to return pipeline caches if supported.
|
||||
Ref<PipelineCacheBase> DeviceBase::GetOrCreatePipelineCacheImpl(const CacheKey& key) {
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
MaybeError DeviceBase::CreateComputePipelineAsync(const ComputePipelineDescriptor* descriptor,
|
||||
WGPUCreateComputePipelineAsyncCallback callback,
|
||||
void* userdata) {
|
||||
|
||||
Reference in New Issue
Block a user