PVRUtils Functions#
pvr::createEglContext#
Defined in EglPlatformContext.h
Function Documentation#
-
std::unique_ptr<platform::EglContext_> pvr::createEglContext()#
Creates an instance of an EGL platform context.
- Returns:
A unique pointer to a pvr::platform::EglContext_ instance.
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
-
inline ::pvrvk::BlendFactor pvr::utils::convertToPVRVk(::pvr::BlendFactor item)#
pvr::utils::getTextureData#
Defined in HelperGles.h
Function Documentation#
-
inline pvr::Texture pvr::utils::getTextureData(const IAssetProvider &app, const char *file)#
pvr::utils::readJsonUUID#
Defined in HelperVk.h
Function Documentation#
-
void pvr::utils::readJsonUUID(std::string fileName, uint8_t *UUID)#
Callback function used when the instance extension VK_EXT_debug_utils is supported (in debug builds only).
- Parameters:
fileName – .json file name to read the UUID data from.
UUID – UUID data read from file.
pvr::utils::createOnScreenRenderPass#
Defined in HelperVk.h
Function Documentation#
-
pvrvk::RenderPass pvr::utils::createOnScreenRenderPass(const pvrvk::Swapchain &swapchain, bool hasDepthStencil, const pvrvk::Format depthStencilFormat = pvrvk::Format::e_UNDEFINED, pvrvk::ImageLayout initialSwapchainLayout = pvrvk::ImageLayout::e_UNDEFINED, pvrvk::ImageLayout initialDepthStencilLayout = pvrvk::ImageLayout::e_UNDEFINED, pvrvk::AttachmentLoadOp colorLoadOp = pvrvk::AttachmentLoadOp::e_CLEAR, pvrvk::AttachmentStoreOp colorStoreOp = pvrvk::AttachmentStoreOp::e_STORE, pvrvk::AttachmentLoadOp depthStencilLoadOp = pvrvk::AttachmentLoadOp::e_CLEAR, pvrvk::AttachmentStoreOp depthStencilStoreOp = pvrvk::AttachmentStoreOp::e_DONT_CARE, pvrvk::SampleCountFlags samples = pvrvk::SampleCountFlags::e_1_BIT)#
Create a renderpass for On-Screen (or other swapchain-based) rendering, based on the information contained in the swapchain. No other objects, (such as framebuffers and attachments) are created.
- Parameters:
swapchain – A swapchain object. The data of the swapchain object will be used to ensure the renderpass created is compatible with this swapchain object
hasDepthStencil – CHANGED API v5.5. Pass “true” if the renderpass will be used for a framebuffer with depth or stencil. To port from the 5.3 code, please pass “true” if the old depthStencilImages parameter would not have been null.
depthStencilFormat – CHANGED API v5.5. If “hasDepthStencil” is true, pass the depth stencil format here. To port from the 5.4 code, retrieve the format from the first member of the old depthStencilImages array
initialSwapchainLayout – This is the layout with which the swapchain images will be in, in the beginning the renderpass.
initialDepthStencilLayout – This is the layout with which the depth/stencil images, if present, will be in, in the beginning the renderpass.
colorLoadOp – This is the LOAD op for the swapchain images, the operation performed on them when beginning the renderpass. Strongly prefer e_CLEAR if possible as it improves performance considerably compared to e_LOAD. For a multisampled renderpass, this is actually the load op for the Color Attachment, as the Color Resolve attachment is automatically e_DONT_CARE since it is always completely overwritten.
colorStoreOp – This is the STORE op for the swapchain images, the operation performed on the swapchain images at the end of the renderpass. This normally has to be e_STORE in order to render the images on screen. For a multisampled renderpass, this is actually the load op for the Color Resolve Attachment, as the Color attachment is automatically e_DONT_CARE since it cannot be used elsewhere since it is multisampled.
depthStencilLoadOp – This is the LOAD op for the depth/stencil images, the operation performed on the depth/stencil images images when beginning the renderpass. Normally has to be (and should be preferred for performance) e_CLEAR For a multisampled renderpass, this is actually the load op for the Depth Attachment, as the Depth Resolve attachment is automatically e_DONT_CARE since it is always completely overwritten.
colorStoreOp – This is the STORE op for the depth/stencil images, the operation performed on the depth/stencil images at the end of the renderpass. Strongly prefer e_DONT_CARE as the depth buffer almost never needs to be preserved between frames, and this can have a strong performance impact as it could even elide memory allocation for it. For a multisampled renderpass, this is actually the store op for the Depth Resolve Attachment, as the Depth attachment is automatically e_DONT_CARE since it cannot be used elsewhere since it is multisampled.
samples – The number of samples (if greater then e_1_BIT, the renderpass will be multisampled, so correct color and depth resolve items will be assumed.
pvr::utils::RetrieveColours#
Defined in HelperGles.h
Function Documentation#
pvr::utils::setImageLayout#
Defined in HelperVk.h
Function Documentation#
-
inline void pvr::utils::setImageLayout(pvrvk::Image &image, pvrvk::ImageLayout oldLayout, pvrvk::ImageLayout newLayout, pvrvk::CommandBufferBase transitionCmdBuffer)#
Set image layout.
- Parameters:
image – The image to transition
oldLayout – An old image layout to transition from
newLayout – A new image layout to transition to
transitionCmdBuffer – A command buffer to add the pipelineBarrier for the image transition.
pvr::utils::createMultipleBuffersFromMesh#
Defined in HelperVk.h
Function Documentation#
-
inline void pvr::utils::createMultipleBuffersFromMesh(pvrvk::Device &device, const assets::Mesh &mesh, std::vector<pvrvk::Buffer> &outVbos, pvrvk::Buffer &outIbo, pvrvk::CommandBuffer &uploadCmdBuffer, bool &requiresCommandBufferSubmission, vma::Allocator bufferAllocator, vma::AllocationCreateFlags vmaAllocationCreateFlags = vma::AllocationCreateFlags::e_MAPPED_BIT)#
Auto generates a set of VBOs and a single IBO from all the vertex data of a mesh.
This utility function will read all vertex data from the mesh and create one pvrvk::Buffer for each data element (block of interleaved data) in the mesh. It is thus commonly used for for meshes containing multiple sets of interleaved data (for example, a VBO with static and a VBO with streaming data).
- Parameters:
device – The device where the buffers will be generated on
mesh – The mesh whose data will populate the buffers
outVbos – Reference to a std::vector of VBO handles where the data will be put. Buffers will be appended at the end.
outIbo – The IBO handle where the data will be put. No buffer needs to have been created on the handle. If no face data is present on the mesh, the handle will be null.
uploadCmdBuffer – A command buffer into which commands may be recorded for uploading mesh data to the created buffers. This command buffer will only be used when memory without e_HOST_VISIBLE_BIT memory property flags was allocated for the vbos or ibos.
requiresCommandBufferSubmission – Indicates whether commands have been recorded into the given command buffer.
bufferAllocator – A VMA allocator used to allocate memory for the created buffer.
vmaAllocationCreateFlags – VMA Allocation creation flags. These flags can be used to control how and where the memory is allocated from. Valid flags include e_DEDICATED_MEMORY_BIT and e_MAPPED_BIT. e_DEDICATED_MEMORY_BIT indicates that the allocation should have its own memory block. e_MAPPED_BIT indicates memory will be persistently mapped respectively. The default vma::AllocationCreateFlags::e_MAPPED_BIT is valid even if HOST_VISIBLE is not used - these flags will be ignored in this case.
pvr::utils::createInputAssemblyFromMesh#
Defined in HelperGles.h
Function Documentation#
-
inline VertexConfiguration pvr::utils::createInputAssemblyFromMesh(const assets::Mesh &mesh, const VertexBindings_Name *bindingMap, uint16_t numBindings, uint16_t *outNumBuffers = NULL)#
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
pvr::utils::captureImageRegion#
Defined in HelperVk.h
Function Documentation#
-
std::vector<unsigned char> pvr::utils::captureImageRegion(pvrvk::Queue &queue, pvrvk::CommandPool &commandPool, pvrvk::Image &image, pvrvk::Offset3D srcOffset = pvrvk::Offset3D(0, 0, 0), pvrvk::Extent3D srcExtent = pvrvk::Extent3D(static_cast<uint32_t>(-1), static_cast<uint32_t>(-1), static_cast<uint32_t>(-1)), pvrvk::Format destinationImageFormat = pvrvk::Format::e_UNDEFINED, pvrvk::ImageLayout imageInitialLayout = pvrvk::ImageLayout::e_TRANSFER_SRC_OPTIMAL, pvrvk::ImageLayout imageFinalLayout = pvrvk::ImageLayout::e_TRANSFER_DST_OPTIMAL, vma::Allocator bufferAllocator = nullptr, vma::Allocator imageAllocator = nullptr)#
Retrieves and returns the contents of a particular image region. Note that the image must have been created with the pvrvk::ImageUsageFlags::e_TRANSFER_SRC_BIT set.
SCREENSHOTS ////////////////////////
- Parameters:
queue – A queue to submit the generated command buffer to. This queue must be compatible with the command pool provided.
commandPool – A command pool from which to allocate a temporary command buffer to carry out the transfer operations.
image – The image from which the specified region will be retrieved.
srcOffset – The offset into the specified image from which to begin the region to capture.
srcExtent – The extent of the region to capture.
destinationImageFormat – The format to use for the saved image. Valid format conversions will be applied using vkCmdBlitImage.
imageInitialLayout – The initial layout of the image from which a transition will be made to pvrvk::ImageLayout::e_TRANSFER_SRC_OPTIMAL.
imageFinalLayout – The final layout of the image to which a transition will be made.
bufferAllocator – A VMA allocator used to allocate memory for the created the buffer used as the target of an imageToBufferCopy.
imageAllocator – A VMA allocator used to allocate memory for the created image.
- Returns:
A vector containing the retrieved image data
pvr::utils::takeScreenshot#
Defined in HelperVk.h
Function Documentation#
-
bool pvr::utils::takeScreenshot(pvrvk::Queue &queue, pvrvk::CommandPool &commandPool, pvrvk::Swapchain &swapchain, const uint32_t swapIndex, const std::string &screenshotFileName, vma::Allocator bufferAllocator = nullptr, vma::Allocator imageAllocator = nullptr, const uint32_t screenshotScale = 1)#
Saves a particular swapchain image corresponding to the swapchain image at index swapIndex for the swapchain.
- Parameters:
queue – A queue to submit the generated command buffer to. This queue must be compatible with the command pool provided.
commandPool – A command pool from which to allocate a temporary command buffer to carry out the transfer operations.
swapchain – The swapchain from which a particular image will be saved.
swapIndex – The swapchain image at index swapIndex will be saved as a TGA file.
screenshotFileName – The filename to use for the saved TGA image.
bufferAllocator – A VMA allocator used to allocate memory for the created the buffer used as the target of an imageToBufferCopy.
imageAllocator – A VMA allocator used to allocate memory for the created image.
screenshotScale – A scaling factor to use for increasing the size of the saved screenshot.
- Returns:
True if the screenshot could be taken successfully
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
-
inline ::pvrvk::ImageAspectFlags pvr::utils::convertToPVRVk(::pvr::ImageAspectFlags item)#
pvr::utils::appendSingleBuffersFromModel#
Defined in HelperVk.h
Function Documentation#
-
template<typename VboContainer_, typename IboContainer_>
inline void pvr::utils::appendSingleBuffersFromModel(pvrvk::Device &device, const assets::Model &model, VboContainer_ &vbos, IboContainer_ &ibos, pvrvk::CommandBuffer &uploadCmdBuffer, bool &requiresCommandBufferSubmission, vma::Allocator bufferAllocator = nullptr, vma::AllocationCreateFlags vmaAllocationCreateFlags = vma::AllocationCreateFlags::e_MAPPED_BIT)# Auto generates a set of VBOs and a set of IBOs from the vertex data of the meshes of a model and appends them at the end of containers provided by the user.
This utility function will read all vertex data from the VBO. It is usually preferred for meshes meshes containing a single set of interleaved data. If multiple data elements (i.e. sets of interleaved data), each block will be successively placed after the other.
- Parameters:
device – The device device where the buffers will be generated on
model – The model whose meshes will be used to generate the Buffers
vbos – A container of pvrvk::Buffer handles. The VBOs will be inserted at the end of this container.
ibos – A container of pvrvk::Buffer handles. The IBOs will be inserted at the end of this container.
uploadCmdBuffer – A command buffer into which commands may be recorded for uploading mesh data to the created buffers. This command buffer will only be used when memory without e_HOST_VISIBLE_BIT memory property flags was allocated for the vbos or ibos.
requiresCommandBufferSubmission – Indicates whether commands have been recorded into the given command buffer.
bufferAllocator – A VMA allocator used to allocate memory for the created buffer.
vmaAllocationCreateFlags – VMA Allocation creation flags. These flags can be used to control how and where the memory is allocated from. Valid flags include e_DEDICATED_MEMORY_BIT and e_MAPPED_BIT. e_DEDICATED_MEMORY_BIT indicates that the allocation should have its own memory block. e_MAPPED_BIT indicates memory will be persistently mapped respectively. The default vma::AllocationCreateFlags::e_MAPPED_BIT is valid even if HOST_VISIBLE is not used - these flags will be ignored in this case.
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
pvr::utils::convertToPVRVkVertexInputFormat#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
-
inline pvrvk::Format pvr::utils::convertToPVRVkVertexInputFormat(DataType dataType, uint8_t width)#
Convert to pvrvk format.
- Parameters:
dataType – Type of the data(Float32, Int32 etc)
width – The Width of the data type
- Returns:
A pvrvk::Format (pvrvk::Format::e_R32_SFLOAT, pvrvk::Format::e_R32G32_SFLOAT etc)
pvr::utils::generateCookTorranceBRDFLUT#
Defined in PBRUtils.h
Function Documentation#
pvr::utils::endCommandBufferDebugLabel#
Defined in HelperVk.h
Function Documentation#
-
inline void pvr::utils::endCommandBufferDebugLabel(pvrvk::CommandBufferBase commandBufferBase)#
Ends a label region of work submitted to this base command buffer.
- Parameters:
commandBufferBase – The command buffer base to which the debug label region should be ended
pvr::utils::loadAndUploadImage#
Defined in HelperVk.h
Function Documentation#
-
pvrvk::Image pvr::utils::loadAndUploadImage(pvrvk::Device &device, const char *fileName, bool allowDecompress, pvrvk::SecondaryCommandBuffer &commandBuffer, IAssetProvider &assetProvider, pvrvk::ImageUsageFlags usageFlags = pvrvk::ImageUsageFlags::e_SAMPLED_BIT, pvrvk::ImageLayout finalLayout = pvrvk::ImageLayout::e_SHADER_READ_ONLY_OPTIMAL, Texture *outAssetTexture = nullptr, vma::Allocator stagingBufferAllocator = nullptr, vma::Allocator imageAllocator = nullptr, vma::AllocationCreateFlags imageAllocationCreateFlags = vma::AllocationCreateFlags::e_NONE)#
Load and upload image to gpu. The upload command and staging buffers are recorded in the commandbuffer.
- Parameters:
device – The device to use to create the image and image view.
fileName – The filename of a source texture from which to take the texture data.
allowDecompress – Specifies whether the texture can be decompressed as part of the image upload.
commandBuffer – A secondary command buffer to which the upload operations should be added. Note that the upload will not be guranteed to be complete until the command buffer is submitted to a queue with appropriate synchronisation.
assetProvider – Specifies an asset provider to use for loading the texture from system memory.
usageFlags – Specifies the usage flags for the image being created.
finalLayout – The final image layout the image will be transitioned to.
outAssetTexture – A pointer to a created pvr::texture.
stagingBufferAllocator – A VMA allocator used to allocate memory for the created staging buffer.
imageAllocator – A VMA allocator used to allocate memory for the created image.
imageAllocationCreateFlags – VMA Allocation creation flags. These flags can be used to control how and where the memory is allocated from. Valid flags include e_DEDICATED_MEMORY_BIT and e_MAPPED_BIT. e_DEDICATED_MEMORY_BIT indicates that the allocation should have its own memory block. e_MAPPED_BIT indicates memory will be persistently mapped respectively.
- Returns:
The Image Object uploaded.
pvr::utils::convertToGles#
Defined in ConvertToGlesTypes.h
Function Documentation#
pvr::utils::createSwapchain#
Defined in HelperVk.h
Function Documentation#
-
pvrvk::Swapchain pvr::utils::createSwapchain(const pvrvk::Device &device, const pvrvk::Surface &surface, pvr::DisplayAttributes &displayAttributes, pvrvk::ImageUsageFlags swapchainImageUsageFlags = pvrvk::ImageUsageFlags::e_COLOR_ATTACHMENT_BIT, const std::vector<pvrvk::Format> &preferredColorFormats = std::vector<pvrvk::Format>())#
Create a pvrvk::Swapchain using a pre-initialised pvrvk::Device and pvrvk::Surface.
- Parameters:
device – A logical device to use for creating the pvrvk::Swapchain.
surface – A pvrvk::Surface from which surface capabilities, supported formats and presentation modes will be derived.
displayAttributes – A set of display attributes from which certain properties will be taken such as width, height, vsync mode and preferences for the number of pixels per channel.
swapchainImageUsageFlags – Specifies for what the swapchain images can be used for.
- Returns:
Return the created pvrvk::Swapchain
pvr::utils::getDepthStencilBits#
Defined in HelperVk.h
Function Documentation#
-
void pvr::utils::getDepthStencilBits(pvrvk::Format format, uint32_t &depthBits, uint32_t &stencilBits)#
Determines the number of depth and stencil bits per pixel for the given pvrvk::Format.
- Parameters:
format – A format to calculate the number of bits for
depthBits – The number of depth bits per pixel
stencilBits – The number of stencil bits per pixel
pvr::utils::insertSorted#
Defined in HelperGles.h
Function Documentation#
pvr::utils::populateViewportStateCreateInfo#
Defined in HelperVk.h
Function Documentation#
-
inline void pvr::utils::populateViewportStateCreateInfo(const pvrvk::Framebuffer &framebuffer, pvrvk::PipelineViewportStateCreateInfo &outCreateInfo)#
Fills out a pvrvk::ViewportStateCreateInfo structure setting parameters for a ‘default’ viewport and scissor based on the specified frame buffer dimensions.
- Parameters:
framebuffer – An input Framebuffer object from which to take dimensions used to initialise a pvrvk::ViewportStateCreateInfo structure.
outCreateInfo – A pvrvk::ViewportStateCreateInfo structure which will have its viewport and scissor members set based on the framebuffers dimensions.
pvr::utils::convertToGles#
Defined in ConvertToGlesTypes.h
Function Documentation#
-
GLenum pvr::utils::convertToGles(BlendFactor blendFactor)#
Convert to opengl blend factor output.
- Parameters:
blendFactor – A BlendFactor enum
- Returns:
A GLenum representing a BlendFactor (GL_ZERO, GL_SRC_COLOR, GL_ONE_MINUS_SRC_ALPHA etc)
pvr::utils::loadAndUploadImageAndView#
Defined in HelperVk.h
Function Documentation#
-
pvrvk::ImageView pvr::utils::loadAndUploadImageAndView(pvrvk::Device &device, const char *fileName, bool allowDecompress, pvrvk::SecondaryCommandBuffer &commandBuffer, IAssetProvider &assetProvider, pvrvk::ImageUsageFlags usageFlags = pvrvk::ImageUsageFlags::e_SAMPLED_BIT, pvrvk::ImageLayout finalLayout = pvrvk::ImageLayout::e_SHADER_READ_ONLY_OPTIMAL, Texture *outAssetTexture = nullptr, vma::Allocator stagingBufferAllocator = nullptr, vma::Allocator imageAllocator = nullptr, vma::AllocationCreateFlags imageAllocationCreateFlags = vma::AllocationCreateFlags::e_NONE, const void *pNext = nullptr)#
Load and upload image to gpu. The upload command and staging buffers are recorded in the commandbuffer.
- Parameters:
device – The device to use to create the image and image view.
fileName – The filename of a source texture from which to take the texture data.
allowDecompress – Specifies whether the texture can be decompressed as part of the image upload.
commandBuffer – A secondary command buffer to which the upload operations should be added. Note that the upload will not be guranteed to be complete until the command buffer is submitted to a queue with appropriate synchronisation.
assetProvider – Specifies an asset provider to use for loading the texture from system memory.
usageFlags – Specifies the usage flags for the image being created.
finalLayout – The final image layout the image will be transitioned to.
outAssetTexture – A pointer to a created pvr::texture.
stagingBufferAllocator – A VMA allocator used to allocate memory for the created staging buffer.
imageAllocator – A VMA allocator used to allocate memory for the created image.
imageAllocationCreateFlags – VMA Allocation creation flags. These flags can be used to control how and where the memory is allocated from. Valid flags include e_DEDICATED_MEMORY_BIT and e_MAPPED_BIT. e_DEDICATED_MEMORY_BIT indicates that the allocation should have its own memory block. e_MAPPED_BIT indicates memory will be persistently mapped respectively.
- Returns:
The Image Object uploaded.
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
pvr::utils::createShaderModule#
Defined in ShaderUtilsVk.h
Function Documentation#
-
pvrvk::ShaderModule pvr::utils::createShaderModule(pvrvk::Device &device, const Stream &shaderSource, pvrvk::ShaderStageFlags shaderStageFlags, pvrvk::ShaderModuleCreateFlags flags = pvrvk::ShaderModuleCreateFlags::e_NONE, const char *const *defines = nullptr, uint32_t numDefines = 0)#
Load a ShaderModule from shader source using glslang.
- Parameters:
device – A device from which to create the ShaderModule
shaderSource – A stream containing the shader source text data
shaderStageFlags – The type (stage) of the shader (vertex, fragment…)
flags – A set of pvrvk::ShaderModuleCreateFlags controlling how the ShaderModule will be created
defines – A number of preprocessor definitions that will be passed to the shader
numDefines – The number of defines
- Returns:
The created ShaderModule object
pvr::utils::insertSorted#
Defined in HelperGles.h
Function Documentation#
-
template<typename container, typename val>
size_t pvr::utils::insertSorted(container &cont, typename container::iterator begin, typename container::iterator end, const val &item)# Insert sorted element in to the container.
- Parameters:
cont – Container to insert the element into.
begin – Container range begin
end – Container range end
item – Item to insert in to the container
pvr::utils::getOpenGLFormat#
Defined in ConvertToGlesTypes.h
Function Documentation#
-
inline void pvr::utils::getOpenGLFormat(ImageStorageFormat storageFormat, uint32_t &glInternalFormat, uint32_t &glFormat, uint32_t &glType, uint32_t &glTypeSize, bool &isCompressedFormat)#
Retrieves the OpenGL ES texture formats for a texture with the provided ImageStorageFormat.
- Parameters:
storageFormat – The pvr::ImageStorageFormat to retrieve a corresponding set of OpenGL ES texture formats for.
glInternalFormat – The internal OpenGL ES format corresponding to the provided pvr::ImageStorageFormat storageFormat
glFormat – The OpenGL ES format corresponding to the provided pvr::ImageStorageFormat storageFormat
glType – The OpenGL ES type corresponding to the provided pvr::ImageStorageFormat storageFormat
glTypeSize – The OpenGL ES type size corresponding to the provided pvr::ImageStorageFormat storageFormat
isCompressedFormat – Specifies whether the OpenGL ES format retrieved is a compressed format.
pvr::utils::insertDebugUtilsLabel#
Defined in HelperVk.h
Function Documentation#
-
inline void pvr::utils::insertDebugUtilsLabel(pvrvk::SecondaryCommandBuffer &secondaryCommandBuffer, const pvrvk::DebugUtilsLabel &labelInfo)#
Inserts a single debug label any time.
- Parameters:
secondaryCommandBuffer – The secondary command buffer to which the debug label should be inserted
labelInfo – Specifies the parameters of the label region to insert
pvr::utils::convertToGles#
Defined in ConvertToGlesTypes.h
Function Documentation#
-
GLenum pvr::utils::convertToGles(PolygonWindingOrder windingOrder)#
Convert to opengl winding-order.
- Parameters:
windingOrder – A PolygonWindingOrder enum
- Returns:
A GLenum representing a winding order (GL_CW, GL_CCW)
pvr::utils::endCommandBufferDebugLabel#
Defined in HelperVk.h
Function Documentation#
-
inline void pvr::utils::endCommandBufferDebugLabel(pvrvk::CommandBuffer &commandBuffer)#
Ends a label region of work submitted to this command buffer.
- Parameters:
commandBuffer – The command buffer to which the debug label region should be ended
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
-
inline pvrvk::Format pvr::utils::convertToPVRVk(const ImageDataFormat &format)#
Convert to pvrvk pixel format.
- Parameters:
format – Image Data format
- Returns:
A pvrvk::Format representing the pixel format
pvr::utils::createSingleBuffersFromMesh#
Defined in HelperGles.h
Function Documentation#
-
inline void pvr::utils::createSingleBuffersFromMesh(const assets::Mesh &mesh, GLuint &outVbo, GLuint &outIbo)#
Auto generates a single VBO and a single IBO from all the vertex data of a mesh. RESETS GL STATE: GL_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER.
This utility function will read all vertex data from a mesh’s data elements and create a single VBO. It is commonly used for a single set of interleaved data. If data are not interleaved, they will be packed on the same VBO, each interleaved block (Data element on the mesh) will be appended at the end of the buffer, and the offsets will need to be calculated by the user when binding the buffer.
- Parameters:
context – The device context where the buffers will be generated on
mesh – The mesh whose data will populate the buffers
outVbo – The VBO handle where the data will be put. No buffer needs to have been created on the handle. IS ASSUMED TO NOT BE A VALID OPENGL OBJECT.
outIbo – The IBO handle where the data will be put. No buffer needs to have been created on the handle. If no face data is present on the mesh, the handle will be set to zero. IS ASSUMED TO NOT BE A VALID OPENGL OBJECT.
pvr::utils::createSwapchainAndDepthStencilImageAndViews#
Defined in HelperVk.h
Function Documentation#
-
void pvr::utils::createSwapchainAndDepthStencilImageAndViews(const pvrvk::Device &device, const pvrvk::Surface &surface, pvr::DisplayAttributes &displayAttributes, pvrvk::Swapchain &outSwapchain, Multi<pvrvk::ImageView> &outDepthStencilImages, const pvrvk::ImageUsageFlags &swapchainImageUsageFlags = pvrvk::ImageUsageFlags::e_COLOR_ATTACHMENT_BIT, const pvrvk::ImageUsageFlags &dsImageUsageFlags = pvrvk::ImageUsageFlags::e_DEPTH_STENCIL_ATTACHMENT_BIT | pvrvk::ImageUsageFlags::e_TRANSIENT_ATTACHMENT_BIT, const vma::Allocator &imageAllocator = nullptr, vma::AllocationCreateFlags dsImageAllocationCreateFlags = vma::AllocationCreateFlags::e_DEDICATED_MEMORY_BIT)#
DEPRECATED. Either use createSwapchainRenderpassFramebuffers, or createSwapchain and createAttachments.
- Parameters:
device – DEPRECATED
surface – DEPRECATED
displayAttributes – DEPRECATED
outSwapchain – DEPRECATED
outDepthStencilImages –
swapchainImageUsageFlags – DEPRECATED
dsImageUsageFlags – DEPRECATED
dsImageAllocator – DEPRECATED
dsImageAllocationCreateFlags – DEPRECATED
pvr::utils::RetrievePositions#
Defined in HelperGles.h
Function Documentation#
pvr::utils::createSurface#
Defined in HelperVk.h
Function Documentation#
-
pvrvk::Surface pvr::utils::createSurface(const pvrvk::Instance &instance, const pvrvk::PhysicalDevice &physicalDevice, void *window, void *display, void *connection)#
Creates an abstract vulkan native platform surface.
- Parameters:
instance – The instance from which to create the native platform surface.
physicalDevice – A physical device from which to create the native platform surface.
window – A pointer to a NativeWindow used to create the windowing surface.
display – A pointer to a NativeDisplay used to create the windowing surface.
connection – A pointer to a NativeConnection used to create the windowing surface.
- Returns:
A pointer to an abstract vulkan native platform surface.
pvr::utils::loadAndUploadImage#
Defined in HelperVk.h
Function Documentation#
-
pvrvk::Image pvr::utils::loadAndUploadImage(pvrvk::Device &device, const char *fileName, bool allowDecompress, pvrvk::CommandBuffer &commandBuffer, IAssetProvider &assetProvider, pvrvk::ImageUsageFlags usageFlags = pvrvk::ImageUsageFlags::e_SAMPLED_BIT, pvrvk::ImageLayout finalLayout = pvrvk::ImageLayout::e_SHADER_READ_ONLY_OPTIMAL, Texture *outAssetTexture = nullptr, vma::Allocator stagingBufferAllocator = nullptr, vma::Allocator imageAllocator = nullptr, vma::AllocationCreateFlags imageAllocationCreateFlags = vma::AllocationCreateFlags::e_NONE)#
Load and upload image to gpu. The upload command and staging buffers are recorded in the commandbuffer.
- Parameters:
device – The device to use to create the image and image view.
fileName – The filename of a source texture from which to take the texture data.
allowDecompress – Specifies whether the texture can be decompressed as part of the image upload.
commandBuffer – A command buffer to which the upload operations should be added. Note that the upload will not be guranteed to be complete until the command buffer is submitted to a queue with appropriate synchronisation.
assetProvider – Specifies an asset provider to use for loading the texture from system memory.
usageFlags – Specifies the usage flags for the image being created.
finalLayout – The final image layout the image will be transitioned to.
outAssetTexture – A pointer to a created pvr::texture.
stagingBufferAllocator – A VMA allocator used to allocate memory for the created staging buffer.
imageAllocator – A VMA allocator used to allocate memory for the created image.
imageAllocationCreateFlags – VMA Allocation creation flags. These flags can be used to control how and where the memory is allocated from. Valid flags include e_DEDICATED_MEMORY_BIT and e_MAPPED_BIT. e_DEDICATED_MEMORY_BIT indicates that the allocation should have its own memory block. e_MAPPED_BIT indicates memory will be persistently mapped respectively.
- Returns:
The Image Object uploaded.
pvr::utils::loadAndUploadImageAndView#
Defined in HelperVk.h
Function Documentation#
-
pvrvk::ImageView pvr::utils::loadAndUploadImageAndView(pvrvk::Device &device, const char *fileName, bool allowDecompress, pvrvk::CommandBuffer &commandBuffer, IAssetProvider &assetProvider, pvrvk::ImageUsageFlags usageFlags = pvrvk::ImageUsageFlags::e_SAMPLED_BIT, pvrvk::ImageLayout finalLayout = pvrvk::ImageLayout::e_SHADER_READ_ONLY_OPTIMAL, Texture *outAssetTexture = nullptr, vma::Allocator stagingBufferAllocator = nullptr, vma::Allocator imageAllocator = nullptr, vma::AllocationCreateFlags imageAllocationCreateFlags = vma::AllocationCreateFlags::e_NONE, const void *pNext = nullptr, bool isSafetyCritical = false)#
Load and upload image to gpu. The upload command and staging buffers are recorded in the commandbuffer.
- Parameters:
device – The device to use to create the image and image view.
fileName – The filename of a source texture from which to take the texture data.
allowDecompress – Specifies whether the texture can be decompressed as part of the image upload.
commandBuffer – A command buffer to which the upload operations should be added. Note that the upload will not be guranteed to be complete until the command buffer is submitted to a queue with appropriate synchronisation.
assetProvider – Specifies an asset provider to use for loading the texture from system memory.
usageFlags – Specifies the usage flags for the image being created.
finalLayout – The final image layout the image will be transitioned to.
outAssetTexture – A pointer to a created pvr::texture.
stagingBufferAllocator – A VMA allocator used to allocate memory for the created staging buffer.
imageAllocator – A VMA allocator used to allocate memory for the created image.
imageAllocationCreateFlags – VMA Allocation creation flags. These flags can be used to control how and where the memory is allocated from. Valid flags include e_DEDICATED_MEMORY_BIT and e_MAPPED_BIT. e_DEDICATED_MEMORY_BIT indicates that the allocation should have its own memory block. e_MAPPED_BIT indicates memory will be persistently mapped respectively.
isSafetyCritical – Whether this method is being called from an application running as standard Vulkan or as Vulkan Safety Critical.
- Returns:
The Image Object uploaded.
pvr::utils::convertToGles#
Defined in ConvertToGlesTypes.h
Function Documentation#
-
GLenum pvr::utils::convertToGles(SamplerAddressMode addressMode)#
Convert to opengl sampler wrap.
- Parameters:
addressMode – A SamplerAddressMode enum
- Returns:
A GLenum representing a Sampler Wrap mode (GL_CLAMP_TO_EDGE, GL_REPEAT etc)
pvr::utils::createSingleBuffersFromMeshes#
Defined in HelperGles.h
Function Documentation#
-
template<typename MeshIterator_, typename VboInsertIterator_, typename IboInsertIterator_>
inline void pvr::utils::createSingleBuffersFromMeshes(MeshIterator_ meshIter, MeshIterator_ meshIterEnd, VboInsertIterator_ outVbos, IboInsertIterator_ outIbos)# Auto generates a set of VBOs and a set of IBOs from the vertex data of multiple meshes and uses std::inserter provided by the user to insert them to any container.
This utility function will read all vertex data from a mesh’s data elements and create a single VBO. It is commonly used for a single set of interleaved data (mesh.getNumDataElements() == 1). If more data elements are present (i.e. more than a single interleaved data element) , they will be packed in the sameVBO, with each interleaved block (Data element ) appended at the end of the buffer. It is then the user’s responsibility to use the buffer correctly with the API (for example use bindbufferbase and similar) with the correct offsets. The std::inserter this function requires can be created from any container with an insert() function with (for example, for insertion at the end of a vector) std::inserter(std::vector,
std::vector::end()) .
- Parameters:
context – The device context where the buffers will be generated on
meshIter – Iterator for a collection of meshes.
meshIterEnd – End Iterator for meshIter.
outVbos – std::inserter for a collection of api::Buffer handles. It will be used to insert one VBO per mesh.
outIbos – std::inserter for a collection of api::Buffer handles. It will be used to insert one IBO per mesh. If face data is not present on the mesh, a null handle will be inserted.
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
pvr::utils::beginCommandBufferDebugLabel#
Defined in HelperVk.h
Function Documentation#
-
inline void pvr::utils::beginCommandBufferDebugLabel(pvrvk::CommandBufferBase commandBufferBase, const pvrvk::DebugUtilsLabel &labelInfo)#
Begins identifying a region of work submitted to this command buffer. The calls to beginDebugUtilsLabel and endDebugUtilsLabel must be matched and balanced.
- Parameters:
commandBufferBase – The command buffer base to which the debug label region should be opened
labelInfo – Specifies the parameters of the label region to open
pvr::utils::appendSingleBuffersFromModel#
Defined in HelperGles.h
Function Documentation#
-
template<typename VboContainer_, typename IboContainer_>
inline void pvr::utils::appendSingleBuffersFromModel(const assets::Model &model, VboContainer_ &vbos, IboContainer_ &ibos)# Auto generates a set of VBOs and a set of IBOs from the vertex data of the meshes of a model and appends them at the end of containers provided by the user.
This utility function will read all vertex data from the VBO. It is usually preferred for meshes meshes containing a single set of interleaved data. If multiple data elements (i.e. sets of interleaved data), each block will be successively placed after the other.
- Parameters:
context – The device context where the buffers will be generated on
model – The model whose meshes will be used to generate the Buffers
vbos – A container of api::Buffer handles. The VBOs will be inserted at the end of this container.
ibos – A container of api::Buffer handles. The IBOs will be inserted at the end of this container.
pvr::utils::beginCommandBufferDebugLabel#
Defined in HelperVk.h
Function Documentation#
-
inline void pvr::utils::beginCommandBufferDebugLabel(pvrvk::SecondaryCommandBuffer &secondaryCommandBuffer, const pvrvk::DebugUtilsLabel &labelInfo)#
Begins identifying a region of work submitted to this secondary command buffer. The calls to beginDebugUtilsLabel and endDebugUtilsLabel must be matched and balanced.
- Parameters:
secondaryCommandBuffer – The secondary command buffer to which the debug label region should be opened
labelInfo – Specifies the parameters of the label region to open
pvr::utils::operator&#
Defined in ModelGles.h
Function Documentation#
pvr::utils::convertToGles#
Defined in ConvertToGlesTypes.h
Function Documentation#
-
GLenum pvr::utils::convertToGles(PrimitiveTopology primitiveType)#
Convert to opengl priitive type.
- Parameters:
primitiveType – a PrimitiveTopology enum
- Returns:
A GLenum representing a primitive type (GL_TRIANGLES, GL_TRIANGLE_STRIP, GL_POINTS etc)
pvr::utils::deleteTexturesAndZero#
Defined in HelperGles.h
Function Documentation#
pvr::utils::createBuffer#
Defined in HelperVk.h
Function Documentation#
-
pvrvk::Buffer pvr::utils::createBuffer(const pvrvk::Device &device, const pvrvk::BufferCreateInfo &createInfo, pvrvk::MemoryPropertyFlags requiredMemoryFlags, pvrvk::MemoryPropertyFlags optimalMemoryFlags = pvrvk::MemoryPropertyFlags::e_NONE, const vma::Allocator &bufferAllocator = nullptr, vma::AllocationCreateFlags vmaAllocationCreateFlags = vma::AllocationCreateFlags::e_MAPPED_BIT, pvrvk::MemoryAllocateFlags memoryAllocateFlags = pvrvk::MemoryAllocateFlags::e_NONE)#
Create a new buffer object and (optionally) allocate and bind memory for it.
.
- Parameters:
device – The device on which to create the buffer
createInfo – A pvrvk::BufferCreateInfo structure controlling how the buffer will be created.
requiredMemoryFlags – The minimal set of memory property flags which are required for the PVRVk buffer to be created. If pvrvk::MemoryPropertyFlags::e_NONE is passed, no memory will be allocated for this buffer.
optimalMemoryFlags – The most optimal set of memory property flags which could be used by the memory backing the returned PVRVk buffer. If pvrvk::MemoryPropertyFlags::e_NONE is passed optimalMemoryFlags will be set to match requiredMemoryFlags.
bufferAllocator – A VMA allocator used to allocate memory for the created buffer.
vmaAllocationCreateFlags – VMA Allocation creation flags. These flags can be used to control how and where the memory is allocated from. Valid flags include e_DEDICATED_MEMORY_BIT and e_MAPPED_BIT. e_DEDICATED_MEMORY_BIT indicates that the allocation should have its own memory block. e_MAPPED_BIT indicates memory will be persistently mapped respectively. The default vma::AllocationCreateFlags::e_MAPPED_BIT is valid even if HOST_VISIBLE is not used - these flags will be ignored in this case.
memoryAllocateFlags – A bitmask of pvrvk::MemoryAllocateFlagBits controlling the allocation.
- Returns:
Return a valid object if success
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
-
inline ::pvrvk::SamplerAddressMode pvr::utils::convertToPVRVk(::pvr::SamplerAddressMode item)#
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
pvr::utils::createShaderModule#
Defined in ShaderUtilsVk.h
Function Documentation#
-
pvrvk::ShaderModule pvr::utils::createShaderModule(pvrvk::Device &device, std::string &shaderSource, pvrvk::ShaderStageFlags shaderStageFlags, pvrvk::ShaderModuleCreateFlags flags = pvrvk::ShaderModuleCreateFlags::e_NONE, const char *const *defines = nullptr, uint32_t numDefines = 0)#
Load a ShaderModule from shader source using glslang.
- Parameters:
device – A device from which to create the ShaderModule
shaderSource – A string containing the shader source text data
shaderStageFlags – The type (stage) of the shader (vertex, fragment…)
flags – A set of pvrvk::ShaderModuleCreateFlags controlling how the ShaderModule will be created
defines – A number of preprocessor definitions that will be passed to the shader
numDefines – The number of defines
- Returns:
The created ShaderModule object
pvr::utils::getColorBits#
Defined in HelperVk.h
Function Documentation#
-
void pvr::utils::getColorBits(pvrvk::Format format, uint32_t &redBits, uint32_t &greenBits, uint32_t &blueBits, uint32_t &alphaBits)#
Determines the number of color bits per pixel for the given pvrvk::Format.
- Parameters:
format – A format to calculate the number of bits for
redBits – The number of red bits per pixel
greenBits – The number of green bits per pixel
blueBits – The number of blue bits per pixel
alphaBits – The number of alpha channel bits per pixel
pvr::utils::isSupportedFormat#
Defined in HelperVk.h
Function Documentation#
-
bool pvr::utils::isSupportedFormat(const pvrvk::PhysicalDevice &pdev, pvrvk::Format fmt)#
Test whether the given texture format is supported by the physical device given as parameter.
IMAGES LAYOUTS AND QUEUES /////////////////
- Parameters:
pdev – Physical device to test whether a format is supported.
fmt – Format to support.
pvr::utils::isImageUsageSupportedBySurface#
Defined in HelperVk.h
Function Documentation#
-
inline bool pvr::utils::isImageUsageSupportedBySurface(const pvrvk::SurfaceCapabilitiesKHR &surfaceCapabilities, pvrvk::ImageUsageFlags imageUsage)#
Utility function used to determine whether the SurfaceCapabilitiesKHR supportedUsageFlags member contains the specified image usage and therefore can be used in the intended way.
- Parameters:
surfaceCapabilities – A SurfaceCapabilitiesKHR structure returned via a call to PhysicalDevice->getSurfaceCapabilities().
imageUsage – A set of image usage flags which should be checked for support.
- Returns:
“true” if the supportedUsageFlags member of the SurfaceCapabilitiesKHR structure contains the specified imageUsage flag bits.
pvr::utils::convertToPVRVkPixelFormat#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
-
inline pvrvk::Format pvr::utils::convertToPVRVkPixelFormat(PixelFormat format, ColorSpace colorSpace, VariableType dataType, bool &outIsCompressedFormat)#
Convert to pvrvk pixel format.
- Parameters:
format – Pixel format
colorSpace – Color space of the format (lRGB, sRGB)
dataType – TYpe of the data (SignedByte, SignedInteger etc)
outIsCompressedFormat – Return if its a compressed format
- Returns:
A pvrvk::Format representing the pixel format
pvr::utils::endQueueDebugLabel#
Defined in HelperVk.h
Function Documentation#
pvr::utils::checkFboStatus#
Defined in HelperGles.h
Function Documentation#
-
inline bool pvr::utils::checkFboStatus()#
Check the currently bound GL_DRAW_FRAMEBUFFER status. On success, return true. On error, log the actual error log and return false.
- Returns:
True on GL_FRAMEBUFFER_COMPLETE, otherwise false. Additionally logs the error on false
pvr::utils::updateHostVisibleBuffer#
Defined in HelperVk.h
Function Documentation#
-
inline void pvr::utils::updateHostVisibleBuffer(pvrvk::Buffer &buffer, const void *data, VkDeviceSize offset = 0, VkDeviceSize size = VK_WHOLE_SIZE, bool flushMemory = false)#
Utility function to update a buffer’s data. This function maps and unmap the buffer only if the buffer is not already mapped.
- Parameters:
buffer – The buffer to map -> update -> unmap.
data – The data to use in the update
offset – The offset to use for the map -> update -> unmap
size – The size of the data to be updated
flushMemory – Boolean flag determining whether to flush the memory prior to the unmap
pvr::utils::getCurrentGlesVersion#
Defined in HelperGles.h
Function Documentation#
pvr::utils::convertToGles#
Defined in ConvertToGlesTypes.h
Function Documentation#
-
GLenum pvr::utils::convertToGles(ImageAspectFlags type)#
Convert to an opengl image aspect type.
- Parameters:
type – An ImageAspectFlags enum
- Returns:
A GLenum representing the ImageAspectFlags
pvr::utils::getGlErrorString#
Defined in ErrorsGles.h
Function Documentation#
-
const char *pvr::utils::getGlErrorString(GLuint apiError)#
Retrieves a string representation of an OpenGLES error code.
- Parameters:
apiError – The OpenGLES error code to stringify.
- Returns:
The string representation of the given OpenGLES error code.
pvr::utils::getMemoryTypeIndex#
Defined in HelperVk.h
Function Documentation#
-
void pvr::utils::getMemoryTypeIndex(const pvrvk::PhysicalDevice &physicalDevice, const uint32_t allowedMemoryTypeBits, const pvrvk::MemoryPropertyFlags requiredMemoryProperties, const pvrvk::MemoryPropertyFlags optimalMemoryProperties, uint32_t &outMemoryTypeIndex, pvrvk::MemoryPropertyFlags &outMemoryPropertyFlags)#
Utility function for retrieving a memory type index for a suitable memory type which supports the memory type bits specified. If the optimal set of memory properties are supported then return the corresponding memory type index otherwise check for availablility of the required set of memory properties. This allows for implementations to optionally request the use of a more optimal set of memory properties whilst still preserving the ability to retrieve the required set of memory properties as a fallback.
- Parameters:
physicalDevice – The physical device whose set of pvrvk::PhysicalDeviceMemoryProperties will be used to determine support for the requested memory properties.
allowedMemoryTypeBits – The memory type bits allowed. The required memory type chosen must be one of those allowed.
optimalMemoryProperties – A set of optimal memory properties which may be preferred by the application.
requiredMemoryProperties – The set of memory properties which must be present.
outMemoryTypeIndex – The returned memory type index.
outMemoryPropertyFlags – The returned set of memory property flags.
pvr::utils::createDepthStencilImageAndViews#
Defined in HelperVk.h
Function Documentation#
-
inline std::vector<pvrvk::ImageView> pvr::utils::createDepthStencilImageAndViews(const pvrvk::Device &device, int32_t imageCount, pvrvk::Format depthFormat, const pvrvk::Extent2D &imageExtent, const pvrvk::ImageUsageFlags &imageUsageFlags = pvrvk::ImageUsageFlags::e_DEPTH_STENCIL_ATTACHMENT_BIT | pvrvk::ImageUsageFlags::e_TRANSIENT_ATTACHMENT_BIT, pvrvk::SampleCountFlags sampleCount = pvrvk::SampleCountFlags::e_1_BIT, vma::Allocator dsImageAllocator = nullptr, vma::AllocationCreateFlags dsImageAllocationCreateFlags = vma::AllocationCreateFlags::e_DEDICATED_MEMORY_BIT)#
DEPRECATED. Use createAttachmentImages instead.
- Parameters:
device – DEPRECATED.
imageCount – DEPRECATED.
depthFormat – DEPRECATED.
imageExtent – DEPRECATED.
imageUsageFlags – DEPRECATED.
sampleCount – DEPRECATED.
dsImageAllocator – DEPRECATED.
dsImageAllocationCreateFlags – DEPRECATED.
- Returns:
DEPRECATED.</return>
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
pvr::utils::operator&=#
Defined in ModelGles.h
Function Documentation#
pvr::utils::isFormatDepthStencil#
Defined in HelperVk.h
Function Documentation#
-
inline bool pvr::utils::isFormatDepthStencil(pvrvk::Format format)#
Return true if the format is a depth stencil format.
SIMPLE CALCULATIONS ///////////////////
- Parameters:
format – Format to querry
- Returns:
True if the pvrvk::Format specified is a depth or stencil format
pvr::utils::getOpenGLStorageFormat#
Defined in ConvertToGlesTypes.h
Function Documentation#
-
inline void pvr::utils::getOpenGLStorageFormat(ImageStorageFormat storageFormat, GLenum &glInternalFormat)#
Retrieves the internal OpenGL ES texture formats for a texture with the provided ImageStorageFormat.
- Parameters:
storageFormat – The pvr::ImageStorageFormat to retrieve a the internal OpenGL ES texture format for.
glInternalFormat – The internal OpenGL ES format corresponding to the provided pvr::ImageStorageFormat storageFormat
- Returns:
Returns ‘True’ if the utility function was able to successfully determin the internal OpenGL ES format corresponding to the provided pvr::ImageStorageFormat storageFormat.
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
pvr::utils::convertToPVRVkMipmapMode#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
pvr::utils::inferAspectFromFormat#
Defined in HelperVk.h
Function Documentation#
-
pvrvk::ImageAspectFlags pvr::utils::inferAspectFromFormat(pvrvk::Format format, uint32_t planeIndex = 0)#
Infers the pvrvk::ImageAspectFlags from the pvrvk::Format.
- Parameters:
format – A format to infer pvrvk::ImageAspectFlags from
- Returns:
pvrvk::ImageAspectFlags inferred based on the pvrvk::Format provided
pvr::utils::createSingleBuffersFromModel#
Defined in HelperVk.h
Function Documentation#
-
template<typename VboInsertIterator_, typename IboInsertIterator_>
inline void pvr::utils::createSingleBuffersFromModel(pvrvk::Device &device, const assets::Model &model, VboInsertIterator_ vbos, IboInsertIterator_ ibos, pvrvk::CommandBuffer &uploadCmdBuffer, bool &requiresCommandBufferSubmission, vma::Allocator bufferAllocator = nullptr, vma::AllocationCreateFlags vmaAllocationCreateFlags = vma::AllocationCreateFlags::e_MAPPED_BIT)# Auto generates a set of VBOs and a set of IBOs from the vertex data of the meshes of a model and inserts them into containers provided by the user using std::inserters.
This utility function will read all vertex data from the VBO. It is usually preferred for meshes meshes containing a single set of interleaved data. If multiple data elements (i.e. sets of interleaved data), each block will be successively placed after the other. The std::inserter this function requires can be created from any container with an insert() function with (for example, for insertion at the end of a vector) std::inserter(std::vector, std::vector::end()) .
- Parameters:
device – The device device where the buffers will be generated on
model – The model whose meshes will be used to generate the Buffers
vbos – An insert iterator to a std::pvrvk::Buffer container for the VBOs. Vbos will be inserted using this iterator.
ibos – An insert iterator to an std::pvrvk::Buffer container for the IBOs. Ibos will be inserted using this iterator.
uploadCmdBuffer – A command buffer into which commands may be recorded for uploading mesh data to the created buffers. This command buffer will only be used when memory without e_HOST_VISIBLE_BIT memory property flags was allocated for the vbos or ibos.
requiresCommandBufferSubmission – Indicates whether commands have been recorded into the given command buffer.
bufferAllocator – A VMA allocator used to allocate memory for the created buffer.
vmaAllocationCreateFlags – VMA Allocation creation flags. These flags can be used to control how and where the memory is allocated from. Valid flags include e_DEDICATED_MEMORY_BIT and e_MAPPED_BIT. e_DEDICATED_MEMORY_BIT indicates that the allocation should have its own memory block. e_MAPPED_BIT indicates memory will be persistently mapped respectively. The default vma::AllocationCreateFlags::e_MAPPED_BIT is valid even if HOST_VISIBLE is not used - these flags will be ignored in this case.
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
pvr::utils::createComputeShaderProgram#
Defined in ShaderUtilsGles.h
Function Documentation#
-
inline GLuint pvr::utils::createComputeShaderProgram(IAssetProvider &app, const char *compShaderFilename, const char *const *defines = 0, uint32_t numDefines = 0)#
Create a native shader program from a compute shader.
- Parameters:
app – An AssetProvider to use for loading shaders from memory
compShaderFilename – The filename of a compute shader
defines – A list of defines to be added to the shaders
numDefines – The number of defines to be added to the shaders
- Returns:
The program object
pvr::utils::getNumSamplesFromSampleCountFlags#
Defined in HelperVk.h
Function Documentation#
-
inline uint8_t pvr::utils::getNumSamplesFromSampleCountFlags(pvrvk::SampleCountFlags sampleCountFlags)#
Convert pvrvk sample count to the number of samples it is equivalent to.
- Parameters:
sampleCountFlags – The pvrvk sample count to determine the number of samples for
- Returns:
The number of samples equivalent to the pvrvk sample count flags
pvr::utils::convertToGles#
Defined in ConvertToGlesTypes.h
Function Documentation#
pvr::utils::createSingleBuffersFromMeshes#
Defined in HelperVk.h
Function Documentation#
-
template<typename MeshIterator_, typename VboInsertIterator_, typename IboInsertIterator_>
inline void pvr::utils::createSingleBuffersFromMeshes(pvrvk::Device &device, MeshIterator_ meshIter, MeshIterator_ meshIterEnd, VboInsertIterator_ outVbos, IboInsertIterator_ outIbos, pvrvk::CommandBuffer &uploadCmdBuffer, bool &requiresCommandBufferSubmission, vma::Allocator bufferAllocator = nullptr, vma::AllocationCreateFlags vmaAllocationCreateFlags = vma::AllocationCreateFlags::e_MAPPED_BIT)# Auto generates a set of VBOs and a set of IBOs from the vertex data of multiple meshes and uses std::inserter provided by the user to insert them to any container.
This utility function will read all vertex data from a mesh’s data elements and create a single VBO. It is commonly used for a single set of interleaved data (mesh.getNumDataElements() == 1). If more data elements are present (i.e. more than a single interleaved data element) , they will be packed in the sameVBO, with each interleaved block (Data element ) appended at the end of the buffer. It is then the user’s responsibility to use the buffer correctly with the API (for example use bindbufferbase and similar) with the correct offsets. The std::inserter this function requires can be created from any container with an insert() function with (for example, for insertion at the end of a vector) std::inserter(std::vector, std::vector::end()) .
- Parameters:
device – The device where the buffers will be generated on
meshIter – Iterator for a collection of meshes.
meshIterEnd – End Iterator for meshIter.
outVbos – std::inserter for a collection of pvrvk::Buffer handles. It will be used to insert one VBO per mesh.
outIbos – std::inserter for a collection of pvrvk::Buffer handles. It will be used to insert one IBO per mesh. If face data is not present on the mesh, a null handle will be inserted.
uploadCmdBuffer – A command buffer into which commands may be recorded for uploading mesh data to the created buffers. This command buffer will only be used when memory without e_HOST_VISIBLE_BIT memory property flags was allocated for the vbos or ibos.
requiresCommandBufferSubmission – Indicates whether commands have been recorded into the given command buffer.
bufferAllocator – A VMA allocator used to allocate memory for the created buffer.
vmaAllocationCreateFlags – VMA Allocation creation flags. These flags can be used to control how and where the memory is allocated from. Valid flags include e_DEDICATED_MEMORY_BIT and e_MAPPED_BIT. e_DEDICATED_MEMORY_BIT indicates that the allocation should have its own memory block. e_MAPPED_BIT indicates memory will be persistently mapped respectively. The default vma::AllocationCreateFlags::e_MAPPED_BIT is valid even if HOST_VISIBLE is not used - these flags will be ignored in this case.
pvr::utils::convertToGles#
Defined in ConvertToGlesTypes.h
Function Documentation#
-
GLenum pvr::utils::convertToGles(ImageViewType texType)#
Convert to opengl texture type.
- Parameters:
texType – A TextureDimension enum
- Returns:
A GLenum representing a texture dimension (GL_TEXTURE_2D, GL_TEXTURE_3D, GL_TEXTURE_CUBE_MAP, GL_TEXTURE_2D_ARRAY)
pvr::utils::convertToPVRVkPixelFormat#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
-
inline pvrvk::Format pvr::utils::convertToPVRVkPixelFormat(PixelFormat format, ColorSpace colorSpace, VariableType dataType)#
Convert to pvrvk pixel format.
- Parameters:
format – Pixel format
colorSpace – Color space of the format (lRGB, sRGB)
dataType – Type of the data (SignedByte, SignedInteger etc)
- Returns:
A pvrvk::Format representing the pixel format
pvr::utils::beginQueueDebugLabel#
Defined in HelperVk.h
Function Documentation#
-
inline void pvr::utils::beginQueueDebugLabel(pvrvk::Queue queue, const pvrvk::DebugUtilsLabel &labelInfo)#
Begins identifying a region of work submitted to this queue. The calls to beginDebugUtilsLabel and endDebugUtilsLabel must be matched and balanced.
- Parameters:
queue – The queue to which the debug label region should be opened
labelInfo – Specifies the parameters of the label region to open
pvr::utils::uploadImageAndView#
Defined in HelperVk.h
Function Documentation#
-
pvrvk::ImageView pvr::utils::uploadImageAndView(pvrvk::Device &device, const Texture &texture, bool allowDecompress, pvrvk::SecondaryCommandBuffer &commandBuffer, pvrvk::ImageUsageFlags usageFlags = pvrvk::ImageUsageFlags::e_SAMPLED_BIT, pvrvk::ImageLayout finalLayout = pvrvk::ImageLayout::e_SHADER_READ_ONLY_OPTIMAL, vma::Allocator stagingBufferAllocator = nullptr, vma::Allocator imageAllocator = nullptr, vma::AllocationCreateFlags imageAllocationCreateFlags = vma::AllocationCreateFlags::e_NONE)#
Uploads an image to gpu. The upload command and staging buffers are recorded in the commandbuffer.
- Parameters:
device – The device to use to create the image and image view.
texture – The source pvr::Texture object from which to take the texture data.
allowDecompress – Specifies whether the texture can be decompressed as part of the image upload.
commandBuffer – A secondary command buffer to which the upload operations are be added. Note that the upload will not be guranteed to be complete until the command buffer is submitted to a queue with appropriate synchronisation.
usageFlags – A command buffer to add the pipelineBarrier for the image transition.
finalLayout – The final image layout the image will be transitioned to.
stagingBufferAllocator – A VMA allocator used to allocate memory for the created staging buffer.
imageAllocator – A VMA allocator used to allocate memory for the created image.
imageAllocationCreateFlags – VMA Allocation creation flags. These flags can be used to control how and where the memory is allocated from. Valid flags include e_DEDICATED_MEMORY_BIT and e_MAPPED_BIT. e_DEDICATED_MEMORY_BIT indicates that the allocation should have its own memory block. e_MAPPED_BIT indicates memory will be persistently mapped respectively.
- Returns:
The loaded image object.
pvr::utils::convertMeshesData#
Defined in HelperGles.h
Function Documentation#
-
void pvr::utils::convertMeshesData(const VertexStreamDescription &description, std::vector<pvr::assets::Model::Mesh>::iterator meshIter, std::vector<pvr::assets::Model::Mesh>::iterator meshIterEnd)#
Convert mesh data to the vertex stream description.
- Parameters:
meshIter – Iterator for the first mesh to process.
meshIterEnd – Iterator for the last mesh to process.
pvr::utils::RetrieveTexcoords#
Defined in HelperGles.h
Function Documentation#
-
bool pvr::utils::RetrieveTexcoords(const pvr::assets::Model::Mesh &mesh, uint32_t texcoordLayer, std::vector<glm::vec2> &uv)#
Get texture coordinate information.
- Parameters:
mesh – Mesh to retrieve the texture coordinate information.
texcoordLayer – Layer to retrieve the texture coordinate information.
uv – Vector with the texture coordinate information.
- Returns:
True if the information was found.
pvr::utils::textureUpload#
Defined in HelperGles.h
Function Documentation#
-
inline GLuint pvr::utils::textureUpload(const IAssetProvider &app, const std::string &file, pvr::Texture &outTexture, bool isEs2 = false)#
pvr::utils::createSwapchainRenderpassFramebuffers#
Defined in HelperVk.h
Function Documentation#
-
OnScreenObjects pvr::utils::createSwapchainRenderpassFramebuffers(const pvrvk::Device &device, const pvrvk::Surface &surface, pvr::DisplayAttributes &displayAttributes, const CreateSwapchainParameters ¶ms = CreateSwapchainParameters())#
Create a pvrvk::Framebuffer and RenderPass to use for ‘default’ rendering to the ‘onscreen’ color images. Default configuration is as follows. Formats and other configurations can be tweaked through displayAttributes and params. RenderPass: Attachment0: ColorAttachment swapchain image, finalLayout - PresentSrcKHR LoadOp - Clear StoreOp - Store Attachment1: DepthStencilAttachment finalLayout - DepthStencilAttachmentOptimal LoadOp - Clear StoreOp - Store If displayAttributes.aaSamples>1 Multisampling will be enabled and the correct resolve attachments for multisampling will be created.
- Parameters:
device – The device
surface – The surface for which the swapchain will be created.
displayAttributes – A configuration object for the requested objects. Can be retrieved from pvr::Shell, or just as easily populated manually.
params – A parameter object containing various different configurations to request for the created framebuffers etc. See the CreateSwapchainParameters struct documentation
- Returns:
An object containing the Swapchain, the Renderpass, the collection of created Framebuffers, and all the created attachments (depth/stencil/resolve).
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
-
inline pvrvk::VertexInputBindingDescription pvr::utils::convertToPVRVk(const VertexInputBindingInfo &info)#
Convert to pvrvk VertexInputBindingDescription.
- Parameters:
info – The pvr::VertexInputBindingInfo to convert
- Returns:
A pvrvk::VertexInputBindingDescription representing the VertexInputBindingInfo
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
-
inline ::pvrvk::SamplerMipmapMode pvr::utils::convertToPVRVk(::pvr::SamplerMipmapMode item)#
pvr::utils::createSingleBuffersFromMeshes#
Defined in HelperVk.h
Function Documentation#
-
template<typename MeshIterator_, typename VboContainer_, typename IboContainer_>
inline void pvr::utils::createSingleBuffersFromMeshes(pvrvk::Device &device, MeshIterator_ meshIter, MeshIterator_ meshIterEnd, VboContainer_ &outVbos, typename VboContainer_::iterator vbos_where, IboContainer_ &outIbos, typename IboContainer_::iterator ibos_where, pvrvk::CommandBuffer &uploadCmdBuffer, bool &requiresCommandBufferSubmission, vma::Allocator bufferAllocator = nullptr, vma::AllocationCreateFlags vmaAllocationCreateFlags = vma::AllocationCreateFlags::e_MAPPED_BIT)# Auto generates a set of VBOs and a set of IBOs from the vertex data of multiple meshes and insert them at the specified spot in a user-provided container.
This utility function will read all vertex data from a mesh’s data elements and create a single VBO. It is commonly used for a single set of interleaved data (mesh.getNumDataElements() == 1). If more data elements are present (i.e. more than a single interleaved data element) , they will be packed in the sameVBO, with each interleaved block (Data element ) appended at the end of the buffer. It is then the user’s responsibility to use the buffer correctly with the API (for example use bindbufferbase and similar) with the correct offsets.
- Parameters:
device – The device where the buffers will be generated on
meshIter – Iterator for a collection of meshes.
meshIterEnd – End Iterator for meshIter.
outVbos – Collection of pvrvk::Buffer handles. It will be used to insert one VBO per mesh.
outIbos – Collection of pvrvk::Buffer handles. It will be used to insert one IBO per mesh. If face data is not present on the mesh, a null handle will be inserted.
vbos_where – Iterator on outVbos - the position where the insertion will happen.
ibos_where – Iterator on outIbos - the position where the insertion will happen.
uploadCmdBuffer – A command buffer into which commands may be recorded for uploading mesh data to the created buffers. This command buffer will only be used when memory without e_HOST_VISIBLE_BIT memory property flags was allocated for the vbos or ibos.
requiresCommandBufferSubmission – Indicates whether commands have been recorded into the given command buffer.
bufferAllocator – A VMA allocator used to allocate memory for the created buffer.
vmaAllocationCreateFlags – VMA Allocation creation flags. These flags can be used to control how and where the memory is allocated from. Valid flags include e_DEDICATED_MEMORY_BIT and e_MAPPED_BIT. e_DEDICATED_MEMORY_BIT indicates that the allocation should have its own memory block. e_MAPPED_BIT indicates memory will be persistently mapped respectively. The default vma::AllocationCreateFlags::e_MAPPED_BIT is valid even if HOST_VISIBLE is not used - these flags will be ignored in this case.
pvr::utils::generatePreFilteredMapMipmapStyle#
Defined in PBRUtilsVk.h
Function Documentation#
-
Texture pvr::utils::generatePreFilteredMapMipmapStyle(pvrvk::Queue queue, pvrvk::ImageView environmentMap, pvr::PixelFormat outputPixelFormat, pvr::VariableType outputVariableType, uint32_t mapSize, bool zeroRoughnessIsExternal, int numMipLevelsToDiscard, uint32_t mapNumSamples = 65536)#
Generate specular irradiance map. Each level of the specular mip map gets blurred corresponding to a roughness value from 0 to 1.0.
- Parameters:
queue – A queue to which command buffers containing commands for generating the diffuse irradiance map will be added.
environmentMap – The source environment map to use in the generation
outputPixelFormat – The format to use for the diffuse irradiance map generated using this function.
outputVariableType – The variable type to use for the generated irradiance map generated using this function
mapSize – The size of the map to generate
zeroRoughnessIsExternal – Denotes that the source environment map itself will be used for the prefiltered environment map mip map level corresponding to a roughness of 0.
numMipLevelsToDiscard – Denotes the number of mip map levels to discard from the bottom of the chain. Generally using the last n mip maps may introduce artifacts.
mapNumSamples – The number of samples to use when generating the prefiltered environment map
- Returns:
The pvr::Texture generated
pvr::utils::insertSorted_overwrite#
Defined in HelperGles.h
Function Documentation#
pvr::utils::loadShader#
Defined in ShaderUtilsGles.h
Function Documentation#
-
GLuint pvr::utils::loadShader(const std::string &shaderSource, ShaderType shaderType, const char *const *defines, uint32_t numDefines)#
Load shader from shader source. Will implicitly load on the current context.
- Parameters:
shaderSource – A string containing the shader source text data
shaderType – The type (stage) of the shader (vertex, fragment…)
defines – A number of preprocessor definitions that will be passed to the shader
numDefines – The number of defines
- Returns:
The shader object
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
-
inline ::pvrvk::DescriptorType pvr::utils::convertToPVRVk(::pvr::DescriptorType item)#
pvr::utils::validatePhysicalDeviceExtensions#
Defined in HelperVk.h
Function Documentation#
-
std::vector<int> pvr::utils::validatePhysicalDeviceExtensions(const pvrvk::Instance instance, const std::vector<std::string> &vectorExtensionNames)#
Tests if any of the physical devices available through the instance given as parameter supports all the requested device extensions in vectorExtensionNames.
- Parameters:
instance – Instance to validate the extension names in vectorExtensionNames for each of the available physical devices.
vectorExtensionName – The physical device extensions to test availability
- Returns:
Vector with the indices of the physical devices that support all the extensions given in vectorExtensionNames.
pvr::utils::RetrieveTangents#
Defined in HelperGles.h
Function Documentation#
-
bool pvr::utils::RetrieveTangents(const pvr::assets::Model::Mesh &mesh, std::vector<glm::vec4> &tangents, bool forceNormalization)#
Get tangent information.
- Parameters:
mesh – Mesh to retrieve the tangent information.
tangents – Vector with the tangent information.
forceNormalization – Whether to force normalization.
- Returns:
True if the information was found.
pvr::utils::createDebugUtilsCallbacks#
Defined in HelperVk.h
Function Documentation#
-
DebugUtilsCallbacks pvr::utils::createDebugUtilsCallbacks(pvrvk::Instance &instance, void *pUserData = nullptr)#
Creates a default set of debug utils messengers or debug callbacks using either VK_EXT_debug_utils or VK_EXT_debug_report respectively. The first callback will trigger an exception to be thrown when an error message is returned. The second callback will Log a message for errors and warnings.
- Parameters:
instance –
The instance from which the debug utils messengers or debug callbacks will be created depending on support for VK_EXT_debug_utils or
VK_EXT_debug_report respectively.
pUserData – Pointer to the user data supplied for the callback.
- Returns:
A pvr::utils::DebugUtilsCallbacks structure which keeps alive the debug utils callbacks created.
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
-
inline ::pvrvk::FrontFace pvr::utils::convertToPVRVk(::pvr::PolygonWindingOrder item)#
pvr::utils::insertSorted#
Defined in HelperGles.h
Function Documentation#
pvr::utils::textureUpload#
Defined in HelperGles.h
Function Documentation#
-
inline GLuint pvr::utils::textureUpload(const IAssetProvider &app, const char *file, pvr::Texture &outTexture, bool isEs2 = false)#
Reads a block of pixel data from the frame buffer using the dimensions width and height as the dimensions of the pixel rectangle saved. The function will save the pixel data as a TGA file with the name specified by screenshotFileName. The function can be used to take screenshots of the current frame buffer or frame when called prior to presenting the backbuffer i.e. swapping buffers.
- Parameters:
screenshotFileName – The name used as the filename for the saved TGA screenshot.
width – The width of the pixel rectangle retrieved.
height – The width of the pixel rectangle retrieved.
screenshotScale – A scaling factor to use for increasing the size of the saved screenshot.
- Returns:
A scaling factor to use for increasing the size of the saved screenshot.
pvr::utils::takeScreenshot#
Defined in HelperGles.h
Function Documentation#
-
inline void pvr::utils::takeScreenshot(const std::string &screenshotFileName, const uint32_t width, const uint32_t height, const uint32_t screenshotScale = 1)#
Reads a block of pixel data from the frame buffer using the dimensions width and height as the dimensions of the pixel rectangle saved. The function will save the pixel data as a TGA file with the name specified by screenshotFileName. The function can be used to take screenshots of the current frame buffer or frame when called prior to presenting the backbuffer i.e. swapping buffers.
- Parameters:
screenshotFileName – The name used as the filename for the saved TGA screenshot.
width – The width of the pixel rectangle retrieved.
height – The width of the pixel rectangle retrieved.
screenshotScale – A scaling factor to use for increasing the size of the saved screenshot.
pvr::utils::populateInputAssemblyFromMesh#
Defined in HelperVk.h
Function Documentation#
-
inline void pvr::utils::populateInputAssemblyFromMesh(const assets::Mesh &mesh, const VertexBindings_Name *bindingMap, uint32_t numBindings, pvrvk::PipelineVertexInputStateCreateInfo &vertexCreateInfo, pvrvk::PipelineInputAssemblerStateCreateInfo &inputAssemblerCreateInfo, uint32_t *numOutBuffers = nullptr)#
Fills out input assembly and vertex input state structures using a mesh and a list of corresponding VertexBindings_Name.
- Parameters:
mesh – A mesh from which to retrieve vertex attributes, vertex buffer strides and primitive topology information from.
bindingMap – A pointer to an array of VertexBindings_Name structures which specify the semantic and binding names of any vertex attributes to retrieve.
numBindings – Specifies the number of VertexBindings structures in the array pointed to by bindingMap.
vertexCreateInfo – A pvrvk::PipelineVertexInputStateCreateInfo structure which will be filled by this utility function.
inputAssemblerCreateInfo – A pvrvk::InputAssemblerStateCreateInfo structure which will be filled by this utility function.
numOutBuffers – A pointer to an unsigned integer which will set to specify the number of buffers required to create buffers for to use the mesh vertex attributes.
pvr::utils::getSupportedDepthStencilFormat#
Defined in HelperVk.h
Function Documentation#
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
-
inline pvrvk::VertexInputAttributeDescription pvr::utils::convertToPVRVk(const VertexAttributeInfo &info, uint32_t binding)#
Convert to pvrvk VertexInputAttributeDescription.
- Parameters:
info – The pvr::VertexAttributeInfo to convert
binding – The binding index to use as part of the pvrvk::VertexInputAttributeDescription
- Returns:
A pvrvk::VertexInputAttributeDescription representing the VertexAttributeInfo with corresponding binding index
pvr::utils::populateClearValues#
Defined in HelperVk.h
Function Documentation#
-
inline void pvr::utils::populateClearValues(const pvrvk::RenderPass &renderpass, const pvrvk::ClearValue &clearColor, const pvrvk::ClearValue &clearDepthStencilValue, pvrvk::ClearValue *outClearValues)#
Populate color and depthstencil clear values.
- Parameters:
renderpass – The renderpass is used to determine the number of attachments and their formats from which a decision will be as to whether the provided clearColor or clearDepthStencilValue will be used for the corresponding pvrvk::ClearValue structure for each attachment.
clearColor – A pvrvk::ClearValue which will be used as the clear color value for the renderpass attachments with color formats
clearDepthStencilValue – A pvrvk::ClearValue which will be used as the depth stencil value for the renderpass attachments with depth stencil formats
outClearValues – A pointer to an array of pvrvk::ClearValue structures which should have size greater than or equal to the number of renderpass attachments.
pvr::utils::createDeviceAndQueues#
Defined in HelperVk.h
Function Documentation#
-
pvrvk::Device pvr::utils::createDeviceAndQueues(pvrvk::PhysicalDevice physicalDevice, const QueuePopulateInfo *queueCreateInfos, uint32_t numQueueCreateInfos, QueueAccessInfo *outAccessInfo, const DeviceExtensions &deviceExtensions = DeviceExtensions(), const VkDeviceObjectReservationCreateInfo *reservationCreateInfo = nullptr)#
Create the pvrvk::Device and the queues.
- Parameters:
physicalDevice – A physical device to use for creating the logical device.
queueCreateInfos – A pointer to a list of QueuePopulateInfo structures specifying the required properties for each of the queues retrieved.
numQueueCreateInfos – The number of QueuePopulateInfo structures provided.
outAccessInfo – A pointer to a list of QueueAccessInfo structures specifying the properties for each of the queues retrieved.
deviceExtensions – A DeviceExtensions structure which specifyies a list device extensions to try to enable.
reservationCreateInfo – Pointer to a struct with information in case the device is done with the application runnin in Vulkan Safety Critical mode.
- Returns:
Returns the created device
pvr::utils::generateTextureAtlas#
Defined in HelperVk.h
Function Documentation#
-
void pvr::utils::generateTextureAtlas(pvrvk::Device &device, const pvrvk::Image *inputImages, pvrvk::Rect2Df *outUVs, uint32_t numImages, pvrvk::ImageLayout inputImageLayout, pvrvk::ImageView *outImageView, TextureHeader *outDescriptor, pvrvk::CommandBufferBase cmdBuffer, pvrvk::ImageLayout finalLayout = pvrvk::ImageLayout::e_SHADER_READ_ONLY_OPTIMAL, vma::Allocator imageAllocator = nullptr, vma::AllocationCreateFlags imageAllocationCreateFlags = vma::AllocationCreateFlags::e_NONE)#
Utility function for generating a texture atlas based on a set of images.
- Parameters:
device – The device used to create the texture atlas.
inputImages – A list of input images used to generate the texture atlas from.
outUVs – A pointer to a set of UVs corresponding to the position of the images within the generated texture atlas.
numImages – The number of textures used for generating the texture atlas.
inputImageLayout – The current layout of the input images. All input images must be in the layout specified.
outImageView – The generated texture atlas returned by the function
outDescriptor – The texture header for the generated texture atlas
cmdBuffer – A previously constructured command buffer which will be used by the utility function for various operations such as creating images.
finalLayout – The final image layout the image will be transitioned to.
imageAllocator – A VMA allocator used to allocate memory for the created image.
imageAllocationCreateFlags – VMA Allocation creation flags. These flags can be used to control how and where the memory is allocated from. Valid flags include e_DEDICATED_MEMORY_BIT and e_MAPPED_BIT. e_DEDICATED_MEMORY_BIT indicates that the allocation should have its own memory block. e_MAPPED_BIT indicates memory will be persistently mapped respectively.
- Returns:
Return true if success
pvr::utils::createAttachmentImages#
Defined in HelperVk.h
Function Documentation#
-
template<typename ImageContainer>
static inline void pvr::utils::createAttachmentImages(ImageContainer &outImages, const pvrvk::Device &device, int32_t imageCount, pvrvk::Format format, const pvrvk::Extent2D &imageExtent, const pvrvk::ImageUsageFlags &imageUsageFlags, pvrvk::SampleCountFlags sampleCount, const vma::Allocator &imageAllocator = nullptr, vma::AllocationCreateFlags imageAllocationCreateFlags = vma::AllocationCreateFlags::e_DEDICATED_MEMORY_BIT, const std::string &objectName = std::string())# Helper function to create a collection of images intended to be used as attachments, e.g. Depth/Stencil images, resolve attachments etc.
<tparam name=”ImageContainer”>The type of container that will be returned. Must have an indexing[] function and a resize() function, making std::vector and pvr::multi common candidates</tparam>
- Parameters:
outImages – The container to use for the images. Must support resize() and indexing[]
device – The device for which the attachment images will be created
imageCount – The swapchain backbuffer image count (double, triple buffering etc).
format – The format of the attachments. If creating multisample color attachments, ensure format matches the swapchain image formats.
imageExtent – The size of the images. For each framebuffer, ensure imageExtent matches for all attachments.
imageUsageFlags – The usage flags for the images.
imageAllocator – An optional Vulkan Memory Allocator object that will be used to allocate memory for the images.
imageAllocationCreateFlags – The vma allocation flags to pass to VMA when constructing the objects.
objectName – The name to use for each created image. An index will be appended to each according to its swapchain index.
pvr::utils::packSamplerFilter#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
-
inline PackedSamplerFilter pvr::utils::packSamplerFilter(pvrvk::Filter mini, pvrvk::Filter magni, pvrvk::SamplerMipmapMode mip)#
Created a packed sampler filter.
- Parameters:
mini – The minification filter
magni – The magnification filter
mip – The sampler mipmap mode
- Returns:
The packed sampler filter
pvr::utils::insertSorted_overwrite#
Defined in HelperGles.h
Function Documentation#
-
template<typename container, typename val>
size_t pvr::utils::insertSorted_overwrite(container &cont, typename container::iterator begin, typename container::iterator end, const val &item)# Insert sorted element, Overwrite if element exist in the container.
- Parameters:
cont – Container to insert the element into.
begin – Container range begin
end – Container range end
item – Item to insert in to the container
pvr::utils::updateImage#
Defined in HelperVk.h
Function Documentation#
-
void pvr::utils::updateImage(pvrvk::Device &device, pvrvk::CommandBufferBase transferCommandBuffer, ImageUpdateInfo *updateInfos, uint32_t numUpdateInfos, pvrvk::Format format, pvrvk::ImageLayout layout, bool isCubeMap, pvrvk::Image &image, vma::Allocator bufferAllocator = nullptr, bool isSafetyCritical = false)#
Utility function to update an image’s data. This function will record the update of the image in the supplied command buffer but NOT submit the command buffer, hence allowing the user to submit it at his own time. IMPORTANT. Assumes image layout is pvrvk::ImageLayout::e_DST_OPTIMAL IMPORTANT. The cleanup object that is the return value of the function must be kept alive as long until the moment that the relevant command buffer submission is finished. Then it can be destroyed (or the cleanup function be called) to free any relevant resources.
- Parameters:
device – The device used to create the image
transferCommandBuffer – The command buffer into which the image update operations will be added.
updateInfos – This object is a c-style array of areas and the data to upload.
numUpdateInfos – The number of ImageUpdateInfo objects in
format – The format of the image.
layout – The final image layout for the image being updated.
isCubeMap – Is the image a cubemap
image – The image to update
bufferAllocator – A VMA allocator used to allocate memory for the created buffer.
isSafetyCritical – Whether this method is being called from an application running as standard Vulkan or as Vulkan Safety Critical.
- Returns:
Returns a pvrvk::Image update results structure - ImageUpdateResults
pvr::utils::getOpenGLStorageFormat#
Defined in ConvertToGlesTypes.h
Function Documentation#
-
void pvr::utils::getOpenGLStorageFormat(PixelFormat pixelFormat, ColorSpace colorSpace, VariableType dataType, GLenum &glInternalFormat)#
Retrieves the internal OpenGL ES texture format for a texture with pvr::PixelFormat pixelFormat, pvr::ColorSpace colorSpace and pvr::VariableType dataType.
- Parameters:
pixelFormat – The pvr::PixelFormat to retrieve a corresponding internal OpenGL ES texture format for.
colorSpace – The pvr::ColorSpace to retrieve a corresponding internal OpenGL ES texture format for.
dataType – The pvr::VariableTypeto retrieve a corresponding internal OpenGL ES texture format for.
glInternalFormat – The internal OpenGL ES format corresponding to the provided pvr::PixelFormat pixelFormat, pvr::ColorSpace colorSpace and pvr::VariableType dataType
pvr::utils::writeVertices#
Defined in HelperGles.h
Function Documentation#
-
void pvr::utils::writeVertices(uint8_t *input, uint8_t *output, const VertexStreamDescription &description, VertexStreamDescription::DataSemantic semantic, uint32_t nbVertices)#
Write vertex atrribute information for a particular channel.
- Parameters:
input – Vertex information to write.
input – Vertex information to output.
description – Vertex stream description.
semantic – Vertex stream data semantic.
nbVertices – Number vertices.
pvr::utils::textureUploadWithResults#
Defined in HelperGles.h
Function Documentation#
-
inline TextureUploadResults pvr::utils::textureUploadWithResults(const IAssetProvider &app, const char *file, bool isEs2 = false)#
pvr::utils::generateTextureAtlas#
Defined in HelperGles.h
Function Documentation#
-
inline void pvr::utils::generateTextureAtlas(const IAssetProvider &app, const StringHash *fileNames, Rectanglef *outUVs, uint32_t numTextures, GLuint *outTexture, TextureHeader *outDescriptor, bool isEs2 = false)#
pvr::utils::createOnscreenFramebuffers#
Defined in HelperVk.h
Function Documentation#
-
template<typename ContainerType>
inline ContainerType pvr::utils::createOnscreenFramebuffers(const pvrvk::Swapchain &swapchain, const pvrvk::RenderPass &renderPass, const pvrvk::ImageView *depthStencilImages, pvrvk::ImageView *colorMultisampledImages, pvrvk::ImageView *depthStencilMultisampledImages)# <sumary>Creates a collection of Framebuffer objects, the same number of images as the Swapchain images. Will take into consideration properties of the swapchain and the renderpass to infer sizes, formats, multisampling etc., and also ensure all parameters are consistently passed. <tparam name=”ContainerType”> The type of container to create the framebuffers. Must support resize() and indexing [].</tparam>
- Parameters:
swapchain – The swapchain for which framebuffers will be created. The swapchain images will used as Color attachments. If multisampled, they will be used as Color Resolve attachments instead.
renderPass – The renderpass for which the framebuffers will be created. Must of course be compatible with the swapchain images.
depthStencilImages – If the renderPass requires a depth buffer, MUST contain an array of Images compatible with the RenderPass definition. Will be used as Depth attachments. If multisampled, will be used as Depth Resolve attachments instead.
colorMultisampledImages – If the renderPass is multisampled, MUST contain an array of Multisampling Images to be used as Color attachments. Otherwise, MUST be null
depthMultisampledImages – If the renderPass is multisampled AND depthStencilImages is not null, MUST contain an array of Multisampling Images to be used as Depth attachments. Otherwise, MUST be null.
- Returns:
A ContainerType containing the framebuffer objects created.
pvr::utils::convertToGles#
Defined in ConvertToGlesTypes.h
Function Documentation#
pvr::utils::createMultipleBuffersFromMesh#
Defined in HelperGles.h
Function Documentation#
-
inline void pvr::utils::createMultipleBuffersFromMesh(const assets::Mesh &mesh, std::vector<GLuint> &outVbos, GLuint &outIbo)#
Auto generates a set of VBOs and a single IBO from all the vertex data of a mesh, respecting the Mesh’s vertex layout configuration: Each Data Element of the mesh will produce another VBO.
This utility function will read all vertex data from the mesh and create one Buffer for each data element (block of interleaved data) in the mesh. It is thus commonly used for for meshes containing multiple sets of interleaved data (for example, a VBO with static and a VBO with streaming data).
- Parameters:
context – The device context where the buffers will be generated on
mesh – The mesh whose data will populate the buffers
outVbos – Reference to a std::vector of VBO handles where the data will be put. Buffers will be appended at the end.
outIbo – The IBO handle where the data will be put. No buffer needs to have been created on the handle. If no face data is present on the mesh, the handle will be null.
pvr::utils::operator|#
Defined in ModelGles.h
Function Documentation#
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
pvr::utils::checkApiError#
Defined in ErrorsGles.h
Function Documentation#
-
int pvr::utils::checkApiError(std::string *errOutStr = NULL)#
Checks and returns api error if appropriate.
- Parameters:
errOutStr – error std::string to be output.
- Returns:
api error code
pvr::utils::generateIrradianceMap#
Defined in PBRUtilsVk.h
Function Documentation#
-
Texture pvr::utils::generateIrradianceMap(pvrvk::Queue queue, pvrvk::ImageView environmentMap, pvr::PixelFormat outputPixelFormat, pvr::VariableType outputVariableType, uint32_t mapSize = 64, uint32_t mapNumSamples = 16384)#
Generates a mipmapped diffuse irradiance map.
- Parameters:
queue – A queue to which command buffers containing commands for generating the diffuse irradiance map will be added.
environmentMap – The source environment map to use in the generation
outputPixelFormat – The format to use for the diffuse irradiance map generated using this function.
outputVariableType – The variable type to use for the generated irradiance map generated using this function.
mapSize – The size of the map to generate
mapNumSamples – The number of samples to use when generating the diffuse irradiance map
- Returns:
The pvr::Texture generated
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
-
inline ::pvrvk::ColorComponentFlags pvr::utils::convertToPVRVk(::pvr::ColorChannelFlags item)#
pvr::utils::deleteTexturesAndZero#
Defined in HelperGles.h
Function Documentation#
-
inline void pvr::utils::deleteTexturesAndZero(GLuint &texture)#
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
-
inline ::pvrvk::PrimitiveTopology pvr::utils::convertToPVRVk(::pvr::PrimitiveTopology item)#
pvr::utils::beginCommandBufferDebugLabel#
Defined in HelperVk.h
Function Documentation#
-
inline void pvr::utils::beginCommandBufferDebugLabel(pvrvk::CommandBuffer &commandBuffer, const pvrvk::DebugUtilsLabel &labelInfo)#
Begins identifying a region of work submitted to this command buffer. The calls to beginDebugUtilsLabel and endDebugUtilsLabel must be matched and balanced.
- Parameters:
commandBuffer – The command buffer to which the debug label region should be opened
labelInfo – Specifies the parameters of the label region to open
pvr::utils::loadShader#
Defined in ShaderUtilsGles.h
Function Documentation#
-
GLuint pvr::utils::loadShader(const Stream &shaderSource, ShaderType shaderType, const char *const *defines, uint32_t numDefines)#
Load shader from shader source. Will implicitly load on the current context.
- Parameters:
shaderSource – A stream containing the shader source text data
shaderType – The type (stage) of the shader (vertex, fragment…)
defines – A number of preprocessor definitions that will be passed to the shader
numDefines – The number of defines
- Returns:
The shader object
pvr::utils::textureUploadWithResults#
Defined in HelperGles.h
Function Documentation#
-
inline TextureUploadResults pvr::utils::textureUploadWithResults(const IAssetProvider &app, const char *file, pvr::Texture &outTexture, bool isEs2 = false)#
pvr::utils::isSupportedDepthStencilFormat#
Defined in HelperVk.h
Function Documentation#
pvr::utils::insertDebugUtilsLabel#
Defined in HelperVk.h
Function Documentation#
-
inline void pvr::utils::insertDebugUtilsLabel(pvrvk::CommandBuffer &commandBuffer, const pvrvk::DebugUtilsLabel &labelInfo)#
Inserts a single debug label any time.
- Parameters:
commandBuffer – The command buffer to which the debug label should be inserted
labelInfo – Specifies the parameters of the label region to insert
pvr::utils::operator|=#
Defined in ModelGles.h
Function Documentation#
pvr::utils::mapDebugUtilsMessageSeverityFlagsToLogLevel#
Defined in HelperVk.h
Function Documentation#
-
inline LogLevel pvr::utils::mapDebugUtilsMessageSeverityFlagsToLogLevel(pvrvk::DebugUtilsMessageSeverityFlagsEXT flags)#
Maps a set of DebugUtilsMessageSeverityFlagsEXT to a particular type of log message.
- Parameters:
flags – The DebugUtilsMessageSeverityFlagsEXT to map to a LogLevel.
- Returns:
Returns a LogLevel deemed to correspond to the given pvrvk::DebugUtilsMessageSeverityFlagsEXT.
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
-
inline pvrvk::PipelineColorBlendAttachmentState pvr::utils::convertToPVRVk(const BlendingConfig &config)#
Convert to pvrvk PipelineColorBlendAttachmentState.
- Parameters:
config – The pvr::BlendingConfig to convert
- Returns:
A pvrvk::PipelineColorBlendAttachmentState representing the BlendingConfig
pvr::utils::unpackSamplerFilter#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
-
inline void pvr::utils::unpackSamplerFilter(PackedSamplerFilter packed, pvrvk::Filter &mini, pvrvk::Filter &magni, pvrvk::SamplerMipmapMode &mip)#
Unpack a packed sampler filter.
- Parameters:
packed – The packed sampler filter
mini – The minification filter
magni – The magnification filter
mip – The sampler mipmap mode
pvr::utils::uploadImageAndViewSubmit#
Defined in HelperVk.h
Function Documentation#
-
pvrvk::ImageView pvr::utils::uploadImageAndViewSubmit(pvrvk::Device &device, const Texture &texture, bool allowDecompress, pvrvk::CommandPool &commandPool, pvrvk::Queue &queue, pvrvk::ImageUsageFlags usageFlags = pvrvk::ImageUsageFlags::e_SAMPLED_BIT, pvrvk::ImageLayout finalLayout = pvrvk::ImageLayout::e_SHADER_READ_ONLY_OPTIMAL, vma::Allocator stagingBufferAllocator = nullptr, vma::Allocator imageAllocator = nullptr, vma::AllocationCreateFlags imageAllocationCreateFlags = vma::AllocationCreateFlags::e_NONE)#
Uploads an image to GPU memory and returns the created image view and associated image.
- Parameters:
device – The device to use to create the image and image view.
texture – The source pvr::Texture object from which to take the texture data.
allowDecompress – Specifies whether the texture can be decompressed as part of the image upload.
commandPool – A command pool from which to allocate a temporary command buffer to carry out the upload operations.
queue – A queue to which the upload operations should be submitted to.
usageFlags – A set of image usage flags for which the created image can be used for.
finalLayout – The final image layout the image will be transitioned to.
stagingBufferAllocator – A VMA allocator used to allocate memory for the created staging buffer.
imageAllocator – A VMA allocator used to allocate memory for the created image.
imageAllocationCreateFlags – VMA Allocation creation flags. These flags can be used to control how and where the memory is allocated from. Valid flags include e_DEDICATED_MEMORY_BIT and e_MAPPED_BIT. e_DEDICATED_MEMORY_BIT indicates that the allocation should have its own memory block. e_MAPPED_BIT indicates memory will be persistently mapped respectively.
- Returns:
The result of the image upload will be a created image view with its associated pvrvk::Image.
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
-
inline pvrvk::ImageViewType pvr::utils::convertToPVRVk(ImageViewType texDimemsion)#
Convert to pvrvk image view type.
- Parameters:
texDimemsion – Texture dimension
- Returns:
A pvrvk::ImageViewType (pvrvk::ImageViewType::e_1D, pvrvk::ImageViewType::e_2D etc)
pvr::utils::updateBufferUsingStagingBuffer#
Defined in HelperVk.h
Function Documentation#
-
inline void pvr::utils::updateBufferUsingStagingBuffer(pvrvk::Device &device, pvrvk::Buffer &buffer, pvrvk::CommandBufferBase uploadCmdBuffer, const void *data, VkDeviceSize offset = 0, VkDeviceSize size = VK_WHOLE_SIZE, vma::Allocator stagingBufferAllocator = nullptr)#
Utility function to update a buffer’s data via an indirect copy from a temporary staging buffer. Updating memory via the use of a staging buffer is necessary when using memory without e_HOST_VISIBLE_BIT memory property flags meaning the buffer itself cannot be mapped to host memory.
- Parameters:
device – The device used to create the staging buffer
buffer – The destination buffer.
uploadCmdBuffer – A command buffer into which commands will be recorded for carrying out the buffer copy
data – The data to use in the update
offset – The offset to use for the map -> update -> unmap
size – The size of the data to be updated
stagingBufferAllocator – A VMA allocator used to allocate memory for the created staging buffer.
pvr::utils::uploadImageAndView#
Defined in HelperVk.h
Function Documentation#
-
pvrvk::ImageView pvr::utils::uploadImageAndView(pvrvk::Device &device, const Texture &texture, bool allowDecompress, pvrvk::CommandBuffer &commandBuffer, pvrvk::ImageUsageFlags usageFlags = pvrvk::ImageUsageFlags::e_SAMPLED_BIT, pvrvk::ImageLayout finalLayout = pvrvk::ImageLayout::e_SHADER_READ_ONLY_OPTIMAL, vma::Allocator stagingBufferAllocator = nullptr, vma::Allocator imageAllocator = nullptr, vma::AllocationCreateFlags imageAllocationCreateFlags = vma::AllocationCreateFlags::e_NONE)#
Upload image to gpu. The upload command and staging buffers are recorded in the commandbuffer.
- Parameters:
device – The device to use to create the image and image view.
texture – The source pvr::Texture object from which to take the texture data.
allowDecompress – Specifies whether the texture can be decompressed as part of the image upload.
commandBuffer – A command buffer to which the upload operations should be added. Note that the upload will not be guranteed to be complete until the command buffer is submitted to a queue with appropriate synchronisation.
usageFlags – A command buffer to add the pipelineBarrier for the image transition.
finalLayout – The final image layout the image will be transitioned to.
stagingBufferAllocator – A VMA allocator used to allocate memory for the created staging buffer.
imageAllocator – A VMA allocator used to allocate memory for the created image.
imageAllocationCreateFlags – VMA Allocation creation flags. These flags can be used to control how and where the memory is allocated from. Valid flags include e_DEDICATED_MEMORY_BIT and e_MAPPED_BIT. e_DEDICATED_MEMORY_BIT indicates that the allocation should have its own memory block. e_MAPPED_BIT indicates memory will be persistently mapped respectively.
- Returns:
The image object.
pvr::utils::RetrieveNormals#
Defined in HelperGles.h
Function Documentation#
-
bool pvr::utils::RetrieveNormals(const pvr::assets::Model::Mesh &mesh, std::vector<glm::vec3> &normals, bool forceNormalization)#
Get normal information.
- Parameters:
mesh – Mesh to retrieve the normal information.
normal – Vector with the normal information.
forceNormalization – Whether to force normalization.
- Returns:
True if the information was found.
pvr::utils::setImageLayoutAndQueueFamilyOwnership#
Defined in HelperVk.h
Function Documentation#
-
void pvr::utils::setImageLayoutAndQueueFamilyOwnership(pvrvk::CommandBufferBase srccmd, pvrvk::CommandBufferBase dstcmd, uint32_t srcQueueFamily, uint32_t dstQueueFamily, pvrvk::ImageLayout oldLayout, pvrvk::ImageLayout newLayout, pvrvk::Image &image, uint32_t baseMipLevel, uint32_t numMipLevels, uint32_t baseArrayLayer, uint32_t numArrayLayers, pvrvk::ImageAspectFlags aspect, bool isSafetyCritical = false)#
Set image layout and queue family ownership.
- Parameters:
srccmd – The source command buffer from which to transition the image from.
dstcmd – The destination command buffer from which to transition the image to.
srcQueueFamily – srcQueueFamily is the source queue family for a queue family ownership transfer.
dstQueueFamily – dstQueueFamily is the destination queue family for a queue family ownership transfer.
oldLayout – An old image layout to transition from
newLayout – A new image layout to transition to
image – The image to transition
baseMipLevel – The base mip level of the image to transition
numMipLevels – The number of mip levels of the image to transition
baseArrayLayer – The base array layer level of the image to transition
numArrayLayers – The number of array layers of the image to transition
aspect – The pvrvk::ImageAspectFlags of the image to transition
isSafetyCritical – Whether this method is being called from an application running as standard Vulkan or as Vulkan Safety Critical.
pvr::utils::convertToPVRVkNumSamples#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
-
inline pvrvk::SampleCountFlags pvr::utils::convertToPVRVkNumSamples(uint8_t numSamples)#
Convert to pvrvk sample count.
- Parameters:
numSamples – Number of samples
- Returns:
A pvrvk::SampleCountFlags (pvrvk::SampleCountFlags::e_1_BIT, pvrvk::SampleCountFlags::e_2_BIT, etc)
pvr::utils::RetrieveBoneIndicesAndWeights#
Defined in HelperGles.h
Function Documentation#
-
bool pvr::utils::RetrieveBoneIndicesAndWeights(const pvr::assets::Model::Mesh &mesh, uint32_t bonesPerVertex, pvr::DataType indexType, std::vector<uint8_t> &boneIndices, std::vector<float> &boneWeights)#
Get bone index and weight information.
- Parameters:
mesh – Mesh to retrieve the bone index and weight information.
bonesPerVertex – Number of bones per vertex.
indexType – Data type for the bone indices.
boneIndices – Bone indices information.
boneWeights – Bone weights information.
- Returns:
True if the information was found.
pvr::utils::create3dPlaneMesh#
Defined in HelperGles.h
Function Documentation#
-
inline void pvr::utils::create3dPlaneMesh(uint32_t width, uint32_t depth, bool generateTexCoords, bool generateNormalCoords, assets::Mesh &outMesh)#
Creates a 3d plane mesh based on the width and depth specified. Texture coordinates and normal coordinates can also optionally be generated based on the generateTexCoords and generateNormalCoords flags respectively. The generated mesh will be returned as a pvr::assets::Mesh.
- Parameters:
width – The width of the plane to generate.
depth – The depth of the plane to generate.
generateTexCoords – Specifies whether to generate texture coordinates for the plane.
generateNormalCoords – Specifies whether to generate normal coordinates for the plane.
outMesh – The generated pvr::assets::Mesh.
pvr::utils::getOpenGLFormat#
Defined in ConvertToGlesTypes.h
Function Documentation#
-
void pvr::utils::getOpenGLFormat(PixelFormat pixelFormat, ColorSpace colorSpace, VariableType dataType, uint32_t &glInternalFormat, uint32_t &glFormat, uint32_t &glType, uint32_t &glTypeSize, bool &isCompressedFormat)#
Retrieves the OpenGL ES texture formats for a texture with pvr::PixelFormat pixelFormat, pvr::ColorSpace colorSpace and pvr::VariableType dataType.
- Parameters:
pixelFormat – The pvr::PixelFormat to retrieve a corresponding set of OpenGL ES texture formats for.
colorSpace – The pvr::ColorSpace to retrieve a corresponding set of OpenGL ES texture formats for.
dataType – The pvr::VariableTypeto retrieve a corresponding set of OpenGL ES texture formats for.
glInternalFormat – The internal OpenGL ES format corresponding to the provided pvr::PixelFormat pixelFormat, pvr::ColorSpace colorSpace and pvr::VariableType dataType.
glFormat – The OpenGL ES format corresponding to the provided pvr::PixelFormat pixelFormat, pvr::ColorSpace colorSpace and pvr::VariableType dataType.
glType – The OpenGL ES type corresponding to the provided pvr::PixelFormat pixelFormat, pvr::ColorSpace colorSpace and pvr::VariableType dataType.
glTypeSize – The OpenGL ES type size corresponding to the provided pvr::PixelFormat pixelFormat, pvr::ColorSpace colorSpace and pvr::VariableType dataType.
isCompressedFormat – Specifies whether the OpenGL ES format retrieved is a compressed format.
pvr::utils::getSupportedDepthStencilFormat#
Defined in HelperVk.h
Function Documentation#
-
pvrvk::Format pvr::utils::getSupportedDepthStencilFormat(const pvrvk::Device &device, pvr::DisplayAttributes &displayAttributes, std::vector<pvrvk::Format> preferredDepthFormats = {})#
pvr::utils::convertToGles#
Defined in ConvertToGlesTypes.h
Function Documentation#
pvr::utils::textureUpload#
Defined in HelperGles.h
Function Documentation#
-
inline GLuint pvr::utils::textureUpload(const IAssetProvider &app, const char *file, bool isEs2 = false)#
pvr::utils::createOnscreenFramebufferAndRenderPass#
Defined in HelperVk.h
Function Documentation#
-
inline pvrvk::RenderPass pvr::utils::createOnscreenFramebufferAndRenderPass(const pvrvk::Swapchain &swapchain, pvrvk::ImageView *depthStencilImages, Multi<pvrvk::Framebuffer> &outFramebuffers, pvrvk::ImageLayout initialSwapchainLayout = pvrvk::ImageLayout::e_UNDEFINED, pvrvk::ImageLayout initialDepthStencilLayout = pvrvk::ImageLayout::e_UNDEFINED, pvrvk::AttachmentLoadOp colorLoadOp = pvrvk::AttachmentLoadOp::e_CLEAR, pvrvk::AttachmentStoreOp colorStoreOp = pvrvk::AttachmentStoreOp::e_STORE, pvrvk::AttachmentLoadOp depthStencilLoadOp = pvrvk::AttachmentLoadOp::e_CLEAR, pvrvk::AttachmentStoreOp depthStencilStoreOp = pvrvk::AttachmentStoreOp::e_DONT_CARE)#
DEPRECATED.
- Parameters:
outFramebuffers – DEPRECATED
swapchain – DEPRECATED
depthStencilImages – DEPRECATED
outRenderPass – DEPRECATED
initialSwapchainLayout – DEPRECATED
initialDepthStencilLayout – DEPRECATED
colorLoadOp – DEPRECATED
colorStoreOp – DEPRECATED
depthStencilLoadOp – DEPRECATED
depthStencilStoreOp – DEPRECATED
pvr::utils::createInstance#
Defined in HelperVk.h
Function Documentation#
-
pvrvk::Instance pvr::utils::createInstance(const std::string &applicationName, VulkanVersion apiVersion = VulkanVersion(), const InstanceExtensions &instanceExtensions = InstanceExtensions(), const InstanceLayers &instanceLayers = InstanceLayers(), const pvrvk::DebugUtilsMessageSeverityFlagsEXT InstanceValidationFlags = pvrvk::DebugUtilsMessageSeverityFlagsEXT::e_WARNING_BIT_EXT | pvrvk::DebugUtilsMessageSeverityFlagsEXT::e_ERROR_BIT_EXT)#
Utility function for creating a Vulkan instance and supported physical devices using the appropriately set parameters.
- Parameters:
applicationName – Used for setting the pApplicationName of the pvrvk::ApplicationInfo structure used when calling vkCreateInstance.
apiVersion – A VulkanVersion structure used for setting the apiVersion of the pvrvk::ApplicationInfo structure used when creating the Vulkan instance.
instanceExtensions – An InstanceExtensions structure which holds a list of instance extensions which will be checked for compatibility with the current Vulkan implementation before setting as the ppEnabledExtensionNames member of the pvrvk::InstanceCreateInfo used when creating the Vulkan instance. It will contain the final list of instance extensions used for the Vulkan instance.
instanceLayers – An InstanceLayers structure which holds a list of instance layers which will be checked for compatibility with the current Vulkan implementation before setting as the ppEnabledLayerNames member of the pvrvk::InstanceCreateInfo used when creating the Vulkan instance.
InstanceValidationFlags – The flags required for the debug callback to log a message during instance creation and destruction
- Returns:
A pointer to the created Instance.
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
pvr::utils::textureUpload#
Defined in TextureUtilsGles.h
Function Documentation#
-
TextureUploadResults pvr::utils::textureUpload(const Texture &texture, bool isEs2, bool allowDecompress)#
Upload a texture to the GPU on the current context, and return it as part of the TextureUploadResults structure.
- Parameters:
texture – The pvr::Texture to upload to the GPU
isEs2 – Signifies whether the current context being used for the texture upload is ES2 only. If the context is ES2 only then the texture upload should not use ES3+ functionality as it will be unsupported via this context.
allowDecompress – Set to true to allow to attempt to de-compress unsupported compressed textures. The textures will be decompressed if ALL of the following are true: The texture is in a compressed format that can be decompressed by the framework (PVRTC), the platform does NOT support this format (if it is hardware supported, it will never be decompressed), and this flag is set to true. Default:true.
- Returns:
A TextureUploadResults object containing the uploaded texture and all necessary information (size, formats, whether it was actually decompressed. The “result” field will contain Result::Success on success, errorcode otherwise. See the Texture
pvr::utils::endCommandBufferDebugLabel#
Defined in HelperVk.h
Function Documentation#
-
inline void pvr::utils::endCommandBufferDebugLabel(pvrvk::SecondaryCommandBuffer &secondaryCommandBuffer)#
Ends a label region of work submitted to this secondary command buffer.
- Parameters:
secondaryCommandBuffer – The secondary command buffer to which the debug label region should be ended
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
pvr::utils::populateInputAssemblyFromMesh#
Defined in HelperVk.h
Function Documentation#
-
inline void pvr::utils::populateInputAssemblyFromMesh(const assets::Mesh &mesh, const VertexBindings *bindingMap, uint16_t numBindings, pvrvk::PipelineVertexInputStateCreateInfo &vertexCreateInfo, pvrvk::PipelineInputAssemblerStateCreateInfo &inputAssemblerCreateInfo, uint16_t *numOutBuffers = nullptr)#
Fills out input assembly and vertex input state structures using a mesh and a list of corresponding VertexBindings.
- Parameters:
mesh – A mesh from which to retrieve vertex attributes, vertex buffer strides and primitive topology information from.
bindingMap – A pointer to an array of VertexBindings structures which specify the semantic names and binding indices of any vertex attributes to retrieve.
numBindings – Specifies the number of VertexBindings structures in the array pointed to by bindingMap.
vertexCreateInfo – A pvrvk::PipelineVertexInputStateCreateInfo structure which will be filled by this utility function.
inputAssemblerCreateInfo – A pvrvk::InputAssemblerStateCreateInfo structure which will be filled by this utility function.
numOutBuffers – A pointer to an unsigned integer which will set to specify the number of buffers required to create buffers for to use the mesh vertex attributes.
pvr::utils::insertSorted#
Defined in HelperGles.h
Function Documentation#
-
template<typename container, typename val, typename cmp>
size_t pvr::utils::insertSorted(container &cont, typename container::iterator begin, typename container::iterator end, const val &item, const cmp &compare)# Insert sorted element in to the container.
- Parameters:
cont – Container to insert the element into.
begin – Container range begin
end – Container range end
item – Item to insert in to the container
compare – Comparison operator used for sorting
pvr::utils::insertDebugUtilsLabel#
Defined in HelperVk.h
Function Documentation#
-
inline void pvr::utils::insertDebugUtilsLabel(pvrvk::CommandBufferBase commandBufferBase, const pvrvk::DebugUtilsLabel &labelInfo)#
Inserts a single debug label any time.
- Parameters:
commandBufferBase – The base command buffer to which the debug label should be inserted
labelInfo – Specifies the parameters of the label region to insert
pvr::utils::loadAndUploadImage#
Defined in HelperVk.h
Function Documentation#
-
pvrvk::Image pvr::utils::loadAndUploadImage(pvrvk::Device &device, const std::string &fileName, bool allowDecompress, pvrvk::CommandBuffer &commandBuffer, IAssetProvider &assetProvider, pvrvk::ImageUsageFlags usageFlags = pvrvk::ImageUsageFlags::e_SAMPLED_BIT, pvrvk::ImageLayout finalLayout = pvrvk::ImageLayout::e_SHADER_READ_ONLY_OPTIMAL, Texture *outAssetTexture = nullptr, vma::Allocator stagingBufferAllocator = nullptr, vma::Allocator imageAllocator = nullptr, vma::AllocationCreateFlags imageAllocationCreateFlags = vma::AllocationCreateFlags::e_NONE)#
Load and upload image to gpu. The upload command and staging buffers are recorded in the commandbuffer.
- Parameters:
device – The device to use to create the image and image view.
fileName – The filename of a source texture from which to take the texture data.
allowDecompress – Specifies whether the texture can be decompressed as part of the image upload.
commandBuffer – A command buffer to which the upload operations should be added. Note that the upload will not be guranteed to be complete until the command buffer is submitted to a queue with appropriate synchronisation.
assetProvider – Specifies an asset provider to use for loading the texture from system memory.
usageFlags – Specifies the usage flags for the image being created.
finalLayout – The final image layout the image will be transitioned to.
outAssetTexture – A pointer to a created pvr::texture.
stagingBufferAllocator – A VMA allocator used to allocate memory for the created staging buffer.
imageAllocator – A VMA allocator used to allocate memory for the created image.
imageAllocationCreateFlags – VMA Allocation creation flags. These flags can be used to control how and where the memory is allocated from. Valid flags include e_DEDICATED_MEMORY_BIT and e_MAPPED_BIT. e_DEDICATED_MEMORY_BIT indicates that the allocation should have its own memory block. e_MAPPED_BIT indicates memory will be persistently mapped respectively.
- Returns:
The Image Object uploaded.
pvr::utils::createImage#
Defined in HelperVk.h
Function Documentation#
-
pvrvk::Image pvr::utils::createImage(const pvrvk::Device &device, const pvrvk::ImageCreateInfo &createInfo, pvrvk::MemoryPropertyFlags requiredMemoryFlags = pvrvk::MemoryPropertyFlags::e_DEVICE_LOCAL_BIT, pvrvk::MemoryPropertyFlags optimalMemoryFlags = pvrvk::MemoryPropertyFlags::e_NONE, const vma::Allocator &imageAllocator = nullptr, vma::AllocationCreateFlags vmaAllocationCreateFlags = vma::AllocationCreateFlags::e_NONE)#
create a new Image(sparse or with memory backing, depending on flags . The user should not call bindMemory on the image if sparse flags are used. requiredMemoryFlags is ignored if flags contains sparse binding flags.
- Parameters:
device – The device on which to create the image
createInfo – A pvrvk::ImageCreateInfo structure controlling how the image will be created.
requiredMemoryFlags – The minimal set of memory property flags which are required for the PVRVk Image to be created. If pvrvk::MemoryPropertyFlags::e_NONE is passed, no memory will be allocated for this Image.
optimalMemoryFlags – The most optimal set of memory property flags which could be used by the memory backing the returned PVRVk Image. If pvrvk::MemoryPropertyFlags::e_NONE is passed optimalMemoryFlags will be set to match requiredMemoryFlags.
imageAllocator – A VMA allocator used to allocate memory for the created image.
vmaAllocationCreateFlags – VMA Allocation creation flags. These flags can be used to control how and where the memory is allocated from. Valid flags include e_DEDICATED_MEMORY_BIT and e_MAPPED_BIT. e_DEDICATED_MEMORY_BIT indicates that the allocation should have its own memory block. e_MAPPED_BIT indicates memory will be persistently mapped respectively. The default vma::AllocationCreateFlags::e_MAPPED_BIT is valid even if HOST_VISIBLE is not used - these flags will be ignored in this case.
- Returns:
The created Imageobject on success, null Image on failure
pvr::utils::imageUploadAsyncWorker#
Defined in AsynchronousVk.h
Function Documentation#
-
inline void pvr::utils::imageUploadAsyncWorker(ImageUploadFuture uploadFuture)#
Provides a mechanism for kicking an asynchronous image upload worker.
- Parameters:
uploadFuture – An image upload future to be uploaded on a separate thread.
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
-
inline ::pvrvk::BufferUsageFlags pvr::utils::convertToPVRVk(::pvr::BufferUsageFlags item)#
pvr::utils::mapDebugReportFlagsToLogLevel#
Defined in HelperVk.h
Function Documentation#
-
inline LogLevel pvr::utils::mapDebugReportFlagsToLogLevel(pvrvk::DebugReportFlagsEXT flags)#
Maps a set of DebugReportFlagsEXT to a particular type of log message.
- Parameters:
flags – The DebugReportFlagsEXT to map to a LogLevel.
- Returns:
Returns a LogLevel deemed to correspond to the given pvrvk::DebugReportFlagsEXT.
pvr::utils::saveImage#
Defined in HelperVk.h
Function Documentation#
-
void pvr::utils::saveImage(pvrvk::Queue &queue, pvrvk::CommandPool &commandPool, pvrvk::Image &image, const pvrvk::ImageLayout imageInitialLayout, const pvrvk::ImageLayout imageFinalLayout, const std::string &filename, vma::Allocator bufferAllocator = nullptr, vma::Allocator imageAllocator = nullptr, const uint32_t screenshotScale = 1)#
Saves the input image as a TGA file with the filename specified. Note that the image must have been created with the pvrvk::ImageUsageFlags::e_TRANSFER_SRC_BIT set.
- Parameters:
queue – A queue to submit the generated command buffer to. This queue must be compatible with the command pool provided.
commandPool – A command pool from which to allocate a temporary command buffer to carry out the transfer operations.
image – The image to save as a TGA file.
imageInitialLayout – The initial layout of the image from which a transition will be made to pvrvk::ImageLayout::e_TRANSFER_SRC_OPTIMAL.
imageFinalLayout – The final layout of the image to which a transition will be made.
filename – The filename to use for the saved TGA image.
bufferAllocator – A VMA allocator used to allocate memory for the created the buffer used as the target of an imageToBufferCopy.
imageAllocator – A VMA allocator used to allocate memory for the created image.
screenshotScale – A scaling factor to use for increasing the size of the saved screenshot.
pvr::utils::createSingleBuffersFromModel#
Defined in HelperGles.h
Function Documentation#
-
template<typename VboInsertIterator_, typename IboInsertIterator_>
inline void pvr::utils::createSingleBuffersFromModel(const assets::Model &model, VboInsertIterator_ vbos, IboInsertIterator_ ibos)# Auto generates a set of VBOs and a set of IBOs from the vertex data of the meshes of a model and inserts them into containers provided by the user using std::inserters.
This utility function will read all vertex data from the VBO. It is usually preferred for meshes meshes containing a single set of interleaved data. If multiple data elements (i.e. sets of interleaved data), each block will be successively placed after the other. The std::inserter this function requires can be created from any container with an insert() function with (for example, for insertion at the end of a vector) std::inserter(std::vector, std::vector::end()) .
- Parameters:
context – The device context where the buffers will be generated on
model – The model whose meshes will be used to generate the Buffers
vbos – An insert iterator to a std::Buffer container for the VBOs. Vbos will be inserted using this iterator.
ibos – An insert iterator to an std::Buffer container for the IBOs. Ibos will be inserted using this iterator.
pvr::utils::createSingleBuffersFromMesh#
Defined in HelperVk.h
Function Documentation#
-
inline void pvr::utils::createSingleBuffersFromMesh(pvrvk::Device &device, const assets::Mesh &mesh, pvrvk::Buffer &outVbo, pvrvk::Buffer &outIbo, pvrvk::CommandBuffer &uploadCmdBuffer, bool &requiresCommandBufferSubmission, vma::Allocator bufferAllocator = nullptr, vma::AllocationCreateFlags vmaAllocationCreateFlags = vma::AllocationCreateFlags::e_MAPPED_BIT)#
Auto generates a single VBO and a single IBO from all the vertex data of a mesh.
This utility function will read all vertex data from a mesh’s data elements and create a single VBO. It is commonly used for a single set of interleaved data. If data are not interleaved, they will be packed on the same VBO, each interleaved block (Data element on the mesh) will be appended at the end of the buffer, and the offsets will need to be calculated by the user when binding the buffer.
- Parameters:
device – The device where the buffers will be generated on
mesh – The mesh whose data will populate the buffers
outVbo – The VBO handle where the data will be put.
outIbo – The IBO handle where the data will be put. If no face data is present on the mesh, the handle will be null.
uploadCmdBuffer – A command buffer into which commands may be recorded for uploading mesh data to the created buffers. This command buffer will only be used when memory without e_HOST_VISIBLE_BIT memory property flags was allocated for the vbos or ibos.
requiresCommandBufferSubmission – Indicates whether commands have been recorded into the given command buffer.
bufferAllocator – A VMA allocator used to allocate memory for the created buffer.
vmaAllocationCreateFlags – VMA Allocation creation flags. These flags can be used to control how and where the memory is allocated from. Valid flags include e_DEDICATED_MEMORY_BIT and e_MAPPED_BIT. e_DEDICATED_MEMORY_BIT indicates that the allocation should have its own memory block. e_MAPPED_BIT indicates memory will be persistently mapped respectively. The default vma::AllocationCreateFlags::e_MAPPED_BIT is valid even if HOST_VISIBLE is not used - these flags will be ignored in this case.
pvr::utils::textureUpload#
Defined in HelperGles.h
Function Documentation#
-
inline GLuint pvr::utils::textureUpload(const IAssetProvider &app, const std::string &file, bool isEs2 = false)#
pvr::utils::convertToGles#
Defined in ConvertToGlesTypes.h
Function Documentation#
pvr::utils::formatWithTilingSupportsFeatureFlags#
Defined in HelperVk.h
Function Documentation#
-
bool pvr::utils::formatWithTilingSupportsFeatureFlags(pvrvk::Format imageFormat, pvrvk::ImageTiling imageTiling, pvrvk::FormatFeatureFlags formatFeatureFlags, const pvrvk::Instance instance, pvrvk::PhysicalDevice physicalDevice)#
Analyse if the image format provided with the image tiling option provided supports the format features provided as parameter.
- Parameters:
imageFormat – Image format to analyse.
imageTiling – Image tiling option to use when querying the format feature flags to query, currently implemented for tiling linear and tiling optimal options.
formatFeatureFlags – Format feature flags to query for the provided format and image tiling option.
instance – Vulkan instance.
physicalDevice – Physical device used for the test.
- Returns:
True if the image format given covers the requirements, false otherwise.
pvr::utils::generateIrradianceMap#
Defined in PBRUtilsGles.h
Function Documentation#
-
void pvr::utils::generateIrradianceMap(GLuint environmentMap, pvr::Texture &outTexture, GLuint &outTextureGles, uint32_t mapSize = 64, uint32_t mapNumSamples = 128)#
Generates a mipmapped diffuse irradiance map.
- Parameters:
environmentMap – The OpenGL ES texture to use as the source for the diffuse irradiance map.
outTexture – a pvr::Texture to use for the output diffuse irradiance map.
outTextureGles – An OpenGL ES texture to use as the output for the diffuse irradiance map.
mapSize – The size of the prefiltered environment map
mapNumSamples – The number of samples to use when generating the diffuse irradiance map
pvr::utils::createSingleBuffersFromMeshes#
Defined in HelperGles.h
Function Documentation#
-
template<typename MeshIterator_, typename VboContainer_, typename IboContainer_>
inline void pvr::utils::createSingleBuffersFromMeshes(MeshIterator_ meshIter, MeshIterator_ meshIterEnd, VboContainer_ &outVbos, typename VboContainer_::iterator vbos_where, IboContainer_ &outIbos, typename IboContainer_::iterator ibos_where)# Auto generates a set of VBOs and a set of IBOs from the vertex data of multiple meshes and insert them at the specified spot in a user-provided container.
This utility function will read all vertex data from a mesh’s data elements and create a single VBO. It is commonly used for a single set of interleaved data (mesh.getNumDataElements() == 1). If more data elements are present (i.e. more than a single interleaved data element) , they will be packed in the sameVBO, with each interleaved block (Data element ) appended at the end of the buffer. It is then the user’s responsibility to use the buffer correctly with the API (for example use bindbufferbase and similar) with the correct offsets.
- Parameters:
context – The device context where the buffers will be generated on
meshIter – Iterator for a collection of meshes.
meshIterEnd – End Iterator for meshIter.
outVbos – Collection of api::Buffer handles. It will be used to insert one VBO per mesh.
outIbos – Collection of api::Buffer handles. It will be used to insert one IBO per mesh. If face data is not present on the mesh, a null handle will be inserted.
vbos_where – Iterator on outVbos - the position where the insertion will happen.
ibos_where – Iterator on outIbos - the position where the insertion will happen.
pvr::utils::insertSorted_overwrite#
Defined in HelperGles.h
Function Documentation#
-
template<typename container, typename val, typename cmp>
size_t pvr::utils::insertSorted_overwrite(container &cont, const val &item, const cmp &compare)# Insert sorted element, Overwrite if element exist in the container.
- Parameters:
cont – Container to insert the element into.
item – Item to insert in to the container
compare – Comparison operator used for sorting
pvr::utils::insertSorted_overwrite#
Defined in HelperGles.h
Function Documentation#
-
template<typename container, typename val, typename cmp>
size_t pvr::utils::insertSorted_overwrite(container &cont, typename container::iterator begin, typename container::iterator end, const val &item, const cmp &compare)# Insert sorted element, Overwrite if element exist in the container.
- Parameters:
cont – Container to insert the element into.
begin – Container range begin
end – Container range end
item – Item to insert in to the container
compare – Comparison operator used for sorting
pvr::utils::convertToPVRVk#
Defined in ConvertToPVRVkTypes.h
Function Documentation#
-
inline pvrvk::StencilOpState pvr::utils::convertToPVRVk(const StencilState &op)#
Convert to pvrvk StencilOpState.
- Parameters:
op – The pvr::StencilState to convert
- Returns:
A pvrvk::StencilOpState representing the StencilState
pvr::utils::createInputAssemblyFromMesh#
Defined in HelperGles.h
Function Documentation#
-
inline VertexConfiguration pvr::utils::createInputAssemblyFromMesh(const assets::Mesh &mesh, const VertexBindings *bindingMap, uint16_t numBindings, uint16_t *outNumBuffers = NULL)#
pvr::utils::generatePreFilteredMapMipMapStyle#
Defined in PBRUtilsGles.h
Function Documentation#
-
void pvr::utils::generatePreFilteredMapMipMapStyle(GLuint environmentMap, pvr::Texture &outTexture, GLuint &outTextureGles, uint32_t mapSize, bool zeroRoughnessIsExternal, int numMipLevelsToDiscard, uint32_t mapNumSamples = 65536)#
Generate specular irradiance map. Each level of the specular mip map gets blurred corresponding to a roughness value from 0 to 1.0.
- Parameters:
environmentMap – The OpenGL ES texture to use as the source for the prefiltered environment map.
outTexture – a pvr::Texture to use for the output prefiltered environment map.
outTextureGles – An OpenGL ES texture to use as the output for the prefiltered environment map.
mapSize – The size of the prefiltered environment map
zeroRoughnessIsExternal – Denotes that the source environment map itself will be used for the prefiltered environment map mip map level corresponding to a roughness of 0.
numMipLevelsToDiscard – Denotes the number of mip map levels to discard from the bottom of the chain. Generally using the last n mip maps may introduce artifacts.
mapNumSamples – The number of samples to use when generating the prefiltered environment map
pvr::utils::throwOnGlError#
Defined in ErrorsGles.h
Function Documentation#
-
void pvr::utils::throwOnGlError(const char *note)#
Checks and logs api errors if appropriate.
- Parameters:
note – A c-style std::string that will be prepended to the error description if an error is found.
pvr::utils::convertToGles#
Defined in ConvertToGlesTypes.h
Function Documentation#
pvr::utils::uploadImage#
Defined in HelperVk.h
Function Documentation#
-
pvrvk::Image pvr::utils::uploadImage(pvrvk::Device &device, const Texture &texture, bool allowDecompress, pvrvk::CommandBuffer &commandBuffer, pvrvk::ImageUsageFlags usageFlags = pvrvk::ImageUsageFlags::e_SAMPLED_BIT, pvrvk::ImageLayout finalLayout = pvrvk::ImageLayout::e_SHADER_READ_ONLY_OPTIMAL, vma::Allocator stagingBufferAllocator = nullptr, vma::Allocator imageAllocator = nullptr, vma::AllocationCreateFlags imageAllocationCreateFlags = vma::AllocationCreateFlags::e_NONE)#
Upload image to gpu. The upload command and staging buffers are recorded in the commandbuffer.
- Parameters:
device – The device to use to create the image.
texture – The source pvr::Texture object from which to take the texture data.
allowDecompress – Specifies whether the texture can be decompressed as part of the image upload.
commandBuffer – A command buffer to which the upload operations should be added. Note that the upload will not be guranteed to be complete until the command buffer is submitted to a queue with appropriate synchronisation.
usageFlags – A command buffer to add the pipelineBarrier for the image transition.
finalLayout – The final image layout the image will be transitioned to.
stagingBufferAllocator – A VMA allocator used to allocate memory for the created staging buffer.
imageAllocator – A VMA allocator used to allocate memory for the created image.
imageAllocationCreateFlags – VMA Allocation creation flags. These flags can be used to control how and where the memory is allocated from. Valid flags include e_DEDICATED_MEMORY_BIT and e_MAPPED_BIT. e_DEDICATED_MEMORY_BIT indicates that the allocation should have its own memory block. e_MAPPED_BIT indicates memory will be persistently mapped respectively.
- Returns:
The image object.
pvr::utils::details::assignAttachmentIndexes#
Defined in HelperVk.h
Function Documentation#
-
inline void pvr::utils::details::assignAttachmentIndexes(bool hasDepth, bool isMultisampled, int &outColorIdx, int &outDepthIdx, int &outColorResolveIdx, int &outDepthResolveIdx)#
pvr::utils::vma::createAllocator#
Defined in MemoryAllocator.h
Function Documentation#
-
Allocator pvr::utils::vma::createAllocator(const AllocatorCreateInfo &createInfo)#
Creates a device memory allocator.
- Parameters:
createInfo – Specifies how the created device memory allocator will function
- Returns:
The created device memory allocator.
clutils::convertChannelContent#
Defined in OpenCLUtils.h
Function Documentation#
-
inline cl_channel_type clutils::convertChannelContent(int bits0, int bits1, int bits2, int bits3, pvr::VariableType type)#
clutils::convertChannelOrder#
Defined in OpenCLUtils.h
Function Documentation#
-
inline cl_channel_order clutils::convertChannelOrder(char ch0, char ch1, char ch2, char ch3)#
clutils::isExtensionSupported#
Defined in OpenCLUtils.h
Function Documentation#
-
inline bool clutils::isExtensionSupported(cl_platform_id platform, const char *extension)#
Determines whether the given OpenCL extension is supported.
- Parameters:
platform – The OpenCL platform.
extension – The OpenCL extension to check support for.
- Returns:
True if the given OpenCL extension is supported.
clutils::throwOnFailure#
Defined in OpenCLUtils.h
Function Documentation#
-
inline void clutils::throwOnFailure(cl_int err, const std::string &str)#
clutils::throwOnFailure#
Defined in OpenCLUtils.h
Function Documentation#
-
inline void clutils::throwOnFailure(cl_int err)#
clutils::loadKernelProgram#
Defined in OpenCLUtils.h
Function Documentation#
-
cl_program clutils::loadKernelProgram(const cl_context &ctx, const cl_device_id &device, const pvr::Stream &kernelSource, const char *compilerOptions = 0, const char *const *defines = 0, uint32_t defineCount = 0)#
Loads a kernel program.
- Parameters:
ctx – The OpenCL context.
device – The OpenCL device
kernelSource – The kernel source code
compilerOptions – A set of compiler option to use
defines – A list of defineCount defines to use in the shader
defineCount – The number of defines to use in the shader
- Returns:
The created kernel program
clutils::convertToOpenCLFormat#
Defined in OpenCLUtils.h
Function Documentation#
-
inline cl_image_format clutils::convertToOpenCLFormat(const pvr::PixelFormat &format, pvr::VariableType variableType, pvr::ColorSpace colorSpace)#
clutils::createOpenCLContext#
Defined in OpenCLUtils.h
Function Documentation#
-
inline void clutils::createOpenCLContext(cl_platform_id &outPlatform, cl_device_id &outDevice, cl_context &outContext, cl_command_queue &outQueue, cl_command_queue_properties queue_properties = 0, cl_device_type device_type = CL_DEVICE_TYPE_ALL, const char *const platformName = NULL, cl_int *err = 0)#
Creates an OpenCL context.
- Parameters:
outPlatform – The OpenCL platform to be created.
outDevice – The OpenCL device to be created.
outContext – The OpenCL context to be created.
outQueue – The OpenCL queue to be created.
queue_properties – The OpenCL queue properties
device_type – The OpenCL device type.
platformName – The OpenCL platform name to use.
err – The OpenCL error.
clutils::getOpenCLError#
Defined in OpenCLUtils.h
Function Documentation#
-
inline const char *clutils::getOpenCLError(cl_int error)#
Get a string representation of an OpenCL error code.
- Parameters:
error – The OpenCL error code
error – The OpenCL error code
- Returns:
The string representation of the OpenCL error code.