mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-17 00:47:13 +00:00
Refactor TransitionUsage to use abstract TransitionUsageImpl
This commit is contained in:
@@ -162,6 +162,7 @@ namespace metal {
|
||||
void SetSubDataImpl(uint32_t start, uint32_t count, const uint32_t* data) override;
|
||||
void MapReadAsyncImpl(uint32_t serial, uint32_t start, uint32_t count) override;
|
||||
void UnmapImpl() override;
|
||||
void TransitionUsageImpl(nxt::BufferUsageBit currentUsage, nxt::BufferUsageBit targetUsage) override;
|
||||
|
||||
Device* device;
|
||||
std::mutex mutex;
|
||||
@@ -309,6 +310,8 @@ namespace metal {
|
||||
id<MTLTexture> GetMTLTexture();
|
||||
|
||||
private:
|
||||
void TransitionUsageImpl(nxt::TextureUsageBit currentUsage, nxt::TextureUsageBit targetUsage) override;
|
||||
|
||||
Device* device;
|
||||
id<MTLTexture> mtlTexture = nil;
|
||||
};
|
||||
|
||||
@@ -233,6 +233,9 @@ namespace metal {
|
||||
// TODO(cwallez@chromium.org): Implement Map Read for the metal backend
|
||||
}
|
||||
|
||||
void Buffer::TransitionUsageImpl(nxt::BufferUsageBit currentUsage, nxt::BufferUsageBit targetUsage) {
|
||||
}
|
||||
|
||||
// BufferView
|
||||
|
||||
BufferView::BufferView(Device* device, BufferViewBuilder* builder)
|
||||
@@ -669,7 +672,7 @@ namespace metal {
|
||||
{
|
||||
TransitionBufferUsageCmd* cmd = commands.NextCommand<TransitionBufferUsageCmd>();
|
||||
|
||||
cmd->buffer->TransitionUsageImpl(cmd->usage);
|
||||
cmd->buffer->UpdateUsageInternal(cmd->usage);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -677,7 +680,7 @@ namespace metal {
|
||||
{
|
||||
TransitionTextureUsageCmd* cmd = commands.NextCommand<TransitionTextureUsageCmd>();
|
||||
|
||||
cmd->texture->TransitionUsageImpl(cmd->usage);
|
||||
cmd->texture->UpdateUsageInternal(cmd->usage);
|
||||
}
|
||||
break;
|
||||
;
|
||||
@@ -1156,6 +1159,9 @@ namespace metal {
|
||||
return mtlTexture;
|
||||
}
|
||||
|
||||
void Texture::TransitionUsageImpl(nxt::TextureUsageBit currentUsage, nxt::TextureUsageBit targetUsage) {
|
||||
}
|
||||
|
||||
// TextureView
|
||||
|
||||
TextureView::TextureView(Device* device, TextureViewBuilder* builder)
|
||||
|
||||
Reference in New Issue
Block a user