title: Access violation from vkCreateGraphicsPipelines
body: <p>I'm running into an access violation on this piece of Vulkan API.</p>
  
  <pre><code>VkResult err = vkCreateGraphicsPipelines(device, pipelineCache, 1, &amp;pipelineCreateInfo, nullptr, &amp;pipelines.billboard);
  </code></pre>
  
  <p>The error is:</p>
  
  <pre><code>Exception thrown at 0x00007FFB8BEDB276 (amdvlk64.dll) in 3Dfunctionvisualizer.exe: 0xC0000005: Access violation reading location 0x000000000000004C.
  </code></pre>
  
  <p>All other relevant code, as far as I can tell:</p>
  
  <pre><code>VkPipelineCacheCreateInfo pipelineCacheCreateInfo = {};
  pipelineCacheCreateInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO;
  VkResult err = vkCreatePipelineCache(device, &amp;pipelineCacheCreateInfo, nullptr, &amp;pipelineCache);
  
  VkPipelineInputAssemblyStateCreateInfo inputAssemblyState =
          vkTools::initializers::pipelineInputAssemblyStateCreateInfo(
              VK_PRIMITIVE_TOPOLOGY_POINT_LIST,
              0,
              VK_FALSE);
  
      VkPipelineRasterizationStateCreateInfo rasterizationState =
          vkTools::initializers::pipelineRasterizationStateCreateInfo(
              VK_POLYGON_MODE_FILL,
              VK_CULL_MODE_BACK_BIT,
              VK_FRONT_FACE_CLOCKWISE,
              0);
  
      VkPipelineColorBlendAttachmentState blendAttachmentState =
          vkTools::initializers::pipelineColorBlendAttachmentState(
              0xf,
              VK_FALSE);
  
      VkPipelineColorBlendStateCreateInfo colorBlendState =
          vkTools::initializers::pipelineColorBlendStateCreateInfo(
              1,
              &amp;blendAttachmentState);
  
      VkPipelineDepthStencilStateCreateInfo depthStencilState =
          vkTools::initializers::pipelineDepthStencilStateCreateInfo(
              VK_TRUE,
              VK_TRUE,
              VK_COMPARE_OP_LESS_OR_EQUAL);
  
      VkPipelineViewportStateCreateInfo viewportState =
          vkTools::initializers::pipelineViewportStateCreateInfo(1, 1, 0);
  
      VkPipelineMultisampleStateCreateInfo multisampleState =
          vkTools::initializers::pipelineMultisampleStateCreateInfo(
              VK_SAMPLE_COUNT_1_BIT,
              0);
  
      std::vector&lt;VkDynamicState&gt; dynamicStateEnables = {
          VK_DYNAMIC_STATE_VIEWPORT,
          VK_DYNAMIC_STATE_SCISSOR,
          VK_DYNAMIC_STATE_LINE_WIDTH
      };
      VkPipelineDynamicStateCreateInfo dynamicState =
          vkTools::initializers::pipelineDynamicStateCreateInfo(
              dynamicStateEnables.data(),
              dynamicStateEnables.size(),
              0);
  
      std::array&lt;VkPipelineShaderStageCreateInfo, 3&gt; shaderStages;
  
      shaderStages[0] = loadShader("./../data/shaders/3DVisualizer/billboard.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
      shaderStages[1] = loadShader("./../data/shaders/3DVisualizer/billboard.geom.spv", VK_SHADER_STAGE_GEOMETRY_BIT);
      shaderStages[2] = loadShader("./../data/shaders/3DVisualizer/billboard.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
  
      VkGraphicsPipelineCreateInfo pipelineCreateInfo =
          vkTools::initializers::pipelineCreateInfo(
              pipelineLayout,
              renderPass,
              0);
  
      pipelineCreateInfo.pVertexInputState = &amp;vertices.billboard.inputState;
      pipelineCreateInfo.pInputAssemblyState = &amp;inputAssemblyState;
      pipelineCreateInfo.pRasterizationState = &amp;rasterizationState;
      pipelineCreateInfo.pColorBlendState = &amp;colorBlendState;
      pipelineCreateInfo.pMultisampleState = &amp;multisampleState;
      pipelineCreateInfo.pViewportState = &amp;viewportState;
      pipelineCreateInfo.pDepthStencilState = &amp;depthStencilState;
      pipelineCreateInfo.pDynamicState = &amp;dynamicState;
      pipelineCreateInfo.stageCount = 3;
      pipelineCreateInfo.pStages = shaderStages.data();
      pipelineCreateInfo.renderPass = renderPass;
  </code></pre>
  
  <p>The device and pipelineCache are both set by the superclass, which was written by Sascha Willems and works for all of the examples he has created, so I don't expect the problem would be there. However, that really only leaves pipelineCreateInfo or pipelines.billboard as the potential source of the error.</p>
  
  <p>Both of those are dealt with in the (almost exact) same way as the examples by Sascha in his examples, so I'm at a loss here.</p>
  
  <p>EDIT: I found the problem. I had failed to specify the binding point for the sampler in my shader.</p>