Skip to content
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d1fcac9
rm dawn again
Apr 8, 2026
5453d5f
add dawn
Apr 8, 2026
2157bd1
dawn/.gitignore
Apr 8, 2026
7fc6c84
rm dawn
Apr 8, 2026
ed2aea7
add dawn without .gitignore
Apr 8, 2026
241a16e
add lib dawn without gitignore file
Apr 8, 2026
20e5186
rm fucking dawn
Apr 8, 2026
cc629b3
dawn without .gitignore
Apr 8, 2026
2ab7beb
fetch dawn
Apr 8, 2026
6de4c2a
invoke fetch_dawn
Apr 8, 2026
b639613
fix up fetch_dawn with cmake
Apr 8, 2026
fdd873c
ignore lib/dawn
Apr 8, 2026
3e5cad8
Merge remote-tracking branch 'origin/master' into try_cache
Apr 9, 2026
ace73c9
try cache build folder
Apr 9, 2026
c68713f
try cache dawn instead
Apr 9, 2026
eb12122
try to cache dawn build folder
Apr 9, 2026
898c27d
dont remove build folder
Apr 9, 2026
a3b4231
move bindgroup factory method into bindgroup layout
Apr 10, 2026
0fb4add
try vendoring dawn code
Apr 10, 2026
d0c7c05
try to fetch deps
Apr 10, 2026
7cdc1bf
disable fetch from cmake
Apr 10, 2026
f6593ad
vendor dawn code
Apr 10, 2026
7c6e35a
update dawn fetch script
Apr 10, 2026
3b5e82a
cleanup
Apr 10, 2026
20cb98a
Merge branch 'dev-vendor-dawn2' into dev_bindgroup_set
Apr 10, 2026
6b7cead
Merge remote-tracking branch 'origin/master' into dev_bindgroup_set
Apr 10, 2026
283e966
Merge remote-tracking branch 'origin/master' into dev_bindgroup_set
Apr 10, 2026
0d51e10
bindgroup set pass
Apr 10, 2026
4c78336
implement compute and render with bindgroup set
Apr 10, 2026
8e04a00
fix default ctor issue
Apr 10, 2026
e42939c
some cleanup, add assertions
Apr 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ set_target_properties(dawn_wrapper PROPERTIES
target_sources(dawn_wrapper PRIVATE
src/bindgroup_layout_wrapper.cpp
src/bindgroup_layout_wrapper_impl.hpp
src/bindgroup_set.cpp
src/bindgroup_set_impl.hpp
src/bindgroup_wrapper.cpp
src/bindgroup_wrapper_impl.hpp
src/buffer_wrapper.cpp
Expand Down
19 changes: 19 additions & 0 deletions src/bindgroup_set.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <iostream>
#include <map>
#include <memory>

#include "bindgroup_set_impl.hpp"

namespace dawn_wrapper {
bindgroup_set::bindgroup_set(ptr_type ptr)
: m_pimpl(ptr)
{
}

bindgroup_set& bindgroup_set::add_bindgroup(bindgroup_wrapper bg, unsigned group)
{
m_pimpl->add_bindgroup(bg, group);
return *this;
}

} // dawn_wrapper
29 changes: 29 additions & 0 deletions src/bindgroup_set_impl.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#pragma once

#include "buffer_wrapper_impl.hpp"
#include "texture_output_wrapper_impl.hpp"
#include "texture_wrapper_impl.hpp"

using namespace wgpu;

namespace dawn_wrapper {

struct bindgroup_set::pimpl {

void add_bindgroup(bindgroup_wrapper bg, unsigned group)
{
m_bindgroups[group] = bg;
}

pimpl(std::string context_name)
: m_bindgroups()
, m_context_name(context_name)
{
}

private:
std::map<unsigned, bindgroup_wrapper> m_bindgroups;
std::string m_context_name;
};
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

}
5 changes: 5 additions & 0 deletions src/compute_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ void compute_wrapper::init_pipeline(bindgroup_layout_wrapper layout)
m_pimpl->init_pipeline(layout);
}

bool compute_wrapper::compute(bindgroup_set set, unsigned width, unsigned height, encoder_wrapper encoder)
{
return m_pimpl->compute(set, width, height, encoder);
}

bool compute_wrapper::compute(bindgroup_wrapper bindGroup, unsigned width, unsigned height, encoder_wrapper encoder)
{
return m_pimpl->compute(bindGroup, width, height, encoder);
Expand Down
8 changes: 8 additions & 0 deletions src/compute_wrapper_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ struct compute_wrapper::pimpl : private shader_base {
m_pipeline = dawn_utils::make_compute_pipeline(m_device, m_shader, m_bindGroupLayout, m_entryPoint.c_str());
}

bool compute(bindgroup_set set, unsigned width, unsigned height, encoder_wrapper encoder)
{


return false;
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated


bool compute(bindgroup_wrapper bindGroup, unsigned width, unsigned height, encoder_wrapper encoder)
{
ASSERT(get_pipeline());
Expand Down
9 changes: 9 additions & 0 deletions src/dawn_wrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,19 @@ struct bindgroup_wrapper {
DAWN_WRAPPER_PIMPL_DEC(bindgroup_wrapper);
};

struct bindgroup_set {
bindgroup_set() = default;
bindgroup_set& add_bindgroup(bindgroup_wrapper bg, unsigned group);

DAWN_WRAPPER_PIMPL_DEC(bindgroup_set);
};
Comment thread
coderabbitai[bot] marked this conversation as resolved.

struct compute_wrapper {
compute_wrapper() = default;
void init_pipeline(bindgroup_layout_wrapper layout);
void compile_shader(std::string script, std::string entryPoint);
bool compute(bindgroup_wrapper, unsigned width, unsigned height, encoder_wrapper encoder);
bool compute(bindgroup_set, unsigned width, unsigned height, encoder_wrapper encoder);
void setup_compute(unsigned width, unsigned height);
bindgroup_layout_wrapper make_bindgroup_layout();
bool is_valid() const;
Expand All @@ -115,6 +123,7 @@ struct render_wrapper {
void compile_shader(std::string script, std::string entryPoint);
void set_surface(surface_wrapper);

void render(bindgroup_set, encoder_wrapper);
void render(bindgroup_wrapper, encoder_wrapper);
void render(encoder_wrapper);
bindgroup_layout_wrapper make_bindgroup_layout();
Expand Down
5 changes: 5 additions & 0 deletions src/render_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ void render_wrapper::init_pipeline()
m_pimpl->init_pipeline();
}

void render_wrapper::render(bindgroup_set set, encoder_wrapper encoder)
{
m_pimpl->render(set, encoder);
}

void render_wrapper::render(bindgroup_wrapper bindGroup, encoder_wrapper encoder)
{
m_pimpl->render(bindGroup, encoder);
Expand Down
6 changes: 6 additions & 0 deletions src/render_wrapper_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ struct render_wrapper::pimpl : private shader_base {
return m_surface.m_pimpl->getCurrentTextureView();
}

void render(bindgroup_set set, encoder_wrapper encoder)
{


}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

void render(bindgroup_wrapper bindGroup, encoder_wrapper encoder)
{
ASSERT(m_bindGroupLayout);
Expand Down
2 changes: 1 addition & 1 deletion test/build_and_run
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

set -euo pipefail

cmake -B build
#cmake -B build
cmake --build build -j 8 #$(nproc)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
./build/Example
Loading