mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-13 15:16:16 +00:00
Refactor TransitionUsage to use abstract TransitionUsageImpl
This commit is contained in:
@@ -83,7 +83,7 @@ namespace null {
|
||||
return module;
|
||||
}
|
||||
TextureBase* Device::CreateTexture(TextureBuilder* builder) {
|
||||
return new TextureBase(builder);
|
||||
return new Texture(builder);
|
||||
}
|
||||
TextureViewBase* Device::CreateTextureView(TextureViewBuilder* builder) {
|
||||
return new TextureViewBase(builder);
|
||||
@@ -149,6 +149,9 @@ namespace null {
|
||||
void Buffer::UnmapImpl() {
|
||||
}
|
||||
|
||||
void Buffer::TransitionUsageImpl(nxt::BufferUsageBit currentUsage, nxt::BufferUsageBit targetUsage) {
|
||||
}
|
||||
|
||||
// Queue
|
||||
|
||||
Queue::Queue(QueueBuilder* builder)
|
||||
@@ -168,5 +171,17 @@ namespace null {
|
||||
operations.clear();
|
||||
}
|
||||
|
||||
// Texture
|
||||
|
||||
Texture::Texture(TextureBuilder* builder)
|
||||
: TextureBase(builder) {
|
||||
}
|
||||
|
||||
Texture::~Texture() {
|
||||
}
|
||||
|
||||
void Texture::TransitionUsageImpl(nxt::TextureUsageBit currentUsage, nxt::TextureUsageBit targetUsage) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace null {
|
||||
using RenderPass = RenderPassBase;
|
||||
using Sampler = SamplerBase;
|
||||
using ShaderModule = ShaderModuleBase;
|
||||
using Texture = TextureBase;
|
||||
class Texture;
|
||||
using TextureView = TextureViewBase;
|
||||
|
||||
struct NullBackendTraits {
|
||||
@@ -129,6 +129,7 @@ namespace null {
|
||||
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;
|
||||
|
||||
std::unique_ptr<char[]> backingData;
|
||||
};
|
||||
@@ -142,6 +143,15 @@ namespace null {
|
||||
void Submit(uint32_t numCommands, CommandBuffer* const * commands);
|
||||
};
|
||||
|
||||
class Texture : public TextureBase {
|
||||
public:
|
||||
Texture(TextureBuilder* buidler);
|
||||
~Texture();
|
||||
|
||||
private:
|
||||
void TransitionUsageImpl(nxt::TextureUsageBit currentUsage, nxt::TextureUsageBit targetUsage) override;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user