Moved VulkanBuffer to vks namespce (Refs #260)
This commit is contained in:
parent
f917ea6640
commit
776b6f0106
54 changed files with 165 additions and 165 deletions
|
|
@ -15,7 +15,7 @@
|
|||
#include "vulkan/vulkan.h"
|
||||
#include "vulkantools.h"
|
||||
|
||||
namespace vk
|
||||
namespace vks
|
||||
{
|
||||
/**
|
||||
* @brief Encapsulates access to a Vulkan buffer backed up by device memory
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
#include <algorithm>
|
||||
#include "vulkan/vulkan.h"
|
||||
#include "vulkantools.h"
|
||||
#include "vulkanbuffer.hpp"
|
||||
#include "VulkanBuffer.hpp"
|
||||
|
||||
namespace vks
|
||||
{
|
||||
|
|
@ -388,7 +388,7 @@ namespace vks
|
|||
*
|
||||
* @return VK_SUCCESS if buffer handle and memory have been created and (optionally passed) data has been copied
|
||||
*/
|
||||
VkResult createBuffer(VkBufferUsageFlags usageFlags, VkMemoryPropertyFlags memoryPropertyFlags, vk::Buffer *buffer, VkDeviceSize size, void *data = nullptr)
|
||||
VkResult createBuffer(VkBufferUsageFlags usageFlags, VkMemoryPropertyFlags memoryPropertyFlags, vks::Buffer *buffer, VkDeviceSize size, void *data = nullptr)
|
||||
{
|
||||
buffer->device = logicalDevice;
|
||||
|
||||
|
|
@ -435,7 +435,7 @@ namespace vks
|
|||
*
|
||||
* @note Source and destionation pointers must have the approriate transfer usage flags set (TRANSFER_SRC / TRANSFER_DST)
|
||||
*/
|
||||
void copyBuffer(vk::Buffer *src, vk::Buffer *dst, VkQueue queue, VkBufferCopy *copyRegion = nullptr)
|
||||
void copyBuffer(vks::Buffer *src, vks::Buffer *dst, VkQueue queue, VkBufferCopy *copyRegion = nullptr)
|
||||
{
|
||||
assert(dst->size <= src->size);
|
||||
assert(src->buffer && src->buffer);
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
#include <glm/gtc/type_ptr.hpp>
|
||||
|
||||
#include "VulkanDevice.hpp"
|
||||
#include "vulkanbuffer.hpp"
|
||||
#include "VulkanBuffer.hpp"
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
#include <android/asset_manager.h>
|
||||
|
|
@ -108,8 +108,8 @@ namespace vks
|
|||
|
||||
struct Model {
|
||||
VkDevice device = nullptr;
|
||||
vk::Buffer vertices;
|
||||
vk::Buffer indices;
|
||||
vks::Buffer vertices;
|
||||
vks::Buffer indices;
|
||||
uint32_t indexCount = 0;
|
||||
uint32_t vertexCount = 0;
|
||||
|
||||
|
|
@ -306,7 +306,7 @@ namespace vks
|
|||
|
||||
// Use staging buffer to move vertex and index buffer to device local memory
|
||||
// Create staging buffers
|
||||
vk::Buffer vertexStaging, indexStaging;
|
||||
vks::Buffer vertexStaging, indexStaging;
|
||||
|
||||
// Vertex buffer
|
||||
VK_CHECK_RESULT(device->createBuffer(
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
#include "vulkantools.h"
|
||||
#include "VulkanDevice.hpp"
|
||||
#include "vulkanbuffer.hpp"
|
||||
#include "VulkanBuffer.hpp"
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
#include <android/asset_manager.h>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#include "vulkan/vulkan.h"
|
||||
#include "VulkanDevice.hpp"
|
||||
#include "vulkanbuffer.hpp"
|
||||
#include "VulkanBuffer.hpp"
|
||||
|
||||
namespace vkTools
|
||||
{
|
||||
|
|
@ -31,8 +31,8 @@ namespace vkTools
|
|||
float heightScale = 1.0f;
|
||||
float uvScale = 1.0f;
|
||||
|
||||
vk::Buffer vertexBuffer;
|
||||
vk::Buffer indexBuffer;
|
||||
vks::Buffer vertexBuffer;
|
||||
vks::Buffer indexBuffer;
|
||||
|
||||
struct Vertex {
|
||||
glm::vec3 pos;
|
||||
|
|
@ -192,7 +192,7 @@ namespace vkTools
|
|||
|
||||
// Generate Vulkan buffers
|
||||
|
||||
vk::Buffer vertexStaging, indexStaging;
|
||||
vks::Buffer vertexStaging, indexStaging;
|
||||
|
||||
// Create staging buffers
|
||||
device->createBuffer(
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
#include <vulkan/vulkan.h>
|
||||
#include "vulkantools.h"
|
||||
#include "vulkandebug.h"
|
||||
#include "vulkanbuffer.hpp"
|
||||
#include "VulkanBuffer.hpp"
|
||||
#include "VulkanDevice.hpp"
|
||||
|
||||
#include "../external/stb/stb_font_consolas_24_latin1.inl"
|
||||
|
|
@ -54,7 +54,7 @@ private:
|
|||
VkSampler sampler;
|
||||
VkImage image;
|
||||
VkImageView view;
|
||||
vk::Buffer vertexBuffer;
|
||||
vks::Buffer vertexBuffer;
|
||||
VkDeviceMemory imageMemory;
|
||||
VkDescriptorPool descriptorPool;
|
||||
VkDescriptorSetLayout descriptorSetLayout;
|
||||
|
|
@ -203,7 +203,7 @@ public:
|
|||
VK_CHECK_RESULT(vkBindImageMemory(vulkanDevice->logicalDevice, image, imageMemory, 0));
|
||||
|
||||
// Staging
|
||||
vk::Buffer stagingBuffer;
|
||||
vks::Buffer stagingBuffer;
|
||||
|
||||
VK_CHECK_RESULT(vulkanDevice->createBuffer(
|
||||
VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue