Refactoring Queue::WriteTexture implementation

More code is now shared across backends.

Bug: dawn:483
Change-Id: I7ca1b8cbc2f12e408c94fbe5bca9fd29e47e0004
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/27021
Commit-Queue: Tomek Ponitka <tommek@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
Tomek Ponitka
2020-08-20 13:29:39 +00:00
committed by Commit Bot service account
parent 7f265d1d40
commit d720785616
22 changed files with 238 additions and 293 deletions

View File

@@ -196,6 +196,13 @@ namespace dawn_native { namespace opengl {
return DAWN_UNIMPLEMENTED_ERROR("Device unable to copy from staging buffer.");
}
MaybeError Device::CopyFromStagingToTexture(const StagingBufferBase* source,
const TextureDataLayout& src,
TextureCopy* dst,
const Extent3D& copySizePixels) {
return DAWN_UNIMPLEMENTED_ERROR("Device unable to copy from staging buffer to texture.");
}
void Device::ShutDownImpl() {
ASSERT(GetState() == State::Disconnected);
}
@@ -208,4 +215,12 @@ namespace dawn_native { namespace opengl {
return {};
}
uint32_t Device::GetOptimalBytesPerRowAlignment() const {
return 1;
}
uint64_t Device::GetOptimalBufferToTextureCopyOffsetAlignment() const {
return 1;
}
}} // namespace dawn_native::opengl

View File

@@ -62,6 +62,14 @@ namespace dawn_native { namespace opengl {
uint64_t destinationOffset,
uint64_t size) override;
MaybeError CopyFromStagingToTexture(const StagingBufferBase* source,
const TextureDataLayout& src,
TextureCopy* dst,
const Extent3D& copySizePixels) override;
uint32_t GetOptimalBytesPerRowAlignment() const override;
uint64_t GetOptimalBufferToTextureCopyOffsetAlignment() const override;
private:
Device(AdapterBase* adapter,
const DeviceDescriptor* descriptor,

View File

@@ -51,4 +51,11 @@ namespace dawn_native { namespace opengl {
return {};
}
MaybeError Queue::WriteTextureImpl(const TextureCopyView& destination,
const void* data,
const TextureDataLayout& dataLayout,
const Extent3D& writeSizePixel) {
return DAWN_UNIMPLEMENTED_ERROR("Unable to write to texture\n");
}
}} // namespace dawn_native::opengl

View File

@@ -32,6 +32,10 @@ namespace dawn_native { namespace opengl {
uint64_t bufferOffset,
const void* data,
size_t size) override;
MaybeError WriteTextureImpl(const TextureCopyView& destination,
const void* data,
const TextureDataLayout& dataLayout,
const Extent3D& writeSizePixel) override;
};
}} // namespace dawn_native::opengl