Skip to content

Commit

Permalink
Address code review comment
Browse files Browse the repository at this point in the history
Remove vkCreateRayTracingPipelinesKHR handler from
VulkanExportJsonConsumerBase.h and VulkanExportJsonConsumerBase.cpp to
address code review comment.
  • Loading branch information
mizhen committed Oct 30, 2023
1 parent d05627b commit 46813fd
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 38 deletions.
25 changes: 0 additions & 25 deletions framework/decode/vulkan_export_json_consumer_base.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
** Copyright (c) 2022-2023 LunarG, Inc.
** Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -621,30 +620,6 @@ void VulkanExportJsonConsumerBase::Process_vkUpdateDescriptorSetWithTemplateKHR(
WriteBlockEnd();
}

void VulkanExportJsonConsumerBase::Process_vkCreateRayTracingPipelinesKHR(
const ApiCallInfo& call_info,
VkResult returnValue,
format::HandleId device,
format::HandleId deferredOperation,
format::HandleId pipelineCache,
uint32_t createInfoCount,
StructPointerDecoder<Decoded_VkRayTracingPipelineCreateInfoKHR>* pCreateInfos,
StructPointerDecoder<Decoded_VkAllocationCallbacks>* pAllocator,
HandlePointerDecoder<VkPipeline>* pPipelines)
{
nlohmann::ordered_json& jdata = WriteApiCallStart(call_info, "vkCreateRayTracingPipelinesKHR");
FieldToJson(jdata[NameReturn()], returnValue, json_options_);
auto& args = jdata[NameArgs()];
HandleToJson(args["device"], device, json_options_);
HandleToJson(args["deferredOperation"], deferredOperation, json_options_);
HandleToJson(args["pipelineCache"], pipelineCache, json_options_);
FieldToJson(args["createInfoCount"], createInfoCount, json_options_);
FieldToJson(args["pCreateInfos"], pCreateInfos, json_options_);
FieldToJson(args["pAllocator"], pAllocator, json_options_);
HandleToJson(args["pPipelines"], pPipelines, json_options_);
WriteBlockEnd();
}

void VulkanExportJsonConsumerBase::WriteBlockStart()
{
json_data_.clear(); // < Dominates profiling (1/2).
Expand Down
12 changes: 0 additions & 12 deletions framework/decode/vulkan_export_json_consumer_base.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
** Copyright (c) 2022-2023 LunarG, Inc.
** Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -180,17 +179,6 @@ class VulkanExportJsonConsumerBase : public VulkanConsumer, public AnnotationHan
format::HandleId descriptorUpdateTemplate,
DescriptorUpdateTemplateDecoder* pData) override;

virtual void Process_vkCreateRayTracingPipelinesKHR(
const ApiCallInfo& call_info,
VkResult returnValue,
format::HandleId device,
format::HandleId deferredOperation,
format::HandleId pipelineCache,
uint32_t createInfoCount,
StructPointerDecoder<Decoded_VkRayTracingPipelineCreateInfoKHR>* pCreateInfos,
StructPointerDecoder<Decoded_VkAllocationCallbacks>* pAllocator,
HandlePointerDecoder<VkPipeline>* pPipelines) override;

