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);
612 template <
typename _Value_type,
int _Rank>
614 template <
typename _Value_type,
int _Rank>
616 template <
typename _Value_type,
int _Rank>
622 template<
typename _Value_type,
int _Rank>
645 template<
typename _Value_type,
int _Rank>
648 static_assert(!std::is_const<_Value_type>::value,
"const value type is not supported for texture.");
675 static_assert(_Rank == 1,
"texture(int) is only permissible on texture<value_type, 1>.");
693 static_assert(_Rank == 2,
"texture(int, int) is only permissible on texture<value_type, 2>.");
714 static_assert(_Rank == 3,
"texture(int, int, int) is only permissible on texture<value_type, 3>.");
772 static_assert(_Rank == 1,
"texture(int, accelerator_view) is only permissible on texture<value_type, 1>.");
796 static_assert(_Rank == 1,
"texture(int, accelerator_view, accelerator_view) is only permissible on texture<value_type, 1>.");
817 static_assert(_Rank == 2,
"texture(int, int, accelerator_view) is only permissible on texture<value_type, 2>.");
844 static_assert(_Rank == 2,
"texture(int, int, accelerator_view, accelerator_view) is only permissible on texture<value_type, 2>.");
868 static_assert(_Rank == 3,
"texture(int, int, int, accelerator_view) is only permissible on texture<value_type, 3>.");
898 static_assert(_Rank == 3,
"texture(int, int, int, accelerator_view, accelerator_view) is only permissible on texture<value_type, 3>.");
936 template<
typename _Input_iterator>
texture(
int _E0, _Input_iterator _Src_first, _Input_iterator _Src_last) __CPU_ONLY
939 static_assert(_Rank == 1,
"texture(int, iterator, iterator) is only permissible on texture<value_type, 1>.");
960 template<
typename _Input_iterator>
texture(
int _E0,
int _E1, _Input_iterator _Src_first, _Input_iterator _Src_last) __CPU_ONLY
963 static_assert(_Rank == 2,
"texture(int, int, iterator, iterator) is only permissible on texture<value_type, 2>.");
988 template<
typename _Input_iterator>
texture(
int _E0,
int _E1,
int _E2, _Input_iterator _Src_first, _Input_iterator _Src_last) __CPU_ONLY
991 static_assert(_Rank == 3,
"texture(int, int, int, iterator, iterator) is only permissible on texture<value_type, 3>.");
1046 _Initialize(_Av, _Associated_av, _Src_first, _Src_last);
1067 static_assert(_Rank == 1,
"texture(int, iterator, iterator, accelerator_view) is only permissible on texture<value_type, 1>.");
1097 static_assert(_Rank == 1,
"texture(int, iterator, iterator, accelerator_view, accelerator_view) is only permissible on texture<value_type, 1>.");
1100 _Initialize(_Av, _Associated_av, _Src_first, _Src_last);
1124 static_assert(_Rank == 2,
"texture(int, int, iterator, iterator, accelerator_view) is only permissible on texture<value_type, 2>.");
1157 static_assert(_Rank == 2,
"texture(int, int, iterator, iterator, accelerator_view, accelerator_view) is only permissible on texture<value_type, 2>.");
1160 _Initialize(_Av, _Associated_av, _Src_first, _Src_last);
1187 static_assert(_Rank == 3,
"texture(int, int, int, iterator, iterator, accelerator_view) is only permissible on texture<value_type, 3>.");
1223 static_assert(_Rank == 3,
"texture(int, int, int, iterator, iterator, accelerator_view, accelerator_view) is only permissible on texture<value_type, 3>.");
1226 _Initialize(_Av, _Associated_av, _Src_first, _Src_last);
1281 texture(
int _E0,
unsigned int _Bits_per_scalar_element) __CPU_ONLY
1284 static_assert(_Rank == 1,
"texture(int, unsigned int) is only permissible on texture<value_type, 1>.");
1303 texture(
int _E0,
int _E1,
unsigned int _Bits_per_scalar_element) __CPU_ONLY
1306 static_assert(_Rank == 2,
"texture(int, int, unsigned int) is only permissible on texture<value_type, 2>.");
1331 texture(
int _E0,
int _E1,
int _E2,
unsigned int _Bits_per_scalar_element) __CPU_ONLY
1334 static_assert(_Rank == 3,
"texture(int, int, int, unsigned int) is only permissible on texture<value_type, 3>.");
1409 _Initialize(_Av, _Associated_av, _Bits_per_scalar_element);
1430 static_assert(_Rank == 1,
"texture(int, unsigned int, accelerator_view) is only permissible on texture<value_type, 1>.");
1458 static_assert(_Rank == 1,
"texture(int, unsigned int, accelerator_view, accelerator_view) is only permissible on texture<value_type, 1>.");
1459 _Initialize(_Av, _Associated_av, _Bits_per_scalar_element);
1483 static_assert(_Rank == 2,
"texture(int, int, unsigned int, accelerator_view) is only permissible on texture<value_type, 2>.");
1514 static_assert(_Rank == 2,
"texture(int, int, unsigned int, accelerator_view, accelerator_view) is only permissible on texture<value_type, 2>.");
1515 _Initialize(_Av, _Associated_av, _Bits_per_scalar_element);
1542 static_assert(_Rank == 3,
"texture(int, int, int, unsigned int, accelerator_view) is only permissible on texture<value_type, 3>.");
1576 static_assert(_Rank == 3,
"texture(int, int, int, unsigned int, accelerator_view, accelerator_view) is only permissible on texture<value_type, 3>.");
1577 _Initialize(_Av, _Associated_av, _Bits_per_scalar_element);
1622 texture(
int _E0,
const void *
_Source,
unsigned int _Src_byte_size,
unsigned int _Bits_per_scalar_element) __CPU_ONLY
1625 static_assert(_Rank == 1,
"texture(int, void *, unsigned int, unsigned int) is only permissible on texture<value_type, 1>.");
1650 texture(
int _E0,
int _E1,
const void *
_Source,
unsigned int _Src_byte_size,
unsigned int _Bits_per_scalar_element) __CPU_ONLY
1653 static_assert(_Rank == 2,
"texture(int, int, void *, unsigned int, unsigned int) is only permissible on texture<value_type, 2>.");
1682 texture(
int _E0,
int _E1,
int _E2,
const void *
_Source,
unsigned int _Src_byte_size,
unsigned int _Bits_per_scalar_element) __CPU_ONLY
1685 static_assert(_Rank == 3,
"texture(int, int, int, void *, unsigned int, unsigned int) is only permissible on texture<value_type, 3>.");
1773 static_assert(_Rank == 1,
"texture(int, void *, unsigned int, unsigned int, accelerator_view) is only permissible on texture<value_type, 1>.");
1807 static_assert(_Rank == 1,
"texture(int, void *, unsigned int, unsigned int, accelerator_view, accelerator_view) is only permissible on texture<value_type, 1>.");
1838 static_assert(_Rank == 2,
"texture(int, int, void *, unsigned int, unsigned int, accelerator_view) is only permissible on texture<value_type, 2>.");
1875 static_assert(_Rank == 2,
"texture(int, int, void *, unsigned int, unsigned int, accelerator_view, accelerator_view) is only permissible on texture<value_type, 2>.");
1909 static_assert(_Rank == 3,
"texture(int, int, int, void *, unsigned int, unsigned int, accelerator_view) is only permissible on texture<value_type, 3>.");
1949 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>.");
2054 _Initialize(_Src.accelerator_view, _Src.associated_accelerator_view, _Src);
2113 if (
this != &_Other)
2117 _Initialize(_Other.accelerator_view, _Other.associated_accelerator_view, _Other);
2133 if (
this != &_Other)
2139 _Other._M_texture_descriptor._Set_texture_ptr(
NULL);
2152 if (this->
extent != _Dest.extent)
2154 throw runtime_exception(
"The source and destination textures must have the exactly the same extent.", E_INVALIDARG);
2161 _Texture_base::_Copy_to(_Dest);
2172 #pragma warning( push )
2173 #pragma warning( disable : 4996 ) //writeonly_texture_view is deprecated
2176 if (this->
extent != _Dest.extent)
2178 throw runtime_exception(
"The source and destination textures must have the exactly the same extent.", E_INVALIDARG);
2185 _Texture_base::_Copy_to(_Dest);
2224 static_assert(_Rank == 1,
"value_type texture::operator[](int) is only permissible on texture<value_type, 1>.");
2239 return (*
this)[_Index];
2253 static_assert(_Rank == 1,
"value_type texture::operator()(int) is only permissible on texture<value_type, 1>.");
2271 static_assert(_Rank == 2,
"value_type texture::operator()(int, int) is only permissible on texture<value_type, 2>.");
2272 return (*
this)[
index<2>(_I0, _I1)];
2292 static_assert(_Rank == 3,
"value_type texture::operator()(int, int, int) is only permissible on texture<value_type, 3>.");
2293 return (*
this)[
index<3>(_I0, _I1, _I2)];
2307 return (*
this)[_Index];
2338 const void*
data() const __CPU_ONLY
2350 static_assert(_Rank >= 2,
"row_pitch is only applicable to staging textures with rank 2 or higher.");
2353 throw runtime_exception(
"row_pitch is only applicable to staging textures.", E_INVALIDARG);
2366 static_assert(_Rank == 3,
"depth_pitch is only applicable to staging textures with rank 3.");
2369 throw runtime_exception(
"depth_pitch is only applicable to staging textures.", E_INVALIDARG);
2387 : details::
_Texture_base<_Value_type, _Rank>(_Ext, _Descriptor)
2398 if (_Bits_per_scalar_element != 8 && _Bits_per_scalar_element != 16 &&
2399 _Bits_per_scalar_element != 32 && _Bits_per_scalar_element != 64)
2401 throw runtime_exception(
"Invalid _Bits_per_scalar_element argument - it can only be 8, 16, 32, or 64.", E_INVALIDARG);
2406 #pragma warning( push )
2407 #pragma warning( disable : 4127 ) // conditional expression is constant
2410 throw runtime_exception(
"Invalid _Bits_per_scalar_element argument - 64 is only valid for texture of double based short vector types.", E_INVALIDARG);
2415 throw runtime_exception(
"Invalid _Bits_per_scalar_element argument - it can only be 64 for texture of double based short vector types.", E_INVALIDARG);
2422 unsigned int _Bits_per_channel = _Bits_per_scalar_element;
2440 throw runtime_exception(
"Creating staging textures with mipmap levels > 1 is not supported", E_INVALIDARG);
2443 _Tex_ptr = _Texture::_Create_stage_texture(
2460 #pragma warning( pop )
2470 _Initialize(_Av, _Associated_av, Concurrency::graphics::details::_Get_default_bits_per_scalar_element<_Value_type>());
2478 template<
typename _Input_iterator>
2492 template<
typename _Input_iterator>
2500 _Initialize(_Av, _Associated_av, _Bits_per_scalar_element);
2522 if (
_Src.bits_per_scalar_element != 0)
2564 #pragma warning( push )
2565 #pragma warning( disable : 4996 ) //writeonly_texture_view is deprecated
2568 static_assert(!std::is_const<_Value_type>::value,
"const value type is not supported for writeonly_texture_view.");
2578 : _Texture_base(_Src, 0, 1)
2582 throw runtime_exception(
"writeonly_texture_view cannot be created from a 3-channel texture with 32 bits per scalar element.", E_INVALIDARG);
2585 throw runtime_exception(
"writeonly_texture_view cannot be created from a staging texture object.", E_INVALIDARG);
2596 : _Texture_base(_Src,
true)
2610 : _Texture_base(_Src)
2622 if (
this != &_Other)
2624 _M_extent = _Other._M_extent;
2625 _M_texture_descriptor = _Other._M_texture_descriptor;
2651 #pragma warning( pop )
2664 template <
typename _Value_type,
int _Rank>
class texture_view :
public details::_Texture_base<_Value_type, _Rank>
2683 throw runtime_exception(
"texture_view cannot be created from a staging texture object.", E_INVALIDARG);
2720 if (
this != &_Other)
2766 static_assert(_Rank == 1,
"const value_type operator[](int) is only permissible on texture_view<value_type, 1>.");
2781 return (*
this)[_Index];
2795 static_assert(_Rank == 1,
"const value_type operator()(int) is only permissible on texture_view<value_type, 1>.");
2813 static_assert(_Rank == 2,
"const value_type operator()(int, int) is only permissible on texture_view<value_type, 2>.");
2814 return (*
this)[
index<2>(_I0, _I1)];
2834 static_assert(_Rank == 3,
"const value_type operator()(int, int, int) is only permissible on texture_view<value_type, 3>.");
2835 return (*
this)[
index<3>(_I0, _I1, _I2)];
2849 return (*
this)[_Index];
2897 template <
typename _Value_type,
int _Rank>
2994 _Other._M_sampler_descriptor._Set_sampler_ptr(
NULL);
3008 if (
this != &_Other)
3029 if (
this != &_Other)
3036 _Other._M_sampler_descriptor._Set_sampler_ptr(
NULL);
3073 sampler(
const _Sampler_descriptor & _Descriptor) __CPU_ONLY
3154 throw runtime_exception(
"Read-only texture_view cannot be created from a staging texture object.", E_INVALIDARG);
3174 throw runtime_exception(
"Read-only texture_view cannot be created from a staging texture object.", E_INVALIDARG);
3227 if (
this != &_Other)
3283 static_assert(_Rank == 1,
"value_type operator[](int) is only permissible on texture_view<value_type, 1>.");
3298 return (*
this)[_Index];
3312 static_assert(_Rank == 1,
"value_type texture_view::operator()(int) is only permissible on texture_view<value_type, 1>.");
3330 static_assert(_Rank == 2,
"value_type texture_view::operator()(int, int) is only permissible on texture_view<value_type, 2>.");
3331 return (*
this)[
index<2>(_I0, _I1)];
3351 static_assert(_Rank == 3,
"value_type texture_view::operator()(int, int, int) is only permissible on texture_view<value_type, 3>.");
3352 return (*
this)[
index<3>(_I0, _I1, _I2)];
3421 template<filter_mode _Filter_mode = filter_linear, address_mode _Address_mode = address_clamp>
3422 value_type
sample(
const coordinates_type& _Coord,
float _Level_of_detail = 0.0f) const
__GPU_ONLY
3427 static_assert((_Filter_mode ==
filter_point || _Filter_mode ==
filter_linear),
"Invalid filter mode for sample method.");
3429 "Invalid address mode for sample method.");
3451 return _Gather(_Sampler, _Coord, 0);
3470 return _Gather(_Sampler, _Coord, 1);
3489 return _Gather(_Sampler, _Coord, 2);
3508 return _Gather(_Sampler, _Coord, 3);
3523 template<address_mode _Address_mode = address_clamp>
3526 return _Gather<_Address_mode>(_Coord, 0);
3541 template<address_mode _Address_mode = address_clamp>
3546 return _Gather<_Address_mode>(_Coord, 1);
3561 template<address_mode _Address_mode = address_clamp>
3566 return _Gather<_Address_mode>(_Coord, 2);
3581 template<address_mode _Address_mode = address_clamp>
3586 return _Gather<_Address_mode>(_Coord, 3);
3595 static_assert(rank == 2,
"gather methods are only permissible on texture_view<value_type, 2>.");
3597 gather_return_type _Tmp;
3602 template<address_mode _Address_mode>
3603 const gather_return_type
_Gather(
const coordinates_type& _Coord,
unsigned int _Component)
const __GPU_ONLY
3608 static_assert(rank == 2,
"gather methods are only permissible on texture_view<value_type, 2>.");
3610 "Invalid address mode for gather methods.");
3612 gather_return_type _Tmp;
3623 template <
typename T>
3630 template <
typename _Value_type,
int _Rank>
3637 template <
typename _Value_type,
int _Rank>
3644 template <
typename _Value_type,
int _Rank>
3651 template <
typename _Value_type,
int _Rank>
3658 template <
typename _Value_type,
int _Rank>
3665 template <
typename _Value_type,
int _Rank>
3672 template <
typename _Value_type,
int _Rank>
3679 template <
typename _Value_type,
int _Rank>
3687 template <
typename _Value_type,
int _Rank>
3696 template <
typename _Input_iterator,
typename _Value_type>
3698 _In_ _Texture *_Dst,
const size_t *_Dst_offset,
unsigned int _Dst_mipmap_level,
3699 const size_t *_Copy_extent,
const size_t *_Preferred_copy_chunk_extent =
NULL)
3705 _ASSERTE((
unsigned int)
std::distance(_First, _Last) >= (_Copy_extent[0] * _Copy_extent[1] * _Copy_extent[2]));
3708 _ASSERTE((_Dst_offset[0] + _Copy_extent[0]) <= _Dst->_Get_width(_Dst_mipmap_level));
3709 _ASSERTE((_Dst_offset[1] + _Copy_extent[1]) <= _Dst->_Get_height(_Dst_mipmap_level));
3710 _ASSERTE((_Dst_offset[2] + _Copy_extent[2]) <= _Dst->_Get_depth(_Dst_mipmap_level));
3712 #pragma warning( push )
3713 #pragma warning( disable : 4127 ) // conditional expression is constant
3714 if ((
sizeof(_Value_type) >
sizeof(
unsigned char)) && (_Dst->_Get_bits_per_element() != (8U *
sizeof(_Value_type))))
3716 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);
3718 #pragma warning( pop )
3721 if (_Dst->_Get_host_ptr() !=
NULL)
3724 _ASSERTE(((_Dst->_Get_bits_per_element() * _Copy_extent[0]) % (8U *
sizeof(_Value_type))) == 0);
3726 size_t _Row_size = (_Dst->_Get_bits_per_element() * _Copy_extent[0]) >> 3;
3727 size_t _Depth_slice_size = _Row_size * _Copy_extent[1];
3729 size_t _Row_pitch = _Dst->_Get_row_pitch();
3730 size_t _Depth_pitch = _Dst->_Get_depth_pitch();
3732 _ASSERTE(_Depth_pitch >= _Depth_slice_size);
3734 size_t _Dst_offset_in_bytes = ((_Dst_offset[0] * _Dst->_Get_bits_per_element()) >> 3) +
3735 (_Dst_offset[1] * _Row_pitch) + (_Dst_offset[2] * _Depth_pitch);
3737 unsigned char *_PDest =
reinterpret_cast<unsigned char*
>(_Dst->_Get_host_ptr()) + _Dst_offset_in_bytes;
3739 _Copy_data_on_host(_Dst->_Get_rank(), _First,
reinterpret_cast<_Value_type*
>(_PDest),
3740 _Row_size /
sizeof(_Value_type), _Copy_extent[1], _Copy_extent[2],
3741 _Row_pitch, _Depth_pitch, _Row_size /
sizeof(_Value_type), _Depth_slice_size /
sizeof(_Value_type));
3752 std::array<size_t, 3> _Copy_chunk_extent;
3753 if (_Preferred_copy_chunk_extent !=
NULL)
3755 std::copy(&_Preferred_copy_chunk_extent[0], &_Preferred_copy_chunk_extent[3], _Copy_chunk_extent.begin());
3759 _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());
3762 std::array<size_t, 3> _Curr_copy_offset;
3763 std::copy(&_Dst_offset[0], &_Dst_offset[3], _Curr_copy_offset.begin());
3765 std::array<size_t, 3> _Remaining_copy_extent;
3766 std::copy(&_Copy_extent[0], &_Copy_extent[3], _Remaining_copy_extent.begin());
3768 bool _Truncated_copy =
false;
3772 std::array<size_t, 3> _Curr_copy_extent;
3773 _Truncated_copy =
_Get_chunked_staging_texture(_Dst, _Copy_chunk_extent.data(), _Remaining_copy_extent.data(), _Curr_copy_extent.data(), &_Dst_staging_tex_ptr);
3779 std::array<size_t, 3> _Dst_staging_tex_offset;
3780 _Dst_staging_tex_offset.fill(0);
3781 _Event _Temp_ev = _Copy_async_impl<_Input_iterator, _Value_type>(_First,
_Last, _Dst_staging_tex_ptr,
3782 _Dst_staging_tex_offset.data(), 0, _Curr_copy_extent.data(), _Copy_chunk_extent.data());
3786 _Temp_ev = _Temp_ev.
_Add_continuation(std::function<
_Event()>([_Dst_staging_tex_ptr, _Dst_tex_ptr, _Curr_copy_extent,
3787 _Dst_staging_tex_offset, _Curr_copy_offset, _Dst_mipmap_level]()
mutable ->
_Event
3789 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);
3795 if (_Truncated_copy)
3798 _Curr_copy_offset[_Dst->_Get_rank() - 1] += _Curr_copy_extent[_Dst->_Get_rank() - 1];
3799 std::advance(_First, (((_Curr_copy_extent[0] * _Dst->_Get_bits_per_element()) >> 3) /
sizeof(_Value_type)) * _Curr_copy_extent[1] * _Curr_copy_extent[2]);
3802 }
while (_Truncated_copy);
3807 template <
typename _Output_iterator,
typename _Value_type>
3808 _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)
3819 #pragma warning( push )
3820 #pragma warning( disable : 4127 ) // conditional expression is constant
3821 if ((
sizeof(_Value_type) >
sizeof(
unsigned char)) && (_Tex->
_Get_bits_per_element() != (8U *
sizeof(_Value_type))))
3823 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);
3825 #pragma warning( pop )
3834 size_t _Depth_slice_size = _Row_size * _Copy_extent[1];
3839 _ASSERTE(_Depth_pitch >= _Depth_slice_size);
3842 (_Tex_offset[1] * _Row_pitch) + (_Tex_offset[2] * _Depth_pitch);
3844 unsigned char *_PTex =
reinterpret_cast<unsigned char*
>(_Tex->
_Get_host_ptr()) + _Tex_offset_in_bytes;
3847 _Row_size /
sizeof(_Value_type), _Copy_extent[1], _Copy_extent[2],
3848 _Row_pitch, _Depth_pitch, _Row_size /
sizeof(_Value_type), _Depth_slice_size /
sizeof(_Value_type));
3860 std::array<size_t, 3> _Copy_chunk_extent;
3861 if (_Preferred_copy_chunk_extent !=
nullptr)
3863 std::copy(&_Preferred_copy_chunk_extent[0], &_Preferred_copy_chunk_extent[3], _Copy_chunk_extent.begin());
3870 std::array<size_t, 3> _Curr_copy_offset;
3871 std::copy(&_Tex_offset[0], &_Tex_offset[3], _Curr_copy_offset.begin());
3873 std::array<size_t, 3> _Remaining_copy_extent;
3874 std::copy(&_Copy_extent[0], &_Copy_extent[3], _Remaining_copy_extent.begin());
3876 bool _Truncated_copy =
false;
3879 std::array<size_t, 3> _Curr_copy_extent;
3880 _Truncated_copy =
_Get_chunked_staging_texture(_Tex, _Copy_chunk_extent.data(), _Remaining_copy_extent.data(), _Curr_copy_extent.data(), &_Staging_tex_ptr);
3883 std::array<size_t, 3> _Staging_tex_offset;
3884 _Staging_tex_offset.fill(0);
3886 _Staging_tex_ptr.
_Get_ptr(), _Staging_tex_offset.data(), 0,
3887 _Curr_copy_extent.data(), _Copy_chunk_extent.data());
3892 if (!_Truncated_copy)
3895 _Curr_copy_extent, _Staging_tex_offset, _Copy_chunk_extent, _First]()
mutable ->
_Event
3897 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());
3904 _Curr_copy_offset[_Tex->
_Get_rank() - 1] += _Curr_copy_extent[_Tex->
_Get_rank() - 1];
3905 return _Ev._Add_continuation(std::function<
_Event()>([_Staging_tex_ptr, _First, _Curr_copy_extent,
3906 _Staging_tex_offset, _Tex_ptr, _Curr_copy_offset, _Remaining_copy_extent, _Copy_chunk_extent, _Src_mipmap_level]()
mutable ->
_Event
3909 _Output_iterator _New_dst_iter = _First;
3910 _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]);
3911 _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());
3914 _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());
3921 template <
typename _Value_type,
int _Rank>
3928 throw runtime_exception(
"Invalid destination - multiple mipmap levels cannot be copied from source", E_INVALIDARG);
3933 if (_Dst.extent == _Copy_extent)
3935 throw runtime_exception(
"Invalid _Src_byte_size argument. _Src_byte_size is smaller than the total size of _Dst.", E_INVALIDARG);
3939 throw runtime_exception(
"Invalid _Src_byte_size argument. _Src_byte_size is smaller than the provided section of _Dst.", E_INVALIDARG);
3944 std::array<size_t, 3> _Copy_extent_arr =
_Get_dimensions(_Copy_extent, 0);
3945 std::array<size_t, 3> _Dst_offset_arr =
_Get_indices(_Dst_offset);
3952 template<
typename _Value_type,
int _Rank>
3959 throw runtime_exception(
"Invalid source - multiple mipmap levels cannot be copied to destination", E_INVALIDARG);
3964 if (_Src.extent == _Copy_extent)
3966 throw runtime_exception(
"Invalid _Dst_byte_size argument. _Dst_byte_size is smaller than the size of _Src.", E_INVALIDARG);
3970 throw runtime_exception(
"Invalid _Dst_byte_size argument. _Dst_byte_size is smaller than the provided section of _Src.", E_INVALIDARG);
3975 std::array<size_t, 3> _Copy_extent_arr =
_Get_dimensions(_Copy_extent, 0);
3976 std::array<size_t, 3> _Src_offset_arr =
_Get_indices(_Src_offset);
3983 template <
typename _Output_iterator,
typename _Value_type,
int _Rank>
3990 throw runtime_exception(
"Invalid source - multiple mipmap levels cannot be copied to destination", E_INVALIDARG);
3994 std::array<size_t, 3> _Copy_extent_arr =
_Get_dimensions(_Copy_extent, 0);
3995 std::array<size_t, 3> _Src_offset_arr =
_Get_indices(_Src_offset);
4000 template <
typename _Input_iterator,
typename _Value_type,
int _Rank>
4004 if (static_cast<unsigned int>(
std::distance(_First, _Last)) < _Copy_extent.
size())
4006 throw runtime_exception(
"Inadequate amount of data supplied through the iterators", E_INVALIDARG);
4011 throw runtime_exception(
"Invalid destination - multiple mipmap levels cannot be copied from source", E_INVALIDARG);
4014 std::array<size_t, 3> _Copy_extent_arr =
_Get_dimensions(_Copy_extent, 0);
4015 std::array<size_t, 3> _Dst_offset_arr =
_Get_indices(_Dst_offset);
4021 template<
typename _Value_type,
int _Rank>
4034 throw runtime_exception(
"The source and destination textures must have the exactly the same number of mipmap levels for texture copy.", E_INVALIDARG);
4037 bool _Is_whole_texture_copy = (_Src_offset == _Dst_offset && _Src_offset ==
index<_Rank>() && _Src.extent == _Dst.extent && _Src.extent == _Copy_extent);
4041 throw runtime_exception(
"Sections are not allowed when copy involves multiple mipmap levels", E_INVALIDARG);
4046 throw runtime_exception(
"The source and destination are overlapping areas on the same texture", E_INVALIDARG);
4057 throw runtime_exception(
"The source and destination textures are not compatible.", E_INVALIDARG);
4060 std::array<size_t, 3> _Src_offset_arr =
_Get_indices(_Src_offset);
4061 std::array<size_t, 3> _Dst_offset_arr =
_Get_indices(_Dst_offset);
4072 std::array<size_t, 3> _Copy_extent_arr =
_Get_dimensions(_Copy_extent, _Mip_offset);
4074 auto _Step_event =
_Copy_async_impl(_Src_tex, _Src_offset_arr.data(), _Src_most_detailed_mipmap_level + _Mip_offset,
4075 _Dst_tex, _Dst_offset_arr.data(), _Dst_most_detailed_mipmap_level + _Mip_offset,
4076 _Copy_extent_arr.data());
4078 _Copy_event = _Copy_event.
_Add_event(_Step_event);
4104 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)
4169 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)
4202 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,
4273 _Out_ void * _Dst,
unsigned int _Dst_byte_size)
4369 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)
4405 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)
4488 if (_Src.extent != _Dst.extent)
4490 throw runtime_exception(
"The source and destination textures must have the exactly the same extent for whole-texture copy.", E_INVALIDARG);
4559 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)
4598 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,
4606 _Event _Ev = details::_Copy_async_impl<InputIterator, _Dst_type::value_type, _Dst_type::rank>(_First,
_Last, _Dst, _Dst_offset, _Copy_extent);
4687 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)
4691 if (_Src.extent != _Dst.extent)
4693 throw runtime_exception(
"The source and destination textures must have the exactly the same extent for whole-texture copy.", E_INVALIDARG);
4749 if (_D3D_texture ==
NULL)
4755 throw runtime_exception(
"Cannot create D3D texture on a non-D3D accelerator_view.", E_INVALIDARG);
4758 _Texture * _Tex_ptr = _Texture::_Adopt_texture(_Rank, _Id, _D3D_texture, _Av, _View_format);
4772 #pragma warning( pop )
4812 #pragma warning( push )
4813 #pragma warning( disable : 4996 ) //writeonly_texture_view is deprecated
4818 #pragma warning( pop )
4865 DXGI_FORMAT _View_format ) __CPU_ONLY
4868 #pragma warning( suppress: 6326 ) // Potential comparison of a constant with another constant
4871 &_Tex_ptr, _View_format);
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:4104
#define _Out_
Definition: sal.h:351
texture & operator=(const texture &_Other)
Copy assignment operator. Deep copy
Definition: amp_graphics.h:2111
uint_2::value_type _Scalar_type
Definition: amp_graphics.h:60
_Check_return_opt_ _In_ long _Offset
Definition: io.h:334
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:1064
friend class accelerator
Definition: amprt.h:1520
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:3225
_Sampler_descriptor _M_sampler_descriptor
Definition: amp_graphics.h:3109
unsigned int uint
Definition: amp_short_vectors.h:498
const _Value_type value_type
Definition: amp_graphics.h:3127
Definition: amp_graphics.h:2884
unsigned int _Get_bits_per_element() const
Definition: amprt.h:2327
Represent a short vector of 2 unorm's.
Definition: amp_short_vectors.h:11343
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2072
sampler & operator=(const sampler &_Other) __GPU
Assignment operator.
Definition: amp_graphics.h:3006
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:3422
unsigned int _Get_section_size(const _Texture_base< _Value_type, _Rank > &_Tex, const extent< _Rank > &_Extent)
Definition: amp_graphics.h:3688
unsigned int _Scalar_type
Definition: amp_graphics.h:50
static const unsigned int _Default_bits_per_channel
Definition: amp_graphics.h:44
_CRTIMP _In_ int _Value
Definition: setjmp.h:190
_Short_vector_base_type_id
Definition: amprt.h:285
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:841
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:2861
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:4930
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:2693
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:729
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:2515
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:1986
sampler(sampler &&_Other) __GPU
Move constructor.
Definition: amp_graphics.h:2987
A texture is a data aggregate on an accelerator_view in the extent domain. It is a collection of vari...
Definition: amp_graphics.h:613
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:1303
_Ret_ IUnknown * get_texture(const texture< _Value_type, _Rank > &_Texture) __CPU_ONLY
Get the D3D texture interface underlying a texture.
Definition: amp_graphics.h:4792
__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:2379
unsigned int _Get_texture_format() const
Definition: amprt.h:2306
_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:2973
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:1455
Represent a short vector of 3 double's.
Definition: amp_short_vectors.h:18932
~texture_view() __GPU
Destructor
Definition: amp_graphics.h:3252
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:1573
const value_type operator()(const index< _Rank > &_Index) const __GPU_ONLY
Get the element value indexed by _Index.
Definition: amp_graphics.h:2237
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
const value_type operator[](const index< _Rank > &_Index) const __GPU_ONLY
Get the element value indexed by _Index.
Definition: amp_graphics.h:2744
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:1427
__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:1354
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:2001
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:1101
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:1804
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:2519
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:2880
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:1511
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:2892
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:1710
__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
_CRTIMP _In_opt_z_ const wchar_t _In_opt_z_ const wchar_t unsigned int
Definition: crtdefs.h:642
#define __GPU
Definition: amprt.h:41
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:2504
norm_4::value_type _Scalar_type
Definition: amp_graphics.h:241
size_t _Get_row_pitch() const
Definition: amprt.h:2387
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:2938
std::array< size_t, 3 > _Get_dimensions(const Concurrency::extent< _Rank > &_Ext, unsigned int _Mip_offset)
Definition: amp_graphics.h:298
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:1480
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:729
texture(const Concurrency::extent< _Rank > &_Ext, const _Texture_descriptor &_Descriptor)
Definition: amp_graphics.h:2386
_OutIt move(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2447
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:1518
__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...
const gather_return_type _Gather(const coordinates_type &_Coord, unsigned int _Component) const __GPU_ONLY
Definition: amp_graphics.h:3603
unsigned int get_mipmap_levels() const __GPU
Definition: amp_graphics.h:482
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:1121
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:1743
The Concurrency namespace provides classes and functions that provide access to the Concurrency Runti...
Definition: agents.h:42
Class represents a future corresponding to a C++ AMP asynchronous operation
Definition: amprt.h:1342
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:1203
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:2473
unsigned int _Get_most_detailed_mipmap_level() const __GPU
Definition: amp_graphics.h:581
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:1094
size_t _Get_depth(unsigned int _Mip_offset=0) const
Definition: amprt.h:2296
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:1041
void _Are_valid_mipmap_parameters(unsigned int _Most_detailed_mipmap_level, unsigned int _Mipmap_levels=0)
Definition: xxamp.h:1255
int _Scalar_type
Definition: amp_graphics.h:90
unsigned int _Get_default_bits_per_scalar_element()
Definition: amp_graphics.h:290
short_vector< scalar_type, 4 >::type gather_return_type
Definition: amp_graphics.h:3129
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:1682
unsigned int value_type
Definition: amp_short_vectors.h:1724
static const bool is_texture
Definition: amp_graphics.h:3626
texture(int _E0) __CPU_ONLY
Construct texture with the extent _E0
Definition: amp_graphics.h:672
#define NULL
Definition: crtdbg.h:30
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:793
unsigned int _Get_num_channels() const
Definition: amprt.h:2316
double value_type
Definition: amp_short_vectors.h:19666
_In_ size_t _In_z_ const char * _Source
Definition: tchar.h:2379
_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:3504
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:3112
iterator_traits< _InIt >::difference_type distance(_InIt _First, _InIt _Last)
Definition: xutility:755
_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.
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:3128
_AMPIMP _Ret_ _Amp_runtime_trace *__cdecl _Get_amp_trace()
const _Sampler_descriptor & _Get_descriptor() const __GPU_ONLY
Definition: amp_graphics.h:3104
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:814
__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:3063
bool _Is_adopted() const
Definition: amprt.h:2157
enum _Short_vector_base_type_id _Texture_base_type_id
Definition: amprt.h:296
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:3137
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:3242
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:2319
texture(int _E0, int _E1) __CPU_ONLY
Construct a texture from two integer extents.
Definition: amp_graphics.h:690
unsigned int _Get_most_detailed_mipmap_level() const __GPU
Definition: amprt.h:653
#define UINT_MAX
Definition: limits.h:41
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:4022
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:3582
texture(const texture_view< _Value_type, _Rank > &_Src)
Construct a texture from a texture_view. Deep copy
Definition: amp_graphics.h:1959
sampler(const _Sampler_descriptor &_Descriptor) __CPU_ONLY
Definition: amp_graphics.h:3073
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:1107
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:895
_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:2150
const void * data() const __CPU_ONLY
Returns a CPU pointer to the raw data of this texture.
Definition: amp_graphics.h:2338
~_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:1406
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:1770
Concurrency::graphics::filter_mode _M_filter_mode
Definition: amp_graphics.h:3110
_Ret_ T * _Get_ptr() const
Definition: amprt.h:242
unsigned int get_row_pitch() const __CPU_ONLY
Definition: amp_graphics.h:2348
static const bool is_writable
Definition: amp_graphics.h:3627
_AMPIMP void _Map_buffer(_Access_mode _Map_type, bool _Wait)
void _Initialize() __CPU_ONLY
Definition: amp_graphics.h:3089
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:1241
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:2039
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:1622
#define _ASSERTE(expr)
Definition: crtdbg.h:216
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:2905
_Ret_ void * data() __CPU_ONLY
Returns a CPU pointer to the raw data of this texture.
Definition: amp_graphics.h:2330
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:1379
_In_ size_t _In_z_ const unsigned char * _Src
Definition: mbstring.h:95
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:658
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:1281
#define _In_
Definition: sal.h:314
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:3449
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:2479
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:3195
Definition: amp_graphics.h:2874
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:3485
_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:2174
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:2131
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:1539
#define __CPU_ONLY
Definition: amprt.h:43
Definition: amp_graphics.h:615
IUnknown * _M_data_ptr
Definition: amprt.h:553
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:1154
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.h:835
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:2920
_Ret_ _Sampler * _Get_sampler_ptr() const __CPU_ONLY
Definition: amp_graphics.h:3084
_Ret_ void * _Get_host_ptr() const
Definition: amprt.h:2095
_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:1598
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:916
bool _Are_mipmap_levels_overlapping(const _Texture_descriptor *_Other) const __CPU_ONLY
Definition: amprt.h:694
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:1012
void _Initialize(const Concurrency::accelerator_view &_Av, _Input_iterator _Src_first, _Input_iterator _Src_last) __CPU_ONLY
Definition: amp_graphics.h:2493
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:3214
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:2364
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:2332
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:4747
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:3562
_Ret_ _Sampler * _Get_sampler_ptr() const __CPU_ONLY
Definition: amprt.h:775
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:3524
A texture_view provides read-only access and sampling capability to a textu...
Definition: amp_graphics.h:3124
float value_type
Definition: amp_short_vectors.h:8950
unsigned int _Get_max_mipmap_levels(const extent< _Rank > &_Extent)
Definition: xxamp.h:1234
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:715
texture(const texture &_Src)
Copy constructor. Deep copy
Definition: amp_graphics.h:2051
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:769
unsigned int _Get_rank() const
Definition: amprt.h:2301
size_t _Get_depth_pitch() const
Definition: amprt.h:2397
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:3391
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:936
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:2882
void _Initialize(const Concurrency::accelerator_view &_Av, unsigned int _Bits_per_scalar_element) __CPU_ONLY
Definition: amp_graphics.h:2463
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:2096
_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:3922
Definition: amp_graphics.h:3624
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:1906
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:3150
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:2679
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:1946
_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:2291
void _Set_view_mipmap_levels(unsigned int _View_mipmap_levels) __CPU_ONLY
Definition: amprt.h:663
__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:3054
Concurrency::graphics::address_mode _M_address_mode
Definition: amp_graphics.h:3111
void _Set_texture_ptr(_In_opt_ _Texture *_Texture_ptr) __CPU_ONLY
Definition: amprt.h:668
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:2498
texture(texture &&_Other)
Move constructor
Definition: amp_graphics.h:2063
Definition: amp_graphics.h:2883
void advance(_InIt &_Where, _Diff _Off)
Definition: xutility:695
Definition: amp_graphics.h:2873
const value_type operator[](const index< _Rank > &_Index) const __GPU_ONLY
Get the element value indexed by _Index.
Definition: amp_graphics.h:2206
void _Initialize(const Concurrency::accelerator_view &_Av, const details::_Texture_base< _Value_type, _Rank > &_Src) __CPU_ONLY
Definition: amp_graphics.h:2549
texture(const texture &_Src, const Concurrency::accelerator_view &_Av)
Copy constructor. Deep copy
Definition: amp_graphics.h:2077
#define _T(x)
Definition: tchar.h:2498
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:3045
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:4864
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:1184
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:2959
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_descriptor _M_texture_descriptor
Definition: amp_graphics.h:593
A texture_view provides read and write access to a texture. Note that currently texture_view can only...
Definition: amp_graphics.h:617
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
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:3542
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:3590
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(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:960
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:3184
#define _Inout_
Definition: sal.h:384
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:988
filter_mode
filter modes supported for texture sampling
Definition: amp_graphics.h:2870
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:1835
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_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:2707
_Ret_ _Texture * _Get_texture_ptr() const __CPU_ONLY
Definition: amprt.h:647
texture(const Concurrency::extent< _Rank > &_Ext) __CPU_ONLY
Construct a texture from extents.
Definition: amp_graphics.h:658
Concurrency::extent< _Rank > _M_extent
Definition: amp_graphics.h:592
Concurrency::details::_Sampler_descriptor _Sampler_descriptor
Definition: amp_graphics.h:3070
void _Copy_data_on_host(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:2564
_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:2468
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:865
basic_stringstream< char, char_traits< char >, allocator< char > > stringstream
Definition: iosfwd:687
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:752
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:1650
unsigned int get_bits_per_scalar_element() const __CPU_ONLY
Definition: amp_graphics.h:469
~texture_view() __GPU
Destructor
Definition: amp_graphics.h:2731
sampler make_sampler(_In_ IUnknown *_D3D_sampler) __CPU_ONLY
Create a sampler from a D3D sampler state interface pointer.
Definition: amp_graphics.h:4903
Definition: amp_graphics.h:2885
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:1275
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:4237
void _Set_sampler_ptr(_In_opt_ _Sampler *_Sampler_ptr) __CPU_ONLY
Definition: amprt.h:780
texture(int _E0, int _E1, int _E2) __CPU_ONLY
Construct a texture from three integer extents.
Definition: amp_graphics.h:711
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:3466
#define __GPU_ONLY
Definition: amprt.h:42
norm_3::value_type _Scalar_type
Definition: amp_graphics.h:231
size_t _Get_width(unsigned int _Mip_offset=0) const
Definition: amprt.h:2286
_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:4889
int value_type
Definition: amp_short_vectors.h:4600
bool _Is_staging() const
Definition: amprt.h:2127
const value_type operator()(const index< _Rank > &_Index) const __GPU_ONLY
Get the element value indexed by _Index.
Definition: amp_graphics.h:2779
Definition: amp_graphics.h:2886
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:2520
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:2396
bool _Is_cpu_accelerator(const accelerator &_Accl)
Definition: amprt.h:3469
~texture() __CPU_ONLY
Destructor
Definition: amp_graphics.h:2193
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:3170
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:1220
bool _Should_create_staging_texture(const Concurrency::accelerator_view &_Av, const Concurrency::accelerator_view &_Associated_av)
Definition: amp_graphics.h:2391
static const int rank
Definition: amp_graphics.h:411
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:1872
sampler & operator=(sampler &&_Other) __GPU
Move assignment operator.
Definition: amp_graphics.h:3027
Definition: amp_graphics.h:2872
texture_view(texture< _Value_type, _Rank > &_Src) __GPU_ONLY
Construct a texture_view of a texture _Src on an accelerator.
Definition: amp_graphics.h:2693
unsigned int _Get_bits_per_channel() const
Definition: amprt.h:2321
_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:2509
const _Texture_descriptor & _Get_texture_descriptor(const _Texture_type &_Tex) __GPU
Definition: xxamp.h:1095
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:2020
_AMPIMP void _Write_end_event(ULONG _Span_id)
#define _Ret_
Definition: sal.h:1005
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:3912
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:1331
Represent a short vector of 4 norm's.
Definition: amp_short_vectors.h:16120
_Pre_maybenull_ _Post_z_ char _Pre_maybenull_ _Post_z_ char _Pre_maybenull_ _Post_z_ char _Pre_maybenull_ _Post_z_ char * _Ext
Definition: stdlib.h:854
__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(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:1263
texture(const texture_view< const _Value_type, _Rank > &_Src)
Construct a texture from a read-only texture_view. Deep copy
Definition: amp_graphics.h:1971
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:2566
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:2718