8000 Vulkan: Fully using a CPU thread with vsync on · Issue #13001 · libsdl-org/SDL · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Vulkan: Fully using a CPU thread with vsync on #13001
Open
@medveed

Description

@medveed

If I create a renderer with Vulkan and make it use VSync, it will use 100% of app's thread. However, with OpenGL this problem doesn't exist.

Steps to reproduce

SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS)
SDL_Window* win = SDL_CreateWindow("Test", 640, 480, SDL_WINDOW_HIDDEN);
SDL_Renderer* ren = SDL_CreateRenderer(win, "vulkan");
if (!SDL_SetRenderVSync(ren, true)) {
    printf("VSync not supported: %s\n", SDL_GetError());
    return 1;
}
SDL_ShowWindow(win);

SDL_Event e;
bool running = true;
while (running) {
    while (SDL_PollEvent(&e)) {
        switch (e.type) {
            case SDL_EVENT_QUIT: running = false; break;
        }
    }
    SDL_SetRenderDrawColor(ren, 32, 32, 32, 255);
    SDL_RenderClear(ren);
    SDL_RenderPresent(ren);
}
SDL_DestroyWindow(win);
SDL_DestroyRenderer(ren);
SDL_Quit();

(window and renderer are created successfully, and it doesn't say that VSync is not supported)

Additional info
SDL Branch: 3.2.x
OS: Mint 22
Graphics server: X11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0