vkr: further break up vkr_device.h

Break it up into vkr_{device,instance,physical_device}.h.  Suggested by
Ryan Neph.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
macos/master
Chia-I Wu 3 years ago
parent dce3ea0701
commit 9489ba1174
  1. 2
      src/meson.build
  2. 1
      src/venus/vkr_buffer.c
  3. 2
      src/venus/vkr_context.c
  4. 2
      src/venus/vkr_device.c
  5. 46
      src/venus/vkr_device.h
  6. 1
      src/venus/vkr_device_memory.c
  7. 1
      src/venus/vkr_image.c
  8. 33
      src/venus/vkr_instance.h
  9. 33
      src/venus/vkr_physical_device.h
  10. 1
      src/venus/vkr_queue.c

@ -95,6 +95,8 @@ venus_sources = [
'venus/vkr_device_memory.h',
'venus/vkr_image.c',
'venus/vkr_image.h',
'venus/vkr_instance.h',
'venus/vkr_physical_device.h',
'venus/vkr_pipeline.c',
'venus/vkr_pipeline.h',
'venus/vkr_query_pool.c',

@ -10,6 +10,7 @@
#include "vkr_context.h"
#include "vkr_device.h"
#include "vkr_physical_device.h"
static void
vkr_dispatch_vkCreateBuffer(struct vn_dispatch_context *dispatch,

@ -18,6 +18,8 @@
#include "vkr_device.h"
#include "vkr_device_memory.h"
#include "vkr_image.h"
#include "vkr_instance.h"
#include "vkr_physical_device.h"
#include "vkr_pipeline.h"
#include "vkr_query_pool.h"
#include "vkr_queue.h"

@ -13,6 +13,8 @@
#include "vkr_context.h"
#include "vkr_descriptor_set.h"
#include "vkr_device_memory.h"
#include "vkr_instance.h"
#include "vkr_physical_device.h"
#include "vkr_queue.h"
static void

@ -8,43 +8,6 @@
#include "vkr_common.h"
struct vkr_physical_device;
struct vkr_instance {
struct vkr_object base;
uint32_t api_version;
PFN_vkCreateDebugUtilsMessengerEXT create_debug_utils_messenger;
PFN_vkDestroyDebugUtilsMessengerEXT destroy_debug_utils_messenger;
PFN_vkGetMemoryFdKHR get_memory_fd;
PFN_vkGetFenceFdKHR get_fence_fd;
VkDebugUtilsMessengerEXT validation_messenger;
uint32_t physical_device_count;
VkPhysicalDevice *physical_device_handles;
struct vkr_physical_device **physical_devices;
};
struct vkr_physical_device {
struct vkr_object base;
VkPhysicalDeviceProperties properties;
uint32_t api_version;
VkExtensionProperties *extensions;
uint32_t extension_count;
bool KHR_external_memory_fd;
bool EXT_external_memory_dma_buf;
bool KHR_external_fence_fd;
VkPhysicalDeviceMemoryProperties memory_properties;
struct list_head devices;
};
struct vkr_device {
struct vkr_object base;
@ -84,16 +47,7 @@ struct vkr_device {
struct list_head objects;
};
void
vkr_context_init_instance_dispatch(struct vkr_context *ctx);
void
vkr_context_init_physical_device_dispatch(struct vkr_context *ctx);
void
vkr_context_init_device_dispatch(struct vkr_context *ctx);
void
vkr_instance_destroy(struct vkr_context *ctx, struct vkr_instance *instance);
#endif /* VKR_DEVICE_H */

@ -10,6 +10,7 @@
#include "vkr_context.h"
#include "vkr_device.h"
#include "vkr_physical_device.h"
static bool
vkr_get_fd_handle_type_from_virgl_fd_type(

@ -12,6 +12,7 @@
#include "vkr_context.h"
#include "vkr_device.h"
#include "vkr_physical_device.h"
static void
vkr_dispatch_vkCreateImage(struct vn_dispatch_context *dispatch,

@ -0,0 +1,33 @@
/*
* Copyright 2020 Google LLC
* SPDX-License-Identifier: MIT
*/
#ifndef VKR_INSTANCE_H
#define VKR_INSTANCE_H
#include "vkr_common.h"
struct vkr_instance {
struct vkr_object base;
uint32_t api_version;
PFN_vkCreateDebugUtilsMessengerEXT create_debug_utils_messenger;
PFN_vkDestroyDebugUtilsMessengerEXT destroy_debug_utils_messenger;
PFN_vkGetMemoryFdKHR get_memory_fd;
PFN_vkGetFenceFdKHR get_fence_fd;
VkDebugUtilsMessengerEXT validation_messenger;
uint32_t physical_device_count;
VkPhysicalDevice *physical_device_handles;
struct vkr_physical_device **physical_devices;
};
void
vkr_context_init_instance_dispatch(struct vkr_context *ctx);
void
vkr_instance_destroy(struct vkr_context *ctx, struct vkr_instance *instance);
#endif /* VKR_INSTANCE_H */

@ -0,0 +1,33 @@
/*
* Copyright 2020 Google LLC
* SPDX-License-Identifier: MIT
*/
#ifndef VKR_PHYSICAL_DEVICE_H
#define VKR_PHYSICAL_DEVICE_H
#include "vkr_common.h"
struct vkr_physical_device {
struct vkr_object base;
VkPhysicalDeviceProperties properties;
uint32_t api_version;
VkExtensionProperties *extensions;
uint32_t extension_count;
bool KHR_external_memory_fd;
bool EXT_external_memory_dma_buf;
bool KHR_external_fence_fd;
VkPhysicalDeviceMemoryProperties memory_properties;
struct list_head devices;
};
void
vkr_context_init_physical_device_dispatch(struct vkr_context *ctx);
#endif /* VKR_PHYSICAL_DEVICE_H */

@ -13,6 +13,7 @@
#include "vkr_context.h"
#include "vkr_device.h"
#include "vkr_physical_device.h"
struct vkr_queue_sync *
vkr_device_alloc_queue_sync(struct vkr_device *dev,

Loading…
Cancel
Save