Kohi Game Engine
vulkan_image.h
Go to the documentation of this file.
1 
12 #pragma once
13 
14 #include "vulkan_types.h"
15 
34  vulkan_context* context,
35  texture_type type,
36  u32 width,
37  u32 height,
38  VkFormat format,
39  VkImageTiling tiling,
40  VkImageUsageFlags usage,
41  VkMemoryPropertyFlags memory_flags,
42  b32 create_view,
43  VkImageAspectFlags view_aspect_flags,
44  const char* name,
45  u32 mip_levels,
46  vulkan_image* out_image);
47 
58  vulkan_context* context,
59  texture_type type,
60  VkFormat format,
61  vulkan_image* image,
62  VkImageAspectFlags aspect_flags);
63 
76  vulkan_context* context,
77  texture_type type,
78  vulkan_command_buffer* command_buffer,
79  vulkan_image* image,
80  VkFormat format,
81  VkImageLayout old_layout,
82  VkImageLayout new_layout);
83 
94  vulkan_context* context,
95  vulkan_image* image,
96  vulkan_command_buffer* command_buffer);
97 
108  vulkan_context* context,
109  texture_type type,
110  vulkan_image* image,
111  VkBuffer buffer,
112  u64 offset,
113  vulkan_command_buffer* command_buffer);
114 
125  vulkan_context* context,
126  texture_type type,
127  vulkan_image* image,
128  VkBuffer buffer,
129  vulkan_command_buffer* command_buffer);
130 
143  vulkan_context* context,
144  texture_type type,
145  vulkan_image* image,
146  VkBuffer buffer,
147  u32 x,
148  u32 y,
149  vulkan_command_buffer* command_buffer);
150 
unsigned int u32
Unsigned 32-bit integer.
Definition: defines.h:25
_Bool b8
8-bit boolean type
Definition: defines.h:58
int b32
32-bit boolean type, used for APIs which require it
Definition: defines.h:55
unsigned long long u64
Unsigned 64-bit integer.
Definition: defines.h:28
texture_type
Represents various types of textures.
Definition: resource_types.h:155
Represents a Vulkan-specific command buffer, which holds a list of commands and is submitted to a que...
Definition: vulkan_types.h:261
The overall Vulkan context for the backend. Holds and maintains global renderer backend state,...
Definition: vulkan_types.h:564
A representation of a Vulkan image. This can be thought of as a texture. Also contains the view and m...
Definition: vulkan_types.h:149
void vulkan_image_create(vulkan_context *context, texture_type type, u32 width, u32 height, VkFormat format, VkImageTiling tiling, VkImageUsageFlags usage, VkMemoryPropertyFlags memory_flags, b32 create_view, VkImageAspectFlags view_aspect_flags, const char *name, u32 mip_levels, vulkan_image *out_image)
Creates a new Vulkan image.
void vulkan_image_transition_layout(vulkan_context *context, texture_type type, vulkan_command_buffer *command_buffer, vulkan_image *image, VkFormat format, VkImageLayout old_layout, VkImageLayout new_layout)
Transitions the provided image from old_layout to new_layout.
void vulkan_image_view_create(vulkan_context *context, texture_type type, VkFormat format, vulkan_image *image, VkImageAspectFlags aspect_flags)
Creates a view for the given image.
void vulkan_image_copy_pixel_to_buffer(vulkan_context *context, texture_type type, vulkan_image *image, VkBuffer buffer, u32 x, u32 y, vulkan_command_buffer *command_buffer)
Copies a single pixel's data from the given image to the provided buffer.
void vulkan_image_destroy(vulkan_context *context, vulkan_image *image)
Destroys the given image.
void vulkan_image_copy_to_buffer(vulkan_context *context, texture_type type, vulkan_image *image, VkBuffer buffer, vulkan_command_buffer *command_buffer)
Copies data in the provided image to the given buffer.
b8 vulkan_image_mipmaps_generate(vulkan_context *context, vulkan_image *image, vulkan_command_buffer *command_buffer)
Generates mipmaps for the given image based on mip_levels set in the image. mip_levels must be > 1 fo...
void vulkan_image_copy_from_buffer(vulkan_context *context, texture_type type, vulkan_image *image, VkBuffer buffer, u64 offset, vulkan_command_buffer *command_buffer)
Copies data in buffer to provided image.
This file contains a collection fo Vulkan-specific types used for the Vulkan backend.