/// @brief Convert annotations, which are simple {type:enum, key:string, value:string} objects.
virtual void ProcessAnnotation(uint64_t block_index,
format::AnnotationType type,
Expand Down
1 change: 0 additions & 1 deletion framework/encode/custom_vulkan_api_call_encoders.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
** Copyright (c) 2018-2020 Valve Corporation
** Copyright (c) 2018-2020 LunarG, Inc.
** Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and associated documentation files (the "Software"),
Expand Down
24 changes: 24 additions & 0 deletions framework/generated/generated_vulkan_export_json_consumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9591,6 +9591,30 @@ void VulkanExportJsonConsumer::Process_vkCmdTraceRaysKHR(
WriteBlockEnd();
}

void VulkanExportJsonConsumer::Process_vkCreateRayTracingPipelinesKHR(
const ApiCallInfo& call_info,
VkResult returnValue,
format::HandleId device,
format::HandleId deferredOperation,
format::HandleId pipelineCache,
uint32_t createInfoCount,
StructPointerDecoder<Decoded_VkRayTracingPipelineCreateInfoKHR>* pCreateInfos,
StructPointerDecoder<Decoded_VkAllocationCallbacks>* pAllocator,
HandlePointerDecoder<VkPipeline>* pPipelines)
{
nlohmann::ordered_json& jdata = WriteApiCallStart(call_info, "vkCreateRayTracingPipelinesKHR");
FieldToJson(jdata[NameReturn()], returnValue, json_options_);
auto& args = jdata[NameArgs()];
HandleToJson(args["device"], device, json_options_);
HandleToJson(args["deferredOperation"], deferredOperation, json_options_);
HandleToJson(args["pipelineCache"], pipelineCache, json_options_);
FieldToJson(args["createInfoCount"], createInfoCount, json_options_);
FieldToJson(args["pCreateInfos"], pCreateInfos, json_options_);
FieldToJson(args["pAllocator"], pAllocator, json_options_);
HandleToJson(args["pPipelines"], pPipelines, json_options_);
WriteBlockEnd();
}

void VulkanExportJsonConsumer::Process_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(
const ApiCallInfo& call_info,
VkResult returnValue,
Expand Down
11 changes: 11 additions & 0 deletions framework/generated/generated_vulkan_export_json_consumer.h
Original file line number Diff line number Diff line change
Expand Up @@ -4116,6 +4116,17 @@ class VulkanExportJsonConsumer : public VulkanExportJsonConsumerBase
uint32_t height,
uint32_t depth) override;

virtual void Process_vkCreateRayTracingPipelinesKHR(
const ApiCallInfo& call_info,
VkResult returnValue,
format::HandleId device,
format::HandleId deferredOperation,
format::HandleId pipelineCache,
uint32_t createInfoCount,
StructPointerDecoder<Decoded_VkRayTracingPipelineCreateInfoKHR>* pCreateInfos,
StructPointerDecoder<Decoded_VkAllocationCallbacks>* pAllocator,
HandlePointerDecoder<VkPipeline>* pPipelines) override;

virtual void Process_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(
const ApiCallInfo& call_info,
VkResult returnValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@ def need_feature_generation(self):
def generate_feature(self):
"""Performs C++ code generation for the feature."""
first = True

# TODO: Each code generator is passed a blacklist like framework\generated\vulkan_generators\blacklists.json
# of functions and structures not to generate code for. Once the feature is implemented, the following can be
# replaced with adding vkCreateRayTracingPipelinesKHR in corresponding blacklist.
if 'vkCreateRayTracingPipelinesKHR' in self.APICALL_BLACKLIST:
self.APICALL_BLACKLIST.remove('vkCreateRayTracingPipelinesKHR')

for cmd in self.get_filtered_cmd_names():
if not cmd in self.customImplementationRequired:
info = self.feature_cmd_params[cmd]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ def __init__(
def generate_feature(self):
"""Performs C++ code generation for the feature."""
first = True

# TODO: Each code generator is passed a blacklist like framework\generated\vulkan_generators\blacklists.json
# of functions and structures not to generate code for. Once the feature is implemented, the following can be
# replaced with adding vkCreateRayTracingPipelinesKHR in corresponding blacklist.
if 'vkCreateRayTracingPipelinesKHR' in self.APICALL_BLACKLIST:
self.APICALL_BLACKLIST.remove('vkCreateRayTracingPipelinesKHR')

for cmd in self.get_filtered_cmd_names():
if cmd not in self.customImplementationRequired:
info = self.feature_cmd_params[cmd]
Expand Down

0 comments on commit 46813fd

Please sign in to comment.