-
Notifications
You must be signed in to change notification settings - Fork 185
Closed
Description
I have the following push consts:
constants: np.ndarray = np.array([
image.shape[1], # image_width
image.shape[0], # image_height
1, # image_depth (since we are using a single 2D slice
window_half_size,
2 * window_half_size + 1, # window_dim
(2 * window_half_size + 1) ** 2 // 2, # vector_count
padded_image.shape[1], # padded_image_width
padded_image.shape[0], # padded_image_height
], dtype=np.int32)
print("constants", constants)
# Create the algorithm
algo = mgr.algorithm(
tensors=tensors,
spirv=spirv_shader,
workgroup=[1, 1, 1],
push_consts=constants,
)And then my GLSL accepts:
// === Push Constants ===
layout(std430, push_constant) uniform PushConsts {
int image_width;
int image_height;
int image_depth;
int window_half_size;
int window_dim;
int vector_count;
int padded_image_width;
int padded_image_height;
} pc;This type-checks and Kompute doesn't warn me about the NumPy array's dtype being int32. However, when I run my compute shader, the array elements seem to be reinterpreted as floats. E.g. passing in the constant image_width==1 (as an int), is then interpreted as pc.image_width==1065353216 (i.e. the float representation of my int).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels