STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Functions
Concurrency::graphics::details Namespace Reference

Classes

struct  _Is_iterator
 
struct  _Short_vector_type_traits
 
struct  _Short_vector_type_traits< double >
 
struct  _Short_vector_type_traits< double_2 >
 
struct  _Short_vector_type_traits< double_3 >
 
struct  _Short_vector_type_traits< double_4 >
 
struct  _Short_vector_type_traits< float >
 
struct  _Short_vector_type_traits< float_2 >
 
struct  _Short_vector_type_traits< float_3 >
 
struct  _Short_vector_type_traits< float_4 >
 
struct  _Short_vector_type_traits< int >
 
struct  _Short_vector_type_traits< int_2 >
 
struct  _Short_vector_type_traits< int_3 >
 
struct  _Short_vector_type_traits< int_4 >
 
struct  _Short_vector_type_traits< norm >
 
struct  _Short_vector_type_traits< norm_2 >
 
struct  _Short_vector_type_traits< norm_3 >
 
struct  _Short_vector_type_traits< norm_4 >
 
struct  _Short_vector_type_traits< uint_2 >
 
struct  _Short_vector_type_traits< uint_3 >
 
struct  _Short_vector_type_traits< uint_4 >
 
struct  _Short_vector_type_traits< unorm >
 
struct  _Short_vector_type_traits< unorm_2 >
 
struct  _Short_vector_type_traits< unorm_3 >
 
struct  _Short_vector_type_traits< unorm_4 >
 
struct  _Short_vector_type_traits< unsigned int >
 
class  _Texture_base
 
struct  texture_traits
 
struct  texture_traits< const texture< _Value_type, _Rank > >
 
struct  texture_traits< const texture_view< _Value_type, _Rank > >
 
struct  texture_traits< const texture_view< const _Value_type, _Rank > >
 
struct  texture_traits< const writeonly_texture_view< _Value_type, _Rank > >
 
struct  texture_traits< texture< _Value_type, _Rank > >
 
struct  texture_traits< texture_view< _Value_type, _Rank > >
 
struct  texture_traits< texture_view< const _Value_type, _Rank > >
 
struct  texture_traits< writeonly_texture_view< _Value_type, _Rank > >
 

Functions

template<typename _Short_vector_type >
unsigned int _Get_default_bits_per_scalar_element ()
 
template<int _Rank>
std::array< size_t, 3 > _Get_dimensions (const Concurrency::extent< _Rank > &_Ext, unsigned int _Mip_offset)
 
template<int _Rank>
std::array< size_t, 3 > _Get_indices (const index< _Rank > &_Idx)
 
template<int _Rank>
Concurrency::extent< _Rank > _Create_extent (size_t _Width, size_t _Height, size_t _Depth)
 
template<typename _Value_type , int _Rank>
_Event _Copy_async_impl (const void *_Src, unsigned int _Src_byte_size, const _Texture_base< _Value_type, _Rank > &_Dst, const index< _Rank > &_Offset, const Concurrency::extent< _Rank > &_Copy_extent)
 
template<typename OutputIterator , typename _Value_type , int _Rank>
_Event _Copy_async_impl (const _Texture_base< _Value_type, _Rank > &_Src, OutputIterator _Dest_iter)
 
template<typename _Value_type , int _Rank>
_Event _Copy_async_impl (const _Texture_base< _Value_type, _Rank > &_Src, const index< _Rank > &_Src_offset, const _Texture_base< _Value_type, _Rank > &_Dst, const index< _Rank > &_Dst_offset, const extent< _Rank > &_Copy_extent)
 
void _Is_valid_data_length (unsigned int _Num_elems, unsigned int _Bits_per_elem)
 
template<typename _Value_type , int _Rank>
unsigned int _Get_section_size (const _Texture_base< _Value_type, _Rank > &_Tex, const extent< _Rank > &_Extent)
 
template<typename _Input_iterator , typename _Value_type >
_Event _Copy_async_impl (_Input_iterator _First, _Input_iterator _Last, _In_ _Texture *_Dst, const size_t *_Dst_offset, unsigned int _Dst_mipmap_level, const size_t *_Copy_extent, const size_t *_Preferred_copy_chunk_extent=NULL)
 
template<typename _Output_iterator , typename _Value_type >
_Event _Copy_async_impl (_Texture *_Tex, const size_t *_Tex_offset, unsigned int _Src_mipmap_level, const size_t *_Copy_extent, _Output_iterator _First, const size_t *_Preferred_copy_chunk_extent=NULL)
 
template<typename _Value_type , int _Rank>
_Event _Copy_async_impl (const _Texture_base< _Value_type, _Rank > &_Src, const index< _Rank > &_Src_offset, const extent< _Rank > &_Copy_extent, _Out_ void *_Dst, unsigned int _Dst_byte_size)
 
template<typename _Output_iterator , typename _Value_type , int _Rank>
_Event _Copy_async_impl (const _Texture_base< _Value_type, _Rank > &_Src, const index< _Rank > &_Src_offset, const extent< _Rank > &_Copy_extent, _Output_iterator _Dest_iter)
 
template<typename _Input_iterator , typename _Value_type , int _Rank>
_Event _Copy_async_impl (_Input_iterator _First, _Input_iterator _Last, const _Texture_base< _Value_type, _Rank > &_Dst, const index< _Rank > &_Dst_offset, const extent< _Rank > &_Copy_extent)
 
template<int _Rank>
Concurrency::extent< _Rank > _Make_texture (const Concurrency::accelerator_view &_Av, _In_ IUnknown *_D3D_texture, _Texture_base_type_id _Id, _Inout_ _Texture **_Tex, DXGI_FORMAT _View_format) __CPU_ONLY
 

Function Documentation

