@@ -162,7 +162,13 @@ static SDL_GPUBuffer* create_spheres(SDL_GPUDevice* device, uint32_t* size)
162162
163163int main (int argc , char * * argv )
164164{
165- SDL_SetLogPriorities (SDL_LOG_PRIORITY_TRACE );
165+ #ifndef NDEBUG
166+ bool debug = true;
167+ #else
168+ bool debug = false;
169+ #endif
170+ SDL_SetAppMetadata ("RTIOW" , NULL , NULL );
171+ SDL_SetLogPriorities (SDL_LOG_PRIORITY_VERBOSE );
166172 if (!SDL_Init (SDL_INIT_VIDEO ))
167173 {
168174 SDL_Log ("Failed to initialize SDL: %s" , SDL_GetError ());
@@ -174,13 +180,7 @@ int main(int argc, char** argv)
174180 SDL_Log ("Failed to create window: %s" , SDL_GetError ());
175181 return EXIT_FAILURE ;
176182 }
177- #if SDL_PLATFORM_WIN32
178- SDL_GPUDevice * device = SDL_CreateGPUDevice (SDL_GPU_SHADERFORMAT_DXIL , true, NULL );
179- #elif SDL_PLATFORM_LINUX
180- SDL_GPUDevice * device = SDL_CreateGPUDevice (SDL_GPU_SHADERFORMAT_SPIRV , true, NULL );
181- #elif SDL_PLATFORM_APPLE
182- SDL_GPUDevice * device = SDL_CreateGPUDevice (SDL_GPU_SHADERFORMAT_MSL , true, NULL );
183- #endif
183+ SDL_GPUDevice * device = SDL_CreateGPUDevice (SDL_GPU_SHADERFORMAT_DXIL | SDL_GPU_SHADERFORMAT_SPIRV | SDL_GPU_SHADERFORMAT_MSL , debug , NULL );
184184 if (!device )
185185 {
186186 SDL_Log ("Failed to create device: %s" , SDL_GetError ());
@@ -191,7 +191,7 @@ int main(int argc, char** argv)
191191 SDL_Log ("Failed to create swapchain: %s" , SDL_GetError ());
192192 return EXIT_FAILURE ;
193193 }
194- SDL_SetWindowAlwaysOnTop (window , true );
194+ SDL_RaiseWindow (window );
195195 SDL_GPUComputePipeline * pipeline = load_compute_pipeline (device , "shader.comp" );
196196 if (!pipeline )
197197 {
@@ -237,7 +237,7 @@ int main(int argc, char** argv)
237237 {
238238 char title [128 ] = {0 };
239239 int samples = batch * SAMPLES / BATCHES ;
240- snprintf (title , sizeof (title ), "%d/%d samples" , samples , SAMPLES );
240+ snprintf (title , sizeof (title ), "%s: % d/%d samples" , SDL_GetGPUDeviceDriver ( device ) , samples , SAMPLES );
241241 SDL_SetWindowTitle (window , title );
242242 SDL_Event event ;
243243 while (SDL_PollEvent (& event ))
0 commit comments