20 #include <dxgiformat.h>
23 #define _AMP_GRAPHICS_H
34 #pragma warning( push )
35 #pragma warning( disable : 6326 ) // Potential comparison of a constant with another constant
37 template<
typename _Ty>
289 template<
typename _Short_vector_type>
300 std::array<size_t, 3> _Arr;
304 _Arr[0] =
static_cast<size_t>((_Ext[0] >> _Mip_offset) ? (_Ext[0] >> _Mip_offset) : 1U);
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);
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);
331 std::array<size_t, 3> _Arr;
335 _Arr[0] =
static_cast<size_t>(_Idx[0]);
340 _Arr[0] =
static_cast<size_t>(_Idx[1]);
341 _Arr[1] =
static_cast<size_t>(_Idx[0]);
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]);
365 _Ext[0] =
static_cast<int>(_Width);
368 _Ext[0] =
static_cast<int>(_Height);
369 _Ext[1] =
static_cast<int>(_Width);
372 _Ext[0] =
static_cast<int>(_Depth);
373 _Ext[1] =
static_cast<int>(_Height);
374 _Ext[2] =
static_cast<int>(_Width);
385 template <
typename _Value_type,
int _Rank>
387 template <
typename OutputIterator,
typename _Value_type,
int _Rank>
390 template<
typename _Value_type,
int _Rank>
395 template <
typename _Value_type,
int _Rank>
398 static_assert(_Rank > 0 && _Rank <= 3,
"texture is only supported for rank 1, 2, and 3.");
399 static_assert(
_Short_vector_type_traits<
typename std::remove_const<_Value_type>::type>::_Is_valid_SVT_for_texture,
"invalid value_type for a texture.");
402 template<
typename _T>
404 template<
typename _T>
406 template<
typename _Value_type,
int _Rank>
436 _Err_msg <<
"Value for _Mipmap_level parameter (" << _Mipmap_level
437 <<
") cannot be greater than or equal to number of mipmap levels ("
516 if (_Mipmap_levels > _Max_mipmap_levels)
519 _Err_msg <<
"The texture extent is too small to generate (" << _Mipmap_levels <<
") mipmap levels, the maximum allowed is (" << _Max_mipmap_levels <<
")";
522 else if (_Mipmap_levels == 0)
526 _Mipmap_levels = _Max_mipmap_levels;
528 _M_texture_descriptor._Set_view_mipmap_levels(_Mipmap_levels);
560 if (!(*
this == _Dest))
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))
602 throw runtime_exception(
"Invalid - texture data_length exceeds UINT_MAX", E_INVALIDARG);
606 template<
typename _Iterator>
611 static constexpr
bool value = decltype(
_Fn(std::declval<_Iterator>(),0))::value;
620 template <
typename _Value_type,
int _Rank>
622 template <
typename _Value_type,
int _Rank>
624 template <
typename _Value_type,
int _Rank>
630 template<
typename _Value_type,
int _Rank>
653 template<
typename _Value_type,
int _Rank>
656 static_assert(!std::is_const<_Value_type>::value,
"const value type is not supported for texture.");
683 static_assert(_Rank == 1,
"texture(int) is only permissible on texture<value_type, 1>.");
701 static_assert(_Rank == 2,
"texture(int, int) is only permissible on texture<value_type, 2>.");
722 static_assert(_Rank == 3,
"texture(int, int, int) is only permissible on texture<value_type, 3>.");
780 static_assert(_Rank == 1,
"texture(int, accelerator_view) is only permissible on texture<value_type, 1>.");
804 static_assert(_Rank == 1,
"texture(int, accelerator_view, accelerator_view) is only permissible on texture<value_type, 1>.");
825 static_assert(_Rank == 2,
"texture(int, int, accelerator_view) is only permissible on texture<value_type, 2>.");
852 static_assert(_Rank == 2,
"texture(int, int, accelerator_view, accelerator_view) is only permissible on texture<value_type, 2>.");
876 static_assert(_Rank == 3,
"texture(int, int, int, accelerator_view) is only permissible on texture<value_type, 3>.");
906 static_assert(_Rank == 3,
"texture(int, int, int, accelerator_view, accelerator_view) is only permissible on texture<value_type, 3>.");
924 template<
typename _Input_iterator,
925 typename =
typename std::enable_if<details::_Is_iterator<_Input_iterator>::value>::type>
946 template<
typename _Input_iterator,
947 typename =
typename std::enable_if<details::_Is_iterator<_Input_iterator>::value>::type>
948 texture(
int _E0, _Input_iterator _Src_first, _Input_iterator _Src_last) __CPU_ONLY
951 static_assert(_Rank == 1,
"texture(int, iterator, iterator) is only permissible on texture<value_type, 1>.");
972 template<
typename _Input_iterator,
973 typename =
typename std::enable_if<details::_Is_iterator<_Input_iterator>::value>::type>
974 texture(
int _E0,
int _E1, _Input_iterator _Src_first, _Input_iterator _Src_last) __CPU_ONLY
977 static_assert(_Rank == 2,
"texture(int, int, iterator, iterator) is only permissible on texture<value_type, 2>.");
1002 template<
typename _Input_iterator,
1003 typename =
typename std::enable_if<details::_Is_iterator<_Input_iterator>::value>::type>
1004 texture(
int _E0,
int _E1,
int _E2, _Input_iterator _Src_first, _Input_iterator _Src_last) __CPU_ONLY
1007 static_assert(_Rank == 3,
"texture(int, int, int, iterator, iterator) is only permissible on texture<value_type, 3>.");
1028 template<
typename _Input_iterator,
1029 typename =
typename std::enable_if<details::_Is_iterator<_Input_iterator>::value>::type>
1059 template<
typename _Input_iterator,
1060 typename =
typename std::enable_if<details::_Is_iterator<_Input_iterator>::value>::type>
1066 _Initialize(_Av, _Associated_av, _Src_first, _Src_last);
1084 template<
typename _Input_iterator,
1085 typename =
typename std::enable_if<details::_Is_iterator<_Input_iterator>::value>::type>
1089 static_assert(_Rank == 1,
"texture(int, iterator, iterator, accelerator_view) is only permissible on texture<value_type, 1>.");
1116 template<
typename _Input_iterator,
1117 typename =
typename std::enable_if<details::_Is_iterator<_Input_iterator>::value>::type>
1121 static_assert(_Rank == 1,
"texture(int, iterator, iterator, accelerator_view, accelerator_view) is only permissible on texture<value_type, 1>.");
1124 _Initialize(_Av, _Associated_av, _Src_first, _Src_last);
1145 template<
typename _Input_iterator,
1146 typename =
typename std::enable_if<details::_Is_iterator<_Input_iterator>::value>::type>
1150 static_assert(_Rank == 2,
"texture(int, int, iterator, iterator, accelerator_view) is only permissible on texture<value_type, 2>.");
1180 template<
typename _Input_iterator,
1181 typename =
typename std::enable_if<details::_Is_iterator<_Input_iterator>::value>::type>
1185 static_assert(_Rank == 2,
"texture(int, int, iterator, iterator, accelerator_view, accelerator_view) is only permissible on texture<value_type, 2>.");
1188 _Initialize(_Av, _Associated_av, _Src_first, _Src_last);
1212 template<
typename _Input_iterator,
1213 typename =
typename std::enable_if<details::_Is_iterator<_Input_iterator>::value>::type>
1217 static_assert(_Rank == 3,
"texture(int, int, int, iterator, iterator, accelerator_view) is only permissible on texture<value_type, 3>.");
1250 template<
typename _Input_iterator,
1251 typename =
typename std::enable_if<details::_Is_iterator<_Input_iterator>::value>::type>
1255 static_assert(_Rank == 3,
"texture(int, int, int, iterator, iterator, accelerator_view, accelerator_view) is only permissible on texture<value_type, 3>.");
1258 _Initialize(_Av, _Associated_av, _Src_first, _Src_last);
1313 texture(
int _E0,
unsigned int _Bits_per_scalar_element) __CPU_ONLY
1316 static_assert(_Rank == 1,
"texture(int, unsigned int) is only permissible on texture<value_type, 1>.");
1335 texture(
int _E0,
int _E1,
unsigned int _Bits_per_scalar_element) __CPU_ONLY
1338 static_assert(_Rank == 2,
"texture(int, int, unsigned int) is only permissible on texture<value_type, 2>.");
1363 texture(
int _E0,
int _E1,
int _E2,
unsigned int _Bits_per_scalar_element) __CPU_ONLY
1366 static_assert(_Rank == 3,
"texture(int, int, int, unsigned int) is only permissible on texture<value_type, 3>.");
1441 _Initialize(_Av, _Associated_av, _Bits_per_scalar_element);
1462 static_assert(_Rank == 1,
"texture(int, unsigned int, accelerator_view) is only permissible on texture<value_type, 1>.");
1490 static_assert(_Rank == 1,
"texture(int, unsigned int, accelerator_view, accelerator_view) is only permissible on texture<value_type, 1>.");
1491 _Initialize(_Av, _Associated_av, _Bits_per_scalar_element);
1515 static_assert(_Rank == 2,
"texture(int, int, unsigned int, accelerator_view) is only permissible on texture<value_type, 2>.");
1546 static_assert(_Rank == 2,
"texture(int, int, unsigned int, accelerator_view, accelerator_view) is only permissible on texture<value_type, 2>.");
1547 _Initialize(_Av, _Associated_av, _Bits_per_scalar_element);
1574 static_assert(_Rank == 3,
"texture(int, int, int, unsigned int, accelerator_view) is only permissible on texture<value_type, 3>.");
1608 static_assert(_Rank == 3,
"texture(int, int, int, unsigned int, accelerator_view, accelerator_view) is only permissible on texture<value_type, 3>.");
1609 _Initialize(_Av, _Associated_av, _Bits_per_scalar_element);
1654 texture(
int _E0,
const void * _Source,
unsigned int _Src_byte_size,
unsigned int _Bits_per_scalar_element) __CPU_ONLY
1657 static_assert(_Rank == 1,
"texture(int, void *, unsigned int, unsigned int) is only permissible on texture<value_type, 1>.");
1682 texture(
int _E0,
int _E1,
const void * _Source,
unsigned int _Src_byte_size,
unsigned int _Bits_per_scalar_element) __CPU_ONLY
1685 static_assert(_Rank == 2,
"texture(int, int, void *, unsigned int, unsigned int) is only permissible on texture<value_type, 2>.");
1714 texture(
int _E0,
int _E1,
int _E2,
const void * _Source,
unsigned int _Src_byte_size,
unsigned int _Bits_per_scalar_element) __CPU_ONLY
1717 static_assert(_Rank == 3,
"texture(int, int, int, void *, unsigned int, unsigned int) is only permissible on texture<value_type, 3>.");
1745 _Initialize(_Av, _Source, _Src_byte_size, _Bits_per_scalar_element);
1778 _Initialize(_Av, _Associated_av, _Source, _Src_byte_size, _Bits_per_scalar_element);
1805 static_assert(_Rank == 1,
"texture(int, void *, unsigned int, unsigned int, accelerator_view) is only permissible on texture<value_type, 1>.");
1806 _Initialize(_Av, _Source, _Src_byte_size, _Bits_per_scalar_element);
1839 static_assert(_Rank == 1,
"texture(int, void *, unsigned int, unsigned int, accelerator_view, accelerator_view) is only permissible on texture<value_type, 1>.");
1840 _Initialize(_Av, _Associated_av, _Source, _Src_byte_size, _Bits_per_scalar_element);
1870 static_assert(_Rank == 2,
"texture(int, int, void *, unsigned int, unsigned int, accelerator_view) is only permissible on texture<value_type, 2>.");
1871 _Initialize(_Av, _Source, _Src_byte_size, _Bits_per_scalar_element);
1907 static_assert(_Rank == 2,
"texture(int, int, void *, unsigned int, unsigned int, accelerator_view, accelerator_view) is only permissible on texture<value_type, 2>.");
1908 _Initialize(_Av, _Associated_av, _Source, _Src_byte_size, _Bits_per_scalar_element);
1941 static_assert(_Rank == 3,
"texture(int, int, int, void *, unsigned int, unsigned int, accelerator_view) is only permissible on texture<value_type, 3>.");
1942 _Initialize(_Av, _Source, _Src_byte_size, _Bits_per_scalar_element);
1981 static_assert(_Rank == 3,
"texture(int, int, int, void *, unsigned int, unsigned int, accelerator_view, accelerator_view) is only permissible on texture<value_type, 3>.");
1982 _Initialize(_Av, _Associated_av, _Source, _Src_byte_size, _Bits_per_scalar_element);
2086 _Initialize(_Src.accelerator_view, _Src.associated_accelerator_view, _Src);
2145 if (
this != &_Other)
2149 _Initialize(_Other.accelerator_view, _Other.associated_accelerator_view, _Other);
2165 if (
this != &_Other)
2171 _Other._M_texture_descriptor._Set_texture_ptr(
NULL);
2184 if (this->
extent != _Dest.extent)
2186 throw runtime_exception(
"The source and destination textures must have the exactly the same extent.", E_INVALIDARG);
2204 #pragma warning( push )
2205 #pragma warning( disable : 4996 ) //writeonly_texture_view is deprecated
2208 if (this->
extent != _Dest.extent)
2210 throw runtime_exception(
"The source and destination textures must have the exactly the same extent.", E_INVALIDARG);
2256 static_assert(_Rank == 1,
"value_type texture::operator[](int) is only permissible on texture<value_type, 1>.");
2271 return (*
this)[_Index];
2285 static_assert(_Rank == 1,
"value_type texture::operator()(int) is only permissible on texture<value_type, 1>.");
2303 static_assert(_Rank == 2,
"value_type texture::operator()(int, int) is only permissible on texture<value_type, 2>.");
2304 return (*
this)[
index<2>(_I0, _I1)];
2324 static_assert(_Rank == 3,
"value_type texture::operator()(int, int, int) is only permissible on texture<value_type, 3>.");
2325 return (*
this)[
index<3>(_I0, _I1, _I2)];
2339 return (*
this)[_Index];
2370 const void*
data() const __CPU_ONLY
2382 static_assert(_Rank >= 2,
"row_pitch is only applicable to staging textures with rank 2 or higher.");
2385 throw runtime_exception(
"row_pitch is only applicable to staging textures.", E_INVALIDARG);
2398 static_assert(_Rank == 3,
"depth_pitch is only applicable to staging textures with rank 3.");
2401 throw runtime_exception(
"depth_pitch is only applicable to staging textures.", E_INVALIDARG);
2419 : details::
_Texture_base<_Value_type, _Rank>(_Ext, _Descriptor)
2430 if (_Bits_per_scalar_element != 8 && _Bits_per_scalar_element != 16 &&
2431 _Bits_per_scalar_element != 32 && _Bits_per_scalar_element != 64)
2433 throw runtime_exception(
"Invalid _Bits_per_scalar_element argument - it can only be 8, 16, 32, or 64.", E_INVALIDARG);
2438 #pragma warning( push )
2439 #pragma warning( disable : 4127 ) // conditional expression is constant
2442 throw runtime_exception(
"Invalid _Bits_per_scalar_element argument - 64 is only valid for texture of double based short vector types.", E_INVALIDARG);
2447 throw runtime_exception(
"Invalid _Bits_per_scalar_element argument - it can only be 64 for texture of double based short vector types.", E_INVALIDARG);
2454 unsigned int _Bits_per_channel = _Bits_per_scalar_element;
2472 throw runtime_exception(
"Creating staging textures with mipmap levels > 1 is not supported", E_INVALIDARG);
2475 _Tex_ptr = _Texture::_Create_stage_texture(
2492 #pragma warning( pop )
2502 _Initialize(_Av, _Associated_av, Concurrency::graphics::details::_Get_default_bits_per_scalar_element<_Value_type>());
2510 template<
typename _Input_iterator>
2524 template<
typename _Input_iterator>
2532 _Initialize(_Av, _Associated_av, _Bits_per_scalar_element);
2538 _Initialize(_Av, _Av, _Source, _Src_byte_size, _Bits_per_scalar_element);
2554 if (_Src.bits_per_scalar_element != 0)
2556 _Initialize(_Av, _Associated_av, _Src.bits_per_scalar_element);
2596 #pragma warning( push )
2597 #pragma warning( disable : 4996 ) //writeonly_texture_view is deprecated
2600 static_assert(!std::is_const<_Value_type>::value,
"const value type is not supported for writeonly_texture_view.");
2610 : _Texture_base(_Src, 0, 1)
2614 throw runtime_exception(
"writeonly_texture_view cannot be created from a 3-channel texture with 32 bits per scalar element.", E_INVALIDARG);
2617 throw runtime_exception(
"writeonly_texture_view cannot be created from a staging texture object.", E_INVALIDARG);
2628 : _Texture_base(_Src,
true)
2642 : _Texture_base(_Src)
2654 if (
this != &_Other)
2656 this->_M_extent = _Other._M_extent;
2657 this->_M_texture_descriptor = _Other._M_texture_descriptor;
2683 #pragma warning( pop )
2696 template <
typename _Value_type,
int _Rank>
class texture_view :
public details::_Texture_base<_Value_type, _Rank>
2715 throw runtime_exception(
"texture_view cannot be created from a staging texture object.", E_INVALIDARG);
2752 if (
this != &_Other)
2798 static_assert(_Rank == 1,
"const value_type operator[](int) is only permissible on texture_view<value_type, 1>.");
2813 return (*
this)[_Index];
2827 static_assert(_Rank == 1,
"const value_type operator()(int) is only permissible on texture_view<value_type, 1>.");
2845 static_assert(_Rank == 2,
"const value_type operator()(int, int) is only permissible on texture_view<value_type, 2>.");
2846 return (*
this)[
index<2>(_I0, _I1)];
2866 static_assert(_Rank == 3,
"const value_type operator()(int, int, int) is only permissible on texture_view<value_type, 3>.");
2867 return (*
this)[
index<3>(_I0, _I1, _I2)];
2881 return (*
this)[_Index];
2929 template <
typename _Value_type,
int _Rank>
3026 _Other._M_sampler_descriptor._Set_sampler_ptr(
NULL);
3040 if (
this != &_Other)
3061 if (
this != &_Other)
3068 _Other._M_sampler_descriptor._Set_sampler_ptr(
NULL);
3105 sampler(
const _Sampler_descriptor & _Descriptor) __CPU_ONLY
3186 throw runtime_exception(
"Read-only texture_view cannot be created from a staging texture object.", E_INVALIDARG);
3206 throw runtime_exception(
"Read-only texture_view cannot be created from a staging texture object.", E_INVALIDARG);
3259 if (
this != &_Other)
3315 static_assert(_Rank == 1,
"value_type operator[](int) is only permissible on texture_view<value_type, 1>.");
3330 return (*
this)[_Index];
3344 static_assert(_Rank == 1,
"value_type texture_view::operator()(int) is only permissible on texture_view<value_type, 1>.");
3362 static_assert(_Rank == 2,
"value_type texture_view::operator()(int, int) is only permissible on texture_view<value_type, 2>.");
3363 return (*
this)[
index<2>(_I0, _I1)];
3383 static_assert(_Rank == 3,
"value_type texture_view::operator()(int, int, int) is only permissible on texture_view<value_type, 3>.");
3384 return (*
this)[
index<3>(_I0, _I1, _I2)];
3453 template<filter_mode _Filter_mode = filter_linear, address_mode _Address_mode = address_clamp>
3454 const _Value_type
sample(
const coordinates_type& _Coord,
float _Level_of_detail = 0.0f) const
__GPU_ONLY
3459 static_assert((_Filter_mode ==
filter_point || _Filter_mode ==
filter_linear),
"Invalid filter mode for sample method.");
3461 "Invalid address mode for sample method.");
3483 return _Gather(_Sampler, _Coord, 0);
3502 return _Gather(_Sampler, _Coord, 1);
3521 return _Gather(_Sampler, _Coord, 2);
3540 return _Gather(_Sampler, _Coord, 3);
3555 template<address_mode _Address_mode = address_clamp>
3558 return _Gather<_Address_mode>(_Coord, 0);
3573 template<address_mode _Address_mode = address_clamp>
3578 return _Gather<_Address_mode>(_Coord, 1);
3593 template<address_mode _Address_mode = address_clamp>
3598 return _Gather<_Address_mode>(_Coord, 2);
3613 template<address_mode _Address_mode = address_clamp>
3618 return _Gather<_Address_mode>(_Coord, 3);
3627 static_assert(_Rank == 2,
"gather methods are only permissible on texture_view<value_type, 2>.");
3629 gather_return_type _Tmp;
3634 template<address_mode _Address_mode>
3635 const gather_return_type
_Gather(
const coordinates_type& _Coord,
unsigned int _Component)
const __GPU_ONLY
3640 static_assert(_Rank == 2,
"gather methods are only permissible on texture_view<value_type, 2>.");
3642 "Invalid address mode for gather methods.");
3644 gather_return_type _Tmp;
3655 template <
typename T>
3662 template <
typename _Value_type,
int _Rank>
3669 template <
typename _Value_type,
int _Rank>
3676 template <
typename _Value_type,
int _Rank>
3683 template <
typename _Value_type,
int _Rank>
3690 template <
typename _Value_type,
int _Rank>
3697 template <
typename _Value_type,
int _Rank>
3704 template <
typename _Value_type,
int _Rank>
3711 template <
typename _Value_type,
int _Rank>
3719 template <
typename _Value_type,
int _Rank>
3728 template <
typename _Input_iterator,
typename _Value_type>
3730 _In_ _Texture *_Dst,
const size_t *_Dst_offset,
unsigned int _Dst_mipmap_level,
3731 const size_t *_Copy_extent,
const size_t *_Preferred_copy_chunk_extent =
NULL)
3733 _ASSERTE(_Dst !=
nullptr);
3734 _ASSERTE(_Dst_offset !=
nullptr);
3735 _ASSERTE(_Copy_extent !=
nullptr);
3737 _ASSERTE((
unsigned int)
std::distance(_First, _Last) >= (_Copy_extent[0] * _Copy_extent[1] * _Copy_extent[2]));
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));
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))))
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);
3750 #pragma warning( pop )
3753 if (_Dst->_Get_host_ptr() !=
NULL)
3756 _ASSERTE(((_Dst->_Get_bits_per_element() * _Copy_extent[0]) % (8U *
sizeof(_Value_type))) == 0);
3758 size_t _Row_size = (_Dst->_Get_bits_per_element() * _Copy_extent[0]) >> 3;
3759 size_t _Depth_slice_size = _Row_size * _Copy_extent[1];
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);
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);
3769 unsigned char *_PDest =
reinterpret_cast<unsigned char*
>(_Dst->_Get_host_ptr()) + _Dst_offset_in_bytes;
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));
3784 std::array<size_t, 3> _Copy_chunk_extent;
3785 if (_Preferred_copy_chunk_extent !=
NULL)
3787 std::copy(&_Preferred_copy_chunk_extent[0], &_Preferred_copy_chunk_extent[3], _Copy_chunk_extent.begin());
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());
3794 std::array<size_t, 3> _Curr_copy_offset;
3795 std::copy(&_Dst_offset[0], &_Dst_offset[3], _Curr_copy_offset.begin());
3797 std::array<size_t, 3> _Remaining_copy_extent;
3798 std::copy(&_Copy_extent[0], &_Copy_extent[3], _Remaining_copy_extent.begin());
3800 bool _Truncated_copy =
false;
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);
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(), 0, _Curr_copy_extent.data(), _Copy_chunk_extent.data());
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
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(), 0, _Dst_mipmap_level);
3827 if (_Truncated_copy)
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]);
3834 }
while (_Truncated_copy);
3839 template <
typename _Output_iterator,
typename _Value_type>
3840 _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)
3842 _ASSERTE(_Tex !=
nullptr);
3843 _ASSERTE(_Tex_offset !=
nullptr);
3844 _ASSERTE(_Copy_extent !=
nullptr);
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));
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))))
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);
3857 #pragma warning( pop )
3866 size_t _Depth_slice_size = _Row_size * _Copy_extent[1];
3870 _ASSERTE(_Row_pitch >= _Row_size);
3871 _ASSERTE(_Depth_pitch >= _Depth_slice_size);
3874 (_Tex_offset[1] * _Row_pitch) + (_Tex_offset[2] * _Depth_pitch);
3876 unsigned char *_PTex =
reinterpret_cast<unsigned char*
>(_Tex->
_Get_host_ptr()) + _Tex_offset_in_bytes;
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));
3892 std::array<size_t, 3> _Copy_chunk_extent;
3893 if (_Preferred_copy_chunk_extent !=
nullptr)
3895 std::copy(&_Preferred_copy_chunk_extent[0], &_Preferred_copy_chunk_extent[3], _Copy_chunk_extent.begin());
3902 std::array<size_t, 3> _Curr_copy_offset;
3903 std::copy(&_Tex_offset[0], &_Tex_offset[3], _Curr_copy_offset.begin());
3905 std::array<size_t, 3> _Remaining_copy_extent;
3906 std::copy(&_Copy_extent[0], &_Copy_extent[3], _Remaining_copy_extent.begin());
3908 bool _Truncated_copy =
false;
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);
3915 std::array<size_t, 3> _Staging_tex_offset;
3916 _Staging_tex_offset.fill(0);
3918 _Staging_tex_ptr.
_Get_ptr(), _Staging_tex_offset.data(), 0,
3919 _Curr_copy_extent.data(), _Copy_chunk_extent.data());
3924 if (!_Truncated_copy)
3927 _Curr_copy_extent, _Staging_tex_offset, _Copy_chunk_extent, _First]()
mutable ->
_Event
3929 return _Copy_async_impl<_Output_iterator, _Value_type>(_Staging_tex_ptr, _Staging_tex_offset.data(), 0, _Curr_copy_extent.data(), _First, _Copy_chunk_extent.data());
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
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());
3946 _Event _Ev2 = _Copy_async_impl<_Output_iterator, _Value_type>(_Staging_tex_ptr, _Staging_tex_offset.data(), 0, _Curr_copy_extent.data(), _First, _Copy_chunk_extent.data());
3953 template <
typename _Value_type,
int _Rank>
3960 throw runtime_exception(
"Invalid destination - multiple mipmap levels cannot be copied from source", E_INVALIDARG);
3965 if (_Dst.extent == _Copy_extent)
3967 throw runtime_exception(
"Invalid _Src_byte_size argument. _Src_byte_size is smaller than the total size of _Dst.", E_INVALIDARG);
3971 throw runtime_exception(
"Invalid _Src_byte_size argument. _Src_byte_size is smaller than the provided section of _Dst.", E_INVALIDARG);
3976 std::array<size_t, 3> _Copy_extent_arr =
_Get_dimensions(_Copy_extent, 0);
3977 std::array<size_t, 3> _Dst_offset_arr =
_Get_indices(_Dst_offset);
3984 template<
typename _Value_type,
int _Rank>
3991 throw runtime_exception(
"Invalid source - multiple mipmap levels cannot be copied to destination", E_INVALIDARG);
3996 if (_Src.extent == _Copy_extent)
3998 throw runtime_exception(
"Invalid _Dst_byte_size argument. _Dst_byte_size is smaller than the size of _Src.", E_INVALIDARG);
4002 throw runtime_exception(
"Invalid _Dst_byte_size argument. _Dst_byte_size is smaller than the provided section of _Src.", E_INVALIDARG);
4007 std::array<size_t, 3> _Copy_extent_arr =
_Get_dimensions(_Copy_extent, 0);
4008 std::array<size_t, 3> _Src_offset_arr =
_Get_indices(_Src_offset);
4015 template <
typename _Output_iterator,
typename _Value_type,
int _Rank>
4022 throw runtime_exception(
"Invalid source - multiple mipmap levels cannot be copied to destination", E_INVALIDARG);
4026 std::array<size_t, 3> _Copy_extent_arr =
_Get_dimensions(_Copy_extent, 0);
4027 std::array<size_t, 3> _Src_offset_arr =
_Get_indices(_Src_offset);
4032 template <
typename _Input_iterator,
typename _Value_type,
int _Rank>
4036 if (static_cast<unsigned int>(
std::distance(_First, _Last)) < _Copy_extent.
size())
4038 throw runtime_exception(
"Inadequate amount of data supplied through the iterators", E_INVALIDARG);
4043 throw runtime_exception(
"Invalid destination - multiple mipmap levels cannot be copied from source", E_INVALIDARG);
4046 std::array<size_t, 3> _Copy_extent_arr =
_Get_dimensions(_Copy_extent, 0);
4047 std::array<size_t, 3> _Dst_offset_arr =
_Get_indices(_Dst_offset);
4053 template<
typename _Value_type,
int _Rank>
4066 throw runtime_exception(
"The source and destination textures must have the exactly the same number of mipmap levels for texture copy.", E_INVALIDARG);
4069 bool _Is_whole_texture_copy = (_Src_offset == _Dst_offset && _Src_offset ==
index<_Rank>() && _Src.extent == _Dst.extent && _Src.extent == _Copy_extent);
4073 throw runtime_exception(
"Sections are not allowed when copy involves multiple mipmap levels", E_INVALIDARG);
4078 throw runtime_exception(
"The source and destination are overlapping areas on the same texture", E_INVALIDARG);
4089 throw runtime_exception(
"The source and destination textures are not compatible.", E_INVALIDARG);
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);
4104 std::array<size_t, 3> _Copy_extent_arr =
_Get_dimensions(_Copy_extent, _Mip_offset);
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());
4110 _Copy_event = _Copy_event.
_Add_event(_Step_event);
4136 template <typename _Src_type, typename = typename std::enable_if<details::texture_traits<_Src_type>::is_texture,
void>::type>
void copy(
const _Src_type &_Src,
_Out_ void * _Dst,
unsigned int _Dst_byte_size)
4171 template <typename _Src_type, typename = typename std::enable_if<details::texture_traits<_Src_type>::is_texture,
void>::type>
void copy(
const _Src_type &_Src,
const index<_Src_type::rank> &_Src_offset,
const extent<_Src_type::rank> &_Copy_extent,
_Out_ void * _Dst,
unsigned int _Dst_byte_size)
4201 template <typename _Dst_type, typename = typename std::enable_if<details::texture_traits<_Dst_type>::is_texture,
void>::type>
void copy(
const void * _Src,
unsigned int _Src_byte_size, _Dst_type & _Dst)
4234 template <typename _Dst_type, typename = typename std::enable_if<details::texture_traits<_Dst_type>::is_texture,
void>::type>
void copy(
const void * _Src,
unsigned int _Src_byte_size, _Dst_type & _Dst,
4305 _Out_ void * _Dst,
unsigned int _Dst_byte_size)
4334 template <typename _Dst_type, typename = typename std::enable_if<details::texture_traits<_Dst_type>::is_texture,
void>::type>
concurrency::completion_future copy_async(
const void * _Src,
unsigned int _Src_byte_size, _Dst_type & _Dst)
4370 template <typename _Dst_type, typename = typename std::enable_if<details::texture_traits<_Dst_type>::is_texture,
void>::type>
concurrency::completion_future copy_async(
const void * _Src,
unsigned int _Src_byte_size, _Dst_type & _Dst,
4401 template <typename InputIterator, typename _Dst_type, typename = typename std::enable_if<details::texture_traits<_Dst_type>::is_texture,
void>::type>
void copy(InputIterator _First, InputIterator
_Last, _Dst_type &_Dst)
4437 template <typename InputIterator, typename _Dst_type, typename = typename std::enable_if<details::texture_traits<_Dst_type>::is_texture,
void>::type>
void copy(InputIterator _First, InputIterator
_Last, _Dst_type &_Dst,
const index<_Dst_type::rank> &_Dst_offset,
const extent<_Dst_type::rank> &_Copy_extent)
4520 if (_Src.extent != _Dst.extent)
4522 throw runtime_exception(
"The source and destination textures must have the exactly the same extent for whole-texture copy.", E_INVALIDARG);
4558 template <typename _Src_type, typename _Dst_type, typename = typename std::enable_if<details::texture_traits<_Src_type>::is_texture && details::texture_traits<_Dst_type>::is_texture,
void>::type>
void copy(
const _Src_type &_Src,
const index<_Src_type::rank> &_Src_offset, _Dst_type &_Dst,
const index<_Dst_type::rank> &_Dst_offset,
const extent<_Src_type::rank> &_Copy_extent)
4591 template <typename InputIterator, typename _Dst_type, typename = typename std::enable_if<details::texture_traits<_Dst_type>::is_texture,
void>::type>
concurrency::completion_future copy_async(InputIterator _First, InputIterator
_Last, _Dst_type &_Dst)
4630 template <typename InputIterator, typename _Dst_type, typename = typename std::enable_if<details::texture_traits<_Dst_type>::is_texture,
void>::type>
concurrency::completion_future copy_async(InputIterator _First, InputIterator
_Last, _Dst_type &_Dst,
4638 _Event _Ev = details::_Copy_async_impl<InputIterator, _Dst_type::value_type, _Dst_type::rank>(_First,
_Last, _Dst, _Dst_offset, _Copy_extent);
4719 template <typename _Src_type, typename _Dst_type, typename = typename std::enable_if<details::texture_traits<_Src_type>::is_texture && details::texture_traits<_Dst_type>::is_texture,
void>::type>
concurrency::completion_future copy_async(_Src_type &_Src, _Dst_type &_Dst)
4723 if (_Src.extent != _Dst.extent)
4725 throw runtime_exception(
"The source and destination textures must have the exactly the same extent for whole-texture copy.", E_INVALIDARG);
4781 if (_D3D_texture ==
NULL)
4787 throw runtime_exception(
"Cannot create D3D texture on a non-D3D accelerator_view.", E_INVALIDARG);
4790 _Texture * _Tex_ptr = _Texture::_Adopt_texture(_Rank, _Id, _D3D_texture, _Av, _View_format);
4804 #pragma warning( pop )
4844 #pragma warning( push )
4845 #pragma warning( disable : 4996 ) //writeonly_texture_view is deprecated
4850 #pragma warning( pop )
4897 DXGI_FORMAT _View_format ) __CPU_ONLY
4900 #pragma warning( suppress: 6326 ) // Potential comparison of a constant with another constant
4903 &_Tex_ptr, _View_format);
4965 __dp_d3d_msad4(reinterpret_cast<uint*>(&_Tmp), _Reference, _Source.x, _Source.y, _Accum.x, _Accum.y, _Accum.z, _Accum.w);
void copy(const _Src_type &_Src, _Out_ void *_Dst, unsigned int _Dst_byte_size)
Copies the contents of the source texture into the destination host buffer.
Definition: amp_graphics.h:4136
#define _Out_
Definition: sal.h:342
texture & operator=(const texture &_Other)
Copy assignment operator. Deep copy
Definition: amp_graphics.h:2143
texture(const Concurrency::extent< _Rank > &_Ext, _Input_iterator _Src_first, _Input_iterator _Src_last, const Concurrency::accelerator_view &_Av, const Concurrency::accelerator_view &_Associated_av) __CPU_ONLY
Construct a staging texture initialized from a pair of iterators into a container, bound to a specific accelerator_view and an associated accelerator_view that is the preferred location for copying to/from this texture.
Definition: amp_graphics.h:1061
uint_2::value_type _Scalar_type
Definition: amp_graphics.h:60
friend class accelerator
Definition: amprt.h:1444
texture_view< const _Value_type, _Rank > & operator=(const texture_view< const _Value_type, _Rank > &_Other) __GPU
Assignment operator. This read-only texture_view becomes a view of the same texture which _Other is a...
Definition: amp_graphics.h:3257
const _Value_type operator[](const index< _Rank > &_Index) const __GPU_ONLY
Get the element value indexed by _Index.
Definition: amp_graphics.h:2238
_Sampler_descriptor _M_sampler_descriptor
Definition: amp_graphics.h:3141
texture(int _E0, int _E1, _Input_iterator _Src_first, _Input_iterator _Src_last, const Concurrency::accelerator_view &_Av) __CPU_ONLY
Construct a texture with two integers and initialized from a pair of iterators into a container...
Definition: amp_graphics.h:1147
unsigned int uint
Definition: amp_short_vectors.h:498
const _Value_type value_type
Definition: amp_graphics.h:3159
Definition: amp_graphics.h:2916
unsigned int _Get_bits_per_element() const
Definition: amprt.h:2251
Represent a short vector of 2 unorm's.
Definition: amp_short_vectors.h:11343
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2369
sampler & operator=(const sampler &_Other) __GPU
Assignment operator.
Definition: amp_graphics.h:3038
unsigned int _Get_section_size(const _Texture_base< _Value_type, _Rank > &_Tex, const extent< _Rank > &_Extent)
Definition: amp_graphics.h:3720
#define NULL
Definition: vcruntime.h:236
texture(const Concurrency::extent< _Rank > &_Ext, _Input_iterator _Src_first, _Input_iterator _Src_last, const Concurrency::accelerator_view &_Av) __CPU_ONLY
Construct a texture initialized from a pair of iterators into a container, bound to a specific accele...
Definition: amp_graphics.h:1030
unsigned int _Scalar_type
Definition: amp_graphics.h:50
static const unsigned int _Default_bits_per_channel
Definition: amp_graphics.h:44
_Short_vector_base_type_id
Definition: amprt.h:291
texture(int _E0, int _E1, const Concurrency::accelerator_view &_Av, const Concurrency::accelerator_view &_Associated_av) __CPU_ONLY
Construct a staging texture from two integer extents, bound to a specific accelerator_view and a...
Definition: amp_graphics.h:849
uint4 msad4(uint _Reference, uint2 _Source, uint4 _Accum) __GPU_ONLY
Compares a 4-byte reference value and an 8-byte source value and accumulates a vector of 4 sums...
Definition: amp_graphics.h:4962
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
static _AMPIMP _Ret_ IUnknown *__cdecl _Get_D3D_texture(_In_ _Texture *_Texture_ptr)
norm _Scalar_type
Definition: amp_graphics.h:211
unchecked_array_iterator< _Iterator > make_unchecked_array_iterator(_Iterator _Ptr)
Definition: iterator:725
double_4::value_type _Scalar_type
Definition: amp_graphics.h:282
void _Initialize(const Concurrency::accelerator_view &_Av, const void *_Source, unsigned int _Src_byte_size) __CPU_ONLY
Definition: amp_graphics.h:2547
texture(const texture_view< _Value_type, _Rank > &_Src, const Concurrency::accelerator_view &_Acc_view)
Construct a texture from a texture_view on another accelerator_view. Deep copy
Definition: amp_graphics.h:2018
sampler(sampler &&_Other) __GPU
Move constructor.
Definition: amp_graphics.h:3019
A texture is a data aggregate on an accelerator_view in the extent domain. It is a collection of vari...
Definition: amp_graphics.h:621
texture(int _E0, int _E1, unsigned int _Bits_per_scalar_element) __CPU_ONLY
Construct a texture with two integers and specified bits per scalar element
Definition: amp_graphics.h:1335
_Ret_ IUnknown * get_texture(const texture< _Value_type, _Rank > &_Texture) __CPU_ONLY
Get the D3D texture interface underlying a texture.
Definition: amp_graphics.h:4824
__declspec(property(get=get_associated_accelerator_view)) Concurrency Concurrency::accelerator_view get_associated_accelerator_view() const __CPU_ONLY
Returns the accelerator_view that is the preferred target where this texture can be copied...
Definition: amp_graphics.h:2411
unsigned int _Get_texture_format() const
Definition: amprt.h:2230
_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
extent< _Rank > _Get_extent_at_level(const extent< _Rank > &_Base_extent, unsigned int _Level)
Definition: xxamp_inl.h:141
sampler(const sampler &_Other) __GPU
Copy constructor.
Definition: amp_graphics.h:3005
texture(int _E0, unsigned int _Bits_per_scalar_element, const Concurrency::accelerator_view &_Av, const Concurrency::accelerator_view &_Associated_av) __CPU_ONLY
Construct a staging texture with integer _E0 and specified bits per scalar element, bound to a specific accelerator and an associated accelerator_view that is the preferred location for copying to/from this texture.
Definition: amp_graphics.h:1487
Represent a short vector of 3 double's.
Definition: amp_short_vectors.h:18932
~texture_view() __GPU
Destructor
Definition: amp_graphics.h:3284
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
texture(int _E0, int _E1, int _E2, unsigned int _Bits_per_scalar_element, const Concurrency::accelerator_view &_Av, const Concurrency::accelerator_view &_Associated_av) __CPU_ONLY
Construct a staging texture with three integers and specified bits per scalar element...
Definition: amp_graphics.h:1605
Concurrency::extent< _Rank > _Create_extent(size_t _Width, size_t _Height, size_t _Depth)
Definition: amp_graphics.h:360
float value_type
Definition: amp_short_vectors.h:8219
Represent a unorm number. Each element is a floating point number in the range of [0...
Definition: amp_short_vectors.h:37
_AMPIMP accelerator_view _Get_accelerator_view() const
texture(int _E0, unsigned int _Bits_per_scalar_element, const Concurrency::accelerator_view &_Av) __CPU_ONLY
Construct a texture with integer _E0 and specified bits per scalar element, bound to a specific...
Definition: amp_graphics.h:1459
__declspec(property(get=get_accelerator_view)) Concurrency Concurrency::accelerator_view get_accelerator_view() const __CPU_ONLY
Returns the accelerator_view where this texture or texture view is located.
Definition: amp_graphics.h:460
texture(const Concurrency::extent< _Rank > &_Ext, unsigned int _Bits_per_scalar_element, const Concurrency::accelerator_view &_Av) __CPU_ONLY
Construct a texture from extents and specified bits per scalar element, bound to a specific accelerat...
Definition: amp_graphics.h:1386
texture(const texture_view< const _Value_type, _Rank > &_Src, const Concurrency::accelerator_view &_Acc_view)
Construct a texture from a read-only texture_view on another accelerator_view. Deep copy ...
Definition: amp_graphics.h:2033
Represent a short vector of 4 unsigned int's.
Definition: amp_short_vectors.h:1721
_Ret_ _Texture * _Get_texture(const _Texture_type &_Tex) __CPU_ONLY
Definition: xxamp.h:1100
texture(int _E0, const void *_Source, unsigned int _Src_byte_size, unsigned int _Bits_per_scalar_element, const Concurrency::accelerator_view &_Av, const Concurrency::accelerator_view &_Associated_av) __CPU_ONLY
Construct a staging texture with integer _E0 and specified bits per scalar element, initialized from a host buffer, bound to a specific accelerator_view and an associated accelerator_view that is the preferred location for copying to/from this texture.
Definition: amp_graphics.h:1836
Represent a short vector of 2 unsigned int's.
Definition: amp_short_vectors.h:522
float_2::value_type _Scalar_type
Definition: amp_graphics.h:141
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
Definition: amp_graphics.h:38
_Texture_base(const _Texture_base &_Src, bool _Flatten_mipmap_levels) __GPU_ONLY
Definition: amp_graphics.h:546
address_mode
address modes supported for texture sampling
Definition: amp_graphics.h:2912
texture(int _E0, int _E1, unsigned int _Bits_per_scalar_element, const Concurrency::accelerator_view &_Av, const Concurrency::accelerator_view &_Associated_av) __CPU_ONLY
Construct a staging texture with two integers and specified bits per scalar element, bound to a specific accelerator and an associated accelerator_view that is the preferred location for copying to/from this texture.
Definition: amp_graphics.h:1543
unorm_2::value_type _Scalar_type
Definition: amp_graphics.h:181
A sampler class aggregates sampling configuration information to be used for texture sampling...
Definition: amp_graphics.h:2924
void set(const index< _Rank > &_Index, const _Value_type &_Value) __GPU_ONLY
Set the element indexed by _Index with value _Value.
Definition: amp_graphics.h:2351
texture(const Concurrency::extent< _Rank > &_Ext, const void *_Source, unsigned int _Src_byte_size, unsigned int _Bits_per_scalar_element, const Concurrency::accelerator_view &_Av) __CPU_ONLY
Construct a texture from extents and specified bits per scalar element, initialized from a host buffe...
Definition: amp_graphics.h:1742
__declspec(property(get=get_bits_per_scalar_element)) unsigned int bits_per_scalar_element
Returns the number of bits per scalar element
void _Copy_to(const _Texture_base &_Dest) const __CPU_ONLY
Definition: amp_graphics.h:558
#define __GPU
Definition: amprt.h:45
void _Initialize(const Concurrency::accelerator_view &_Av, const void *_Source, unsigned int _Src_byte_size, unsigned int _Bits_per_scalar_element) __CPU_ONLY
Definition: amp_graphics.h:2536
norm_4::value_type _Scalar_type
Definition: amp_graphics.h:241
size_t _Get_row_pitch() const
Definition: amprt.h:2311
sampler(address_mode _Address_mode, float_4 _Border_color=float_4(0.0f, 0.0f, 0.0f, 0.0f)) __CPU_ONLY
Constructs a sampler with default filter mode (filter_linear, same for min, mag, mip), but specified addressing mode (same for all dimensions) and border color.
Definition: amp_graphics.h:2970
std::array< size_t, 3 > _Get_dimensions(const Concurrency::extent< _Rank > &_Ext, unsigned int _Mip_offset)
Definition: amp_graphics.h:298
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
texture(int _E0, int _E1, unsigned int _Bits_per_scalar_element, const Concurrency::accelerator_view &_Av) __CPU_ONLY
Construct a texture with two integers and specified bits per scalar element, bound to a specific...
Definition: amp_graphics.h:1512
_In_ int _Val
Definition: vcruntime_string.h:62
texture(const Concurrency::extent< _Rank > &_Ext, const Concurrency::accelerator_view &_Av) __CPU_ONLY
Construct a texture from extents, bound to a specific accelerator_view.
Definition: amp_graphics.h:737
texture(const Concurrency::extent< _Rank > &_Ext, const _Texture_descriptor &_Descriptor)
Definition: amp_graphics.h:2418
uint_3::value_type _Scalar_type
Definition: amp_graphics.h:70
Class represents a virtual device abstraction on a C++ AMP data-parallel accelerator ...
Definition: amprt.h:1442
__declspec(property(get=get_row_pitch)) unsigned int row_pitch
Returns the row pitch (in bytes) of a 2D or 3D staging texture on the CPU to be used for navigating t...
static constexpr bool value
Definition: amp_graphics.h:611
const gather_return_type _Gather(const coordinates_type &_Coord, unsigned int _Component) const __GPU_ONLY
Definition: amp_graphics.h:3635
unsigned int get_mipmap_levels() const __GPU
Definition: amp_graphics.h:482
static _AMPIMP _Ret_ IUnknown *__cdecl _Get_D3D_buffer(_In_ _Buffer *_Buffer_ptr)
Represent a short vector of 3 unorm's.
Definition: amp_short_vectors.h:11718
double_2::value_type _Scalar_type
Definition: amp_graphics.h:262
texture(const Concurrency::extent< _Rank > &_Ext, const void *_Source, unsigned int _Src_byte_size, unsigned int _Bits_per_scalar_element, const Concurrency::accelerator_view &_Av, const Concurrency::accelerator_view &_Associated_av) __CPU_ONLY
Construct a staging texture from extents and specified bits per scalar element, initialized from a ho...
Definition: amp_graphics.h:1775
The Concurrency namespace provides classes and functions that provide access to the Concurrency Runti...
Definition: agents.h:43
Class represents a future corresponding to a C++ AMP asynchronous operation
Definition: amprt.h:1266
Represent a short vector of 2 int's.
Definition: amp_short_vectors.h:4189
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
void _Initialize(const Concurrency::accelerator_view &_Av) __CPU_ONLY
Definition: amp_graphics.h:2505
unsigned int _Get_most_detailed_mipmap_level() const __GPU
Definition: amp_graphics.h:581
size_t _Get_depth(unsigned int _Mip_offset=0) const
Definition: amprt.h:2220
void _Are_valid_mipmap_parameters(unsigned int _Most_detailed_mipmap_level, unsigned int _Mipmap_levels=0)
Definition: xxamp.h:1246
int _Scalar_type
Definition: amp_graphics.h:90
unsigned int _Get_default_bits_per_scalar_element()
Definition: amp_graphics.h:290
unorm _Scalar_type
Definition: amp_graphics.h:171
_Value_type value_type
Definition: amp_graphics.h:412
texture(int _E0, int _E1, int _E2, const void *_Source, unsigned int _Src_byte_size, unsigned int _Bits_per_scalar_element) __CPU_ONLY
Construct a texture with three integers and specified bits per scalar element, initialized from a host buffer.
Definition: amp_graphics.h:1714
unsigned int value_type
Definition: amp_short_vectors.h:1724
static const bool is_texture
Definition: amp_graphics.h:3658
texture(int _E0) __CPU_ONLY
Construct texture with the extent _E0
Definition: amp_graphics.h:680
integral_constant< bool, false > false_type
Definition: xtr1common:41
texture(int _E0, const Concurrency::accelerator_view &_Av, const Concurrency::accelerator_view &_Associated_av) __CPU_ONLY
Construct a staging texture with the extent _E0, bound to a specific accelerator_view and an ass...
Definition: amp_graphics.h:801
texture(int _E0, _Input_iterator _Src_first, _Input_iterator _Src_last, const Concurrency::accelerator_view &_Av) __CPU_ONLY
Construct a texture with integer _E0 and initialized from a pair of iterators into a container...
Definition: amp_graphics.h:1086
Definition: amp_graphics.h:607
unsigned int _Get_num_channels() const
Definition: amprt.h:2240
double value_type
Definition: amp_short_vectors.h:19666
_AMPIMP accelerator_view _Get_access_on_accelerator_view() const
const gather_return_type gather_alpha(const sampler &_Sampler, const coordinates_type &_Coord) const __GPU_ONLY
Sample the texture at the given coordinates using the specified sampling configuration and return the...
Definition: amp_graphics.h:3536
short_vector provides metaprogramming definitions which are useful for programming short vectors gene...
Definition: amp_short_vectors.h:23839
Represent a short vector of 4 double's.
Definition: amp_short_vectors.h:19663
float_4 _M_border_color
Definition: amp_graphics.h:3144
const _Value_type sample(const sampler &_Sampler, const coordinates_type &_Coord, float _Level_of_detail=0.0f) const __GPU_ONLY
Sample the texture at the given coordinates and level of detail using the specified sampling configur...
Definition: amp_graphics.h:3423
_AMPIMP bool __cdecl _Is_D3D_accelerator_view(const accelerator_view &_Av)
unsigned int get_data_length() const __CPU_ONLY
Definition: amp_graphics.h:493
_AMPIMP void _Get()
Wait until the _Event completes and throw any exceptions that occur.
texture(const Concurrency::extent< _Rank > &_Ext, _Input_iterator _Src_first, _Input_iterator _Src_last) __CPU_ONLY
Construct a texture initialized from a pair of iterators into a container.
Definition: amp_graphics.h:926
Represent a short vector of 3 int's.
Definition: amp_short_vectors.h:4597
short_vector< float, _Rank >::type coordinates_type
Definition: amp_graphics.h:3160
_AMPIMP _Ret_ _Amp_runtime_trace *__cdecl _Get_amp_trace()
const _Sampler_descriptor & _Get_descriptor() const __GPU_ONLY
Definition: amp_graphics.h:3136
texture(int _E0, int _E1, const Concurrency::accelerator_view &_Av) __CPU_ONLY
Construct a texture from two integer extents, bound to a specific accelerator_view.
Definition: amp_graphics.h:822
__declspec(property(get=get_border_color)) Concurrency Concurrency::graphics::float_4 get_border_color() const __GPU
Returns the sampler's border value
Definition: amp_graphics.h:3095
bool _Is_adopted() const
Definition: amprt.h:2081
enum _Short_vector_base_type_id _Texture_base_type_id
Definition: amprt.h:302
texture_view(const texture< _Value_type, _Rank > &_Src) __GPU_ONLY
Construct a read-only texture_view of a texture _Src on an accelerator.
Definition: amp_graphics.h:3169
Represent a norm number. Each element is a floating point number in the range of [-1.0f, 1.0f].
Definition: amp_short_vectors.h:208
texture_view< const _Value_type, _Rank > & operator=(const texture_view< _Value_type, _Rank > &_Other) __CPU_ONLY
Assignment operator from a writable texture_view. This read-only texture_view becomes a view of the s...
Definition: amp_graphics.h:3274
texture(int _E0, int _E1) __CPU_ONLY
Construct a texture from two integer extents.
Definition: amp_graphics.h:698
unsigned int _Get_most_detailed_mipmap_level() const __GPU
Definition: amprt.h:659
#define UINT_MAX
Definition: limits.h:36
extent() __GPU
Default constructor. The value at each dimension is initialized to zero.
Definition: amp.h:404
friend _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) __CPU_ONLY
Definition: amp_graphics.h:4054
int_4::value_type _Scalar_type
Definition: amp_graphics.h:120
const gather_return_type gather_alpha(const coordinates_type &_Coord) const __GPU_ONLY
Sample the texture at the given coordinates using the predefined sampling configuration and return th...
Definition: amp_graphics.h:3614
texture(const texture_view< _Value_type, _Rank > &_Src)
Construct a texture from a texture_view. Deep copy
Definition: amp_graphics.h:1991
sampler(const _Sampler_descriptor &_Descriptor) __CPU_ONLY
Definition: amp_graphics.h:3105
void __dp_d3d_msad4(_Out_ unsigned int *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) __GPU_ONLY
static _AMPIMP _Ret_ IUnknown *__cdecl _Get_D3D_sampler(const Concurrency::accelerator_view &_Av, _In_ _Sampler *_Sampler_ptr)
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
texture(int _E0, int _E1, int _E2, const Concurrency::accelerator_view &_Av, const Concurrency::accelerator_view &_Associated_av) __CPU_ONLY
Construct a staging texture from three integer extents, bound to a specific accelerator_view and...
Definition: amp_graphics.h:903
_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 copy_to(texture &_Dest) const
Copy-to, deep copy
Definition: amp_graphics.h:2182
const void * data() const __CPU_ONLY
Returns a CPU pointer to the raw data of this texture.
Definition: amp_graphics.h:2370
~_Texture_base() __GPU
Definition: amp_graphics.h:572
texture(const Concurrency::extent< _Rank > &_Ext, unsigned int _Bits_per_scalar_element, const Concurrency::accelerator_view &_Av, const Concurrency::accelerator_view &_Associated_av) __CPU_ONLY
Construct a staging texture from extents and specified bits per scalar element, bound to a specific a...
Definition: amp_graphics.h:1438
texture(int _E0, const void *_Source, unsigned int _Src_byte_size, unsigned int _Bits_per_scalar_element, const Concurrency::accelerator_view &_Av) __CPU_ONLY
Construct a texture with integer _E0 and specified bits per scalar element, initialized from a ...
Definition: amp_graphics.h:1802
Concurrency::graphics::filter_mode _M_filter_mode
Definition: amp_graphics.h:3142
_Ret_ T * _Get_ptr() const
Definition: amprt.h:248
unsigned int get_row_pitch() const __CPU_ONLY
Definition: amp_graphics.h:2380
static const bool is_writable
Definition: amp_graphics.h:3659
_AMPIMP void _Map_buffer(_Access_mode _Map_type, bool _Wait)
void _Initialize() __CPU_ONLY
Definition: amp_graphics.h:3121
const _Value_type sample(const coordinates_type &_Coord, float _Level_of_detail=0.0f) const __GPU_ONLY
Sample the texture at the given coordinates and level of detail using the predefined sampling configu...
Definition: amp_graphics.h:3454
texture(const Concurrency::extent< _Rank > &_Ext, unsigned int _Bits_per_scalar_element) __CPU_ONLY
Construct a texture from extents and specified bits per scalar element
Definition: amp_graphics.h:1273
texture(const texture_view< const _Value_type, _Rank > &_Src, const Concurrency::accelerator_view &_Acc_view, const Concurrency::accelerator_view &_Associated_av)
Construct a staging texture from a read-only texture_view on another accelerator_view. Deep copy
Definition: amp_graphics.h:2071
std::array< size_t, 3 > _Get_indices(const index< _Rank > &_Idx)
Definition: amp_graphics.h:329
static const bool _Is_valid_SVT_for_texture
Definition: amp_graphics.h:41
Definition: amp_graphics.h:384
texture(int _E0, const void *_Source, unsigned int _Src_byte_size, unsigned int _Bits_per_scalar_element) __CPU_ONLY
Construct a texture with integer _E0 and specified bits per scalar element, initialized from a h...
Definition: amp_graphics.h:1654
sampler() __CPU_ONLY
Constructs a sampler with default filter mode (filter_lienar, same for min, mag, mip), addressing mode (address_clamp, same for all dimensions), and border color (float_4(0.0f, 0.0f, 0.0f, 0.0f)).
Definition: amp_graphics.h:2937
_Ret_ void * data() __CPU_ONLY
Returns a CPU pointer to the raw data of this texture.
Definition: amp_graphics.h:2362
static auto _Fn(_Uty _Val, decltype(*_Val,++_Val, 0)) -> std::true_type
texture(const Concurrency::extent< _Rank > &_Ext, unsigned int _Bits_per_scalar_element, unsigned int _Mipmap_levels, const Concurrency::accelerator_view &_Av) __CPU_ONLY
Construct a texture from extents, specified bits per scalar element and number of mipmap levels ...
Definition: amp_graphics.h:1411
Concurrency::extent< _Rank > get_mipmap_extent(unsigned int _Mipmap_level) const __CPU_ONLY
Returns the extent for specific mipmap level of this texture or texture view.
Definition: amp_graphics.h:431
unsigned int _Get_view_mipmap_levels() const __GPU
Definition: amprt.h:664
texture(int _E0, unsigned int _Bits_per_scalar_element) __CPU_ONLY
Construct a texture with integer _E0 and specified bits per scalar element
Definition: amp_graphics.h:1313
#define _In_
Definition: sal.h:305
int_2::value_type _Scalar_type
Definition: amp_graphics.h:100
_Texture_base(const _Texture_base &_Src) __GPU
Definition: amp_graphics.h:532
const gather_return_type gather_red(const sampler &_Sampler, const coordinates_type &_Coord) const __GPU_ONLY
Sample the texture at the given coordinates using the specified sampling configuration and return the...
Definition: amp_graphics.h:3481
void _Initialize(const Concurrency::accelerator_view &_Av, const Concurrency::accelerator_view &_Associated_av, _Input_iterator _Src_first, _Input_iterator _Src_last) __CPU_ONLY
Definition: amp_graphics.h:2511
texture_view(const texture_view< const _Value_type, _Rank > &_Other) __GPU
Construct a read-only texture_view from another read-only texture_view. Both are views of the same te...
Definition: amp_graphics.h:3227
Definition: amp_graphics.h:2906
Represent a short vector of 4 unorm's.
Definition: amp_short_vectors.h:12488
const gather_return_type gather_blue(const sampler &_Sampler, const coordinates_type &_Coord) const __GPU_ONLY
Sample the texture at the given coordinates using the specified sampling configuration and return the...
Definition: amp_graphics.h:3517
_Texture_base(const _Texture_base &_Src, unsigned int _Most_detailed_mipmap_level, unsigned int _View_mipmap_levels) __CPU_ONLY
Definition: amp_graphics.h:538
void copy_to(const writeonly_texture_view< _Value_type, _Rank > &_Dest) const
Copy-to, deep copy
Definition: amp_graphics.h:2206
norm_2::value_type _Scalar_type
Definition: amp_graphics.h:221
struct Concurrency::details::_Sampler_descriptor _Sampler_descriptor
texture & operator=(texture< _Value_type, _Rank > &&_Other)
Move assignment operator
Definition: amp_graphics.h:2163
texture(int _E0, int _E1, int _E2, unsigned int _Bits_per_scalar_element, const Concurrency::accelerator_view &_Av) __CPU_ONLY
Construct a texture with three integers and specified bits per scalar element, bound to a specific accelerator.
Definition: amp_graphics.h:1571
#define __CPU_ONLY
Definition: amprt.h:47
Definition: amp_graphics.h:623
IUnknown * _M_data_ptr
Definition: amprt.h:558
Represent a short vector of 2 double's.
Definition: amp_short_vectors.h:18590
_Short_vector_type_traits< _Value_type >::_Scalar_type scalar_type
Definition: amp_graphics.h:413
Exception thrown due to a C++ AMP runtime_exception. This is the base type for all C++ AMP exception ...
Definition: amprt_exceptions.h:29
sampler(filter_mode _Filter_mode) __CPU_ONLY
Constructs a sampler with specified filter mode (same for min, mag, mip), but with default addressing...
Definition: amp_graphics.h:2952
_Ret_ _Sampler * _Get_sampler_ptr() const __CPU_ONLY
Definition: amp_graphics.h:3116
_Ret_ void * _Get_host_ptr() const
Definition: amprt.h:2019
_AMPIMP accelerator __cdecl _Select_default_accelerator()
texture(const Concurrency::extent< _Rank > &_Ext, const void *_Source, unsigned int _Src_byte_size, unsigned int _Bits_per_scalar_element) __CPU_ONLY
Construct a texture from extents and specified bits per scalar element, initialized from a host buffe...
Definition: amp_graphics.h:1630
bool _Are_mipmap_levels_overlapping(const _Texture_descriptor *_Other) const __CPU_ONLY
Definition: amprt.h:699
void _Initialize(const Concurrency::accelerator_view &_Av, _Input_iterator _Src_first, _Input_iterator _Src_last) __CPU_ONLY
Definition: amp_graphics.h:2525
texture_view(const texture_view< const _Value_type, _Rank > &_Other, unsigned int _Most_detailed_mip, unsigned int _Mip_levels) __CPU_ONLY
Construct a read-only texture_view from another read-only texture_view. Allows narrowing down the acc...
Definition: amp_graphics.h:3246
Represent a short vector of 3 float's.
Definition: amp_short_vectors.h:8216
extent< _Rank > _Get_extent_at_level_unsafe(const extent< _Rank > &_Base_extent, unsigned int _Level) __GPU
Definition: xxamp_inl.h:95
unsigned int get_depth_pitch() const __CPU_ONLY
Definition: amp_graphics.h:2396
Represent a short vector of 4 int's.
Definition: amp_short_vectors.h:5400
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
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
Definition: amp_graphics.h:4779
void _Scalar_type
Definition: amp_graphics.h:40
Concurrency::extent< _Rank > get_mipmap_extent(unsigned int _Mipmap_level) const __GPU_ONLY
Returns the extent for specific mipmap level of this texture or texture view.
Definition: amp_graphics.h:451
const gather_return_type gather_blue(const coordinates_type &_Coord) const __GPU_ONLY
Sample the texture at the given coordinates using the predefined sampling configuration and return th...
Definition: amp_graphics.h:3594
_Ret_ _Sampler * _Get_sampler_ptr() const __CPU_ONLY
Definition: amprt.h:780
const gather_return_type gather_red(const coordinates_type &_Coord) const __GPU_ONLY
Sample the texture at the given coordinates using the predefined sampling configuration and return th...
Definition: amp_graphics.h:3556
A texture_view provides read-only access and sampling capability to a textu...
Definition: amp_graphics.h:3156
float value_type
Definition: amp_short_vectors.h:8950
void set(const index< _Rank > &_Index, const _Value_type &_Value) const __GPU_ONLY
Set the element indexed by _Index with value _Value.
Definition: amp_graphics.h:2893
unsigned int _Get_max_mipmap_levels(const extent< _Rank > &_Extent)
Definition: xxamp.h:1225
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
float _Scalar_type
Definition: amp_graphics.h:131
void * _M_data_ptr
Definition: amprt.h:720
texture(const texture &_Src)
Copy constructor. Deep copy
Definition: amp_graphics.h:2083
texture(int _E0, const Concurrency::accelerator_view &_Av) __CPU_ONLY
Construct a texture with the extent _E0, bound to a specific accelerator_view.
Definition: amp_graphics.h:777
unsigned int _Get_rank() const
Definition: amprt.h:2225
size_t _Get_depth_pitch() const
Definition: amprt.h:2321
unsigned int value_type
Definition: amp_short_vectors.h:525
_AMPIMP ULONG _Launch_async_copy_event_helper(const _Buffer_descriptor &_Src, const _Buffer_descriptor &_Dest, ULONGLONG _Num_bytes_for_copy)
Definition: amp_graphics.h:2914
texture(int _E0, int _E1, int _E2, _Input_iterator _Src_first, _Input_iterator _Src_last, const Concurrency::accelerator_view &_Av) __CPU_ONLY
Construct a texture with three integers and initialized from a pair of iterators into a containe...
Definition: amp_graphics.h:1214
void _Initialize(const Concurrency::accelerator_view &_Av, unsigned int _Bits_per_scalar_element) __CPU_ONLY
Definition: amp_graphics.h:2495
unorm_3::value_type _Scalar_type
Definition: amp_graphics.h:191
texture(const texture &_Src, const Concurrency::accelerator_view &_Av, const Concurrency::accelerator_view &_Associated_av)
Copy constructor. Deep copy
Definition: amp_graphics.h:2128
_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)
Definition: amp_graphics.h:3954
Definition: amp_graphics.h:3656
short_vector< typename details::_Texture_base< _Value_type, _Rank >::scalar_type, 4 >::type gather_return_type
Definition: amp_graphics.h:3161
texture(int _E0, int _E1, int _E2, const void *_Source, unsigned int _Src_byte_size, unsigned int _Bits_per_scalar_element, const Concurrency::accelerator_view &_Av) __CPU_ONLY
Construct a texture with three integers and specified bits per scalar element, initialized from a host buffer, bound to a specific accelerator_view.
Definition: amp_graphics.h:1938
texture_view(const texture< _Value_type, _Rank > &_Src) __CPU_ONLY
Construct a texture_view of a texture _Src on the host.
Definition: amp_graphics.h:3182
texture_view(texture< _Value_type, _Rank > &_Src, unsigned int _Mipmap_level=0) __CPU_ONLY
Construct a texture_view of a texture _Src on host.
Definition: amp_graphics.h:2711
int_3::value_type _Scalar_type
Definition: amp_graphics.h:110
static const _Short_vector_base_type_id _Format_base_type_id
Definition: amp_graphics.h:42
texture(int _E0, int _E1, int _E2, const void *_Source, unsigned int _Src_byte_size, unsigned int _Bits_per_scalar_element, const Concurrency::accelerator_view &_Av, const Concurrency::accelerator_view &_Associated_av) __CPU_ONLY
Construct a staging texture with three integers and specified bits per scalar element...
Definition: amp_graphics.h:1978
_AMPIMP ULONG _Start_copy_event_helper(const _Buffer_descriptor &_Src, const _Buffer_descriptor &_Dest, ULONGLONG _Num_bytes_for_copy)
size_t _Get_height(unsigned int _Mip_offset=0) const
Definition: amprt.h:2215
void _Set_view_mipmap_levels(unsigned int _View_mipmap_levels) __CPU_ONLY
Definition: amprt.h:669
__declspec(property(get=get_address_mode)) Concurrency Concurrency::graphics::address_mode get_address_mode() const __GPU
Returns the sampler's address mode
Definition: amp_graphics.h:3086
Concurrency::graphics::address_mode _M_address_mode
Definition: amp_graphics.h:3143
void _Set_texture_ptr(_In_opt_ _Texture *_Texture_ptr) __CPU_ONLY
Definition: amprt.h:674
void _Initialize(const Concurrency::accelerator_view &_Av, const Concurrency::accelerator_view &_Associated_av, const void *_Source, unsigned int _Src_byte_size, unsigned int _Bits_per_scalar_element) __CPU_ONLY
Definition: amp_graphics.h:2530
texture(texture &&_Other)
Move constructor
Definition: amp_graphics.h:2095
Definition: amp_graphics.h:2915
void advance(_InIt &_Where, _Diff _Off)
Definition: xutility:1089
Definition: amp_graphics.h:2905
void _Initialize(const Concurrency::accelerator_view &_Av, const details::_Texture_base< _Value_type, _Rank > &_Src) __CPU_ONLY
Definition: amp_graphics.h:2581
texture(const texture &_Src, const Concurrency::accelerator_view &_Av)
Copy constructor. Deep copy
Definition: amp_graphics.h:2109
Concurrency::details::_Texture_descriptor _Texture_descriptor
Definition: amp_graphics.h:500
double value_type
Definition: amp_short_vectors.h:18593
__declspec(property(get=get_filter_mode)) Concurrency Concurrency::graphics::filter_mode get_filter_mode() const __GPU
Returns the sampler's filter mode
Definition: amp_graphics.h:3077
const _Value_type operator()(const index< _Rank > &_Index) const __GPU_ONLY
Get the element value indexed by _Index.
Definition: amp_graphics.h:2811
void _Is_valid_data_length(unsigned int _Num_elems, unsigned int _Bits_per_elem)
Definition: amp_graphics.h:596
texture< _Value_type, _Rank > make_texture(const Concurrency::accelerator_view &_Av, _In_ IUnknown *_D3D_texture, DXGI_FORMAT _View_format=DXGI_FORMAT_UNKNOWN) __CPU_ONLY
Create an texture from a D3D texture interface pointer, optionally using the specified DXGI format fo...
Definition: amp_graphics.h:4896
texture(int _E0, _Input_iterator _Src_first, _Input_iterator _Src_last, const Concurrency::accelerator_view &_Av, const Concurrency::accelerator_view &_Associated_av) __CPU_ONLY
Construct a staging texture with integer _E0 and initialized from a pair of iterators into a con...
Definition: amp_graphics.h:1118
Represent a short vector of 2 float's.
Definition: amp_short_vectors.h:7874
sampler(filter_mode _Filter_mode, address_mode _Address_mode, float_4 _Border_color=float_4(0.0f, 0.0f, 0.0f, 0.0f)) __CPU_ONLY
Constructs a sampler with specified filter mode (same for min, mag, mip), addressing mode (same for a...
Definition: amp_graphics.h:2991
float_3::value_type _Scalar_type
Definition: amp_graphics.h:151
Represent a short vector of 3 norm's.
Definition: amp_short_vectors.h:15325
texture(int _E0, int _E1, int _E2, _Input_iterator _Src_first, _Input_iterator _Src_last, const Concurrency::accelerator_view &_Av, const Concurrency::accelerator_view &_Associated_av) __CPU_ONLY
Construct a staging texture with three integers and initialized from a pair of iterators into a ...
Definition: amp_graphics.h:1252
_Texture_descriptor _M_texture_descriptor
Definition: amp_graphics.h:593
const _Value_type operator()(const index< _Rank > &_Index) const __GPU_ONLY
Get the element value indexed by _Index.
Definition: amp_graphics.h:2269
A texture_view provides read and write access to a texture. Note that currently texture_view can only...
Definition: amp_graphics.h:625
double_3::value_type _Scalar_type
Definition: amp_graphics.h:272
Represent a short vector of 4 float's.
Definition: amp_short_vectors.h:8947
_Ret_ _Texture * _Get_texture() const __CPU_ONLY
Definition: amp_graphics.h:576
texture(int _E0, int _E1, _Input_iterator _Src_first, _Input_iterator _Src_last, const Concurrency::accelerator_view &_Av, const Concurrency::accelerator_view &_Associated_av) __CPU_ONLY
Construct a staging texture with two integers and initialized from a pair of iterators into a co...
Definition: amp_graphics.h:1182
double value_type
Definition: amp_short_vectors.h:18935
const gather_return_type gather_green(const coordinates_type &_Coord) const __GPU_ONLY
Sample the texture at the given coordinates using the predefined sampling configuration and return th...
Definition: amp_graphics.h:3574
float_4::value_type _Scalar_type
Definition: amp_graphics.h:161
_Texture_base(const Concurrency::extent< _Rank > &_Ext, unsigned int _Mipmap_levels=1) __CPU_ONLY
Definition: amp_graphics.h:508
bool operator==(const _Texture_base &_Other) const __CPU_ONLY
Definition: amp_graphics.h:567
const gather_return_type _Gather(const sampler &_Sampler, const coordinates_type &_Coord, unsigned int _Component) const __GPU_ONLY
Definition: amp_graphics.h:3622
const _Value_type operator[](const index< _Rank > &_Index) const __GPU_ONLY
Get the element value indexed by _Index.
Definition: amp_graphics.h:2776
integral_constant< bool, true > true_type
Definition: xtr1common:40
Definition: type_traits:931
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
Define an N-dimensional index point; which may also be viewed as a vector based at the origin in N-sp...
Definition: amp.h:53
unsigned int value_type
Definition: amp_short_vectors.h:927
static const unsigned int _Num_channels
Definition: amp_graphics.h:43
texture_view(const texture_view< _Value_type, _Rank > &_Other) __CPU_ONLY
Construct a read-only texture_view of a writable texture_view.
Definition: amp_graphics.h:3216
#define _Inout_
Definition: sal.h:375
filter_mode
filter modes supported for texture sampling
Definition: amp_graphics.h:2902
texture(int _E0, int _E1, const void *_Source, unsigned int _Src_byte_size, unsigned int _Bits_per_scalar_element, const Concurrency::accelerator_view &_Av) __CPU_ONLY
Construct a texture with two integers and specified bits per scalar element, initialized from a host buffer, bound to a specific accelerator_view.
Definition: amp_graphics.h:1867
bool _Are_mipmap_levels_overlapping(const _Texture_base &_Other) const __CPU_ONLY
Definition: amp_graphics.h:586
uint_4::value_type _Scalar_type
Definition: amp_graphics.h:80
texture(int _E0, int _E1, int _E2, _Input_iterator _Src_first, _Input_iterator _Src_last) __CPU_ONLY
Construct a texture with three integers and initialized from a pair of iterators into a containe...
Definition: amp_graphics.h:1004
texture_view(const texture_view< _Value_type, _Rank > &_Other) __GPU
Construct a texture_view from another texture_view. Both are views of the same texture.
Definition: amp_graphics.h:2739
_Ret_ _Texture * _Get_texture_ptr() const __CPU_ONLY
Definition: amprt.h:653
texture(const Concurrency::extent< _Rank > &_Ext) __CPU_ONLY
Construct a texture from extents.
Definition: amp_graphics.h:666
Concurrency::extent< _Rank > _M_extent
Definition: amp_graphics.h:592
Concurrency::details::_Sampler_descriptor _Sampler_descriptor
Definition: amp_graphics.h:3102
Definition: type_traits:950
_Texture_base(const Concurrency::extent< _Rank > &_Ext, const _Texture_descriptor &_Desc) __CPU_ONLY
Definition: amp_graphics.h:552
void _Initialize(const Concurrency::accelerator_view &_Av, const Concurrency::accelerator_view &_Associated_av) __CPU_ONLY
Definition: amp_graphics.h:2500
texture(int _E0, int _E1, int _E2, const Concurrency::accelerator_view &_Av) __CPU_ONLY
Construct a texture from three integer extents, bound to a specific accelerator_view.
Definition: amp_graphics.h:873
basic_stringstream< char, char_traits< char >, allocator< char > > stringstream
Definition: iosfwd:688
texture(const Concurrency::extent< _Rank > &_Ext, const Concurrency::accelerator_view &_Av, const Concurrency::accelerator_view &_Associated_av) __CPU_ONLY
Construct a staging texture from extents, bound to a specific accelerator_view and an associated acce...
Definition: amp_graphics.h:760
float value_type
Definition: amp_short_vectors.h:7877
int value_type
Definition: amp_short_vectors.h:5403
texture(int _E0, int _E1, const void *_Source, unsigned int _Src_byte_size, unsigned int _Bits_per_scalar_element) __CPU_ONLY
Construct a texture with two integers and specified bits per scalar element, initialized from a ...
Definition: amp_graphics.h:1682
unsigned int get_bits_per_scalar_element() const __CPU_ONLY
Definition: amp_graphics.h:469
~texture_view() __GPU
Destructor
Definition: amp_graphics.h:2763
sampler make_sampler(_In_ IUnknown *_D3D_sampler) __CPU_ONLY
Create a sampler from a D3D sampler state interface pointer.
Definition: amp_graphics.h:4935
Definition: amp_graphics.h:2917
texture(int _E0, int _E1, _Input_iterator _Src_first, _Input_iterator _Src_last) __CPU_ONLY
Construct a texture with two integers and initialized from a pair of iterators into a container...
Definition: amp_graphics.h:974
void _Is_valid_mipmap_range(unsigned int _Src_view_mipmap_levels, unsigned int _Dst_most_detailed_level, unsigned int _Dst_view_mipmap_levels)
Definition: xxamp.h:1266
double _Scalar_type
Definition: amp_graphics.h:252
concurrency::completion_future copy_async(const _Src_type &_Src, _Out_ void *_Dst, unsigned int _Dst_byte_size)
Asynchronously copies the contents of the source texture into the destination host buffer...
Definition: amp_graphics.h:4269
void _Set_sampler_ptr(_In_opt_ _Sampler *_Sampler_ptr) __CPU_ONLY
Definition: amprt.h:785
texture(int _E0, int _E1, int _E2) __CPU_ONLY
Construct a texture from three integer extents.
Definition: amp_graphics.h:719
const gather_return_type gather_green(const sampler &_Sampler, const coordinates_type &_Coord) const __GPU_ONLY
Sample the texture at the given coordinates using the specified sampling configuration and return the...
Definition: amp_graphics.h:3498
#define __GPU_ONLY
Definition: amprt.h:46
norm_3::value_type _Scalar_type
Definition: amp_graphics.h:231
size_t _Get_width(unsigned int _Mip_offset=0) const
Definition: amprt.h:2210
_Ret_ IUnknown * get_sampler(const Concurrency::accelerator_view &_Av, const sampler &_Sampler) __CPU_ONLY
Get the D3D sampler state interface on the given accelerator view that represents the specified sampl...
Definition: amp_graphics.h:4921
int value_type
Definition: amp_short_vectors.h:4600
bool _Is_staging() const
Definition: amprt.h:2051
Definition: amp_graphics.h:2918
void _Initialize(const Concurrency::accelerator_view &_Av, const Concurrency::accelerator_view &_Associated_av, const details::_Texture_base< _Value_type, _Rank > &_Src) __CPU_ONLY
Definition: amp_graphics.h:2552
void _Initialize(const Concurrency::accelerator_view &_Av, const Concurrency::accelerator_view &_Associated_av, unsigned int _Bits_per_scalar_element) __CPU_ONLY
Definition: amp_graphics.h:2428
bool _Is_cpu_accelerator(const accelerator &_Accl)
Definition: amprt.h:3401
~texture() __CPU_ONLY
Destructor
Definition: amp_graphics.h:2225
struct Concurrency::details::_Texture_descriptor _Texture_descriptor
texture_view(const texture< _Value_type, _Rank > &_Src, unsigned int _Most_detailed_mip, unsigned int _Mip_levels) __CPU_ONLY
Construct a read-only texture_view with specific range of mipmap levels of a texture _Src on the host...
Definition: amp_graphics.h:3202
bool _Should_create_staging_texture(const Concurrency::accelerator_view &_Av, const Concurrency::accelerator_view &_Associated_av)
Definition: amp_graphics.h:2423
texture(int _E0, int _E1, const void *_Source, unsigned int _Src_byte_size, unsigned int _Bits_per_scalar_element, const Concurrency::accelerator_view &_Av, const Concurrency::accelerator_view &_Associated_av) __CPU_ONLY
Construct a staging texture with two integers and specified bits per scalar element...
Definition: amp_graphics.h:1904
_In_ int _Value
Definition: setjmp.h:173
sampler & operator=(sampler &&_Other) __GPU
Move assignment operator.
Definition: amp_graphics.h:3059
Definition: amp_graphics.h:2904
texture_view(texture< _Value_type, _Rank > &_Src) __GPU_ONLY
Construct a texture_view of a texture _Src on an accelerator.
Definition: amp_graphics.h:2725
unsigned int _Get_bits_per_channel() const
Definition: amprt.h:2245
_Texture_base() __CPU_ONLY
Definition: amp_graphics.h:502
Represent a short vector of 3 unsigned int's.
Definition: amp_short_vectors.h:924
_FwdIt _Last
Definition: algorithm:1936
unorm_4::value_type _Scalar_type
Definition: amp_graphics.h:201
Represent a short vector of 2 norm's.
Definition: amp_short_vectors.h:14929
void _Initialize(const Concurrency::accelerator_view &_Av, const Concurrency::accelerator_view &_Associated_av, const void *_Source, unsigned int _Src_byte_size) __CPU_ONLY
Definition: amp_graphics.h:2541
const _Texture_descriptor & _Get_texture_descriptor(const _Texture_type &_Tex) __GPU
Definition: xxamp.h:1094
texture(const texture_view< _Value_type, _Rank > &_Src, const Concurrency::accelerator_view &_Acc_view, const Concurrency::accelerator_view &_Associated_av)
Construct a staging texture from a texture_view on another accelerator_view. Deep copy ...
Definition: amp_graphics.h:2052
_AMPIMP void _Write_end_event(ULONG _Span_id)
#define _Ret_
Definition: sal.h:996
int value_type
Definition: amp_short_vectors.h:4192
concurrency::completion_future _Start_async_op_wait_event_helper(ULONG _Async_op_id, _Event _Ev)
Definition: amprt.h:3753
texture(int _E0, int _E1, int _E2, unsigned int _Bits_per_scalar_element) __CPU_ONLY
Construct a texture with three integers and specified bits per scalar element ...
Definition: amp_graphics.h:1363
Represent a short vector of 4 norm's.
Definition: amp_short_vectors.h:16120
__declspec(property(get=get_extent)) Concurrency Concurrency::extent< _Rank > get_extent() const __GPU
Returns the extent that defines the shape of this texture or texture view.
Definition: amp_graphics.h:420
texture(int _E0, _Input_iterator _Src_first, _Input_iterator _Src_last) __CPU_ONLY
Construct a texture with the extent _E0 and from a pair of iterators into a container.
Definition: amp_graphics.h:948
texture(const Concurrency::extent< _Rank > &_Ext, unsigned int _Bits_per_scalar_element, unsigned int _Mipmap_levels) __CPU_ONLY
Construct a texture from extents, specified bits per scalar element and number of mipmap levels ...
Definition: amp_graphics.h:1295
texture(const texture_view< const _Value_type, _Rank > &_Src)
Construct a texture from a read-only texture_view. Deep copy
Definition: amp_graphics.h:2003
class __declspec(deprecated("writeonly_texture_view is deprecated. Please use texture_view instead.")) writeonly_texture_view
A writeonly_texture_view provides writeonly access to a texture.
Definition: amp_graphics.h:2598
texture_view< _Value_type, _Rank > & operator=(const texture_view< _Value_type, _Rank > &_Other) __GPU
Assignment operator. This texture_view becomes a view of the same texture which _Other is a view of...
Definition: amp_graphics.h:2750