Permalink
Browse files

Update the Vulkan loader to the latest version

  • Loading branch information...
1 parent f530ef7 commit 8d476fc845f9535e4f2d3ef15089a4bdab364ac8 @DrChat DrChat committed Nov 23, 2016
@@ -227,46 +227,19 @@ void VulkanDevice::ReleaseQueue(VkQueue queue) {
void VulkanDevice::DbgSetObjectName(VkDevice device, uint64_t object,
VkDebugReportObjectTypeEXT object_type,
std::string name) {
- PFN_vkDebugMarkerSetObjectNameEXT pfn_vkDebugMarkerSetObjectNameEXT = nullptr;
- if (!pfn_vkDebugMarkerSetObjectNameEXT) {
- pfn_vkDebugMarkerSetObjectNameEXT =
- (PFN_vkDebugMarkerSetObjectNameEXT)vkGetDeviceProcAddr(
- device, "vkDebugMarkerSetObjectNameEXT");
-
- if (!pfn_vkDebugMarkerSetObjectNameEXT) {
- return;
- }
- }
-
VkDebugMarkerObjectNameInfoEXT info;
info.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT;
info.pNext = nullptr;
info.objectType = object_type;
info.object = object;
info.pObjectName = name.c_str();
- pfn_vkDebugMarkerSetObjectNameEXT(device, &info);
+ vkDebugMarkerSetObjectNameEXT(device, &info);
}
void VulkanDevice::DbgSetObjectName(uint64_t object,
VkDebugReportObjectTypeEXT object_type,
std::string name) {
- if (!pfn_vkDebugMarkerSetObjectNameEXT_) {
- pfn_vkDebugMarkerSetObjectNameEXT_ =
- (PFN_vkDebugMarkerSetObjectNameEXT)vkGetDeviceProcAddr(
- handle, "vkDebugMarkerSetObjectNameEXT");
-
- if (!pfn_vkDebugMarkerSetObjectNameEXT_) {
- return;
- }
- }
-
- VkDebugMarkerObjectNameInfoEXT info;
- info.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT;
- info.pNext = nullptr;
- info.objectType = object_type;
- info.object = object;
- info.pObjectName = name.c_str();
- pfn_vkDebugMarkerSetObjectNameEXT_(handle, &info);
+ DbgSetObjectName(*this, object, object_type, name);
}
bool VulkanDevice::is_renderdoc_attached() const {
@@ -101,8 +101,6 @@ class VulkanDevice {
std::vector<Requirement> required_layers_;
std::vector<Requirement> required_extensions_;
- PFN_vkDebugMarkerSetObjectNameEXT pfn_vkDebugMarkerSetObjectNameEXT_;
-
DeviceInfo device_info_;
uint32_t queue_family_index_ = 0;
std::mutex queue_mutex_;
@@ -88,6 +88,10 @@ void cJSON_Delete(cJSON *c) {
}
}
+void cJSON_Free(void *p) {
+ cJSON_free(p);
+}
+
/* Parse the input text to generate a number, and populate the result into item.
*/
static const char *parse_number(cJSON *item, const char *num) {
@@ -84,6 +84,8 @@ extern char *cJSON_PrintUnformatted(cJSON *item);
extern char *cJSON_PrintBuffered(cJSON *item, int prebuffer, int fmt);
/* Delete a cJSON entity and all subentities. */
extern void cJSON_Delete(cJSON *c);
+/* Delete an item allocated inside the JSON parser*/
+extern void cJSON_Free(void *p);
/* Returns the number of items in an array (or object). */
extern int cJSON_GetArraySize(cJSON *array);
Oops, something went wrong.

0 comments on commit 8d476fc

Please sign in to comment.