Add GPUResourceUsage.Staging for both CPU read/write access
This commit is contained in:
@@ -142,6 +142,14 @@ GPUTextureDescription GPUTextureDescription::ToStagingReadback() const
|
||||
return copy;
|
||||
}
|
||||
|
||||
GPUTextureDescription GPUTextureDescription::ToStaging() const
|
||||
{
|
||||
auto copy = *this;
|
||||
copy.Flags = GPUTextureFlags::None;
|
||||
copy.Usage = GPUResourceUsage::Staging;
|
||||
return copy;
|
||||
}
|
||||
|
||||
bool GPUTextureDescription::Equals(const GPUTextureDescription& other) const
|
||||
{
|
||||
return Dimensions == other.Dimensions
|
||||
@@ -208,6 +216,11 @@ GPUTexture::GPUTexture()
|
||||
_desc.Clear();
|
||||
}
|
||||
|
||||
bool GPUTexture::IsStaging() const
|
||||
{
|
||||
return _desc.Usage == GPUResourceUsage::StagingUpload || _desc.Usage == GPUResourceUsage::StagingReadback || _desc.Usage == GPUResourceUsage::Staging;
|
||||
}
|
||||
|
||||
Float2 GPUTexture::Size() const
|
||||
{
|
||||
return Float2(static_cast<float>(_desc.Width), static_cast<float>(_desc.Height));
|
||||
|
||||
Reference in New Issue
Block a user