10 HANDLE mutex = ::CreateMutexW(
11 nullptr, FALSE, acmxvk::ipc::SHADER_SELECTION_MUTEX_NAME_WINDOWS);
12 if (mutex ==
nullptr) {
13 std::cerr <<
"CreateMutexW failed: " << ::GetLastError() <<
'\n';
17 HANDLE mapping = ::CreateFileMappingW(
18 INVALID_HANDLE_VALUE,
nullptr, PAGE_READWRITE, 0,
20 acmxvk::ipc::SHADER_SELECTION_MAPPING_NAME_WINDOWS);
21 if (mapping ==
nullptr) {
22 std::cerr <<
"CreateFileMappingW failed: " << ::GetLastError() <<
'\n';
27 void *view = ::MapViewOfFile(mapping, FILE_MAP_ALL_ACCESS, 0, 0,
29 if (view ==
nullptr) {
30 std::cerr <<
"MapViewOfFile failed: " << ::GetLastError() <<
'\n';
31 ::CloseHandle(mapping);
39 acmxvk::ipc::InterfaceLock lock(mutex);
41 std::cerr <<
"Could not lock test mapping\n";
42 ::UnmapViewOfFile(view);
43 ::CloseHandle(mapping);
49 selection->shader_pass_enabled = 1;
50 selection->shader_pass_count = 2;
51 std::strcpy(selection->selected_shader_name,
"selected.frag.spv");
52 std::strcpy(selection->shader_pass_names[0],
"first.comp.spv");
53 std::strcpy(selection->shader_pass_names[1],
"second.frag.spv");
54 selection->custom_uniform_count = 1;
55 std::strcpy(selection->custom_uniform_names[0],
"slider1");
56 selection->custom_uniform_values[0] = 0.75F;
57 selection->audio_file_sequence = 7;
58 std::strcpy(selection->audio_file_path,
"C:/audio/test.wav");
59 selection->audio_pass_through = 1;
60 selection->dream_enabled = 1;
61 selection->dream_fp16 = 1;
62 selection->dream_gpu_filter_first = 1;
63 selection->dream_iterations = 3;
64 selection->dream_maximum_dimension = 768;
65 selection->dream_channel = 12;
66 selection->dream_octaves = 2;
67 selection->dream_jitter = 4;
68 selection->dream_smoothing = 2;
69 selection->dream_strength = 0.125F;
70 selection->dream_feedback = 0.8F;
71 selection->dream_zoom = 1.02F;
72 selection->dream_rotation = -0.25F;
73 selection->dream_octave_scale = 1.6F;
74 std::strcpy(selection->dream_model_path,
"C:/models/dream.pt");
75 std::strcpy(selection->dream_layer,
"relu4_2");
80 const bool opened = client.
open();
81 const bool read = opened && client.
read(state);
108 ::UnmapViewOfFile(view);
109 ::CloseHandle(mapping);
110 ::CloseHandle(mutex);
112 std::cerr <<
"Windows interface-control round trip failed\n";
115 std::cout <<
"ACMXVK Windows interface-control test passed\n";