template<typename _Value_type , int _Rank>
_Event Concurrency::graphics::details::_Copy_async_impl ( const void _Src,
unsigned int  _Src_byte_size,
const _Texture_base< _Value_type, _Rank > &  _Dst,
const index< _Rank > &  _Offset,
const Concurrency::extent< _Rank > &  _Copy_extent 
)
3955 {
3956  _Is_valid_section(_Dst.extent, _Dst_offset, _Copy_extent);
3957 
3958  if (_Dst.get_mipmap_levels() > 1)
3959  {
3960  throw runtime_exception("Invalid destination - multiple mipmap levels cannot be copied from source", E_INVALIDARG);
3961  }
3962 
3963  if (_Src_byte_size < _Get_section_size(_Dst, _Copy_extent))
3964  {
3965  if (_Dst.extent == _Copy_extent)
3966  {
3967  throw runtime_exception("Invalid _Src_byte_size argument. _Src_byte_size is smaller than the total size of _Dst.", E_INVALIDARG);
3968  }
3969  else
3970  {
3971  throw runtime_exception("Invalid _Src_byte_size argument. _Src_byte_size is smaller than the provided section of _Dst.", E_INVALIDARG);
3972  }
3973  }
3974 
3975  _Texture *_Dst_tex_ptr = _Get_texture(_Dst);
3976  std::array<size_t, 3> _Copy_extent_arr = _Get_dimensions(_Copy_extent, /*_Mip_offset=*/0);
3977  std::array<size_t, 3> _Dst_offset_arr = _Get_indices(_Dst_offset);
3978  auto _First = stdext::make_unchecked_array_iterator(reinterpret_cast<const unsigned char*>(_Src));
3979  auto _Last = stdext::make_unchecked_array_iterator(reinterpret_cast<const unsigned char*>(_Src) + _Src_byte_size);
3980 
3981  return _Copy_async_impl<decltype(_First), unsigned char>(_First, _Last, _Dst_tex_ptr, _Dst_offset_arr.data(), _Get_texture_descriptor(_Dst)._Get_most_detailed_mipmap_level(), _Copy_extent_arr.data());
3982 }
unsigned int _Get_section_size(const _Texture_base< _Value_type, _Rank > &_Tex, const extent< _Rank > &_Extent)
Definition: amp_graphics.h:3720
unchecked_array_iterator< _Iterator > make_unchecked_array_iterator(_Iterator _Ptr)
Definition: iterator:725
_Ret_ _Texture * _Get_texture(const _Texture_type &_Tex) __CPU_ONLY
Definition: xxamp.h:1100
std::array< size_t, 3 > _Get_dimensions(const Concurrency::extent< _Rank > &_Ext, unsigned int _Mip_offset)
Definition: amp_graphics.h:298
Definition: amprt.h:2152
unsigned int _Get_most_detailed_mipmap_level() const __GPU
Definition: amprt.h:659
static void _Is_valid_section(const _T2< _Rank > &_Base_extent, const _T1< _Rank > &_Section_origin, const _T2< _Rank > &_Section_extent) __CPU_ONLY
Definition: xxamp.h:1106
std::array< size_t, 3 > _Get_indices(const index< _Rank > &_Idx)
Definition: amp_graphics.h:329
_FwdIt _Last
Definition: algorithm:1936
const _Texture_descriptor & _Get_texture_descriptor(const _Texture_type &_Tex) __GPU
Definition: xxamp.h:1094
template<typename OutputIterator , typename _Value_type , int _Rank>
_Event Concurrency::graphics::details::_Copy_async_impl ( const _Texture_base< _Value_type, _Rank > &  _Src,
OutputIterator  _Dest_iter 
)
template<typename _Value_type , int _Rank>
_Event Concurrency::graphics::details::_Copy_async_impl ( const _Texture_base< _Value_type, _Rank > &  _Src,
const index< _Rank > &  _Src_offset,
const _Texture_base< _Value_type, _Rank > &  _Dst,
const index< _Rank > &  _Dst_offset,
const extent< _Rank > &  _Copy_extent 
)
4057 {
4058  _Is_valid_section(_Src.extent, _Src_offset, _Copy_extent);
4059  _Is_valid_section(_Dst.extent, _Dst_offset, _Copy_extent);
4060 
4061  _Texture_descriptor _Src_tex_desc = _Get_texture_descriptor(_Src);
4062  _Texture_descriptor _Dst_tex_desc = _Get_texture_descriptor(_Dst);
4063 
4064  if (_Src_tex_desc._Get_view_mipmap_levels() != _Dst_tex_desc._Get_view_mipmap_levels())
4065  {
4066  throw runtime_exception("The source and destination textures must have the exactly the same number of mipmap levels for texture copy.", E_INVALIDARG);
4067  }
4068 
4069  bool _Is_whole_texture_copy = (_Src_offset == _Dst_offset && _Src_offset == index<_Rank>() && _Src.extent == _Dst.extent && _Src.extent == _Copy_extent);
4070 
4071  if (_Src_tex_desc._Get_view_mipmap_levels() > 1 && !_Is_whole_texture_copy)
4072  {
4073  throw runtime_exception("Sections are not allowed when copy involves multiple mipmap levels", E_INVALIDARG);
4074  }
4075 
4076  if (_Src_tex_desc._Are_mipmap_levels_overlapping(&_Dst_tex_desc))
4077  {
4078  throw runtime_exception("The source and destination are overlapping areas on the same texture", E_INVALIDARG);
4079  }
4080 
4081  _Texture* _Src_tex = _Get_texture(_Src);
4082  _Texture* _Dst_tex = _Get_texture(_Dst);
4083 
4084  // Formats must be identical for non-adopted textures. Textures created through D3D interop are not subject to this test
4085  // to allow copy between related, but not identical, formats. Attempting to copy between unrelated formats through interop
4086  // will result in exceptions in debug mode and undefined behavior in release mode.
4087  if (!_Src_tex->_Is_adopted() && !_Dst_tex->_Is_adopted() && (_Src_tex->_Get_texture_format() != _Dst_tex->_Get_texture_format()))
4088  {
4089  throw runtime_exception("The source and destination textures are not compatible.", E_INVALIDARG);
4090  }
4091 
4092  std::array<size_t, 3> _Src_offset_arr = _Get_indices(_Src_offset);
4093  std::array<size_t, 3> _Dst_offset_arr = _Get_indices(_Dst_offset);
4094 
4095  _Event _Copy_event;
4096 
4097  unsigned int _Src_most_detailed_mipmap_level = _Src_tex_desc._Get_most_detailed_mipmap_level();
4098  unsigned int _Dst_most_detailed_mipmap_level = _Dst_tex_desc._Get_most_detailed_mipmap_level();
4099 
4100  // Copy all mipmap levels from source to destination one by one.
4101  // Note that the offsets are not allowed therefore only dimensions need to be updated for subsequent mipmap levels
4102  for (unsigned int _Mip_offset = 0; _Mip_offset < _Src_tex_desc._Get_view_mipmap_levels(); ++_Mip_offset)
4103  {
4104  std::array<size_t, 3> _Copy_extent_arr = _Get_dimensions(_Copy_extent, _Mip_offset);
4105 
4106  auto _Step_event = _Copy_async_impl(_Src_tex, _Src_offset_arr.data(), _Src_most_detailed_mipmap_level + _Mip_offset,
4107  _Dst_tex, _Dst_offset_arr.data(), _Dst_most_detailed_mipmap_level + _Mip_offset,
4108  _Copy_extent_arr.data());
4109 
4110  _Copy_event = _Copy_event._Add_event(_Step_event);
4111  }
4112 
4113  return _Copy_event;
4114 }
unsigned int _Get_texture_format() const
Definition: amprt.h:2230
_Event _Copy_async_impl(_Input_iterator _First, _Input_iterator _Last, const _Texture_base< _Value_type, _Rank > &_Dst, const index< _Rank > &_Dst_offset, const extent< _Rank > &_Copy_extent)
Definition: amp_graphics.h:4033
_Ret_ _Texture * _Get_texture(const _Texture_type &_Tex) __CPU_ONLY
Definition: xxamp.h:1100
std::array< size_t, 3 > _Get_dimensions(const Concurrency::extent< _Rank > &_Ext, unsigned int _Mip_offset)
Definition: amp_graphics.h:298
Definition: amprt.h:2152
bool _Is_adopted() const
Definition: amprt.h:2081
unsigned int _Get_most_detailed_mipmap_level() const __GPU
Definition: amprt.h:659
static void _Is_valid_section(const _T2< _Rank > &_Base_extent, const _T1< _Rank > &_Section_origin, const _T2< _Rank > &_Section_extent) __CPU_ONLY
Definition: xxamp.h:1106
_AMPIMP _Event _Add_event(_Event _Ev)
Creates an event which is an ordered collection of this and _Ev
std::array< size_t, 3 > _Get_indices(const index< _Rank > &_Idx)
Definition: amp_graphics.h:329
unsigned int _Get_view_mipmap_levels() const __GPU
Definition: amprt.h:664
bool _Are_mipmap_levels_overlapping(const _Texture_descriptor *_Other) const __CPU_ONLY
Definition: amprt.h:699
Definition: amprt.h:318
const _Texture_descriptor & _Get_texture_descriptor(const _Texture_type &_Tex) __GPU
Definition: xxamp.h:1094
template<typename _Input_iterator , typename _Value_type >
_Event Concurrency::graphics::details::_Copy_async_impl ( _Input_iterator  _First,
_Input_iterator  _Last,
_In_ _Texture _Dst,
const size_t _Dst_offset,
unsigned int  _Dst_mipmap_level,
const size_t _Copy_extent,
const size_t _Preferred_copy_chunk_extent = NULL 
)
3732 {
3733  _ASSERTE(_Dst != nullptr);
3734  _ASSERTE(_Dst_offset != nullptr);
3735  _ASSERTE(_Copy_extent != nullptr);
3736 
3737  _ASSERTE((unsigned int)std::distance(_First, _Last) >= (_Copy_extent[0] * _Copy_extent[1] * _Copy_extent[2]));
3738 
3739  // The copy region should be within the bounds of the destination texture
3740  _ASSERTE((_Dst_offset[0] + _Copy_extent[0]) <= _Dst->_Get_width(_Dst_mipmap_level));
3741  _ASSERTE((_Dst_offset[1] + _Copy_extent[1]) <= _Dst->_Get_height(_Dst_mipmap_level));
3742  _ASSERTE((_Dst_offset[2] + _Copy_extent[2]) <= _Dst->_Get_depth(_Dst_mipmap_level));
3743 
3744 #pragma warning( push )
3745 #pragma warning( disable : 4127 ) // conditional expression is constant
3746  if ((sizeof(_Value_type) > sizeof(unsigned char)) && (_Dst->_Get_bits_per_element() != (8U * sizeof(_Value_type))))
3747  {
3748  throw runtime_exception("Iterator-based copy is not supported on textures where the size of the _Value_type is not equal to the texel size.", E_INVALIDARG);
3749  }
3750 #pragma warning( pop )
3751 
3752  // If the dest is accessible on the host we can perform the copy entirely on the host
3753  if (_Dst->_Get_host_ptr() != NULL)
3754  {
3755  // We have made sure that the three multiplications below won't cause integer overflow when creating the texture
3756  _ASSERTE(((_Dst->_Get_bits_per_element() * _Copy_extent[0]) % (8U * sizeof(_Value_type))) == 0);
3757 
3758  size_t _Row_size = (_Dst->_Get_bits_per_element() * _Copy_extent[0]) >> 3; // in bytes
3759  size_t _Depth_slice_size = _Row_size * _Copy_extent[1];
3760 
3761  size_t _Row_pitch = _Dst->_Get_row_pitch();
3762  size_t _Depth_pitch = _Dst->_Get_depth_pitch();
3763  _ASSERTE(_Row_pitch >= _Row_size);
3764  _ASSERTE(_Depth_pitch >= _Depth_slice_size);
3765 
3766  size_t _Dst_offset_in_bytes = ((_Dst_offset[0] * _Dst->_Get_bits_per_element()) >> 3) +
3767  (_Dst_offset[1] * _Row_pitch) + (_Dst_offset[2] * _Depth_pitch);
3768 
3769  unsigned char *_PDest = reinterpret_cast<unsigned char*>(_Dst->_Get_host_ptr()) + _Dst_offset_in_bytes;
3770 
3771  _Copy_data_on_host_src_iter(_Dst->_Get_rank(), _First, reinterpret_cast<_Value_type*>(_PDest),
3772  _Row_size / sizeof(_Value_type), _Copy_extent[1], _Copy_extent[2],
3773  _Row_pitch, _Depth_pitch, _Row_size / sizeof(_Value_type), _Depth_slice_size / sizeof(_Value_type));
3774 
3775  return _Event();
3776  }
3777 
3778  // The dest is not accessible on the host; we need to copy src to
3779  // a temporary staging texture and launch a copy from the staging texture
3780  // to the dest texture.
3781  _Event _Ev;
3782 
3783  // Determine the copy chunk extent
3784  std::array<size_t, 3> _Copy_chunk_extent;
3785  if (_Preferred_copy_chunk_extent != NULL)
3786  {
3787  std::copy(&_Preferred_copy_chunk_extent[0], &_Preferred_copy_chunk_extent[3], _Copy_chunk_extent.begin());
3788  }
3789  else
3790  {
3791  _Get_preferred_copy_chunk_extent(_Dst->_Get_rank(), _Copy_extent[0], _Copy_extent[1], _Copy_extent[2], _Dst->_Get_bits_per_element(), _Copy_chunk_extent.data());
3792  }
3793 
3794  std::array<size_t, 3> _Curr_copy_offset;
3795  std::copy(&_Dst_offset[0], &_Dst_offset[3], _Curr_copy_offset.begin());
3796 
3797  std::array<size_t, 3> _Remaining_copy_extent;
3798  std::copy(&_Copy_extent[0], &_Copy_extent[3], _Remaining_copy_extent.begin());
3799 
3800  bool _Truncated_copy = false;
3801  do
3802  {
3803  _Texture_ptr _Dst_staging_tex_ptr;
3804  std::array<size_t, 3> _Curr_copy_extent;
3805  _Truncated_copy = _Get_chunked_staging_texture(_Dst, _Copy_chunk_extent.data(), _Remaining_copy_extent.data(), _Curr_copy_extent.data(), &_Dst_staging_tex_ptr);
3806 
3807 
3808  // Now copy from the src pointer to the temp staging texture
3809  _Dst_staging_tex_ptr->_Map_buffer(_Write_access, true /* _Wait */);
3810 
3811  std::array<size_t, 3> _Dst_staging_tex_offset;
3812  _Dst_staging_tex_offset.fill(0);
3813  _Event _Temp_ev = _Copy_async_impl<_Input_iterator, _Value_type>(_First, _Last, _Dst_staging_tex_ptr,
3814  _Dst_staging_tex_offset.data(), /*_Dst_mipmap_level=*/0, _Curr_copy_extent.data(), _Copy_chunk_extent.data());
3815 
3816  // Now chain a copy from the temporary staging texture to the _Dst texture
3817  _Texture_ptr _Dst_tex_ptr = _Dst;
3818  _Temp_ev = _Temp_ev._Add_continuation(std::function<_Event()>([_Dst_staging_tex_ptr, _Dst_tex_ptr, _Curr_copy_extent,
3819  _Dst_staging_tex_offset, _Curr_copy_offset, _Dst_mipmap_level]() mutable -> _Event
3820  {
3821  return _Dst_staging_tex_ptr->_Copy_to_async(_Dst_tex_ptr, _Curr_copy_extent.data(), _Dst_staging_tex_offset.data(), _Curr_copy_offset.data(), /*_Src_mipmap_level=*/0, _Dst_mipmap_level);
3822  }));
3823 
3824  _Ev = _Ev._Add_event(_Temp_ev);
3825 
3826  // Now adjust the _Src and _Dst offsets for the remaining part of the copy
3827  if (_Truncated_copy)
3828  {
3829  // The offset only needs to be adjusted in the most significant dimension
3830  _Curr_copy_offset[_Dst->_Get_rank() - 1] += _Curr_copy_extent[_Dst->_Get_rank() - 1];
3831  std::advance(_First, (((_Curr_copy_extent[0] * _Dst->_Get_bits_per_element()) >> 3) / sizeof(_Value_type)) * _Curr_copy_extent[1] * _Curr_copy_extent[2]);
3832  }
3833 
3834  } while (_Truncated_copy);
3835 
3836  return _Ev;
3837 }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2369
#define NULL
Definition: vcruntime.h:236
void _Get_preferred_copy_chunk_extent(unsigned int _Rank, size_t _Width, size_t _Height, size_t _Depth, size_t _Bits_per_element, _Out_writes_(3) size_t *_Preferred_copy_chunk_extent)
Definition: amprt.h:2619
_AMPIMP _Event _Add_continuation(const std::function< _Event __cdecl()> &_Continuation_task)
Creates an event which is an ordered collection of this and a continuation task
void _Copy_data_on_host_src_iter(int _Rank, _Input_iterator _Src, _Out_ _Value_type *_Dst, size_t _Width, size_t _Height, size_t _Depth, size_t _Dst_row_pitch_in_bytes, size_t _Dst_depth_pitch_in_bytes, size_t _Src_row_pitch, size_t _Src_depth_pitch)
Definition: amprt.h:2489
details::_Reference_counted_obj_ptr< details::_Texture > _Texture_ptr
Definition: amprt.h:309
bool _Get_chunked_staging_texture(_In_ _Texture *_Tex, const size_t *_Copy_chunk_extent, _Inout_ size_t *_Remaining_copy_extent, _Out_ size_t *_Curr_copy_extent, _Out_ _Texture_ptr *_Staging_texture)
Definition: amprt.h:2443
_Iter_diff_t< _InIt > distance(_InIt _First, _InIt _Last)
Definition: xutility:1124
_AMPIMP _Event _Add_event(_Event _Ev)
Creates an event which is an ordered collection of this and _Ev
void advance(_InIt &_Where, _Diff _Off)
Definition: xutility:1089
Definition: amprt.h:318
Definition: amprt.h:92
_FwdIt _Last
Definition: algorithm:1936
template<typename _Output_iterator , typename _Value_type >
_Event Concurrency::graphics::details::_Copy_async_impl ( _Texture _Tex,
const size_t _Tex_offset,
unsigned int  _Src_mipmap_level,
const size_t _Copy_extent,
_Output_iterator  _First,
const size_t _Preferred_copy_chunk_extent = NULL 
)
3841 {
3842  _ASSERTE(_Tex != nullptr);
3843  _ASSERTE(_Tex_offset != nullptr);
3844  _ASSERTE(_Copy_extent != nullptr);
3845 
3846  // The copy region should be within the bounds of the source texture
3847  _ASSERTE((_Tex_offset[0] + _Copy_extent[0]) <= _Tex->_Get_width(_Src_mipmap_level));
3848  _ASSERTE((_Tex_offset[1] + _Copy_extent[1]) <= _Tex->_Get_height(_Src_mipmap_level));
3849  _ASSERTE((_Tex_offset[2] + _Copy_extent[2]) <= _Tex->_Get_depth(_Src_mipmap_level));
3850 
3851 #pragma warning( push )
3852 #pragma warning( disable : 4127 ) // conditional expression is constant
3853  if ((sizeof(_Value_type) > sizeof(unsigned char)) && (_Tex->_Get_bits_per_element() != (8U * sizeof(_Value_type))))
3854  {
3855  throw runtime_exception("Iterator-based copy is not supported on textures where the size of the _Value_type is not equal to the texel size.", E_INVALIDARG);
3856  }
3857 #pragma warning( pop )
3858 
3859  // If the texture is available on the host then we can perform the copy entirely on the host
3860  if (_Tex->_Get_host_ptr() != nullptr)
3861  {
3862  // We have made sure that the three multiplications below won't cause integer overflow when creating the texture
3863  _ASSERTE(((_Tex->_Get_bits_per_element() * _Copy_extent[0]) % 8U) == 0);
3864 
3865  size_t _Row_size = (_Tex->_Get_bits_per_element() * _Copy_extent[0]) >> 3; // in bytes
3866  size_t _Depth_slice_size = _Row_size * _Copy_extent[1];
3867 
3868  size_t _Row_pitch = _Tex->_Get_row_pitch();
3869  size_t _Depth_pitch = _Tex->_Get_depth_pitch();
3870  _ASSERTE(_Row_pitch >= _Row_size);
3871  _ASSERTE(_Depth_pitch >= _Depth_slice_size);
3872 
3873  size_t _Tex_offset_in_bytes = ((_Tex_offset[0] * _Tex->_Get_bits_per_element()) >> 3) +
3874  (_Tex_offset[1] * _Row_pitch) + (_Tex_offset[2] * _Depth_pitch);
3875 
3876  unsigned char *_PTex = reinterpret_cast<unsigned char*>(_Tex->_Get_host_ptr()) + _Tex_offset_in_bytes;
3877 
3878  _Copy_data_on_host_dst_iter(_Tex->_Get_rank(), reinterpret_cast<_Value_type*>(_PTex), _First,
3879  _Row_size / sizeof(_Value_type), _Copy_extent[1], _Copy_extent[2],
3880  _Row_pitch, _Depth_pitch, _Row_size / sizeof(_Value_type), _Depth_slice_size / sizeof(_Value_type));
3881 
3882  return _Event();
3883  }
3884 
3885  // The texture is not accessible on the host; we need to copy to/from a staging
3886  // texture before the copy to the destination. This is done in chunks, such that
3887  // we can concurrently copy from the source texture to a staging texture while
3888  // copying from a staging texture from a previous chunk to the destination.
3889  _Event _Ev;
3890 
3891  // Determine the copy chunk extent
3892  std::array<size_t, 3> _Copy_chunk_extent;
3893  if (_Preferred_copy_chunk_extent != nullptr)
3894  {
3895  std::copy(&_Preferred_copy_chunk_extent[0], &_Preferred_copy_chunk_extent[3], _Copy_chunk_extent.begin());
3896  }
3897  else
3898  {
3899  _Get_preferred_copy_chunk_extent(_Tex->_Get_rank(), _Copy_extent[0], _Copy_extent[1], _Copy_extent[2], _Tex->_Get_bits_per_element(), _Copy_chunk_extent.data());
3900  }
3901 
3902  std::array<size_t, 3> _Curr_copy_offset;
3903  std::copy(&_Tex_offset[0], &_Tex_offset[3], _Curr_copy_offset.begin());
3904 
3905  std::array<size_t, 3> _Remaining_copy_extent;
3906  std::copy(&_Copy_extent[0], &_Copy_extent[3], _Remaining_copy_extent.begin());
3907 
3908  bool _Truncated_copy = false;
3909 
3910  _Texture_ptr _Staging_tex_ptr;
3911  std::array<size_t, 3> _Curr_copy_extent;
3912  _Truncated_copy = _Get_chunked_staging_texture(_Tex, _Copy_chunk_extent.data(), _Remaining_copy_extent.data(), _Curr_copy_extent.data(), &_Staging_tex_ptr);
3913 
3914  // Now copy into the temp staging texture
3915  std::array<size_t, 3> _Staging_tex_offset;
3916  _Staging_tex_offset.fill(0);
3917  _Event _Temp_ev = _Copy_async_impl(_Tex, _Curr_copy_offset.data(), _Src_mipmap_level,
3918  _Staging_tex_ptr._Get_ptr(), _Staging_tex_offset.data(), /*_Dst_mipmap_level=*/0,
3919  _Curr_copy_extent.data(), _Copy_chunk_extent.data());
3920  _Ev = _Ev._Add_event(_Temp_ev);
3921 
3922  // If we have finished our copy, we just need to add a continuation to copy
3923  // from the temporary staging texture to the _Dst pointer
3924  if (!_Truncated_copy)
3925  {
3926  return _Ev._Add_continuation(std::function<_Event()>([_Staging_tex_ptr,
3927  _Curr_copy_extent, _Staging_tex_offset, _Copy_chunk_extent, _First]() mutable -> _Event
3928  {
3929  return _Copy_async_impl<_Output_iterator, _Value_type>(_Staging_tex_ptr, _Staging_tex_offset.data(), /*_Src_mipmap_level=*/0, _Curr_copy_extent.data(), _First, _Copy_chunk_extent.data());
3930  }));
3931  }
3932  else
3933  {
3934  // The copy was truncated. We need to recursively perform the rest of the copy
3935  _Texture_ptr _Tex_ptr = _Tex;
3936  _Curr_copy_offset[_Tex->_Get_rank() - 1] += _Curr_copy_extent[_Tex->_Get_rank() - 1];
3937  return _Ev._Add_continuation(std::function<_Event()>([_Staging_tex_ptr, _First, _Curr_copy_extent,
3938  _Staging_tex_offset, _Tex_ptr, _Curr_copy_offset, _Remaining_copy_extent, _Copy_chunk_extent, _Src_mipmap_level]() mutable -> _Event
3939  {
3940  // Initiate copying of the remaining portion
3941  _Output_iterator _New_dst_iter = _First;
3942  _Advance_output_iterator<decltype(_New_dst_iter), size_t>(_New_dst_iter, (((_Curr_copy_extent[0] * _Tex_ptr->_Get_bits_per_element()) >> 3) / sizeof(_Value_type)) * _Curr_copy_extent[1] * _Curr_copy_extent[2]);
3943  _Event _Ev1 = _Copy_async_impl<_Output_iterator, _Value_type>(_Tex_ptr, _Curr_copy_offset.data(), _Src_mipmap_level, _Remaining_copy_extent.data(), _New_dst_iter, _Copy_chunk_extent.data());
3944 
3945  // Now copy the data from the temp staging buffer to the _Dst pointer
3946  _Event _Ev2 = _Copy_async_impl<_Output_iterator, _Value_type>(_Staging_tex_ptr, _Staging_tex_offset.data(), /*_Src_mipmap_level=*/0, _Curr_copy_extent.data(), _First, _Copy_chunk_extent.data());
3947 
3948  return _Ev2._Add_event(_Ev1);
3949  }));
3950  }
3951 }
unsigned int _Get_bits_per_element() const
Definition: amprt.h:2251
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2369
void _Get_preferred_copy_chunk_extent(unsigned int _Rank, size_t _Width, size_t _Height, size_t _Depth, size_t _Bits_per_element, _Out_writes_(3) size_t *_Preferred_copy_chunk_extent)
Definition: amprt.h:2619
_AMPIMP _Event _Add_continuation(const std::function< _Event __cdecl()> &_Continuation_task)
Creates an event which is an ordered collection of this and a continuation task
_Event _Copy_async_impl(_Input_iterator _First, _Input_iterator _Last, const _Texture_base< _Value_type, _Rank > &_Dst, const index< _Rank > &_Dst_offset, const extent< _Rank > &_Copy_extent)
Definition: amp_graphics.h:4033
details::_Reference_counted_obj_ptr< details::_Texture > _Texture_ptr
Definition: amprt.h:309
bool _Get_chunked_staging_texture(_In_ _Texture *_Tex, const size_t *_Copy_chunk_extent, _Inout_ size_t *_Remaining_copy_extent, _Out_ size_t *_Curr_copy_extent, _Out_ _Texture_ptr *_Staging_texture)
Definition: amprt.h:2443
size_t _Get_row_pitch() const
Definition: amprt.h:2311
void _Copy_data_on_host_dst_iter(int _Rank, const _Value_type *_Src, _Output_iterator _Dst, size_t _Width, size_t _Height, size_t _Depth, size_t _Src_row_pitch_in_bytes, size_t _Src_depth_pitch_in_bytes, size_t _Dst_row_pitch, size_t _Dst_depth_pitch)
Definition: amprt.h:2553
size_t _Get_depth(unsigned int _Mip_offset=0) const
Definition: amprt.h:2220
_AMPIMP _Event _Add_event(_Event _Ev)
Creates an event which is an ordered collection of this and _Ev
_Ret_ void * _Get_host_ptr() const
Definition: amprt.h:2019
unsigned int _Get_rank() const
Definition: amprt.h:2225
size_t _Get_depth_pitch() const
Definition: amprt.h:2321
size_t _Get_height(unsigned int _Mip_offset=0) const
Definition: amprt.h:2215
Definition: amprt.h:318
size_t _Get_width(unsigned int _Mip_offset=0) const
Definition: amprt.h:2210
template<typename _Value_type , int _Rank>
_Event Concurrency::graphics::details::_Copy_async_impl ( const _Texture_base< _Value_type, _Rank > &  _Src,
const index< _Rank > &  _Src_offset,
const extent< _Rank > &  _Copy_extent,
_Out_ void _Dst,
unsigned int  _Dst_byte_size 
)
3986 {
3987  _Is_valid_section(_Src.extent, _Src_offset, _Copy_extent);
3988 
3989  if (_Src.get_mipmap_levels() > 1)
3990  {
3991  throw runtime_exception("Invalid source - multiple mipmap levels cannot be copied to destination", E_INVALIDARG);
3992  }
3993 
3994  if (_Get_section_size(_Src, _Copy_extent) > _Dst_byte_size)
3995  {
3996  if (_Src.extent == _Copy_extent)
3997  {
3998  throw runtime_exception("Invalid _Dst_byte_size argument. _Dst_byte_size is smaller than the size of _Src.", E_INVALIDARG);
3999  }
4000  else
4001  {
4002  throw runtime_exception("Invalid _Dst_byte_size argument. _Dst_byte_size is smaller than the provided section of _Src.", E_INVALIDARG);
4003  }
4004  }
4005 
4006  _Texture *_Src_tex_ptr = _Get_texture(_Src);
4007  std::array<size_t, 3> _Copy_extent_arr = _Get_dimensions(_Copy_extent, /*_Mip_offset=*/0);
4008  std::array<size_t, 3> _Src_offset_arr = _Get_indices(_Src_offset);
4009 
4010  auto _First = stdext::make_unchecked_array_iterator(reinterpret_cast<unsigned char*>(_Dst));
4011 
4012  return _Copy_async_impl<decltype(_First), unsigned char>(_Src_tex_ptr, _Src_offset_arr.data(), _Get_texture_descriptor(_Src)._Get_most_detailed_mipmap_level(), _Copy_extent_arr.data(), _First);
4013 }
unsigned int _Get_section_size(const _Texture_base< _Value_type, _Rank > &_Tex, const extent< _Rank > &_Extent)
Definition: amp_graphics.h:3720
unchecked_array_iterator< _Iterator > make_unchecked_array_iterator(_Iterator _Ptr)
Definition: iterator:725
_Ret_ _Texture * _Get_texture(const _Texture_type &_Tex) __CPU_ONLY
Definition: xxamp.h:1100
std::array< size_t, 3 > _Get_dimensions(const Concurrency::extent< _Rank > &_Ext, unsigned int _Mip_offset)
Definition: amp_graphics.h:298
Definition: amprt.h:2152
unsigned int _Get_most_detailed_mipmap_level() const __GPU
Definition: amprt.h:659
static void _Is_valid_section(const _T2< _Rank > &_Base_extent, const _T1< _Rank > &_Section_origin, const _T2< _Rank > &_Section_extent) __CPU_ONLY
Definition: xxamp.h:1106
std::array< size_t, 3 > _Get_indices(const index< _Rank > &_Idx)
Definition: amp_graphics.h:329
const _Texture_descriptor & _Get_texture_descriptor(const _Texture_type &_Tex) __GPU
Definition: xxamp.h:1094
template<typename _Output_iterator , typename _Value_type , int _Rank>
_Event Concurrency::graphics::details::_Copy_async_impl ( const _Texture_base< _Value_type, _Rank > &  _Src,
const index< _Rank > &  _Src_offset,
const extent< _Rank > &  _Copy_extent,
_Output_iterator  _Dest_iter 
)
4017 {
4018  _Is_valid_section(_Src.extent, _Src_offset, _Copy_extent);
4019 
4020  if (_Src.get_mipmap_levels() > 1)
4021  {
4022  throw runtime_exception("Invalid source - multiple mipmap levels cannot be copied to destination", E_INVALIDARG);
4023  }
4024 
4025  _Texture *_Src_tex_ptr = _Get_texture(_Src);
4026  std::array<size_t, 3> _Copy_extent_arr = _Get_dimensions(_Copy_extent, /*_Mip_offset=*/0);
4027  std::array<size_t, 3> _Src_offset_arr = _Get_indices(_Src_offset);
4028 
4029  return _Copy_async_impl<_Output_iterator, _Value_type>(_Src_tex_ptr, _Src_offset_arr.data(), _Get_texture_descriptor(_Src)._Get_most_detailed_mipmap_level(), _Copy_extent_arr.data(), _Dest_iter);
4030 }
_Ret_ _Texture * _Get_texture(const _Texture_type &_Tex) __CPU_ONLY
Definition: xxamp.h:1100
std::array< size_t, 3 > _Get_dimensions(const Concurrency::extent< _Rank > &_Ext, unsigned int _Mip_offset)
Definition: amp_graphics.h:298
Definition: amprt.h:2152
unsigned int _Get_most_detailed_mipmap_level() const __GPU
Definition: amprt.h:659
static void _Is_valid_section(const _T2< _Rank > &_Base_extent, const _T1< _Rank > &_Section_origin, const _T2< _Rank > &_Section_extent) __CPU_ONLY
Definition: xxamp.h:1106
std::array< size_t, 3 > _Get_indices(const index< _Rank > &_Idx)
Definition: amp_graphics.h:329
const _Texture_descriptor & _Get_texture_descriptor(const _Texture_type &_Tex) __GPU
Definition: xxamp.h:1094
template<typename _Input_iterator , typename _Value_type , int _Rank>
_Event Concurrency::graphics::details::_Copy_async_impl ( _Input_iterator  _First,
_Input_iterator  _Last,
const _Texture_base< _Value_type, _Rank > &  _Dst,
const index< _Rank > &  _Dst_offset,
const extent< _Rank > &  _Copy_extent 
)
4034 {
4035  _Is_valid_section(_Dst.extent, _Dst_offset, _Copy_extent);
4036  if (static_cast<unsigned int>(std::distance(_First, _Last)) < _Copy_extent.size())
4037  {
4038  throw runtime_exception("Inadequate amount of data supplied through the iterators", E_INVALIDARG);
4039  }
4040 
4041  if (_Dst.get_mipmap_levels() > 1)
4042  {
4043  throw runtime_exception("Invalid destination - multiple mipmap levels cannot be copied from source", E_INVALIDARG);
4044  }
4045 
4046  std::array<size_t, 3> _Copy_extent_arr = _Get_dimensions(_Copy_extent, /*_Mip_offset=*/0);
4047  std::array<size_t, 3> _Dst_offset_arr = _Get_indices(_Dst_offset);
4048 
4049  _Texture *_Dst_tex_ptr = _Get_texture(_Dst);
4050  return _Copy_async_impl<_Input_iterator, _Value_type>(_First, _Last, _Dst_tex_ptr, _Dst_offset_arr.data(), _Get_texture_descriptor(_Dst)._Get_most_detailed_mipmap_level(), _Copy_extent_arr.data());
4051 }
_Ret_ _Texture * _Get_texture(const _Texture_type &_Tex) __CPU_ONLY
Definition: xxamp.h:1100
std::array< size_t, 3 > _Get_dimensions(const Concurrency::extent< _Rank > &_Ext, unsigned int _Mip_offset)
Definition: amp_graphics.h:298
Definition: amprt.h:2152
unsigned int _Get_most_detailed_mipmap_level() const __GPU
Definition: amprt.h:659
static void _Is_valid_section(const _T2< _Rank > &_Base_extent, const _T1< _Rank > &_Section_origin, const _T2< _Rank > &_Section_extent) __CPU_ONLY
Definition: xxamp.h:1106
_Iter_diff_t< _InIt > distance(_InIt _First, _InIt _Last)
Definition: xutility:1124
std::array< size_t, 3 > _Get_indices(const index< _Rank > &_Idx)
Definition: amp_graphics.h:329
_FwdIt _Last
Definition: algorithm:1936
const _Texture_descriptor & _Get_texture_descriptor(const _Texture_type &_Tex) __GPU
Definition: xxamp.h:1094
template<int _Rank>
Concurrency::extent<_Rank> Concurrency::graphics::details::_Create_extent ( size_t  _Width,
size_t  _Height,
size_t  _Depth 
)
361 {
362  extent<_Rank> _Ext;
363  switch((_Rank)) {
364  case 1:
365  _Ext[0] = static_cast<int>(_Width);
366  break;
367  case 2:
368  _Ext[0] = static_cast<int>(_Height);
369  _Ext[1] = static_cast<int>(_Width);
370  break;
371  case 3:
372  _Ext[0] = static_cast<int>(_Depth);
373  _Ext[1] = static_cast<int>(_Height);
374  _Ext[2] = static_cast<int>(_Width);
375  break;
376  default:
377  _ASSERTE(false);
378  break;
379  }
380  return _Ext;
381 }
Definition: type_traits:974
template<typename _Short_vector_type >
unsigned int Concurrency::graphics::details::_Get_default_bits_per_scalar_element ( )
291 {
292  return _Short_vector_type_traits<_Short_vector_type>::_Format_base_type_id == _Double_type ?
293  _Short_vector_type_traits<_Short_vector_type>::_Default_bits_per_channel * 2 :
294  _Short_vector_type_traits<_Short_vector_type>::_Default_bits_per_channel;
295 }
Definition: amprt.h:298
template<int _Rank>
std::array<size_t, 3> Concurrency::graphics::details::_Get_dimensions ( const Concurrency::extent< _Rank > &  _Ext,
unsigned int  _Mip_offset 
)
299 {
300  std::array<size_t, 3> _Arr;
301  // For un-used dimensions, use value 1.
302  switch((_Rank)) {
303  case 1:
304  _Arr[0] = static_cast<size_t>((_Ext[0] >> _Mip_offset) ? (_Ext[0] >> _Mip_offset) : 1U);
305  _Arr[1] = 1;
306  _Arr[2] = 1;
307  break;
308  case 2:
309  _Arr[0] = static_cast<size_t>((_Ext[1] >> _Mip_offset) ? (_Ext[1] >> _Mip_offset) : 1U);
310  _Arr[1] = static_cast<size_t>((_Ext[0] >> _Mip_offset) ? (_Ext[0] >> _Mip_offset) : 1U);
311  _Arr[2] = 1;
312  break;
313  case 3:
314  _Arr[0] = static_cast<size_t>((_Ext[2] >> _Mip_offset) ? (_Ext[2] >> _Mip_offset) : 1U);
315  _Arr[1] = static_cast<size_t>((_Ext[1] >> _Mip_offset) ? (_Ext[1] >> _Mip_offset) : 1U);
316  _Arr[2] = static_cast<size_t>((_Ext[0] >> _Mip_offset) ? (_Ext[0] >> _Mip_offset) : 1U);
317  break;
318  default:
319  _ASSERTE(false);
320  _Arr[0] = 1;
321  _Arr[1] = 1;
322  _Arr[2] = 1;
323  break;
324  }
325  return _Arr;
326 }
template<int _Rank>
std::array<size_t, 3> Concurrency::graphics::details::_Get_indices ( const index< _Rank > &  _Idx)
330 {
331  std::array<size_t, 3> _Arr;
332  // For un-used dimensions, use value 0.
333  switch((_Rank)) {
334  case 1:
335  _Arr[0] = static_cast<size_t>(_Idx[0]);
336  _Arr[1] = 0;
337  _Arr[2] = 0;
338  break;
339  case 2:
340  _Arr[0] = static_cast<size_t>(_Idx[1]);
341  _Arr[1] = static_cast<size_t>(_Idx[0]);
342  _Arr[2] = 0;
343  break;
344  case 3:
345  _Arr[0] = static_cast<size_t>(_Idx[2]);
346  _Arr[1] = static_cast<size_t>(_Idx[1]);
347  _Arr[2] = static_cast<size_t>(_Idx[0]);
348  break;
349  default:
350  _ASSERTE(false);
351  _Arr[0] = 0;
352  _Arr[1] = 0;
353  _Arr[2] = 0;
354  break;
355  }
356  return _Arr;
357 }
template<typename _Value_type , int _Rank>
unsigned int Concurrency::graphics::details::_Get_section_size ( const _Texture_base< _Value_type, _Rank > &  _Tex,
const extent< _Rank > &  _Extent 
)
3721 {
3722  _Texture* _Tex_ptr = _Get_texture(_Tex);
3723  _Texture_descriptor _Tex_desc = _Get_texture_descriptor(_Tex);
3724 
3725  return _Tex_ptr->_Get_data_length(_Tex_desc._Get_most_detailed_mipmap_level(), _Tex_desc._Get_view_mipmap_levels(), _Get_dimensions(_Extent, /*Mip_offset=*/0).data());
3726 }
_Ret_ _Texture * _Get_texture(const _Texture_type &_Tex) __CPU_ONLY
Definition: xxamp.h:1100
std::array< size_t, 3 > _Get_dimensions(const Concurrency::extent< _Rank > &_Ext, unsigned int _Mip_offset)
Definition: amp_graphics.h:298
Definition: amprt.h:2152
unsigned int _Get_most_detailed_mipmap_level() const __GPU
Definition: amprt.h:659
unsigned int _Get_view_mipmap_levels() const __GPU
Definition: amprt.h:664
unsigned int _Get_data_length(unsigned int _Most_detailed_mipmap_level, unsigned int _View_mipmap_levels, const size_t *_Extents=nullptr) const
Definition: amprt.h:2256
const _Texture_descriptor & _Get_texture_descriptor(const _Texture_type &_Tex) __GPU
Definition: xxamp.h:1094
void Concurrency::graphics::details::_Is_valid_data_length ( unsigned int  _Num_elems,
unsigned int  _Bits_per_elem 
)
inline
597 {
598  unsigned long long _Bytes_per_elem = static_cast<unsigned long long>(_Bits_per_elem / 8U);
599  unsigned long long _Total_bytes = static_cast<unsigned long long>(_Num_elems) * _Bytes_per_elem;
600  if (_Total_bytes > static_cast<unsigned long long>(UINT_MAX))
601  {
602  throw runtime_exception("Invalid - texture data_length exceeds UINT_MAX", E_INVALIDARG);
603  }
604 }
#define UINT_MAX
Definition: limits.h:36
template<int _Rank>
Concurrency::extent<_Rank> Concurrency::graphics::details::_Make_texture ( const Concurrency::accelerator_view _Av,
_In_ IUnknown *  _D3D_texture,
_Texture_base_type_id  _Id,
_Inout_ _Texture **  _Tex,
DXGI_FORMAT  _View_format 
)
4780 {
4781  if (_D3D_texture == NULL)
4782  {
4783  throw runtime_exception("NULL D3D texture pointer.", E_INVALIDARG);
4784  }
4785 
4787  throw runtime_exception("Cannot create D3D texture on a non-D3D accelerator_view.", E_INVALIDARG);
4788  }
4789 
4790  _Texture * _Tex_ptr = _Texture::_Adopt_texture(_Rank, _Id, _D3D_texture, _Av, _View_format);
4791  if (_Tex_ptr->_Is_staging())
4792  {
4793  _Tex_ptr->_Map_buffer(_Write_access, true /* _Wait */);
4794  }
4795  Concurrency::extent<_Rank> _Ext = Concurrency::graphics::details::_Create_extent<_Rank>(_Tex_ptr->_Get_width(), _Tex_ptr->_Get_height(), _Tex_ptr->_Get_depth());
4796 
4797  _Is_valid_extent(_Ext);
4799 
4800  *_Tex = _Tex_ptr;
4801  return _Ext;
4802 }
unsigned int _Get_bits_per_element() const
Definition: amprt.h:2251
#define NULL
Definition: vcruntime.h:236
static void _Is_valid_extent(const _T< _Rank > &_Tuple) __CPU_ONLY
Definition: xxamp.h:1195
unsigned int size() const __GPU
Returns the total linear size of this extent (in units of elements).
Definition: amp.h:521
size_t _Get_depth(unsigned int _Mip_offset=0) const
Definition: amprt.h:2220
Definition: amprt.h:2152
_AMPIMP bool __cdecl _Is_D3D_accelerator_view(const accelerator_view &_Av)
_AMPIMP void _Map_buffer(_Access_mode _Map_type, bool _Wait)
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
size_t _Get_height(unsigned int _Mip_offset=0) const
Definition: amprt.h:2215
void _Is_valid_data_length(unsigned int _Num_elems, unsigned int _Bits_per_elem)
Definition: amp_graphics.h:596
Definition: amprt.h:92
size_t _Get_width(unsigned int _Mip_offset=0) const
Definition: amprt.h:2210
bool _Is_staging() const
Definition: amprt.h:2051