Skip to content

Commit 5640ea6

Browse files
committed
[Bindless] Struct for unique addressing modes per dimension
1 parent 12c8312 commit 5640ea6

File tree

5 files changed

+103
-0
lines changed

5 files changed

+103
-0
lines changed

include/ur.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ class ur_structure_type_v(IntEnum):
250250
EXP_FILE_DESCRIPTOR = 0x2003 ## ::ur_exp_file_descriptor_t
251251
EXP_WIN32_HANDLE = 0x2004 ## ::ur_exp_win32_handle_t
252252
EXP_LAYERED_IMAGE_PROPERTIES = 0x2005 ## ::ur_exp_layered_image_properties_t
253+
EXP_SAMPLER_ADDR_MODES = 0x2006 ## ::ur_exp_sampler_addr_modes_t
253254

254255
class ur_structure_type_t(c_int):
255256
def __str__(self):
@@ -2216,6 +2217,22 @@ class ur_exp_sampler_mip_properties_t(Structure):
22162217
("mipFilterMode", ur_sampler_filter_mode_t) ## [in] mipmap filter mode used for filtering between mipmap levels
22172218
]
22182219

2220+
###############################################################################
2221+
## @brief Describes unique sampler addressing mode per dimension
2222+
##
2223+
## @details
2224+
## - Specify these properties in ::urSamplerCreate via ::ur_sampler_desc_t
2225+
## as part of a `pNext` chain.
2226+
class ur_exp_sampler_addr_modes_t(Structure):
2227+
_fields_ = [
2228+
("stype", ur_structure_type_t), ## [in] type of this structure, must be
2229+
## ::UR_STRUCTURE_TYPE_EXP_SAMPLER_ADDR_MODES
2230+
("pNext", c_void_p), ## [in,out][optional] pointer to extension-specific structure
2231+
("addrModeX", ur_sampler_addressing_mode_t), ## [in] Specify the addressing mode of the x-dimension.
2232+
("addrModeY", ur_sampler_addressing_mode_t), ## [in] Specify the addressing mode of the y-dimension.
2233+
("addrModeZ", ur_sampler_addressing_mode_t) ## [in] Specify the addressing mode of the z-dimension.
2234+
]
2235+
22192236
###############################################################################
22202237
## @brief Describes an interop memory resource descriptor
22212238
class ur_exp_interop_mem_desc_t(Structure):

