Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few bugfixes #23

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@ vkGetLayerObjectPropertyTRACETOOLTEST(VkInstance instance, VkObjectType objectTy
uint64_t objectHandle, VkLayerObjectPropertyTRACETOOLTEST valueType) which can request
layer internal information from the layer supporting this extension.

VK_TRACETOOLTEST_memory_markup - defines ways to mark buffer device addresses and
shader group handles in memory for identification by tools.
VK_TRACETOOLTEST_trace_helpers - various helper commands for tracing tools. Defines
ways to mark buffer device addresses and shader group handles in memory for
identification by tools.

Private GLES extensions
-----------------------
Expand Down
7 changes: 4 additions & 3 deletions include/vulkan_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ typedef enum VkAddressRemapTargetTRACETOOLTEST

// Mark where in memory buffer device addresses or shader group handles are stored, as they may need to be
// remapped for trace replay.
// Passed to vkCreatePipelineLayout for specialization constants, vkCmdPushConstants2KHR for push constants,
// Passed to VkPipelineShaderStageCreateInfo for specialization constants, vkCmdPushConstants2KHR for push constants,
// vkCmdUpdateBuffer2TRACETOOLTEST for commandbuffer buffer updates, or vkUpdateBufferTRACETOOLTEST for mapped
// memory buffer updates. When used with vkCmdPushConstants2KHR, offsets given here are relative to the start
// of its dstOffset.
Expand Down Expand Up @@ -93,5 +93,6 @@ typedef void (VKAPI_PTR *PFN_vkPatchImageTRACETOOLTEST)(VkDevice device, VkImage

// All pending Vulkan work has been host synchronized at this point to prevent race conditions. On trace replay, all other threads
// must also synchronize to this point. When called outside of a replay context, this is a no-op. You should never need to add this
// yourself to code, but it could be useful as a debug tool for tracing issues.
typedef void (VKAPI_PTR *PFN_vkThreadBarrierTRACETOOLTEST)();
// yourself to code, but it could be useful as a debug tool for tracing issues. To call it yourself, set count to zero and pValues
// to null, and tools will find it and fill it out with their internal tracking data for your threads.
typedef void (VKAPI_PTR *PFN_vkThreadBarrierTRACETOOLTEST)(uint32_t count, uint32_t* pValues);
14 changes: 4 additions & 10 deletions src/vulkan_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,15 @@ vulkan_setup_t test_init(int argc, char** argv, const std::string& testname, vul
{
reqs.reqfeat12.bufferDeviceAddress = VK_TRUE;
}

if (VK_VERSION_MAJOR(reqs.apiVersion) >= 1 && VK_VERSION_MINOR(reqs.apiVersion) >= 2)
{
deviceInfo.pNext = &reqs.reqfeat2;
}
else
else // Vulkan 1.1 or below
{
deviceInfo.pEnabledFeatures = &reqs.reqfeat2.features;
deviceInfo.pNext = &reqs.reqfeat11;
}

std::vector<const char*> enabledExtensions;
Expand All @@ -424,7 +426,6 @@ vulkan_setup_t test_init(int argc, char** argv, const std::string& testname, vul
std::vector<VkExtensionProperties> supported_device_extensions(propertyCount);
result = vkEnumerateDeviceExtensionProperties(vulkan.physical, nullptr, &propertyCount, supported_device_extensions.data());
assert(result == VK_SUCCESS);
VkPhysicalDeviceFrameBoundaryFeaturesEXT pdfbfinfo = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT, nullptr };

for (const VkExtensionProperties& s : supported_device_extensions)
{
Expand Down Expand Up @@ -453,14 +454,7 @@ vulkan_setup_t test_init(int argc, char** argv, const std::string& testname, vul
enabledExtensions.push_back(str.c_str());
device_required.erase(str);

// Official frame boundary extension required and supported
if (strcmp(s.extensionName, VK_EXT_FRAME_BOUNDARY_EXTENSION_NAME) == 0)
{
pdfbfinfo.pNext = (void*)deviceInfo.pNext;
pdfbfinfo.frameBoundary = VK_TRUE;
deviceInfo.pNext = (VkPhysicalDeviceFrameBoundaryFeaturesEXT*)&pdfbfinfo;
}
else if (strcmp(s.extensionName, VK_KHR_MAINTENANCE_6_EXTENSION_NAME) == 0)
if (strcmp(s.extensionName, VK_KHR_MAINTENANCE_6_EXTENSION_NAME) == 0)
{
req_maintenance_6 = true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/vulkan_compute_bda_sc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static void bda_sc_create_pipeline(vulkan_setup_t& vulkan, compute_resources& r,
shaderStageCreateInfo.pName = "main";
shaderStageCreateInfo.pSpecializationInfo = &specInfo;

VkDeviceSize markup_location = 5;
VkDeviceSize markup_location = 5 * sizeof(int32_t); // address in bytes
VkAddressRemapTRACETOOLTEST mm = { VK_STRUCTURE_TYPE_ADDRESS_REMAP_TRACETOOLTEST, shaderStageCreateInfo.pNext };
mm.target = VK_ADDRESS_REMAP_TARGET_SPECIALIZATION_CONSTANTS_TRACETOOLTEST;
mm.count = 1;
Expand Down