Skip to content

Commit da3ed77

Browse files
committed
Iterations
1 parent ee664f2 commit da3ed77

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/runtime/d3d12compute.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2110,7 +2110,10 @@ WEAK d3d12_function *d3d12_compile_shader_dxc(d3d12_device *device, d3d12_librar
21102110

21112111
// Entry point (narrow ASCII to wide)
21122112
WCHAR entry_wide[256];
2113-
narrow_to_wide(name, entry_wide, 256);
2113+
if (narrow_to_wide(name, entry_wide, 256) >= 256) {
2114+
error(user_context) << "d3d12compute: entry point name too long (truncated)\n";
2115+
return nullptr;
2116+
}
21142117

21152118
// Target profile: "cs_6_X" where X = sm_version % 10
21162119
WCHAR target_profile[16] = {(WCHAR)'c', (WCHAR)'s', (WCHAR)'_', (WCHAR)'6', (WCHAR)'_',

test/generator/gpu_texture_aottest.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ int main(int argc, char **argv) {
2929
#if !defined(TEST_OPENCL) && !defined(TEST_D3D12COMPUTE)
3030
printf("[SKIP] No GPU texture target enabled.\n");
3131
return 0;
32-
#endif
32+
#else
3333

3434
#if defined(TEST_OPENCL)
3535
const auto *interface = halide_opencl_device_interface();
@@ -57,7 +57,6 @@ int main(int argc, char **argv) {
5757

5858
gpu_texture(input, output);
5959

60-
#if defined(TEST_OPENCL) || defined(TEST_D3D12COMPUTE)
6160
{
6261
using image_device_interface_fn = const struct halide_device_interface_t *(*)();
6362
#if defined(TEST_OPENCL)
@@ -76,7 +75,6 @@ int main(int argc, char **argv) {
7675
return 1;
7776
}
7877
}
79-
#endif
8078

8179
output.copy_to_host();
8280

@@ -92,4 +90,5 @@ int main(int argc, char **argv) {
9290

9391
printf("Success!\n");
9492
return 0;
93+
#endif
9594
}

0 commit comments

Comments
 (0)