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

@@ -325,7 +325,7 @@ namespace opengl {
{
TransitionBufferUsageCmd* cmd = commands.NextCommand<TransitionBufferUsageCmd>();
cmd->buffer->TransitionUsageImpl(cmd->usage);
cmd->buffer->UpdateUsageInternal(cmd->usage);
}
break;
@@ -333,7 +333,7 @@ namespace opengl {
{
TransitionTextureUsageCmd* cmd = commands.NextCommand<TransitionTextureUsageCmd>();
cmd->texture->TransitionUsageImpl(cmd->usage);
cmd->texture->UpdateUsageInternal(cmd->usage);
}
break;
}

View File

@@ -141,6 +141,9 @@ namespace opengl {
// TODO(cwallez@chromium.org): Implement Map Read for the GL backend
}
void Buffer::TransitionUsageImpl(nxt::BufferUsageBit currentUsage, nxt::BufferUsageBit targetUsage) {
}
// BufferView
BufferView::BufferView(Device* device, BufferViewBuilder* builder)

View File

@@ -128,6 +128,7 @@ namespace opengl {
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;
GLuint buffer = 0;

View File

@@ -76,6 +76,9 @@ namespace opengl {
return GetGLFormatInfo(GetFormat());
}
void Texture::TransitionUsageImpl(nxt::TextureUsageBit currentUsage, nxt::TextureUsageBit targetUsage) {
}
// TextureView
TextureView::TextureView(Device* device, TextureViewBuilder* builder)

View File

@@ -39,6 +39,8 @@ namespace opengl {
TextureFormatInfo GetGLFormat() const;
private:
void TransitionUsageImpl(nxt::TextureUsageBit currentUsage, nxt::TextureUsageBit targetUsage) override;
Device* device;
GLuint handle;
GLenum target;