diff --git a/src/data/frustum.vert b/src/data/frustum.vert index 38a0e588..4742ee49 100644 --- a/src/data/frustum.vert +++ b/src/data/frustum.vert @@ -8,6 +8,8 @@ layout(push_constant, row_major) uniform PCR { // NOTE: offset = 76 already used by fragment shader. } pcr; +layout(location = 0) out vec3 outPos; + void main() { // Buffer-free cube line list generation. Needs 24 vertices in draw call int mask = (1 << gl_VertexIndex); @@ -24,5 +26,6 @@ void main() { y *= z; } + outPos = vec3(x, y, z); gl_Position = pcr.viewProjMtx * vec4(x, y, z, 1.0); } diff --git a/src/gui/command.cpp b/src/gui/command.cpp index 54e4eec0..f8c18f84 100644 --- a/src/gui/command.cpp +++ b/src/gui/command.cpp @@ -1532,7 +1532,7 @@ void CommandViewer::displayCommand() { dlg_assertm(vertex, "TODO Graphics pipeline without vertex shader"); if(vertex) { if(ImGui::Button("Debug vertex shader")) { - if(dcmd->state.pipe) { + if(dcmd->state->pipe) { auto mod = copySpecializeSpirv(*vertex); shaderDebugger_.select(vertex->stage, std::move(mod)); view_ = IOView::shader; diff --git a/src/gui/pipes.cpp b/src/gui/pipes.cpp index 3a18a798..2e2f3528 100644 --- a/src/gui/pipes.cpp +++ b/src/gui/pipes.cpp @@ -64,10 +64,23 @@ void initPipes(Device& dev, VkPipelineLayout histogramPipeLayout, Gui::Pipelines& dstPipes, bool manualSRGB) { std::vector modules; - auto createShaderMod = [&](span spv) { - return modules.emplace_back(dev, spv).vkHandle(); + auto createShaderModNamed = [&](span spv, const char* name) { + auto ret = modules.emplace_back(dev, spv).vkHandle(); + if(dev.dispatch.SetDebugUtilsObjectNameEXT) { + VkDebugUtilsObjectNameInfoEXT ni {}; + ni.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT; + ni.pObjectName = name; + ni.objectHandle = handleToU64(ret); + ni.objectType = VK_OBJECT_TYPE_SHADER_MODULE; + dev.dispatch.SetDebugUtilsObjectNameEXT(dev.handle, + &ni); + } + return ret; }; +#define createShaderMod(spv) createShaderModNamed(spv, "vil:" #spv) +#define initStages(spv) initStagesNamed(spv, "vil:" #spv) + auto vertModule = createShaderMod(gui_vert_spv_data); VkSpecializationMapEntry manualSRGBEntry {}; @@ -82,8 +95,8 @@ void initPipes(Device& dev, srgbSpec.mapEntryCount = 1u; srgbSpec.pMapEntries = &manualSRGBEntry; - auto initStages = [&](span fragSpv) { - VkShaderModule fragModule = createShaderMod(fragSpv); + auto initStagesNamed = [&](span fragSpv, const char* name) { + VkShaderModule fragModule = createShaderModNamed(fragSpv, name); std::array ret {}; ret[0].sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;