Rasterfarm-SDK
|
#include <implementation.h>
Classes | |
struct | SwapChainImage |
Public Types | |
typedef void GL_APIENTRY(* | GLDeleteVertexArrays_func) (GLsizei n, const GLuint *arrays) |
typedef void GL_APIENTRY(* | GLGenVertexArrays_func) (GLsizei n, GLuint *arrays) |
typedef GLboolean GL_APIENTRY(* | GLIsVertexArray_func) (GLuint array) |
typedef void GL_APIENTRY(* | GLInvalidateFramebuffer_func) (GLenum target, GLsizei numAttachments, const GLenum *attachments) |
typedef UnorderedMap< int, int > | ImplementationIntegerMap |
typedef UnorderedMap< int, HeapArray< int > > | ImplementationIntegerArrayMap |
typedef UnorderedMap< int, Vector2i > | ImplementationIntegerPairMap |
typedef UnorderedMap< int, Vector4i > | ImplementationIntegerGroupMap |
typedef UnorderedMap< int, float > | ImplementationFloatMap |
typedef UnorderedMap< int, Vector2f > | ImplementationFloatPairMap |
typedef UnorderedMap< int, Vector4f > | ImplementationFloatGroupMap |
Public Attributes | |
const GLStateUnorderedSet | glStateIntegerSet |
const GLStateUnorderedSet | glStateTextureBindingSet |
const GLStateUnorderedSet | glStateFloatSet |
const GLStateUnorderedSet | glStateIntegerPairSet = { GL_MAX_VIEWPORT_DIMS } |
const GLStateUnorderedSet | glStateFloatPairSet |
const GLStateUnorderedSet | glStateIntegerGroupSet = { GL_VIEWPORT } |
const GLStateUnorderedSet | glStateFloatGroupSet = { GL_COLOR_CLEAR_VALUE } |
const StateUnorderedSet | stateSet |
Static Public Attributes | |
static GLDeleteVertexArrays_func | deleteVertexArrays |
static GLGenVertexArrays_func | generateVertexArrays |
static GLIsVertexArray_func | isVertexArray |
static GLInvalidateFramebuffer_func | invalidateFramebuffer |
static const UnorderedMap< PixelFormat, uint > | pixelFormatStride |
Protected Member Functions | |
void | initialize () |
bool | getGlExtension (const char *str) |
int | getGlStateInteger (GLenum state) |
HeapArray< int > & | getGlStateTextureBinding (GLenum state) |
Vector2i | getGlStateIntegerPair (GLenum state) |
Vector4i | getGlStateIntegerGroup (GLenum state) |
float | getGlStateFloat (GLenum state) |
Vector2f | getGlStateFloatPair (GLenum state) |
Vector4f | getGlStateFloatGroup (GLenum state) |
Implementation () | |
~Implementation () | |
void | finish () |
void | uninitialize () |
void | initialize () |
Implementation () | |
~Implementation () | |
void | finish () |
void | uninitialize () |
VkInstance | createInstance (bool singleton=true) |
VkSurfaceKHR | createSurface () |
VkSwapchainKHR | createSwapChain (const HeapArray< PixelFormat > &preferredPixelFormat, VkSurfaceKHR vkSurace, uint advanceFrameSize=1) |
void | destroySwapChain (VkSwapchainKHR swapChain) |
Static Protected Member Functions | |
static int | getGlInteger (GLenum glState) |
static Vector2i | getGlIntegerPair (GLenum value) |
static Vector4i | getGlIntegerGroup (GLenum value) |
static float | getGlFloat (GLenum glState) |
static Vector2f | getGlFloatPair (GLenum value) |
static Vector4f | getGlFloatGroup (GLenum value) |
static void | mipmapServer () |
static void | presentQueueServer () |
static void | queueSubmitServer () |
static void | dynamicDestroyServer () |
Friends | |
class | SDL2Window |
class | GraphicsPipeline |
typedef void GL_APIENTRY(* Implementation::GLDeleteVertexArrays_func) (GLsizei n, const GLuint *arrays) |
typedef void GL_APIENTRY(* Implementation::GLGenVertexArrays_func) (GLsizei n, GLuint *arrays) |
typedef void GL_APIENTRY(* Implementation::GLInvalidateFramebuffer_func) (GLenum target, GLsizei numAttachments, const GLenum *attachments) |
typedef GLboolean GL_APIENTRY(* Implementation::GLIsVertexArray_func) (GLuint array) |
typedef UnorderedMap< int, Vector4f > Implementation::ImplementationFloatGroupMap |
typedef UnorderedMap< int, float > Implementation::ImplementationFloatMap |
typedef UnorderedMap< int, Vector2f > Implementation::ImplementationFloatPairMap |
typedef UnorderedMap< int, HeapArray< int > > Implementation::ImplementationIntegerArrayMap |
typedef UnorderedMap< int, Vector4i > Implementation::ImplementationIntegerGroupMap |
typedef UnorderedMap< int, int > Implementation::ImplementationIntegerMap |
typedef UnorderedMap< int, Vector2i > Implementation::ImplementationIntegerPairMap |
|
protected |
|
protected |
|
protected |
|
protected |
VkShaderModule Implementation::acquireShaderModule | ( | Shader * | pShader | ) |
void Implementation::activeTextureUnit | ( | GLuint | textureUnit | ) |
void Implementation::activeTextureUnit | ( | uint | textureUnit | ) |
void Implementation::bindAttributeBuffer | ( | VertexBufferHandle | vbo | ) |
void Implementation::bindElementBuffer | ( | VertexBufferHandle | vbo | ) |
void Implementation::bindFramebuffer | ( | FrameBufferHandle | frameBuffer | ) |
void Implementation::bindFramebuffer | ( | FrameBufferHandle | frameBuffer | ) |
If | handle is nullptr or BASE_FRAMEBUFFER_HANDLE the swap-chain image's framebuffer for the current-frame will be bound. |
void Implementation::bindRenderbuffer | ( | RenderBuffer * | pRenderBuffer | ) |
void Implementation::bindRenderbuffer | ( | RenderBufferHandle | renderBuffer | ) |
void Implementation::bindTexture2D | ( | GLuint | id | ) |
void Implementation::bindTextureCubeMap | ( | GLuint | id | ) |
void Implementation::bindVertexArray | ( | VertexArrayHandle | vao | ) |
void Implementation::clearBuffers | ( | uint | mask = COLOR_BUFFER|STENCIL_BUFFER|DEPTH_BUFFER | ) |
Clear the color, depth, and stencil buffers.
void Implementation::clearBuffers | ( | uint | mask = COLOR_BUFFER|STENCIL_BUFFER|DEPTH_BUFFER | ) |
Clear the color, depth, and stencil buffers.
void Implementation::clearColor | ( | const Vector4f & | color | ) |
void Implementation::clearColor | ( | const Vector4f & | color | ) |
VkCommandBuffer Implementation::createCommandBuffer | ( | VkCommandPool | commandPool, |
VkCommandBufferLevel | bufferLevel ) |
VkCommandPool Implementation::createCommandPool | ( | ) |
VkFence Implementation::createFence | ( | VkFenceCreateFlags | flags = 0 | ) |
FrameBufferHandle Implementation::createFrameBuffer | ( | ) |
VkFramebuffer Implementation::createFrameBuffer | ( | RenderBuffer * | pRenderBuffer, |
HeapArray< VkImageView > | vkImageView, | ||
uint | width, | ||
uint | height ) |
HeapArray< FrameBufferHandle > Implementation::createFrameBufferArray | ( | size_t | size | ) |
void Implementation::createGraphicsPipeline | ( | Program * | pProgram | ) |
VkImage Implementation::createImage | ( | const VkImageCreateInfo & | createInfo | ) |
void Implementation::createImageSampler | ( | Texture * | pTexture, |
TextureType | textureType ) |
VkImageView Implementation::createImageView | ( | VkImage | image, |
VkFormat | format, | ||
TextureType | textureType, | ||
uint | mipLevels = 1 ) |
|
protected |
True | if this instance is owned by the Implementation::instance - a singleton object |
void Implementation::createMipmaps | ( | Texture * | pTexture, |
TextureType | type ) |
VkPipelineCache Implementation::createPipelineCache | ( | uint | size = 0, |
void * | pBuffer = nullptr ) |
ProgramHandle Implementation::createProgram | ( | ) |
RenderBufferHandle Implementation::createRenderBuffer | ( | ) |
HeapArray< RenderBufferHandle > Implementation::createRenderBufferArray | ( | size_t | size | ) |
VkRenderPass Implementation::createRenderPass | ( | FrameBuffer * | pFrameBuffer, |
bool | display ) |
The | FrameBuffer to create a compatible render-pass for. |
True | if final render-pass color-layout if for the display(present). |
VkSampler Implementation::createSampler | ( | VkImageViewType | imageViewType | ) |
VkSemaphore Implementation::createSemaphore | ( | ) |
ShaderHandle Implementation::createShader | ( | ShaderType | type | ) |
ShaderHandle Implementation::createShader | ( | ShaderType | type | ) |
VkShaderModule Implementation::createShaderModule | ( | const HeapArray< uint > & | irCode | ) |
Handle Implementation::createShaderProgram | ( | ) |
|
protected |
|
protected |
Create a new swap-chain with the preferred pixel-format for the given surface.
The | preferred pixel-formats for the swap-chain image. |
The | surface for the given swap-chain. |
The | requested number of frames. NOTE: if frameSize is greater than the maximum supported |
TextureHandle Implementation::createTexture | ( | ) |
HeapArray< TextureHandle > Implementation::createTextureArray | ( | size_t | size | ) |
VkDescriptorPool Implementation::createUniformDescriptorPool | ( | const HeapArray< Pair< UniformDescriptorType, uint > > & | descriptorType | ) |
VertexArrayHandle Implementation::createVertexArrayObject | ( | ) |
HeapArray< VertexArrayHandle > Implementation::createVertexArrayObjectArray | ( | size_t | size | ) |
VertexBufferHandle Implementation::createVertexBuffer | ( | ) |
HeapArray< VertexBufferHandle > Implementation::createVertexBufferArray | ( | size_t | size | ) |
void Implementation::destroyBuffer | ( | VkBuffer | buffer | ) |
void Implementation::destroyCommandPool | ( | VkCommandPool | commandPool | ) |
void Implementation::destroyDescriptorPool | ( | VkDescriptorPool | pool | ) |
void Implementation::destroyDescriptorSetLayout | ( | VkDescriptorSetLayout | layout | ) |
void Implementation::destroyFence | ( | VkFence | semaphore | ) |
void Implementation::destroyFrameBuffer | ( | FrameBufferHandle | frameBufferHandle | ) |
Destroys the frame-buffer handle and associated command-buffer.
void Implementation::destroyFrameBuffer | ( | FrameBufferHandle | handle | ) |
void Implementation::destroyFrameBufferArray | ( | const HeapArray< FrameBufferHandle > & | array | ) |
void Implementation::destroyGraphicsPipeline | ( | Program * | pProgram | ) |
void Implementation::destroyImage | ( | VkImage | image | ) |
void Implementation::destroyImageSampler | ( | Texture * | pTexture | ) |
void Implementation::destroyImageView | ( | VkImageView | view | ) |
void Implementation::destroyMemory | ( | Memory * | pMemory | ) |
void Implementation::destroyPipeline | ( | VkPipeline | pipeline | ) |
void Implementation::destroyPipelineCache | ( | VkPipelineCache | pipelineCache | ) |
void Implementation::destroyPipelineLayout | ( | VkPipelineLayout | layout | ) |
void Implementation::destroyProgram | ( | ProgramHandle | handle | ) |
void Implementation::destroyRenderBuffer | ( | RenderBufferHandle | handle | ) |
void Implementation::destroyRenderBufferArray | ( | const HeapArray< RenderBufferHandle > & | array | ) |
void Implementation::destroyRenderPass | ( | VkRenderPass | renderPass | ) |
Destroys the render-buffer handle.
void Implementation::destroySampler | ( | VkSampler | sampler | ) |
void Implementation::destroySemaphore | ( | VkSemaphore | semaphore | ) |
void Implementation::destroyShader | ( | ShaderHandle | handle | ) |
void Implementation::destroyShader | ( | ShaderHandle | shader | ) |
void Implementation::destroyShaderModule | ( | VkShaderModule | handle | ) |
void Implementation::destroyShaderProgram | ( | ProgramHandle | handle | ) |
void Implementation::destroySurface | ( | VkSurfaceKHR | surface | ) |
|
protected |
void Implementation::destroyTexture | ( | TextureHandle | handle | ) |
void Implementation::destroyTextureArray | ( | const HeapArray< TextureHandle > & | array | ) |
void Implementation::destroyVertexArrayObject | ( | VertexArrayHandle | handle | ) |
void Implementation::destroyVertexArrayObjectArray | ( | const HeapArray< VertexArrayHandle > & | array | ) |
void Implementation::destroyVertexBuffer | ( | VertexBufferHandle | handle | ) |
void Implementation::destroyVertexBufferArray | ( | const HeapArray< VertexBufferHandle > & | array | ) |
void Implementation::disableState | ( | PipelineState | glState | ) |
|
staticprotected |
void Implementation::enableState | ( | const StateUnorderedSet & | stateSubSet | ) |
void Implementation::enableState | ( | PipelineState | glState | ) |
void Implementation::exportCurrentFrameToPng | ( | const char * | filename | ) |
Capture and export the current frame.
void Implementation::exportCurrentFrameToPng | ( | const char * | filename | ) |
Capture and export the current frame.
|
protected |
|
protected |
|
inline |
VkCommandPool Implementation::getCommandPool | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
GraphicsPipeline * Implementation::getGraphicsPipeline | ( | Program * | pProgram | ) |
VkDescriptorImageInfo & Implementation::getImageSampler | ( | TextureHandle | textureHandle | ) |
|
inline |
|
inline |
MemoryAllocator * Implementation::getMemoryAllocator | ( | MemoryType | memoryType | ) |
const VkMemoryHeap & Implementation::getMemoryHeap | ( | MemoryType | memoryType | ) |
const VkMemoryHeap & Implementation::getMemoryHeap | ( | uint | memoryHeapIndex | ) |
const VkMemoryType & Implementation::getMemoryType | ( | uint | heapIndex | ) |
uint Implementation::getMemoryTypeIndex | ( | MemoryType | type, |
uint | heapIndex ) |
|
inline |
|
inline |
VkFormatProperties Implementation::getPhysicalDeviceFormatProperties | ( | PixelFormat | format | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
RenderBuffer * Implementation::getPresentRenderBuffer | ( | ) |
|
inline |
FrameBufferHandle Implementation::getRenderingFrameBuffer | ( | ) |
|
inline |
|
inline |
|
inline |
RenderBuffer * Implementation::getRenderingRenderBuffer | ( | ) |
|
inline |
|
inline |
bool Implementation::hasDepthTexture | ( | ) |
bool Implementation::hasGraphicsPipeline | ( | Program * | pProgram | ) |
bool Implementation::hasImageSampler | ( | Texture * | pTexture | ) |
bool Implementation::hasImageSampler | ( | TextureHandle | textureHandle | ) |
bool Implementation::hasMemoryType | ( | MemoryType | memoryType | ) |
bool Implementation::hasShaderModule | ( | Shader * | pShader | ) |
|
protected |
Once the platform is initialized, this method should be called and only needs to be called once.
|
protected |
|
staticprotected |
The method runs-on a dedicated thread with a dedicated command-pool/buffer that only performs the generation of mip-maps.
|
staticprotected |
void Implementation::presentQueueSubmit | ( | Pair< uint, VkSemaphore > | swapIndex | ) |
void Implementation::queueSubmit | ( | CommandBuffer * | pCommandBuffer | ) |
void Implementation::queueSubmit | ( | const HeapArray< CommandBuffer * > & | pCommandBuffer | ) |
|
staticprotected |
void Implementation::releaseShaderModule | ( | Shader * | pShader | ) |
uint Implementation::renderBufferSize | ( | ) |
Number of render buffers available. This does not include the number currently in-use.
void Implementation::scissorBuffer | ( | uint | offsetX, |
uint | offsetY, | ||
uint | width, | ||
uint | height ) |
Clip or scissor the window-buffer.
offsetX | The horizontal offset of the clip plane. |
offsetY | The vertical offset of the clip plane |
width | The width of the clip plane |
height | The height of the clip plane |
void Implementation::setBlendAlphaFunctions | ( | BlendFactor | sBlendFactor, |
BlendFactor | dBlendFactor ) |
void Implementation::setCullFaceMode | ( | CullFace | mode | ) |
void Implementation::setDepthTestFunction | ( | CompareOperation | function | ) |
void Implementation::setDepthTestWriteMask | ( | GLuint | mask | ) |
void Implementation::setFrontFaceOrientation | ( | VertexOrientation | orientation | ) |
void Implementation::setLineWidth | ( | float | width | ) |
void Implementation::setSampleCoverage | ( | float | value, |
bool | invert ) |
void Implementation::setSampleCoverage | ( | float | value, |
bool | invert ) |
void Implementation::setStencilFunctions | ( | CompareOperation | function, |
int | value, | ||
uint | mask ) |
void Implementation::setStencilOperations | ( | StencilOperation | fail, |
StencilOperation | depthFail, | ||
StencilOperation | depthPass ) |
void Implementation::swapBuffers | ( | ) |
Swap the front and back buffers.
void Implementation::swapBuffers | ( | ) |
Rotate the swap-chain buffers.
uint Implementation::textureUnitSize | ( | ) |
Number of texture units available. This does not include the number currently in-use.
uint Implementation::textureUnitSize | ( | ) |
Number of texture units available. This does not include the number currently in-use.
uint Implementation::uniformVectorSize | ( | GLenum | type | ) |
Number of shader uniform vectors available. This does not include the number currently in-use.
|
protected |
|
protected |
uint Implementation::varyingVectorSize | ( | ) |
Number of shader varying vectors available. This does not include the number currently in-use.
bool Implementation::vertexArrayObjectSupport | ( | ) |
uint Implementation::vertexAttributeSize | ( | ) |
Number of shader vertex attributes available. This does not include the number currently in-use.
|
friend |
|
friend |
|
protected |
The number of present-images that can be acquired in-advance of current frame.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Synchronizes the destruction of objects after the the current swap-image frame has rendered.
|
protected |
A dedicated-thread for destruction of vulkan resources. This thread will run post-frame
|
protected |
|
static |
const GLStateUnorderedSet Implementation::glStateFloatGroupSet = { GL_COLOR_CLEAR_VALUE } |
const GLStateUnorderedSet Implementation::glStateFloatPairSet |
const GLStateUnorderedSet Implementation::glStateFloatSet |
const GLStateUnorderedSet Implementation::glStateIntegerGroupSet = { GL_VIEWPORT } |
const GLStateUnorderedSet Implementation::glStateIntegerPairSet = { GL_MAX_VIEWPORT_DIMS } |
const GLStateUnorderedSet Implementation::glStateIntegerSet |
const GLStateUnorderedSet Implementation::glStateTextureBindingSet |
|
protected |
|
protected |
Handle to the dispatchable application-instance.
|
protected |
|
static |
|
static |
|
protected |
Handle to the dispatchable logical-device.
|
protected |
Memory-pools for each memory-heap.
|
protected |
|
protected |
The index of the memory-type for the give heap-index;
|
protected |
|
protected |
Serializes all jobs for this thread.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Handle to the dispatchable physical-device.
|
protected |
The physical-device features.
|
protected |
The format-properties for the physical-device.
|
protected |
The memory-properties for the physical-device.
|
protected |
The physical-device properties. NOTE: there are memory-properties there too...
|
protected |
|
static |
|
protected |
|
protected |
|
protected |
Set by useProgram()
|
protected |
Optimal format.
|
protected |
Optimal format.
|
protected |
This Queue-Array is specific-to the physical-device.
|
protected |
Prevent simultaneous calls to vkSubmitQueue from different threads, one for each graphics-present queue.
|
protected |
2 semaphores allow 1 image to be aquired in-advance of rendering the current frame.
|
protected |
Dedicated thread for frame presentation to display.
|
protected |
|
protected |
Indices of the swap-images presented to the display and associated wait-semaphores.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Serializes all jobs for this thread.
|
protected |
|
protected |
|
protected |
GLSL hash for SPIR-V shader-module
|
protected |
|
protected |
const StateUnorderedSet Implementation::stateSet |
|
protected |
Handle to the non-dispatchable window-surface
|
protected |
Handle to the non-dispatchable swap-chain.
|
protected |
|
protected |
|
protected |
Handle for swap-chain images.
|
protected |
Index of currently-acquired swap-image within the chain.