include/ur_api.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ typedef enum ur_structure_type_t {
259259
UR_STRUCTURE_TYPE_EXP_FILE_DESCRIPTOR = 0x2003, ///< ::ur_exp_file_descriptor_t
260260
UR_STRUCTURE_TYPE_EXP_WIN32_HANDLE = 0x2004, ///< ::ur_exp_win32_handle_t
261261
UR_STRUCTURE_TYPE_EXP_LAYERED_IMAGE_PROPERTIES = 0x2005, ///< ::ur_exp_layered_image_properties_t
262+
UR_STRUCTURE_TYPE_EXP_SAMPLER_ADDR_MODES = 0x2006, ///< ::ur_exp_sampler_addr_modes_t
262263
/// @cond
263264
UR_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff
264265
/// @endcond
@@ -7037,6 +7038,22 @@ typedef struct ur_exp_sampler_mip_properties_t {
70377038

70387039
} ur_exp_sampler_mip_properties_t;
70397040

7041+
///////////////////////////////////////////////////////////////////////////////
7042+
/// @brief Describes unique sampler addressing mode per dimension
7043+
///
7044+
/// @details
7045+
/// - Specify these properties in ::urSamplerCreate via ::ur_sampler_desc_t
7046+
/// as part of a `pNext` chain.
7047+
typedef struct ur_exp_sampler_addr_modes_t {
7048+
ur_structure_type_t stype; ///< [in] type of this structure, must be
7049+
///< ::UR_STRUCTURE_TYPE_EXP_SAMPLER_ADDR_MODES
7050+
void *pNext; ///< [in,out][optional] pointer to extension-specific structure
7051+
ur_sampler_addressing_mode_t addrModeX; ///< [in] Specify the addressing mode of the x-dimension.
7052+
ur_sampler_addressing_mode_t addrModeY; ///< [in] Specify the addressing mode of the y-dimension.
7053+
ur_sampler_addressing_mode_t addrModeZ; ///< [in] Specify the addressing mode of the z-dimension.
7054+
7055+
} ur_exp_sampler_addr_modes_t;
7056+
70407057
///////////////////////////////////////////////////////////////////////////////
70417058
/// @brief Describes an interop memory resource descriptor
70427059
typedef struct ur_exp_interop_mem_desc_t {

scripts/core/EXP-BINDLESS-IMAGES.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ Enums
6969
${X}_STRUCTURE_TYPE_EXP_FILE_DESCRIPTOR
7070
${X}_STRUCTURE_TYPE_EXP_WIN32_HANDLE
7171
${X}_STRUCTURE_TYPE_EXP_LAYERED_IMAGE_PROPERTIES
72+
${X}_STRUCTURE_TYPE_EXP_SAMPLER_ADDR_MODES
7273

7374
* ${x}_device_info_t
7475
* ${X}_DEVICE_INFO_BINDLESS_IMAGES_SUPPORT_EXP
@@ -129,6 +130,7 @@ Types
129130
* ${x}_exp_file_descriptor_t
130131
* ${x}_exp_win32_handle_t
131132
* ${x}_exp_layered_image_properties_t
133+
* ${x}_exp_sampler_addr_modes_t
132134

133135
Functions
134136
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -180,6 +182,8 @@ Changelog
180182
+----------+-------------------------------------------------------------+
181183
| 7.0 | Add layered image properties struct. |
182184
+----------+-------------------------------------------------------------+
185+
| 8.0 | Added structure for sampler addressing modes per dimension. |
186+
+------------------------------------------------------------------------+
183187

184188
Contributors
185189
--------------------------------------------------------------------------------

scripts/core/exp-bindless-images.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ etors:
110110
- name: EXP_LAYERED_IMAGE_PROPERTIES
111111
desc: $x_exp_layered_image_properties_t
112112
value: "0x2005"
113+
- name: EXP_SAMPLER_ADDR_MODES
114+
desc: $x_exp_sampler_addr_modes_t
115+
value: "0x2006"
113116
--- #--------------------------------------------------------------------------
114117
type: enum
115118
extend: true
@@ -176,6 +179,25 @@ members:
176179
desc: "[in] mipmap filter mode used for filtering between mipmap levels"
177180
--- #--------------------------------------------------------------------------
178181
type: struct
182+
desc: "Describes unique sampler addressing mode per dimension"
183+
details:
184+
- Specify these properties in $xSamplerCreate via $x_sampler_desc_t as part
185+
of a `pNext` chain.
186+
class: $xBindlessImages
187+
name: $x_exp_sampler_addr_modes_t
188+
base: $x_base_properties_t
189+
members:
190+
- type: $x_sampler_addressing_mode_t
191+
name: addrModeX
192+
desc: "[in] Specify the addressing mode of the x-dimension."
193+
- type: $x_sampler_addressing_mode_t
194+
name: addrModeY
195+
desc: "[in] Specify the addressing mode of the y-dimension."
196+
- type: $x_sampler_addressing_mode_t
197+
name: addrModeZ
198+
desc: "[in] Specify the addressing mode of the z-dimension."
199+
--- #--------------------------------------------------------------------------
200+
type: struct
179201
desc: "Describes an interop memory resource descriptor"
180202
class: $xBindlessImages
181203
name: $x_exp_interop_mem_desc_t

source/common/ur_params.hpp

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,8 @@ inline std::ostream &operator<<(std::ostream &os,
432432
inline std::ostream &
433433
operator<<(std::ostream &os,
434434
const struct ur_exp_sampler_mip_properties_t params);
435+
inline std::ostream &
436+
operator<<(std::ostream &os, const struct ur_exp_sampler_addr_modes_t params);
435437
inline std::ostream &operator<<(std::ostream &os,
436438
const struct ur_exp_interop_mem_desc_t params);
437439
inline std::ostream &
@@ -1333,6 +1335,10 @@ inline std::ostream &operator<<(std::ostream &os,
13331335
case UR_STRUCTURE_TYPE_EXP_LAYERED_IMAGE_PROPERTIES:
13341336
os << "UR_STRUCTURE_TYPE_EXP_LAYERED_IMAGE_PROPERTIES";
13351337
break;
1338+
1339+
case UR_STRUCTURE_TYPE_EXP_SAMPLER_ADDR_MODES:
1340+
os << "UR_STRUCTURE_TYPE_EXP_SAMPLER_ADDR_MODES";
1341+
break;
13361342
default:
13371343
os << "unknown enumerator";
13381344
break;
@@ -1587,6 +1593,12 @@ inline void serializeStruct(std::ostream &os, const void *ptr) {
15871593
(const ur_exp_layered_image_properties_t *)ptr;
15881594
ur_params::serializePtr(os, pstruct);
15891595
} break;
1596+
1597+
case UR_STRUCTURE_TYPE_EXP_SAMPLER_ADDR_MODES: {
1598+
const ur_exp_sampler_addr_modes_t *pstruct =
1599+
(const ur_exp_sampler_addr_modes_t *)ptr;
1600+
ur_params::serializePtr(os, pstruct);
1601+
} break;
15901602
default:
15911603
os << "unknown enumerator";
15921604
break;
@@ -9879,6 +9891,37 @@ operator<<(std::ostream &os,
98799891
os << "}";
98809892
return os;
98819893
}
9894+
inline std::ostream &
9895+
operator<<(std::ostream &os, const struct ur_exp_sampler_addr_modes_t params) {
9896+
os << "(struct ur_exp_sampler_addr_modes_t){";
9897+
9898+
os << ".stype = ";
9899+
9900+
os << (params.stype);
9901+
9902+
os << ", ";
9903+
os << ".pNext = ";
9904+
9905+
ur_params::serializeStruct(os, (params.pNext));
9906+
9907+
os << ", ";
9908+
os << ".addrModeX = ";
9909+
9910+
os << (params.addrModeX);
9911+
9912+
os << ", ";
9913+
os << ".addrModeY = ";
9914+
9915+
os << (params.addrModeY);
9916+
9917+
os << ", ";
9918+
os << ".addrModeZ = ";
9919+
9920+
os << (params.addrModeZ);
9921+
9922+
os << "}";
9923+
return os;
9924+
}
98829925
inline std::ostream &operator<<(std::ostream &os,
98839926
const struct ur_exp_interop_mem_desc_t params) {
98849927
os << "(struct ur_exp_interop_mem_desc_t){";

0 commit comments

Comments
 (0)