Skip to content

Commit

Permalink
tests: Pipeline Binary cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
spencer-lunarg committed Sep 12, 2024
1 parent 5567df4 commit ff33a4e
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 290 deletions.
2 changes: 1 addition & 1 deletion layers/stateless/sl_pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ bool StatelessValidation::ValidatePipelineBinaryInfo(const void *next, VkPipelin
skip |= LogError(GetPipelineBinaryInfoVUID(flag_loc, vvl::PipelineBinaryInfoError::PNext_09617), device, flag_loc,
"(%s) includes VK_PIPELINE_CREATE_2_CAPTURE_DATA_BIT_KHR while "
"pipelineCache is not VK_NULL_HANDLE.",
string_VkPipelineCreateFlags2KHR(flags).c_str());
string_VkPipelineCreateFlags2KHR(create_flags_2).c_str());
}

const auto binary_info = vku::FindStructInPNextChain<VkPipelineBinaryInfoKHR>(next);
Expand Down
9 changes: 5 additions & 4 deletions tests/framework/pipeline_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,13 @@ void CreatePipelineHelper::LateBindPipelineInfo() {
}
}

VkResult CreatePipelineHelper::CreateGraphicsPipeline(bool do_late_bind) {
VkResult CreatePipelineHelper::CreateGraphicsPipeline(bool do_late_bind, bool no_cache) {
InitPipelineCache();
if (do_late_bind) {
LateBindPipelineInfo();
}
return vk::CreateGraphicsPipelines(device_->handle(), pipeline_cache_, 1, &gp_ci_, NULL, &pipeline_);
return vk::CreateGraphicsPipelines(device_->handle(), no_cache ? VK_NULL_HANDLE : pipeline_cache_, 1, &gp_ci_, NULL,
&pipeline_);
}

CreateComputePipelineHelper::CreateComputePipelineHelper(VkLayerTest &test, void *pNext) : layer_test_(test) {
Expand Down Expand Up @@ -362,12 +363,12 @@ void CreateComputePipelineHelper::LateBindPipelineInfo() {
cp_ci_.stage = cs_.get()->GetStageCreateInfo();
}

VkResult CreateComputePipelineHelper::CreateComputePipeline(bool do_late_bind) {
VkResult CreateComputePipelineHelper::CreateComputePipeline(bool do_late_bind, bool no_cache) {
InitPipelineCache();
if (do_late_bind) {
LateBindPipelineInfo();
}
return vk::CreateComputePipelines(device_->handle(), pipeline_cache_, 1, &cp_ci_, NULL, &pipeline_);
return vk::CreateComputePipelines(device_->handle(), no_cache ? VK_NULL_HANDLE : pipeline_cache_, 1, &cp_ci_, NULL, &pipeline_);
}

namespace vkt {
Expand Down
4 changes: 2 additions & 2 deletions tests/framework/pipeline_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class CreatePipelineHelper {
void Destroy();

void LateBindPipelineInfo();
VkResult CreateGraphicsPipeline(bool do_late_bind = true);
VkResult CreateGraphicsPipeline(bool do_late_bind = true, bool no_cache = false);

void InitVertexInputLibInfo(void *p_next = nullptr);

Expand Down Expand Up @@ -147,7 +147,7 @@ class CreateComputePipelineHelper {
void Destroy();

void LateBindPipelineInfo();
VkResult CreateComputePipeline(bool do_late_bind = true);
VkResult CreateComputePipeline(bool do_late_bind = true, bool no_cache = false);

// Helper function to create a simple test case (positive or negative)
//
Expand Down
Loading

0 comments on commit ff33a4e

Please sign in to comment.