Refactor TransitionUsage to use abstract TransitionUsageImpl

This commit is contained in:
Austin Eng
2017-06-12 18:31:10 -04:00
committed by Austin Eng
parent 39c901d3dc
commit 459537491b
15 changed files with 71 additions and 12 deletions

View File

@@ -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) {
}
}
}

View File

@@ -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;
};
}
}