Skip to content

Commit

Permalink
mesh emulation in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
Try committed Jun 5, 2023
1 parent 9fc1cfe commit 379c1ef
Show file tree
Hide file tree
Showing 12 changed files with 209 additions and 151 deletions.
99 changes: 61 additions & 38 deletions Engine/gapi/spirv/meshconverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,13 +380,11 @@ void MeshConverter::emitEngSsbo(libspirv::MutableBytecode& comp, spv::ExecutionM
const uint32_t _ptr_Priate_uint = comp.OpTypePointer(fn,spv::StorageClassPrivate, uint_t);
const uint32_t _runtimearr_uint = comp.OpTypeRuntimeArray(fn, uint_t);

const uint32_t DrawIndexedIndirectCommand = comp.OpTypeStruct (fn, {uint_t, uint_t, uint_t, int_t, uint_t});
const uint32_t IndirectCommand = comp.OpTypeStruct (fn, {uint_t});
const uint32_t DrawIndexedIndirectCommand = comp.OpTypeStruct (fn, {uint_t, uint_t, uint_t, uint_t, uint_t, int_t, uint_t, uint_t});
const uint32_t Descriptor = comp.OpTypeStruct (fn, {uint_t, uint_t, uint_t});
const uint32_t _runtimearr_desc = comp.OpTypeRuntimeArray(fn, Descriptor);
const uint32_t _runtimearr_cmd = comp.OpTypeRuntimeArray(fn, IndirectCommand);

const uint32_t EngineInternal0_t = comp.OpTypeStruct (fn, { _runtimearr_cmd }); // indirects
const uint32_t EngineInternal0_t = comp.OpTypeStruct (fn, { DrawIndexedIndirectCommand }); // indirects
const uint32_t _ptr_Storage_EngineInternal0 = comp.OpTypePointer(fn,spv::StorageClassStorageBuffer, EngineInternal0_t);

const uint32_t EngineInternal1_t = comp.OpTypeStruct (fn, {uint_t, uint_t, _runtimearr_desc}); // descritors
Expand All @@ -409,11 +407,9 @@ void MeshConverter::emitEngSsbo(libspirv::MutableBytecode& comp, spv::ExecutionM

fn = comp.findSectionEnd(libspirv::Bytecode::S_Annotations);
fn.insert(spv::OpDecorate, {_runtimearr_uint, spv::DecorationArrayStride, 4});
fn.insert(spv::OpDecorate, {_runtimearr_cmd, spv::DecorationArrayStride, 4});
fn.insert(spv::OpDecorate, {_runtimearr_desc, spv::DecorationArrayStride, 12});
//fn.insert(spv::OpDecorate, {_runtimearr_cmd, spv::DecorationArrayStride, 20});

fn.insert(spv::OpMemberDecorate, {IndirectCommand, 0, spv::DecorationOffset, 0});
// fn.insert(spv::OpMemberDecorate, {IndirectCommand, 0, spv::DecorationOffset, 0});

fn.insert(spv::OpMemberDecorate, {Descriptor, 0, spv::DecorationOffset, 0});
fn.insert(spv::OpMemberDecorate, {Descriptor, 1, spv::DecorationOffset, 4});
Expand All @@ -424,6 +420,9 @@ void MeshConverter::emitEngSsbo(libspirv::MutableBytecode& comp, spv::ExecutionM
fn.insert(spv::OpMemberDecorate, {DrawIndexedIndirectCommand, 2, spv::DecorationOffset, 8});
fn.insert(spv::OpMemberDecorate, {DrawIndexedIndirectCommand, 3, spv::DecorationOffset, 12});
fn.insert(spv::OpMemberDecorate, {DrawIndexedIndirectCommand, 4, spv::DecorationOffset, 16});
fn.insert(spv::OpMemberDecorate, {DrawIndexedIndirectCommand, 5, spv::DecorationOffset, 20});
fn.insert(spv::OpMemberDecorate, {DrawIndexedIndirectCommand, 6, spv::DecorationOffset, 24});
fn.insert(spv::OpMemberDecorate, {DrawIndexedIndirectCommand, 7, spv::DecorationOffset, 28});

fn.insert(spv::OpDecorate, {vIndirectCmd, spv::DecorationDescriptorSet, 1});
fn.insert(spv::OpDecorate, {vIndirectCmd, spv::DecorationBinding, 0});
Expand All @@ -442,22 +441,26 @@ void MeshConverter::emitEngSsbo(libspirv::MutableBytecode& comp, spv::ExecutionM
fn.insert(spv::OpDecorate, {EngineInternal2_t, spv::DecorationBlock});
fn.insert(spv::OpMemberDecorate, {EngineInternal2_t, 0, spv::DecorationOffset, 0});
fn.insert(spv::OpMemberDecorate, {EngineInternal2_t, 1, spv::DecorationOffset, 4});
// fn.insert(spv::OpMemberDecorate, {EngineInternal2_t, 1, spv::DecorationCoherent});

fn = comp.findSectionEnd(libspirv::Bytecode::S_Debug);
fn.insert(spv::OpName, IndirectCommand, "IndirectCommand");
fn.insert(spv::OpMemberName, IndirectCommand, 0, "indexCount");
//fn.insert(spv::OpName, IndirectCommand, "IndirectCommand");
//fn.insert(spv::OpMemberName, IndirectCommand, 0, "indexCount");

fn.insert(spv::OpName, Descriptor, "Descriptor");
fn.insert(spv::OpMemberName, Descriptor, 0, "drawId");
fn.insert(spv::OpMemberName, Descriptor, 1, "ptr");
fn.insert(spv::OpMemberName, Descriptor, 2, "indSz");

fn.insert(spv::OpName, DrawIndexedIndirectCommand, "VkDrawIndexedIndirectCommand");
fn.insert(spv::OpMemberName, DrawIndexedIndirectCommand, 0, "indexCount");
fn.insert(spv::OpMemberName, DrawIndexedIndirectCommand, 1, "instanceCount");
fn.insert(spv::OpMemberName, DrawIndexedIndirectCommand, 2, "firstIndex");
fn.insert(spv::OpMemberName, DrawIndexedIndirectCommand, 3, "vertexOffset");
fn.insert(spv::OpMemberName, DrawIndexedIndirectCommand, 4, "firstInstance");
fn.insert(spv::OpName, DrawIndexedIndirectCommand, "DrawIndexedIndirectCommand");
fn.insert(spv::OpMemberName, DrawIndexedIndirectCommand, 0, "drawId");
fn.insert(spv::OpMemberName, DrawIndexedIndirectCommand, 1, "indexCountSrc");
fn.insert(spv::OpMemberName, DrawIndexedIndirectCommand, 2, "indexCount");
fn.insert(spv::OpMemberName, DrawIndexedIndirectCommand, 3, "instanceCount");
fn.insert(spv::OpMemberName, DrawIndexedIndirectCommand, 4, "firstIndex");
fn.insert(spv::OpMemberName, DrawIndexedIndirectCommand, 5, "vertexOffset");
fn.insert(spv::OpMemberName, DrawIndexedIndirectCommand, 6, "firstInstance");
fn.insert(spv::OpMemberName, DrawIndexedIndirectCommand, 7, "padding0");

fn.insert(spv::OpName, EngineInternal0_t, "EngineInternal0");
fn.insert(spv::OpMemberName, EngineInternal0_t, 0, "indirect");
Expand Down Expand Up @@ -552,7 +555,8 @@ void MeshConverter::emitSetMeshOutputs(libspirv::MutableBytecode& comp, uint32_t

const uint32_t drawId = comp.fetchAddBound();
const uint32_t rgDrawId = comp.fetchAddBound();
fn.insert(spv::OpAccessChain, {_ptr_Input_uint, drawId, gl_WorkGroupID, const2}); // &gl_WorkGroupID.z (abused as drawid)
//fn.insert(spv::OpAccessChain, {_ptr_Input_uint, drawId, gl_WorkGroupID, const2}); // &gl_WorkGroupID.z (abused as drawid)
fn.insert(spv::OpAccessChain, {_ptr_Storage_uint, drawId, vIndirectCmd, const0, const0}); //&EngineInternal0::indirect.drawId
fn.insert(spv::OpLoad, {uint_t, rgDrawId, drawId});

// gl_LocalInvocationIndex==0
Expand All @@ -575,28 +579,6 @@ void MeshConverter::emitSetMeshOutputs(libspirv::MutableBytecode& comp, uint32_t

fn.insert(spv::OpStore, {vTmp, rgTmp0});

// vIndirectCmd[i].indexCount += N;
const uint32_t ptrCmdDest = comp.fetchAddBound();
const uint32_t rgTmp1 = comp.fetchAddBound();
fn.insert(spv::OpAccessChain, {_ptr_Storage_uint, ptrCmdDest, vIndirectCmd, const0, rgDrawId, const0}); //&EngineInternal0::indirect[i]
fn.insert(spv::OpAtomicIAdd, {uint_t, rgTmp1, ptrCmdDest, const1/*scope*/, const0/*semantices*/, rgIboSize});

// vDecriptors
const uint32_t ptrDescDest = comp.fetchAddBound();
fn.insert(spv::OpAccessChain, {_ptr_Storage_uint, ptrDescDest, vDecriptors, const0}); //&EngineInternal1::grow
const uint32_t rgTmp2 = comp.fetchAddBound();
fn.insert(spv::OpAtomicIAdd, {uint_t, rgTmp2, ptrDescDest, const1/*scope*/, const0/*semantices*/, const1});

const uint32_t descDestDr = comp.fetchAddBound();
fn.insert(spv::OpAccessChain, {_ptr_Storage_uint, descDestDr, vDecriptors, const2, rgTmp2, const0}); //&EngineInternal1::desc[].drawId
fn.insert(spv::OpStore, {descDestDr, rgDrawId});
const uint32_t descDestInd = comp.fetchAddBound();
fn.insert(spv::OpAccessChain, {_ptr_Storage_uint, descDestInd, vDecriptors, const2, rgTmp2, const1}); //&EngineInternal1::desc[].ptr
fn.insert(spv::OpStore, {descDestInd, rgTmp0});
const uint32_t descDestSz = comp.fetchAddBound();
fn.insert(spv::OpAccessChain, {_ptr_Storage_uint, descDestSz, vDecriptors, const2, rgTmp2, const2}); //&EngineInternal1::desc[].indSz
fn.insert(spv::OpStore, {descDestSz, rgIboSize});

fn.insert(spv::OpBranch, {condBlockEnd});
fn.insert(spv::OpLabel, {condBlockEnd});
}
Expand Down Expand Up @@ -640,6 +622,47 @@ void MeshConverter::emitSetMeshOutputs(libspirv::MutableBytecode& comp, uint32_t
}
}

// gl_LocalInvocationIndex==0
{
const uint32_t cond0 = comp.fetchAddBound();
fn.insert(spv::OpIEqual, {bool_t, cond0, rgThreadId, const0});

const uint32_t condBlockBegin = comp.fetchAddBound();
const uint32_t condBlockEnd = comp.fetchAddBound();
fn.insert(spv::OpSelectionMerge, {condBlockEnd, spv::SelectionControlMaskNone});
fn.insert(spv::OpBranchConditional, {cond0, condBlockBegin, condBlockEnd});
fn.insert(spv::OpLabel, {condBlockBegin});
// fn.insert(spv::OpReturn, {});

const uint32_t rgTmp0 = comp.fetchAddBound();
fn.insert(spv::OpLoad, {uint_t, rgTmp0, vTmp});

// vIndirectCmd[i].indexCountSrc += N;
const uint32_t ptrCmdDest = comp.fetchAddBound();
const uint32_t rgTmp1 = comp.fetchAddBound();
fn.insert(spv::OpAccessChain, {_ptr_Storage_uint, ptrCmdDest, vIndirectCmd, const0, const1}); //&EngineInternal0::indirect.indexCountSrc
fn.insert(spv::OpAtomicIAdd, {uint_t, rgTmp1, ptrCmdDest, const1/*scope*/, const0/*semantices*/, rgIboSize});

// vDecriptors
const uint32_t ptrDescDest = comp.fetchAddBound();
fn.insert(spv::OpAccessChain, {_ptr_Storage_uint, ptrDescDest, vDecriptors, const0}); //&EngineInternal1::grow
const uint32_t rgTmp2 = comp.fetchAddBound();
fn.insert(spv::OpAtomicIAdd, {uint_t, rgTmp2, ptrDescDest, const1/*scope*/, const0/*semantices*/, const1});

const uint32_t descDestDr = comp.fetchAddBound();
fn.insert(spv::OpAccessChain, {_ptr_Storage_uint, descDestDr, vDecriptors, const2, rgTmp2, const0}); //&EngineInternal1::desc[].drawId
fn.insert(spv::OpStore, {descDestDr, rgDrawId});
const uint32_t descDestInd = comp.fetchAddBound();
fn.insert(spv::OpAccessChain, {_ptr_Storage_uint, descDestInd, vDecriptors, const2, rgTmp2, const1}); //&EngineInternal1::desc[].ptr
fn.insert(spv::OpStore, {descDestInd, rgTmp0});
const uint32_t descDestSz = comp.fetchAddBound();
fn.insert(spv::OpAccessChain, {_ptr_Storage_uint, descDestSz, vDecriptors, const2, rgTmp2, const2}); //&EngineInternal1::desc[].indSz
fn.insert(spv::OpStore, {descDestSz, rgIboSize});

fn.insert(spv::OpBranch, {condBlockEnd});
fn.insert(spv::OpLabel, {condBlockEnd});
}

fn.insert(spv::OpReturn, {});
fn.insert(spv::OpFunctionEnd, {});
}
Expand Down
10 changes: 1 addition & 9 deletions Engine/gapi/vulkan/vcommandbuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1136,16 +1136,8 @@ void VMeshCommandBuffer::dispatchMesh(size_t x, size_t y, size_t z) {
if(px.meshPipeline()==VK_NULL_HANDLE)
return;

assert(z==1); // abused as drawId
auto& ms = *device.meshHelper;

if(meshIndirectId==0) {
ms.firstDraw(cbHelper);
}

device.vkCmdDispatchBase(cbHelper,
0, 0, uint32_t(meshIndirectId),
uint32_t(x), uint32_t(y), 1);
ms.drawCompute(cbHelper, uint32_t(meshIndirectId), x,y,z);
ms.drawIndirect(impl, uint32_t(meshIndirectId));
++meshIndirectId;
}
Expand Down
50 changes: 29 additions & 21 deletions Engine/gapi/vulkan/vmeshlethelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,19 @@ VMeshletHelper::VMeshletHelper(VDevice& dev) : dev(dev) {
const auto ms = MemUsage::StorageBuffer | MemUsage::Indirect | MemUsage::TransferDst | MemUsage::TransferSrc;
const auto geo = MemUsage::StorageBuffer | MemUsage::IndexBuffer | MemUsage::TransferDst | MemUsage::TransferSrc;

indirectSrc = dev.allocator.alloc(nullptr, IndirectScratchSize, 1,1, ind, BufferHeap::Device);
indirect = dev.allocator.alloc(nullptr, IndirectMemorySize, 1,1, ind, BufferHeap::Device);

meshlets = dev.allocator.alloc(nullptr, MeshletsMemorySize, 1,1, ms, BufferHeap::Device);
scratch = dev.allocator.alloc(nullptr, PipelineMemorySize, 1,1, geo, BufferHeap::Device);

// scratch = dev.allocator.alloc(nullptr, PipelineMemorySize, 1,1, geo, BufferHeap::Device);
scratch = dev.allocator.alloc(nullptr, PipelineMemorySize, 1,1, geo, BufferHeap::Upload);
// TODO
// assert(dev.props.ssbo.offsetAlign <= 32);

{
auto c = dev.dataMgr().get();
auto& cmd = reinterpret_cast<VMeshCommandBuffer&>(*c.get());
cmd.begin();
// drawcall-related parts should be set to zeros.
vkCmdFillBuffer(cmd.impl, indirectSrc.impl, 0, VK_WHOLE_SIZE, 0);
vkCmdFillBuffer(cmd.impl, indirect.impl, 0, VK_WHOLE_SIZE, 0);
// meshlet counters
vkCmdFillBuffer(cmd.impl, meshlets.impl, 0, sizeof(uint32_t)*2, 0);
// heap counters
Expand All @@ -52,11 +51,11 @@ VMeshletHelper::VMeshletHelper(VDevice& dev) : dev(dev) {
engLay = initLayout(dev);
engPool = initPool(dev,3);
engSet = initDescriptors(dev,engPool,engLay);
initEngSet(engSet,3);
initEngSet(engSet,3,true);

compPool = initPool(dev,4);
compPool = initPool(dev,3);
compSet = initDescriptors(dev,compPool,compactageLay.handler->impl);
initEngSet(compSet,4);
initEngSet(compSet,3,false);

drawLay = initDrawLayout(dev);
drawPool = initPool(dev,1);
Expand Down Expand Up @@ -94,10 +93,7 @@ void VMeshletHelper::cleanup() {
}

void VMeshletHelper::bindCS(VkCommandBuffer impl, VkPipelineLayout lay) {
vkCmdBindDescriptorSets(impl, VK_PIPELINE_BIND_POINT_COMPUTE,
lay, 1,
1,&engSet,
0,nullptr);
currentCsLayout = lay;
}

void VMeshletHelper::bindVS(VkCommandBuffer impl, VkPipelineLayout lay) {
Expand All @@ -108,9 +104,9 @@ void VMeshletHelper::bindVS(VkCommandBuffer impl, VkPipelineLayout lay) {
0,nullptr);
}

void VMeshletHelper::drawIndirect(VkCommandBuffer impl, uint32_t id) {
assert(id<IndirectCmdCount);
uint32_t off = id*sizeof(VkDrawIndexedIndirectCommand);
void VMeshletHelper::drawIndirect(VkCommandBuffer impl, uint32_t drawId) {
assert(drawId<IndirectCmdCount);
uint32_t off = drawId*sizeof(VkDrawIndexedIndirectCommand) + 2*sizeof(uint32_t);
vkCmdDrawIndexedIndirect(impl, indirect.impl, off, 1, sizeof(VkDrawIndexedIndirectCommand));
// vkCmdDrawIndexed(impl, 3, 1, 0, 0, 0);
}
Expand Down Expand Up @@ -149,6 +145,7 @@ void VMeshletHelper::initRP(VkCommandBuffer impl) {
void VMeshletHelper::sortPass(VkCommandBuffer impl, uint32_t meshCallsCount) {
if(meshCallsCount==0)
return;
currentCsLayout = VK_NULL_HANDLE;

// prefix summ pass
barrier(impl, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
Expand Down Expand Up @@ -188,6 +185,16 @@ void VMeshletHelper::firstDraw(VkCommandBuffer impl) {
VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT);
}

void VMeshletHelper::drawCompute(VkCommandBuffer impl, uint32_t drawId, size_t x, size_t y, size_t z) {
if(drawId==0)
firstDraw(impl);
vkCmdBindDescriptorSets(impl, VK_PIPELINE_BIND_POINT_COMPUTE,
currentCsLayout, 1,
1,&engSet,
1,&drawId);
vkCmdDispatch(impl, uint32_t(x), uint32_t(y), uint32_t(z));
}

void VMeshletHelper::barrier(VkCommandBuffer impl,
VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask,
Expand Down Expand Up @@ -215,6 +222,7 @@ VkDescriptorSetLayout VMeshletHelper::initLayout(VDevice& device) {
bind[i].descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER;
bind[i].stageFlags = VK_SHADER_STAGE_COMPUTE_BIT;
}
bind[0].descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC;

VkDescriptorSetLayoutCreateInfo info={};
info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO;
Expand Down Expand Up @@ -280,9 +288,9 @@ VkDescriptorSet VMeshletHelper::initDescriptors(VDevice& device,
return desc;
}

void VMeshletHelper::initEngSet(VkDescriptorSet set, uint32_t cnt) {
void VMeshletHelper::initEngSet(VkDescriptorSet set, uint32_t cnt, bool dynamic) {
VkDescriptorBufferInfo buf[4] = {};
buf[0].buffer = indirectSrc.impl;
buf[0].buffer = indirect.impl;
buf[0].offset = 0;
buf[0].range = VK_WHOLE_SIZE;

Expand All @@ -294,10 +302,6 @@ void VMeshletHelper::initEngSet(VkDescriptorSet set, uint32_t cnt) {
buf[2].offset = 0;
buf[2].range = VK_WHOLE_SIZE;

buf[3].buffer = indirect.impl;
buf[3].offset = 0;
buf[3].range = VK_WHOLE_SIZE;

VkWriteDescriptorSet write[4] = {};
for(uint32_t i=0; i<cnt; ++i) {
write[i].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
Expand All @@ -309,6 +313,10 @@ void VMeshletHelper::initEngSet(VkDescriptorSet set, uint32_t cnt) {
write[i].pBufferInfo = &buf[i];
}

if(dynamic) {
write[0].descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC;
}

vkUpdateDescriptorSets(dev.device.impl, cnt, write, 0, nullptr);
}

Expand Down
11 changes: 8 additions & 3 deletions Engine/gapi/vulkan/vmeshlethelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class VMeshletHelper {
};

struct VkDrawIndexedIndirectCommand {
uint32_t drawId;
uint32_t indexCountSrc;
uint32_t indexCount;
uint32_t instanceCount;
uint32_t firstIndex; // prefix sum
Expand Down Expand Up @@ -47,7 +49,8 @@ class VMeshletHelper {
void initRP(VkCommandBuffer impl);

void firstDraw(VkCommandBuffer impl);
void drawIndirect(VkCommandBuffer impl, uint32_t id);
void drawCompute(VkCommandBuffer impl, uint32_t drawId, size_t x, size_t y, size_t z);
void drawIndirect(VkCommandBuffer impl, uint32_t drawId);
void sortPass(VkCommandBuffer impl, uint32_t meshCallsCount);

VkDescriptorSetLayout lay() const { return engLay; }
Expand All @@ -60,15 +63,15 @@ class VMeshletHelper {
VkDescriptorSet initDescriptors(VDevice& device, VkDescriptorPool pool, VkDescriptorSetLayout lay);
void initShaders(VDevice& device);

void initEngSet (VkDescriptorSet set, uint32_t cnt);
void initEngSet (VkDescriptorSet set, uint32_t cnt, bool dynamic);
void initDrawSet(VkDescriptorSet set);

void barrier(VkCommandBuffer impl,
VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask,
VkAccessFlags srcAccessMask, VkAccessFlags dstAccessMask);

VDevice& dev;
VBuffer indirectSrc, indirect, meshlets, scratch;
VBuffer indirect, meshlets, scratch;

VkDescriptorSetLayout engLay = VK_NULL_HANDLE;
VkDescriptorPool engPool = VK_NULL_HANDLE;
Expand All @@ -81,6 +84,8 @@ class VMeshletHelper {
VkDescriptorSet drawPool = VK_NULL_HANDLE;
VkDescriptorSet drawSet = VK_NULL_HANDLE;

VkPipelineLayout currentCsLayout = VK_NULL_HANDLE;

DSharedPtr<VPipelineLay*> prefixSumLay;
DSharedPtr<VCompPipeline*> prefixSum;

Expand Down
11 changes: 6 additions & 5 deletions Engine/gapi/vulkan/vmeshshaderemulated.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@ VMeshShaderEmulated::VMeshShaderEmulated(VDevice& device, const void *source, si
assert(code.findExecutionModel()==spv::ExecutionModelMeshEXT);

MeshConverter conv(code);
// conv.options.deferredMeshShading = true;
conv.exec();

//debugLog("mesh_orig.mesh.spv", reinterpret_cast<const uint32_t*>(source),src_size/4);

auto& comp = conv.computeShader();
/*
debugLog("mesh_conv.comp.spv", comp.opcodes(), comp.size());
std::system("spirv-cross.exe -V .\\mesh_conv.comp.spv");
std::system("spirv-val.exe .\\mesh_conv.comp.spv");
*/

// debugLog("mesh_conv.comp.spv", comp.opcodes(), comp.size());
// std::system("spirv-cross.exe -V .\\mesh_conv.comp.spv");
// std::system("spirv-val.exe .\\mesh_conv.comp.spv");


auto& vert = conv.vertexPassthrough();

Expand Down
Loading

0 comments on commit 379c1ef

Please sign in to comment.