Merge pull request #246 from lummax/swapchainimage-clear-value

image/swapchain: Implement ImageClearValue for SwapchainImage
This commit is contained in:
tomaka 2016-09-03 18:07:26 +02:00 committed by GitHub
commit 29c50f2261

View File

@ -15,12 +15,15 @@ use std::sync::Weak;
use command_buffer::Submission;
use device::Queue;
use format::ClearValue;
use format::Format;
use format::FormatDesc;
use image::traits::AccessRange;
use image::traits::CommandBufferState;
use image::traits::CommandListState;
use image::traits::GpuAccessResult;
use image::traits::Image;
use image::traits::ImageClearValue;
use image::traits::ImageContent;
use image::traits::ImageView;
use image::traits::PipelineBarrierRequest;
@ -194,6 +197,14 @@ unsafe impl Image for SwapchainImage {
}
}
unsafe impl ImageClearValue<<Format as FormatDesc>::ClearValue> for SwapchainImage
{
#[inline]
fn decode(&self, value: <Format as FormatDesc>::ClearValue) -> Option<ClearValue> {
Some(self.format.decode_clear_value(value))
}
}
unsafe impl<P> ImageContent<P> for SwapchainImage {
#[inline]
fn matches_format(&self) -> bool {