Comments (5)
Not in sokol_gfx, but most likely in a sokol_gfx 2.0. Here's my thinking:
The main reason why sokol_gfx doesn't expose command buffers at all are basically all the GL platforms, especially WebGL (and actually D3D11 too). Those backends would need to emulate command buffers (but only for the very coarse 'commands' of the sokol_gfx API (beginpass, applydrawstate, ... etc...).
Once WebGPU becomes available I will most likely fork off this sokol_gfx 2.0, which would basically be "sokol for modern 3D APIs", instead of GL, D3D11 and Metal, this would support Vulkan, D3D12, Metal 2.0 (and WebGPU of course). This would still be a very simple and opinionated API, but would expose multithreading via command buffers/lists, and also support compute.
from sokol.
@floooh would you perhaps add compute support to the current sokol and hide it under a capability flag? For DX11/Metal/GL ES3.1 only that is. I'm thinking of using sokol as a fallback to a framework which is targetting Vulkan/D3D12/Metal2.0 (commands are cpu-only already and fairly coarse). Cheers!
from sokol.
I see, the next webgpu should be part of this project https://github.com/google/nxt-standalone
Maybe you can concept of command context and have immediate context as now and support command list with emulation on OpenGL?
Or capacity flag for command buffers.
You have metal support there, D3D11 support Deferred context, only OpenGL would need emulation probably.
from sokol.
Sorry for resurrecting this closed issue. As an additional note to what @amerkoleci said:
nVidia provides the NV_command_list
extension for OpenGL. So, this feature would only require emulation on devices, that do not support this extension.
@floooh Since support for <threads.h>
is basically non-existent, how do you plan on synchronizing threads? Are you going to drop in a third-party implementation or are there any plans to roll a custom solution?
I was thinking about rolling an header-only implementation myself (which is NOT just a wrapper for pthreads, unlike those implementations I've found so far); might as well contribute it to the project.
from sokol.
No plans for a command-list API for sokol_gfx.h, IMHO this only really makes sense once traditional 3D APIs can be dropped (e.g. only Metal, D3D12, Vulkan and WebGPU would need to be considered). IMHO that's a topic for "sokol_gfx.h 2.0" (as I wrote above).
What I'm thinking about though is to move resource creation into threads if the underlying 3D API allows this, this wouldn't require public API changes (since asynchronouse resource creation is already "designed into the API"), this would be especially important for pipeline creation, because this can be quite expensive on some APIs (e.g. Metal).
But before that I'd like to overhaul the entire dynamic resource update API area (sg_update_buffer, etc...).
from sokol.
Related Issues (20)
- [sokol_imgui] Manage ImDrawCallback_ResetRenderState HOT 3
- [sokol_gfx] Array of struct uniform HOT 1
- WebGPU samples currently broken. HOT 1
- Regression: swapchains with depth (not depth/stencil) buffers currently broken in Metal. HOT 2
- [sokol_app] A call to GetIntegerv in _sapp_wgl_create_context leaves the stack corrupted HOT 8
- Sampling a depth texture using `SG_IMAGESAMPLETYPE_FLOAT` in order to copy it to the main framebuffer's depth buffer HOT 2
- Crash on validation error HOT 2
- sdhc + sokol_app.h: Uniform Arrays of smaller than vec4 type lead to validation errors or silently introduce buggy behaviour HOT 5
- Will you accept a PR that allows setting minimum width/height for resizable windows? HOT 3
- Apps showcase HOT 2
- Why isn't SOKOL_NO_ENTRY supported on android? Is it impossible or just not implemented yet? HOT 1
- How to fill the new sg_swapchain struct when using SDL2? HOT 1
- support arm64-v8a - INSTALL_FAILED_NO_MATCHING_ABIS HOT 4
- Load graphical dynamic libraries on demand with dlopen HOT 6
- sokol_gfx: warnings when compiling with mingw-w64 HOT 3
- sokol_app.h: request for show/hide/focus window functions HOT 1
- Request for Tagged Releases HOT 6
- README gives no indication of what this library does HOT 1
- [sokol_gfx] Any plans to support base vertex location? HOT 12
- error: expected '(' for function-style cast or type construction, while using SG_RANGE on MacOS using c++ HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sokol.