Moved VulkanDevice to vks namespce (Refs #260)
This commit is contained in:
parent
27e8c258dc
commit
70f4daff5d
18 changed files with 38 additions and 38 deletions
|
|
@ -17,7 +17,7 @@
|
|||
#include "vulkantools.h"
|
||||
#include "vulkanbuffer.hpp"
|
||||
|
||||
namespace vk
|
||||
namespace vks
|
||||
{
|
||||
struct VulkanDevice
|
||||
{
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
#include <glm/gtc/matrix_transform.hpp>
|
||||
#include <glm/gtc/type_ptr.hpp>
|
||||
|
||||
#include "vulkandevice.hpp"
|
||||
#include "VulkanDevice.hpp"
|
||||
#include "vulkanbuffer.hpp"
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
|
|
@ -154,7 +154,7 @@ namespace vks
|
|||
* @param copyQueue Queue used for the memory staging copy commands (must support transfer)
|
||||
* @param (Optional) flags ASSIMP model loading flags
|
||||
*/
|
||||
bool loadFromFile(const std::string& filename, vks::VertexLayout layout, vks::ModelCreateInfo *createInfo, vk::VulkanDevice *device, VkQueue copyQueue, const int flags = defaultFlags)
|
||||
bool loadFromFile(const std::string& filename, vks::VertexLayout layout, vks::ModelCreateInfo *createInfo, vks::VulkanDevice *device, VkQueue copyQueue, const int flags = defaultFlags)
|
||||
{
|
||||
this->device = device->logicalDevice;
|
||||
|
||||
|
|
@ -380,7 +380,7 @@ namespace vks
|
|||
* @param copyQueue Queue used for the memory staging copy commands (must support transfer)
|
||||
* @param (Optional) flags ASSIMP model loading flags
|
||||
*/
|
||||
bool loadFromFile(const std::string& filename, vks::VertexLayout layout, float scale, vk::VulkanDevice *device, VkQueue copyQueue, const int flags = defaultFlags)
|
||||
bool loadFromFile(const std::string& filename, vks::VertexLayout layout, float scale, vks::VulkanDevice *device, VkQueue copyQueue, const int flags = defaultFlags)
|
||||
{
|
||||
vks::ModelCreateInfo modelCreateInfo(scale, 1.0f, 0.0f);
|
||||
return loadFromFile(filename, layout, &modelCreateInfo, device, copyQueue, flags);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
#include <gli/gli.hpp>
|
||||
|
||||
#include "vulkantools.h"
|
||||
#include "vulkandevice.hpp"
|
||||
#include "VulkanDevice.hpp"
|
||||
#include "vulkanbuffer.hpp"
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
|
|
@ -30,7 +30,7 @@ namespace vks
|
|||
/** @brief Vulkan texture base class */
|
||||
class Texture {
|
||||
public:
|
||||
vk::VulkanDevice *device;
|
||||
vks::VulkanDevice *device;
|
||||
VkImage image;
|
||||
VkImageLayout imageLayout;
|
||||
VkDeviceMemory deviceMemory;
|
||||
|
|
@ -82,7 +82,7 @@ namespace vks
|
|||
void loadFromFile(
|
||||
std::string filename,
|
||||
VkFormat format,
|
||||
vk::VulkanDevice *device,
|
||||
vks::VulkanDevice *device,
|
||||
VkQueue copyQueue,
|
||||
VkImageUsageFlags imageUsageFlags = VK_IMAGE_USAGE_SAMPLED_BIT,
|
||||
VkImageLayout imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
|
||||
|
|
@ -385,7 +385,7 @@ namespace vks
|
|||
VkFormat format,
|
||||
uint32_t width,
|
||||
uint32_t height,
|
||||
vk::VulkanDevice *device,
|
||||
vks::VulkanDevice *device,
|
||||
VkQueue copyQueue,
|
||||
VkFilter filter = VK_FILTER_LINEAR,
|
||||
VkImageUsageFlags imageUsageFlags = VK_IMAGE_USAGE_SAMPLED_BIT,
|
||||
|
|
@ -561,7 +561,7 @@ namespace vks
|
|||
void loadFromFile(
|
||||
std::string filename,
|
||||
VkFormat format,
|
||||
vk::VulkanDevice *device,
|
||||
vks::VulkanDevice *device,
|
||||
VkQueue copyQueue,
|
||||
VkImageUsageFlags imageUsageFlags = VK_IMAGE_USAGE_SAMPLED_BIT,
|
||||
VkImageLayout imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL)
|
||||
|
|
@ -770,7 +770,7 @@ namespace vks
|
|||
void loadFromFile(
|
||||
std::string filename,
|
||||
VkFormat format,
|
||||
vk::VulkanDevice *device,
|
||||
vks::VulkanDevice *device,
|
||||
VkQueue copyQueue,
|
||||
VkImageUsageFlags imageUsageFlags = VK_IMAGE_USAGE_SAMPLED_BIT,
|
||||
VkImageLayout imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL)
|
||||
|
|
|
|||
|
|
@ -812,7 +812,7 @@ void VulkanExampleBase::initVulkan()
|
|||
// Vulkan device creation
|
||||
// This is handled by a separate class that gets a logical device representation
|
||||
// and encapsulates functions related to a device
|
||||
vulkanDevice = new vk::VulkanDevice(physicalDevice);
|
||||
vulkanDevice = new vks::VulkanDevice(physicalDevice);
|
||||
VkResult res = vulkanDevice->createLogicalDevice(enabledFeatures, enabledExtensions);
|
||||
if (res != VK_SUCCESS) {
|
||||
vkTools::exitFatal("Could not create Vulkan device: \n" + vkTools::errorString(res), "Fatal error");
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
#include "vulkandebug.h"
|
||||
|
||||
#include "VulkanInitializers.hpp"
|
||||
#include "vulkandevice.hpp"
|
||||
#include "VulkanDevice.hpp"
|
||||
#include "vulkanswapchain.hpp"
|
||||
#include "vulkantextoverlay.hpp"
|
||||
#include "camera.hpp"
|
||||
|
|
@ -90,7 +90,7 @@ protected:
|
|||
// todo: getter? should always point to VulkanDevice->device
|
||||
VkDevice device;
|
||||
/** @brief Encapsulated physical and logical vulkan device */
|
||||
vk::VulkanDevice *vulkanDevice;
|
||||
vks::VulkanDevice *vulkanDevice;
|
||||
// Handle to the device graphics queue that command buffers are submitted to
|
||||
VkQueue queue;
|
||||
// Depth buffer format (selected during Vulkan initialization)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#include <iterator>
|
||||
#include <vector>
|
||||
#include "vulkan/vulkan.h"
|
||||
#include "vulkandevice.hpp"
|
||||
#include "VulkanDevice.hpp"
|
||||
#include "vulkantools.h"
|
||||
|
||||
namespace vk
|
||||
|
|
@ -89,7 +89,7 @@ namespace vk
|
|||
struct Framebuffer
|
||||
{
|
||||
private:
|
||||
vk::VulkanDevice *vulkanDevice;
|
||||
vks::VulkanDevice *vulkanDevice;
|
||||
public:
|
||||
uint32_t width, height;
|
||||
VkFramebuffer framebuffer;
|
||||
|
|
@ -102,7 +102,7 @@ namespace vk
|
|||
*
|
||||
* @param vulkanDevice Pointer to a valid VulkanDevice
|
||||
*/
|
||||
Framebuffer(vk::VulkanDevice *vulkanDevice)
|
||||
Framebuffer(vks::VulkanDevice *vulkanDevice)
|
||||
{
|
||||
assert(vulkanDevice);
|
||||
this->vulkanDevice = vulkanDevice;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include <gli/gli.hpp>
|
||||
|
||||
#include "vulkan/vulkan.h"
|
||||
#include "vulkandevice.hpp"
|
||||
#include "VulkanDevice.hpp"
|
||||
#include "vulkanbuffer.hpp"
|
||||
|
||||
namespace vkTools
|
||||
|
|
@ -23,7 +23,7 @@ namespace vkTools
|
|||
uint32_t dim;
|
||||
uint32_t scale;
|
||||
|
||||
vk::VulkanDevice *device = nullptr;
|
||||
vks::VulkanDevice *device = nullptr;
|
||||
VkQueue copyQueue = VK_NULL_HANDLE;
|
||||
public:
|
||||
enum Topology { topologyTriangles, topologyQuads };
|
||||
|
|
@ -44,7 +44,7 @@ namespace vkTools
|
|||
size_t indexBufferSize = 0;
|
||||
uint32_t indexCount = 0;
|
||||
|
||||
HeightMap(vk::VulkanDevice *device, VkQueue copyQueue)
|
||||
HeightMap(vks::VulkanDevice *device, VkQueue copyQueue)
|
||||
{
|
||||
this->device = device;
|
||||
this->copyQueue = copyQueue;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
#include "vulkantools.h"
|
||||
#include "vulkandebug.h"
|
||||
#include "vulkanbuffer.hpp"
|
||||
#include "vulkandevice.hpp"
|
||||
#include "VulkanDevice.hpp"
|
||||
|
||||
#include "../external/stb/stb_font_consolas_24_latin1.inl"
|
||||
|
||||
|
|
@ -42,7 +42,7 @@
|
|||
class VulkanTextOverlay
|
||||
{
|
||||
private:
|
||||
vk::VulkanDevice *vulkanDevice;
|
||||
vks::VulkanDevice *vulkanDevice;
|
||||
|
||||
VkQueue queue;
|
||||
VkFormat colorFormat;
|
||||
|
|
@ -89,7 +89,7 @@ public:
|
|||
* @param vulkanDevice Pointer to a valid VulkanDevice
|
||||
*/
|
||||
VulkanTextOverlay(
|
||||
vk::VulkanDevice *vulkanDevice,
|
||||
vks::VulkanDevice *vulkanDevice,
|
||||
VkQueue queue,
|
||||
std::vector<VkFramebuffer> &framebuffers,
|
||||
VkFormat colorformat,
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ struct Scene {
|
|||
}
|
||||
}
|
||||
|
||||
void loadFromFile(std::string filename, vk::VulkanDevice* vulkanDevice, VkQueue queue)
|
||||
void loadFromFile(std::string filename, vks::VulkanDevice* vulkanDevice, VkQueue queue)
|
||||
{
|
||||
model.loadFromFile(filename, vertexLayout, 1.0f, vulkanDevice, queue);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
#include <vulkan/vulkan.h>
|
||||
#include "vulkanexamplebase.h"
|
||||
#include "vulkandevice.hpp"
|
||||
#include "VulkanDevice.hpp"
|
||||
#include "vulkanbuffer.hpp"
|
||||
|
||||
#define VERTEX_BUFFER_BIND_ID 0
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
#include "vulkan/vulkan.h"
|
||||
|
||||
#include "vulkantools.h"
|
||||
#include "vulkandevice.hpp"
|
||||
#include "VulkanDevice.hpp"
|
||||
#include "vulkanbuffer.hpp"
|
||||
|
||||
struct Vertex
|
||||
|
|
@ -70,7 +70,7 @@ private:
|
|||
glm::vec3 lightPos;
|
||||
};
|
||||
|
||||
vk::VulkanDevice *vulkanDevice;
|
||||
vks::VulkanDevice *vulkanDevice;
|
||||
|
||||
glm::vec3 color;
|
||||
glm::vec3 pos;
|
||||
|
|
@ -96,7 +96,7 @@ public:
|
|||
|
||||
void setupDescriptorSet(VkDescriptorPool pool, VkDescriptorSetLayout descriptorSetLayout);
|
||||
|
||||
VulkanGear(vk::VulkanDevice *vulkanDevice) : vulkanDevice(vulkanDevice) {};
|
||||
VulkanGear(vks::VulkanDevice *vulkanDevice) : vulkanDevice(vulkanDevice) {};
|
||||
~VulkanGear();
|
||||
|
||||
void generate(GearInfo *gearinfo, VkQueue queue);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
#include <vulkan/vulkan.h>
|
||||
#include "vulkanexamplebase.h"
|
||||
#include "VulkanTexture.hpp"
|
||||
#include "vulkandevice.hpp"
|
||||
#include "VulkanDevice.hpp"
|
||||
#include "vulkanbuffer.hpp"
|
||||
|
||||
#define VERTEX_BUFFER_BIND_ID 0
|
||||
|
|
@ -96,7 +96,7 @@ struct ScenePart
|
|||
class Scene
|
||||
{
|
||||
private:
|
||||
vk::VulkanDevice *vulkanDevice;
|
||||
vks::VulkanDevice *vulkanDevice;
|
||||
VkQueue queue;
|
||||
|
||||
VkDescriptorPool descriptorPool;
|
||||
|
|
@ -425,7 +425,7 @@ public:
|
|||
uint32_t scenePartIndex = 0;
|
||||
|
||||
// Default constructor
|
||||
Scene(vk::VulkanDevice *vulkanDevice, VkQueue queue)
|
||||
Scene(vks::VulkanDevice *vulkanDevice, VkQueue queue)
|
||||
{
|
||||
this->vulkanDevice = vulkanDevice;
|
||||
this->queue = queue;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
#include <vulkan/vulkan.h>
|
||||
|
||||
#include "vulkanexamplebase.h"
|
||||
#include "vulkandevice.hpp"
|
||||
#include "VulkanDevice.hpp"
|
||||
#include "vulkanbuffer.hpp"
|
||||
#include "VulkanModel.hpp"
|
||||
#include "VulkanTexture.hpp"
|
||||
|
|
@ -48,7 +48,7 @@
|
|||
class TextOverlay
|
||||
{
|
||||
private:
|
||||
vk::VulkanDevice *vulkanDevice;
|
||||
vks::VulkanDevice *vulkanDevice;
|
||||
|
||||
VkQueue queue;
|
||||
VkFormat colorFormat;
|
||||
|
|
@ -87,7 +87,7 @@ public:
|
|||
bool visible = true;
|
||||
|
||||
TextOverlay(
|
||||
vk::VulkanDevice *vulkanDevice,
|
||||
vks::VulkanDevice *vulkanDevice,
|
||||
VkQueue queue,
|
||||
std::vector<VkFramebuffer> &framebuffers,
|
||||
VkFormat colorformat,
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include <vulkan/vulkan.h>
|
||||
#include "vulkanexamplebase.h"
|
||||
#include "vulkandevice.hpp"
|
||||
#include "VulkanDevice.hpp"
|
||||
#include "vulkanbuffer.hpp"
|
||||
|
||||
#define VERTEX_BUFFER_BIND_ID 0
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include <vulkan/vulkan.h>
|
||||
#include "vulkanexamplebase.h"
|
||||
#include "vulkandevice.hpp"
|
||||
#include "VulkanDevice.hpp"
|
||||
#include "vulkanbuffer.hpp"
|
||||
#include "VulkanModel.hpp"
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include <vulkan/vulkan.h>
|
||||
#include "vulkanexamplebase.h"
|
||||
#include "vulkandevice.hpp"
|
||||
#include "VulkanDevice.hpp"
|
||||
#include "vulkanbuffer.hpp"
|
||||
#include "VulkanModel.hpp"
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ todos:
|
|||
#include <vulkan/vulkan.h>
|
||||
#include "vulkanexamplebase.h"
|
||||
#include "VulkanTexture.hpp"
|
||||
#include "vulkandevice.hpp"
|
||||
#include "VulkanDevice.hpp"
|
||||
#include "vulkanbuffer.hpp"
|
||||
#include "vulkanheightmap.hpp"
|
||||
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Base", "Base", "{09B9A54B-F
|
|||
base\vulkanbuffer.hpp = base\vulkanbuffer.hpp
|
||||
base\vulkandebug.cpp = base\vulkandebug.cpp
|
||||
base\vulkandebug.h = base\vulkandebug.h
|
||||
base\vulkandevice.hpp = base\vulkandevice.hpp
|
||||
base\VulkanDevice.hpp = base\VulkanDevice.hpp
|
||||
base\vulkanexamplebase.cpp = base\vulkanexamplebase.cpp
|
||||
base\vulkanexamplebase.h = base\vulkanexamplebase.h
|
||||
base\vulkanframebuffer.hpp = base\vulkanframebuffer.hpp
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue