webgpu triangle
This commit is contained in:
parent
64116cd980
commit
5553ded476
22 changed files with 2107 additions and 42 deletions
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
Crafter®.Graphics
|
||||
Copyright (C) 2026 Catcrafts®
|
||||
catcrafts.net
|
||||
*/
|
||||
|
||||
module;
|
||||
module Crafter.Graphics:ShaderBindingTableWebGPU_impl;
|
||||
|
||||
import :ShaderBindingTableWebGPU;
|
||||
import std;
|
||||
|
||||
using namespace Crafter;
|
||||
|
||||
WebGPUShader::WebGPUShader(const std::filesystem::path& wgslPath,
|
||||
std::string fn,
|
||||
WebGPURTStage s)
|
||||
: entryFn(std::move(fn)), stage(s) {
|
||||
std::ifstream f(wgslPath, std::ios::binary | std::ios::ate);
|
||||
if (!f.is_open()) {
|
||||
std::println("WebGPUShader: cannot open {}", wgslPath.string());
|
||||
return;
|
||||
}
|
||||
auto size = f.tellg();
|
||||
if (size <= 0) {
|
||||
std::println("WebGPUShader: empty file {}", wgslPath.string());
|
||||
return;
|
||||
}
|
||||
f.seekg(0, std::ios::beg);
|
||||
source.resize(static_cast<std::size_t>(size));
|
||||
f.read(source.data(), size);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue