Giter Site home page Giter Site logo

sdl_gpu_examples's Introduction

WIP collection of examples to demonstrate the usage of the SDL_gpu proposal.

To clone and build:

git clone https://github.com/thatcosmonaut/SDL -b gpu
cd SDL
mkdir build
cd build
cmake ..

cd ../..
git clone --recursive https://github.com/TheSpydog/SDL_gpu_examples
cd SDL_gpu_examples
mkdir build
cd build
cmake .. -DSDL3_DIR="full/path/to/SDL/build"

then run make or your favorite IDE.

sdl_gpu_examples's People

Contributors

thespydog avatar thatcosmonaut avatar flibitijibibo avatar

Stargazers

 avatar Eric Johnson avatar Nathaniel Sabanski avatar Luis Ernesto Del Toro Peña avatar tomat avatar Mohamed Shazan avatar Matheus K Schaefer avatar Amer Koleci avatar Mārtiņš Možeiko avatar Karim Ahmed avatar Andrei Alexeyev avatar TheSunCat avatar Aeva & Watch Gallery 2 avatar Phil Chang avatar Angga avatar Sahin Vardar avatar  avatar Benji avatar ello avatar  avatar Robert D. Blanchet Jr. avatar CerealPXL avatar Noel Berry avatar Diarmaid "Water" Malone avatar Larken Barnes avatar  avatar Alexander avatar

Watchers

 avatar  avatar

Forkers

bartwe jaedan

sdl_gpu_examples's Issues

Aggressive readback sample

Cycling transfer buffers isn't as trivial as GPU buffers on the library side, but it should be easy for the app side - we should demonstrate this to avoid having to cobble together host-memory cycling in SDL.

ComputeSpriteBatch example triggers presentation mode errors

First of all, this is fantastic work.

On my machine, the ComputeSpriteBatch is the only one failing: nothing shows up, and instead it's a flow of error logs:

WARN: Failed to recreate swapchain!
ERROR: Device does not support requested present mode!

I am on Ubuntu Linux 24.04, with a AMD Radeon 5700XT, a decent GPU:

INFO: Welcome to the SDL_Gpu example suite!
INFO: Press A/D to move between examples!
INFO: STARTING EXAMPLE: ClearScreen
INFO: Validation layers enabled, expect debug level performance!
INFO: SDL_Gpu Driver: Vulkan
INFO: Vulkan Device: AMD Radeon RX 5700 XT (RADV NAVI10)
INFO: Vulkan Driver: radv Mesa 24.0.5-1ubuntu1
INFO: Vulkan Conformance: 1.2.1

All other examples work as expected.

ComputeSpriteBatch seems to be using SDL_GPU_PRESENTMODE_IMMEDIATE.

Many other Vulkan apps do work as expected on my workstation, not sure which presentation mode they do use.

I can try on a Windows machine with different GPU on Monday.

Question on SDL_CompileFromSPIRV and SDL_GpuCreateShader

It seems a bit strange in this code snippet:

if (SDL_GpuGetDriver(device) == SDL_GPU_DRIVER_VULKAN)
{
	shader = SDL_GpuCreateShader(device, &shaderInfo);
}
else
{
	shader = SDL_CompileFromSPIRV(device, &shaderInfo, SDL_FALSE);
}

It seems the design intent of these examples is to load up the SPIR-V blobs and cross compile them. This would make shipping the SPIR-V blobs a cross-platform shader solution. Is this correct? If so, why should I, as a user, need to ever call SDL_GpuCreateShader, unless I write a platform-dependent shader? Even if I'm targeting Vulkan, can I not just also call SDL_CompileFromSPIRV?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.