Skip to content

Commit

Permalink
mesh-shader cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Try committed Mar 4, 2023
1 parent 64c7da1 commit 4bd8922
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions Engine/gapi/vulkan/vcommandbuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,7 @@ 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) {
Expand Down
4 changes: 2 additions & 2 deletions Engine/gapi/vulkan/vmeshlethelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ void VMeshletHelper::initRP(VkCommandBuffer impl) {

uint32_t indSize = (desc[0].z ) & 0x3FF;

//uint32_t ibo[3*3] = {};
//compacted.read(ibo,0,sizeof(ibo));
// uint32_t ibo[3*3] = {};
// compacted.read(ibo,0,sizeof(ibo));

// float vbo[11*3] = {};
// uint32_t vboI[11*3] = {};
Expand Down
6 changes: 3 additions & 3 deletions Engine/gapi/vulkan/vpipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ VPipeline::VPipeline(VDevice& device, const RenderState& st, Topology tp,
vkAssert(vkCreateComputePipelines(device.device.impl, VK_NULL_HANDLE, 1, &info, nullptr, &meshCompuePipeline));

// cancel native mesh shading
pushStageFlags &= ~VK_SHADER_STAGE_MESH_BIT_NV;
pushStageFlags &= ~VK_SHADER_STAGE_MESH_BIT_EXT;
pushStageFlags |= VK_SHADER_STAGE_VERTEX_BIT;
}
}
Expand Down Expand Up @@ -204,11 +204,11 @@ VkPipelineLayout VPipeline::initLayout(VDevice& dev, const VPipelineLay& uboLay,

if(uboLay.msHelper!=VK_NULL_HANDLE) {
if(isMeshCompPass) {
if((pushStageFlags&VK_SHADER_STAGE_MESH_BIT_NV)==VK_SHADER_STAGE_MESH_BIT_NV) {
if((pushStageFlags&VK_SHADER_STAGE_MESH_BIT_EXT)==VK_SHADER_STAGE_MESH_BIT_EXT) {
pushStageFlags = VK_SHADER_STAGE_COMPUTE_BIT;
}
} else {
pushStageFlags &= ~VK_SHADER_STAGE_MESH_BIT_NV;
pushStageFlags &= ~VK_SHADER_STAGE_MESH_BIT_EXT;
pushStageFlags |= VK_SHADER_STAGE_VERTEX_BIT;
}
}
Expand Down
4 changes: 2 additions & 2 deletions Engine/gapi/vulkan/vpipelinelay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ VkDescriptorSetLayout VPipelineLay::create(uint32_t runtimeArraySz) const {
b.descriptorCount = e.runtimeSized ? runtimeArraySz : e.arraySize;
b.descriptorType = nativeFormat(e.cls);
b.stageFlags = nativeFormat(e.stage);
if((b.stageFlags&VK_SHADER_STAGE_MESH_BIT_NV)==VK_SHADER_STAGE_MESH_BIT_NV && dev.props.meshlets.meshShaderEmulated) {
b.stageFlags &= ~VK_SHADER_STAGE_MESH_BIT_NV;
if((b.stageFlags&VK_SHADER_STAGE_MESH_BIT_EXT)==VK_SHADER_STAGE_MESH_BIT_EXT && dev.props.meshlets.meshShaderEmulated) {
b.stageFlags &= ~VK_SHADER_STAGE_MESH_BIT_EXT;
b.stageFlags |= VK_SHADER_STAGE_VERTEX_BIT;
b.stageFlags |= VK_SHADER_STAGE_COMPUTE_BIT;
}
Expand Down

0 comments on commit 4bd8922

Please sign in to comment.