Creating Graphics Pipeline in Vulkan API Causes Segmentation Fault Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election Results Why I closed the “Why is Kali so hard” questionsox segmentation faultSegmentation fault in libGL.so.1Segmentation fault with dialogImagemagick segmentation-faultRunning application ends with “Segmentation Fault”What Causes Maintenance Shell Segmentation Fault?Debian Segmentation FaultError - Segmentation Faultmydumper segmentation fault in g_ascii_strtoullParole - Segmentation fault (core dumped)
Fantasy story; one type of magic grows in power with use, but the more powerful they are, they more they are drawn to travel to their source
How to tell that you are a giant?
What font is "z" in "z-score"?
Is there any way for the UK Prime Minister to make a motion directly dependent on Government confidence?
Is there a kind of relay only consumes power when switching?
Is the Standard Deduction better than Itemized when both are the same amount?
Is there such thing as an Availability Group failover trigger?
How to compare two different files line by line in unix?
Is it cost-effective to upgrade an old-ish Giant Escape R3 commuter bike with entry-level branded parts (wheels, drivetrain)?
Extracting terms with certain heads in a function
First console to have temporary backward compatibility
Do wooden building fires get hotter than 600°C?
If a VARCHAR(MAX) column is included in an index, is the entire value always stored in the index page(s)?
Can anything be seen from the center of the Boötes void? How dark would it be?
How would a mousetrap for use in space work?
Dating a Former Employee
Using et al. for a last / senior author rather than for a first author
Why aren't air breathing engines used as small first stages
How to Make a Beautiful Stacked 3D Plot
What is homebrew?
Amount of permutations on an NxNxN Rubik's Cube
If my PI received research grants from a company to be able to pay my postdoc salary, did I have a potential conflict interest too?
Is it fair for a professor to grade us on the possession of past papers?
Around usage results
Creating Graphics Pipeline in Vulkan API Causes Segmentation Fault
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questionsox segmentation faultSegmentation fault in libGL.so.1Segmentation fault with dialogImagemagick segmentation-faultRunning application ends with “Segmentation Fault”What Causes Maintenance Shell Segmentation Fault?Debian Segmentation FaultError - Segmentation Faultmydumper segmentation fault in g_ascii_strtoullParole - Segmentation fault (core dumped)
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm following a tutorial in vulkan programming by Alexander Overvoorde, and came across a segmentation error. I have already ran GDB to find the error and this is what I got:
(gdb) bt
#0 0x00007ffff6201435 in ?? () from /usr/lib/libnvidia-glcore.so.418.43
#1 0x00007ffff6203222 in ?? () from /usr/lib/libnvidia-glcore.so.418.43
#2 0x00007ffff6209f00 in ?? () from /usr/lib/libnvidia-glcore.so.418.43
#3 0x0000555555559848 in VulkanEngine::createGraphicsPipeline (
this=0x7fffffffdc50) at main.cpp:452
#4 0x000055555555b7cc in GameApplication::initVulkan (this=0x7fffffffdc50)
at main.cpp:906
#5 0x000055555555b70e in GameApplication::run (this=0x7fffffffdc50)
at main.cpp:879
#6 0x0000555555557712 in main () at main.cpp:931
By the looks of it, this is Nvidia's fault but I'm not sure. If anyone know what I should do about this, please let me know!
OS: KDE Manjaro 5.0.5,
Plasma Version 5.15.3,
GPU: GTX 1060 3GB propitary drivers
// Function to create the graphics layout and pipeline
void createGraphicsPipeline() VK_COLOR_COMPONENT_A_BIT;
colorBlendAttachment.blendEnable = VK_FALSE;
// Define the color blending state
VkPipelineColorBlendStateCreateInfo colorBlending = ;
colorBlending.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO;
colorBlending.logicOpEnable = VK_FALSE;
colorBlending.logicOp = VK_LOGIC_OP_COPY;
colorBlending.attachmentCount = 1;
colorBlending.pAttachments = &colorBlendAttachment;
colorBlending.blendConstants[0] = 0.0f;
colorBlending.blendConstants[1] = 0.0f;
colorBlending.blendConstants[2] = 0.0f;
colorBlending.blendConstants[3] = 0.0f;
// Define the pipeline layout information
VkPipelineLayoutCreateInfo pipelineLayoutInfo = ;
pipelineLayoutInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO;
pipelineLayoutInfo.setLayoutCount = 0;
pipelineLayoutInfo.pSetLayouts = nullptr;
pipelineLayoutInfo.pushConstantRangeCount = 0;
pipelineLayoutInfo.pPushConstantRanges = nullptr;
if(vkCreatePipelineLayout(device, &pipelineLayoutInfo, nullptr, &pipelineLayout) != VK_SUCCESS)
throw std::runtime_error("Failed the create pipeline layout!");
else
std::cout<<"Successfully created pipeline layout!"<<std::endl;
// Define the pipeline information
VkGraphicsPipelineCreateInfo pipelineInfo = ;
pipelineInfo.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO; // the struct type (self-explanitory)
pipelineInfo.stageCount = 2; // number of the shader stages
pipelineInfo.pStages = shaderStages; // reference to the shader stages array
pipelineInfo.pVertexInputState = &vertexInputInfo; // reference to the vertex input state
pipelineInfo.pInputAssemblyState = &inputAssembly; // reference to the input assembly state
pipelineInfo.pViewportState = &viewportState; // reference to the viewport state
pipelineInfo.pRasterizationState = &rasterizer; // reference to the rasterizer state
pipelineInfo.pMultisampleState = &multiSampling; // reference to the multisampling state
pipelineInfo.pDepthStencilState = nullptr; // reference to a depth stencil state
pipelineInfo.pColorBlendState = &colorBlending; // reference to a color blend state
pipelineInfo.pDynamicState = nullptr; // specifies a dynamic state
pipelineInfo.layout = pipelineLayout; // reference to the used pipeline layout
pipelineInfo.renderPass = renderPass; // reference to the used render pass
pipelineInfo.subpass = 0; // index reference to the used subpasses
pipelineInfo.basePipelineHandle = VK_NULL_HANDLE; // reference to another pipeline to shift to
pipelineInfo.basePipelineIndex = -1; // index reference to another pipeline to shift to
// Try to create graphics pipelines and print the outcome
if(vkCreateGraphicsPipelines(device, VK_NULL_HANDLE, 1, &pipelineInfo, nullptr, &graphicsPipeline) == VK_SUCCESS)
std::cout<<"Successfully created graphics pipelines!"<<std::endl;
else
throw std::runtime_error("Failed to create graphics pipelines!");
// Destroy the uneeded modules
vkDestroyShaderModule(device, fragShaderModule, nullptr); // destroy the vertex shader module
vkDestroyShaderModule(device, vertShaderModule, nullptr); // destroy the fragment shader module
class GameApplication
public:
GameApplication()
~GameApplication()
void run()
initWindow();
initVulkan();
mainLoop();
cleanup();
void createInstance();
private:
VulkanEngine vulkanEngine;
GLFWwindow *appWindow;
// Function to setup render window
void initWindow()
appWindow = vulkanEngine.getWindow();
vulkanEngine.windowInit();
// Initialize vulkan routines
void initVulkan()
vulkanEngine.createInstance(); // create the engine instance
vulkanEngine.createSurface(); // create window surface
vulkanEngine.pickPhysicalDevice(); // choose GPU to render with
vulkanEngine.createLogicalDevice(); // create the logical process for GPU
vulkanEngine.createSwapChain(); // create window swap chain
vulkanEngine.createImageViews(); // create window image views
vulkanEngine.createRenderPass(); // create a render pass
vulkanEngine.createGraphicsPipeline(); // create graphics pipeline
vulkanEngine.createFrameBuffers(); // create all frame buffers
vulkanEngine.createCommandPool(); // create the command pool
vulkanEngine.createCommandBuffers(); // create all command buffers
vulkanEngine.createSemaphores(); // create render semaphores
// Main render loop
void mainLoop()
while(!glfwWindowShouldClose(appWindow)) // if window should not close
vulkanEngine.windowUpdate(); // update window
vulkanEngine.drawFrame(); // draw a new frame
// End of program clean up
void cleanup()
vulkanEngine.cleanup(); // clean up vulkan waste
vulkanEngine.windowDestroy(); // clean up glfw waste
;
Line 452
if(vkCreateGraphicsPipelines(device, VK_NULL_HANDLE, 1, &pipelineInfo, nullptr, &graphicsPipeline) == VK_SUCCESS){
nvidia manjaro programming segmentation-fault vulkan
New contributor
add a comment |
I'm following a tutorial in vulkan programming by Alexander Overvoorde, and came across a segmentation error. I have already ran GDB to find the error and this is what I got:
(gdb) bt
#0 0x00007ffff6201435 in ?? () from /usr/lib/libnvidia-glcore.so.418.43
#1 0x00007ffff6203222 in ?? () from /usr/lib/libnvidia-glcore.so.418.43
#2 0x00007ffff6209f00 in ?? () from /usr/lib/libnvidia-glcore.so.418.43
#3 0x0000555555559848 in VulkanEngine::createGraphicsPipeline (
this=0x7fffffffdc50) at main.cpp:452
#4 0x000055555555b7cc in GameApplication::initVulkan (this=0x7fffffffdc50)
at main.cpp:906
#5 0x000055555555b70e in GameApplication::run (this=0x7fffffffdc50)
at main.cpp:879
#6 0x0000555555557712 in main () at main.cpp:931
By the looks of it, this is Nvidia's fault but I'm not sure. If anyone know what I should do about this, please let me know!
OS: KDE Manjaro 5.0.5,
Plasma Version 5.15.3,
GPU: GTX 1060 3GB propitary drivers
// Function to create the graphics layout and pipeline
void createGraphicsPipeline() VK_COLOR_COMPONENT_A_BIT;
colorBlendAttachment.blendEnable = VK_FALSE;
// Define the color blending state
VkPipelineColorBlendStateCreateInfo colorBlending = ;
colorBlending.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO;
colorBlending.logicOpEnable = VK_FALSE;
colorBlending.logicOp = VK_LOGIC_OP_COPY;
colorBlending.attachmentCount = 1;
colorBlending.pAttachments = &colorBlendAttachment;
colorBlending.blendConstants[0] = 0.0f;
colorBlending.blendConstants[1] = 0.0f;
colorBlending.blendConstants[2] = 0.0f;
colorBlending.blendConstants[3] = 0.0f;
// Define the pipeline layout information
VkPipelineLayoutCreateInfo pipelineLayoutInfo = ;
pipelineLayoutInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO;
pipelineLayoutInfo.setLayoutCount = 0;
pipelineLayoutInfo.pSetLayouts = nullptr;
pipelineLayoutInfo.pushConstantRangeCount = 0;
pipelineLayoutInfo.pPushConstantRanges = nullptr;
if(vkCreatePipelineLayout(device, &pipelineLayoutInfo, nullptr, &pipelineLayout) != VK_SUCCESS)
throw std::runtime_error("Failed the create pipeline layout!");
else
std::cout<<"Successfully created pipeline layout!"<<std::endl;
// Define the pipeline information
VkGraphicsPipelineCreateInfo pipelineInfo = ;
pipelineInfo.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO; // the struct type (self-explanitory)
pipelineInfo.stageCount = 2; // number of the shader stages
pipelineInfo.pStages = shaderStages; // reference to the shader stages array
pipelineInfo.pVertexInputState = &vertexInputInfo; // reference to the vertex input state
pipelineInfo.pInputAssemblyState = &inputAssembly; // reference to the input assembly state
pipelineInfo.pViewportState = &viewportState; // reference to the viewport state
pipelineInfo.pRasterizationState = &rasterizer; // reference to the rasterizer state
pipelineInfo.pMultisampleState = &multiSampling; // reference to the multisampling state
pipelineInfo.pDepthStencilState = nullptr; // reference to a depth stencil state
pipelineInfo.pColorBlendState = &colorBlending; // reference to a color blend state
pipelineInfo.pDynamicState = nullptr; // specifies a dynamic state
pipelineInfo.layout = pipelineLayout; // reference to the used pipeline layout
pipelineInfo.renderPass = renderPass; // reference to the used render pass
pipelineInfo.subpass = 0; // index reference to the used subpasses
pipelineInfo.basePipelineHandle = VK_NULL_HANDLE; // reference to another pipeline to shift to
pipelineInfo.basePipelineIndex = -1; // index reference to another pipeline to shift to
// Try to create graphics pipelines and print the outcome
if(vkCreateGraphicsPipelines(device, VK_NULL_HANDLE, 1, &pipelineInfo, nullptr, &graphicsPipeline) == VK_SUCCESS)
std::cout<<"Successfully created graphics pipelines!"<<std::endl;
else
throw std::runtime_error("Failed to create graphics pipelines!");
// Destroy the uneeded modules
vkDestroyShaderModule(device, fragShaderModule, nullptr); // destroy the vertex shader module
vkDestroyShaderModule(device, vertShaderModule, nullptr); // destroy the fragment shader module
class GameApplication
public:
GameApplication()
~GameApplication()
void run()
initWindow();
initVulkan();
mainLoop();
cleanup();
void createInstance();
private:
VulkanEngine vulkanEngine;
GLFWwindow *appWindow;
// Function to setup render window
void initWindow()
appWindow = vulkanEngine.getWindow();
vulkanEngine.windowInit();
// Initialize vulkan routines
void initVulkan()
vulkanEngine.createInstance(); // create the engine instance
vulkanEngine.createSurface(); // create window surface
vulkanEngine.pickPhysicalDevice(); // choose GPU to render with
vulkanEngine.createLogicalDevice(); // create the logical process for GPU
vulkanEngine.createSwapChain(); // create window swap chain
vulkanEngine.createImageViews(); // create window image views
vulkanEngine.createRenderPass(); // create a render pass
vulkanEngine.createGraphicsPipeline(); // create graphics pipeline
vulkanEngine.createFrameBuffers(); // create all frame buffers
vulkanEngine.createCommandPool(); // create the command pool
vulkanEngine.createCommandBuffers(); // create all command buffers
vulkanEngine.createSemaphores(); // create render semaphores
// Main render loop
void mainLoop()
while(!glfwWindowShouldClose(appWindow)) // if window should not close
vulkanEngine.windowUpdate(); // update window
vulkanEngine.drawFrame(); // draw a new frame
// End of program clean up
void cleanup()
vulkanEngine.cleanup(); // clean up vulkan waste
vulkanEngine.windowDestroy(); // clean up glfw waste
;
Line 452
if(vkCreateGraphicsPipelines(device, VK_NULL_HANDLE, 1, &pipelineInfo, nullptr, &graphicsPipeline) == VK_SUCCESS){
nvidia manjaro programming segmentation-fault vulkan
New contributor
Should be posted on Stackoverflow
– 炸鱼薯条德里克
Apr 14 at 5:17
add a comment |
I'm following a tutorial in vulkan programming by Alexander Overvoorde, and came across a segmentation error. I have already ran GDB to find the error and this is what I got:
(gdb) bt
#0 0x00007ffff6201435 in ?? () from /usr/lib/libnvidia-glcore.so.418.43
#1 0x00007ffff6203222 in ?? () from /usr/lib/libnvidia-glcore.so.418.43
#2 0x00007ffff6209f00 in ?? () from /usr/lib/libnvidia-glcore.so.418.43
#3 0x0000555555559848 in VulkanEngine::createGraphicsPipeline (
this=0x7fffffffdc50) at main.cpp:452
#4 0x000055555555b7cc in GameApplication::initVulkan (this=0x7fffffffdc50)
at main.cpp:906
#5 0x000055555555b70e in GameApplication::run (this=0x7fffffffdc50)
at main.cpp:879
#6 0x0000555555557712 in main () at main.cpp:931
By the looks of it, this is Nvidia's fault but I'm not sure. If anyone know what I should do about this, please let me know!
OS: KDE Manjaro 5.0.5,
Plasma Version 5.15.3,
GPU: GTX 1060 3GB propitary drivers
// Function to create the graphics layout and pipeline
void createGraphicsPipeline() VK_COLOR_COMPONENT_A_BIT;
colorBlendAttachment.blendEnable = VK_FALSE;
// Define the color blending state
VkPipelineColorBlendStateCreateInfo colorBlending = ;
colorBlending.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO;
colorBlending.logicOpEnable = VK_FALSE;
colorBlending.logicOp = VK_LOGIC_OP_COPY;
colorBlending.attachmentCount = 1;
colorBlending.pAttachments = &colorBlendAttachment;
colorBlending.blendConstants[0] = 0.0f;
colorBlending.blendConstants[1] = 0.0f;
colorBlending.blendConstants[2] = 0.0f;
colorBlending.blendConstants[3] = 0.0f;
// Define the pipeline layout information
VkPipelineLayoutCreateInfo pipelineLayoutInfo = ;
pipelineLayoutInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO;
pipelineLayoutInfo.setLayoutCount = 0;
pipelineLayoutInfo.pSetLayouts = nullptr;
pipelineLayoutInfo.pushConstantRangeCount = 0;
pipelineLayoutInfo.pPushConstantRanges = nullptr;
if(vkCreatePipelineLayout(device, &pipelineLayoutInfo, nullptr, &pipelineLayout) != VK_SUCCESS)
throw std::runtime_error("Failed the create pipeline layout!");
else
std::cout<<"Successfully created pipeline layout!"<<std::endl;
// Define the pipeline information
VkGraphicsPipelineCreateInfo pipelineInfo = ;
pipelineInfo.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO; // the struct type (self-explanitory)
pipelineInfo.stageCount = 2; // number of the shader stages
pipelineInfo.pStages = shaderStages; // reference to the shader stages array
pipelineInfo.pVertexInputState = &vertexInputInfo; // reference to the vertex input state
pipelineInfo.pInputAssemblyState = &inputAssembly; // reference to the input assembly state
pipelineInfo.pViewportState = &viewportState; // reference to the viewport state
pipelineInfo.pRasterizationState = &rasterizer; // reference to the rasterizer state
pipelineInfo.pMultisampleState = &multiSampling; // reference to the multisampling state
pipelineInfo.pDepthStencilState = nullptr; // reference to a depth stencil state
pipelineInfo.pColorBlendState = &colorBlending; // reference to a color blend state
pipelineInfo.pDynamicState = nullptr; // specifies a dynamic state
pipelineInfo.layout = pipelineLayout; // reference to the used pipeline layout
pipelineInfo.renderPass = renderPass; // reference to the used render pass
pipelineInfo.subpass = 0; // index reference to the used subpasses
pipelineInfo.basePipelineHandle = VK_NULL_HANDLE; // reference to another pipeline to shift to
pipelineInfo.basePipelineIndex = -1; // index reference to another pipeline to shift to
// Try to create graphics pipelines and print the outcome
if(vkCreateGraphicsPipelines(device, VK_NULL_HANDLE, 1, &pipelineInfo, nullptr, &graphicsPipeline) == VK_SUCCESS)
std::cout<<"Successfully created graphics pipelines!"<<std::endl;
else
throw std::runtime_error("Failed to create graphics pipelines!");
// Destroy the uneeded modules
vkDestroyShaderModule(device, fragShaderModule, nullptr); // destroy the vertex shader module
vkDestroyShaderModule(device, vertShaderModule, nullptr); // destroy the fragment shader module
class GameApplication
public:
GameApplication()
~GameApplication()
void run()
initWindow();
initVulkan();
mainLoop();
cleanup();
void createInstance();
private:
VulkanEngine vulkanEngine;
GLFWwindow *appWindow;
// Function to setup render window
void initWindow()
appWindow = vulkanEngine.getWindow();
vulkanEngine.windowInit();
// Initialize vulkan routines
void initVulkan()
vulkanEngine.createInstance(); // create the engine instance
vulkanEngine.createSurface(); // create window surface
vulkanEngine.pickPhysicalDevice(); // choose GPU to render with
vulkanEngine.createLogicalDevice(); // create the logical process for GPU
vulkanEngine.createSwapChain(); // create window swap chain
vulkanEngine.createImageViews(); // create window image views
vulkanEngine.createRenderPass(); // create a render pass
vulkanEngine.createGraphicsPipeline(); // create graphics pipeline
vulkanEngine.createFrameBuffers(); // create all frame buffers
vulkanEngine.createCommandPool(); // create the command pool
vulkanEngine.createCommandBuffers(); // create all command buffers
vulkanEngine.createSemaphores(); // create render semaphores
// Main render loop
void mainLoop()
while(!glfwWindowShouldClose(appWindow)) // if window should not close
vulkanEngine.windowUpdate(); // update window
vulkanEngine.drawFrame(); // draw a new frame
// End of program clean up
void cleanup()
vulkanEngine.cleanup(); // clean up vulkan waste
vulkanEngine.windowDestroy(); // clean up glfw waste
;
Line 452
if(vkCreateGraphicsPipelines(device, VK_NULL_HANDLE, 1, &pipelineInfo, nullptr, &graphicsPipeline) == VK_SUCCESS){
nvidia manjaro programming segmentation-fault vulkan
New contributor
I'm following a tutorial in vulkan programming by Alexander Overvoorde, and came across a segmentation error. I have already ran GDB to find the error and this is what I got:
(gdb) bt
#0 0x00007ffff6201435 in ?? () from /usr/lib/libnvidia-glcore.so.418.43
#1 0x00007ffff6203222 in ?? () from /usr/lib/libnvidia-glcore.so.418.43
#2 0x00007ffff6209f00 in ?? () from /usr/lib/libnvidia-glcore.so.418.43
#3 0x0000555555559848 in VulkanEngine::createGraphicsPipeline (
this=0x7fffffffdc50) at main.cpp:452
#4 0x000055555555b7cc in GameApplication::initVulkan (this=0x7fffffffdc50)
at main.cpp:906
#5 0x000055555555b70e in GameApplication::run (this=0x7fffffffdc50)
at main.cpp:879
#6 0x0000555555557712 in main () at main.cpp:931
By the looks of it, this is Nvidia's fault but I'm not sure. If anyone know what I should do about this, please let me know!
OS: KDE Manjaro 5.0.5,
Plasma Version 5.15.3,
GPU: GTX 1060 3GB propitary drivers
// Function to create the graphics layout and pipeline
void createGraphicsPipeline() VK_COLOR_COMPONENT_A_BIT;
colorBlendAttachment.blendEnable = VK_FALSE;
// Define the color blending state
VkPipelineColorBlendStateCreateInfo colorBlending = ;
colorBlending.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO;
colorBlending.logicOpEnable = VK_FALSE;
colorBlending.logicOp = VK_LOGIC_OP_COPY;
colorBlending.attachmentCount = 1;
colorBlending.pAttachments = &colorBlendAttachment;
colorBlending.blendConstants[0] = 0.0f;
colorBlending.blendConstants[1] = 0.0f;
colorBlending.blendConstants[2] = 0.0f;
colorBlending.blendConstants[3] = 0.0f;
// Define the pipeline layout information
VkPipelineLayoutCreateInfo pipelineLayoutInfo = ;
pipelineLayoutInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO;
pipelineLayoutInfo.setLayoutCount = 0;
pipelineLayoutInfo.pSetLayouts = nullptr;
pipelineLayoutInfo.pushConstantRangeCount = 0;
pipelineLayoutInfo.pPushConstantRanges = nullptr;
if(vkCreatePipelineLayout(device, &pipelineLayoutInfo, nullptr, &pipelineLayout) != VK_SUCCESS)
throw std::runtime_error("Failed the create pipeline layout!");
else
std::cout<<"Successfully created pipeline layout!"<<std::endl;
// Define the pipeline information
VkGraphicsPipelineCreateInfo pipelineInfo = ;
pipelineInfo.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO; // the struct type (self-explanitory)
pipelineInfo.stageCount = 2; // number of the shader stages
pipelineInfo.pStages = shaderStages; // reference to the shader stages array
pipelineInfo.pVertexInputState = &vertexInputInfo; // reference to the vertex input state
pipelineInfo.pInputAssemblyState = &inputAssembly; // reference to the input assembly state
pipelineInfo.pViewportState = &viewportState; // reference to the viewport state
pipelineInfo.pRasterizationState = &rasterizer; // reference to the rasterizer state
pipelineInfo.pMultisampleState = &multiSampling; // reference to the multisampling state
pipelineInfo.pDepthStencilState = nullptr; // reference to a depth stencil state
pipelineInfo.pColorBlendState = &colorBlending; // reference to a color blend state
pipelineInfo.pDynamicState = nullptr; // specifies a dynamic state
pipelineInfo.layout = pipelineLayout; // reference to the used pipeline layout
pipelineInfo.renderPass = renderPass; // reference to the used render pass
pipelineInfo.subpass = 0; // index reference to the used subpasses
pipelineInfo.basePipelineHandle = VK_NULL_HANDLE; // reference to another pipeline to shift to
pipelineInfo.basePipelineIndex = -1; // index reference to another pipeline to shift to
// Try to create graphics pipelines and print the outcome
if(vkCreateGraphicsPipelines(device, VK_NULL_HANDLE, 1, &pipelineInfo, nullptr, &graphicsPipeline) == VK_SUCCESS)
std::cout<<"Successfully created graphics pipelines!"<<std::endl;
else
throw std::runtime_error("Failed to create graphics pipelines!");
// Destroy the uneeded modules
vkDestroyShaderModule(device, fragShaderModule, nullptr); // destroy the vertex shader module
vkDestroyShaderModule(device, vertShaderModule, nullptr); // destroy the fragment shader module
class GameApplication
public:
GameApplication()
~GameApplication()
void run()
initWindow();
initVulkan();
mainLoop();
cleanup();
void createInstance();
private:
VulkanEngine vulkanEngine;
GLFWwindow *appWindow;
// Function to setup render window
void initWindow()
appWindow = vulkanEngine.getWindow();
vulkanEngine.windowInit();
// Initialize vulkan routines
void initVulkan()
vulkanEngine.createInstance(); // create the engine instance
vulkanEngine.createSurface(); // create window surface
vulkanEngine.pickPhysicalDevice(); // choose GPU to render with
vulkanEngine.createLogicalDevice(); // create the logical process for GPU
vulkanEngine.createSwapChain(); // create window swap chain
vulkanEngine.createImageViews(); // create window image views
vulkanEngine.createRenderPass(); // create a render pass
vulkanEngine.createGraphicsPipeline(); // create graphics pipeline
vulkanEngine.createFrameBuffers(); // create all frame buffers
vulkanEngine.createCommandPool(); // create the command pool
vulkanEngine.createCommandBuffers(); // create all command buffers
vulkanEngine.createSemaphores(); // create render semaphores
// Main render loop
void mainLoop()
while(!glfwWindowShouldClose(appWindow)) // if window should not close
vulkanEngine.windowUpdate(); // update window
vulkanEngine.drawFrame(); // draw a new frame
// End of program clean up
void cleanup()
vulkanEngine.cleanup(); // clean up vulkan waste
vulkanEngine.windowDestroy(); // clean up glfw waste
;
Line 452
if(vkCreateGraphicsPipelines(device, VK_NULL_HANDLE, 1, &pipelineInfo, nullptr, &graphicsPipeline) == VK_SUCCESS){
nvidia manjaro programming segmentation-fault vulkan
nvidia manjaro programming segmentation-fault vulkan
New contributor
New contributor
edited Apr 14 at 2:21
Stephen Harris
27.5k35383
27.5k35383
New contributor
asked Apr 13 at 18:23
SomeRandomDudeSomeRandomDude
1
1
New contributor
New contributor
Should be posted on Stackoverflow
– 炸鱼薯条德里克
Apr 14 at 5:17
add a comment |
Should be posted on Stackoverflow
– 炸鱼薯条德里克
Apr 14 at 5:17
Should be posted on Stackoverflow
– 炸鱼薯条德里克
Apr 14 at 5:17
Should be posted on Stackoverflow
– 炸鱼薯条德里克
Apr 14 at 5:17
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
SomeRandomDude is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f512310%2fcreating-graphics-pipeline-in-vulkan-api-causes-segmentation-fault%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
SomeRandomDude is a new contributor. Be nice, and check out our Code of Conduct.
SomeRandomDude is a new contributor. Be nice, and check out our Code of Conduct.
SomeRandomDude is a new contributor. Be nice, and check out our Code of Conduct.
SomeRandomDude is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f512310%2fcreating-graphics-pipeline-in-vulkan-api-causes-segmentation-fault%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Should be posted on Stackoverflow
– 炸鱼薯条德里克
Apr 14 at 5:17