Beatmup
|
Internal low-level GPU control API. More...
#include <pipeline.h>
Classes | |
class | Impl |
Public Types | |
enum class | Mode { RENDERING , INFERENCE } |
Graphic pipeline working mode setting some common OpenGL switches. More... | |
enum class | Limit { TEXTURE_IMAGE_UNITS , FRAGMENT_UNIFORM_VECTORS , LOCAL_GROUPS_X , LOCAL_GROUPS_Y , LOCAL_GROUPS_Z , LOCAL_GROUPS_TOTAL , SHARED_MEM } |
GPU characteristics. More... | |
Public Member Functions | |
GraphicPipeline () | |
~GraphicPipeline () | |
void | switchDisplay (void *data) |
void | swapBuffers () |
void | bindOutput (AbstractBitmap &bitmap) |
Binds a bitmap to the pipeline output. More... | |
void | bindOutput (AbstractBitmap &bitmap, const IntRectangle &viewport) |
Binds a bitmap to the pipeline output. More... | |
void | bindOutput (GL::TextureHandler &texture) |
void | bindOutput (GL::handle_t texture) |
void | unbindOutput () |
Unbinds a bitmap from output and switches to screen. More... | |
const ImageResolution & | getDisplayResolution () const |
void | bind (GL::TextureHandler &texture, size_t texUnit, const TextureParam param) |
void | bind (GL::TextureHandler &texture, size_t imageUnit, bool read, bool write) |
void | pullPixels (AbstractBitmap &bitmap) |
Transfers bitmap pixels from GPU to CPU. More... | |
void | pushPixels (AbstractBitmap &bitmap) |
Transfers bitmap pixels from CPU to GPU. More... | |
void | flush () |
Waits until all operations submitted to GPU are finished. More... | |
int | getLimit (Limit limit) const |
void | switchMode (Mode mode) |
Switches GPU mode. More... | |
GL::RenderingPrograms & | getRenderingPrograms () |
const GL::VertexShader & | getDefaultVertexShader () const |
const char * | getGpuVendorString () const |
const char * | getGpuRendererString () const |
int | getGlslVersion () const |
Returns GLSL language version supported by the GPU context being used. More... | |
bool | isGlEsCompliant () const |
Returns true if the GPU context is OpenGL ES-compliant. More... | |
void | setTextureCoordinates (const Rectangle &coords) |
Specifies texture coordinates for the next rendering pass. More... | |
void | setTextureCoordinates (const Point &leftTop, const Point &rightTop, const Point &leftBottom, const Point &rightBottom) |
Specifies texture coordinates for the next rendering pass. More... | |
void | setTextureCoordinates (const Rectangle &area, const IntPoint &size, const IntPoint &sampling) |
Specifies texture coordinates for the next rendering pass. More... | |
Static Public Member Functions | |
static Rectangle | getTextureCoordinates (const Rectangle &area, const IntPoint &size, const IntPoint &sampling) |
Computes floating-point texture coordinates for pixel-accurate sampling: a texture gets sampled exactly at specified pixel locations. More... | |
Static Public Attributes | |
static const int | ATTRIB_VERTEX_COORD = 0 |
vertex coordinate attribute index in the VBO More... | |
static const int | ATTRIB_TEXTURE_COORD = 1 |
texture coordinate attribute index in the VBO More... | |
Private Member Functions | |
GraphicPipeline (const GraphicPipeline &)=delete | |
Private Attributes | |
Impl * | impl |
GL::RenderingPrograms * | renderingPrograms |
Friends | |
class | GL::TextureHandler |
Internal low-level GPU control API.
Hides OpenGL stuff from intsances of AbstractTask operating with images. A GraphicPipeline instance is likely a singleton accessible from a single thread.
Definition at line 33 of file pipeline.h.
|
strong |
Graphic pipeline working mode setting some common OpenGL switches.
Enumerator | |
---|---|
RENDERING | Textures are images to be blended together to produce another image. |
INFERENCE | Textures are feature maps computed in fragment shaders. |
Definition at line 47 of file pipeline.h.
|
strong |
GPU characteristics.
Definition at line 55 of file pipeline.h.
|
privatedelete |
GraphicPipeline::GraphicPipeline | ( | ) |
Definition at line 858 of file pipeline.cpp.
GraphicPipeline::~GraphicPipeline | ( | ) |
Definition at line 865 of file pipeline.cpp.
void GraphicPipeline::switchDisplay | ( | void * | data | ) |
Definition at line 871 of file pipeline.cpp.
void GraphicPipeline::swapBuffers | ( | ) |
Definition at line 876 of file pipeline.cpp.
void GraphicPipeline::bindOutput | ( | AbstractBitmap & | bitmap | ) |
Binds a bitmap to the pipeline output.
[in] | bitmap | A bitmap to be filled with pixels on the next render pass. |
Definition at line 891 of file pipeline.cpp.
void GraphicPipeline::bindOutput | ( | AbstractBitmap & | bitmap, |
const IntRectangle & | viewport | ||
) |
Binds a bitmap to the pipeline output.
[in] | bitmap | A bitmap to be filled with pixels on the next render pass. |
[in] | viewport | Output viewport in pixels: only this area of the bitmap will be affected |
Definition at line 896 of file pipeline.cpp.
void GraphicPipeline::bindOutput | ( | GL::TextureHandler & | texture | ) |
Definition at line 901 of file pipeline.cpp.
void GraphicPipeline::bindOutput | ( | GL::handle_t | texture | ) |
Definition at line 906 of file pipeline.cpp.
void GraphicPipeline::unbindOutput | ( | ) |
const ImageResolution & GraphicPipeline::getDisplayResolution | ( | ) | const |
Definition at line 916 of file pipeline.cpp.
void GraphicPipeline::bind | ( | GL::TextureHandler & | texture, |
size_t | texUnit, | ||
const TextureParam | param | ||
) |
Definition at line 881 of file pipeline.cpp.
void GraphicPipeline::bind | ( | GL::TextureHandler & | texture, |
size_t | imageUnit, | ||
bool | read, | ||
bool | write | ||
) |
Definition at line 886 of file pipeline.cpp.
void GraphicPipeline::pullPixels | ( | AbstractBitmap & | bitmap | ) |
Transfers bitmap pixels from GPU to CPU.
The bitmap is assumed locked.
Definition at line 921 of file pipeline.cpp.
void GraphicPipeline::pushPixels | ( | AbstractBitmap & | bitmap | ) |
Transfers bitmap pixels from CPU to GPU.
The bitmap is assumed locked.
Definition at line 926 of file pipeline.cpp.
void GraphicPipeline::flush | ( | ) |
Waits until all operations submitted to GPU are finished.
Definition at line 931 of file pipeline.cpp.
int GraphicPipeline::getLimit | ( | Limit | limit | ) | const |
Definition at line 936 of file pipeline.cpp.
void GraphicPipeline::switchMode | ( | Mode | mode | ) |
Switches GPU mode.
Definition at line 941 of file pipeline.cpp.
|
inline |
Definition at line 125 of file pipeline.h.
|
inline |
Definition at line 126 of file pipeline.h.
const char * GraphicPipeline::getGpuVendorString | ( | ) | const |
Definition at line 946 of file pipeline.cpp.
const char * GraphicPipeline::getGpuRendererString | ( | ) | const |
Definition at line 951 of file pipeline.cpp.
int GraphicPipeline::getGlslVersion | ( | ) | const |
Returns GLSL language version supported by the GPU context being used.
Definition at line 956 of file pipeline.cpp.
bool GraphicPipeline::isGlEsCompliant | ( | ) | const |
Returns true
if the GPU context is OpenGL ES-compliant.
Definition at line 961 of file pipeline.cpp.
void GraphicPipeline::setTextureCoordinates | ( | const Rectangle & | coords | ) |
Specifies texture coordinates for the next rendering pass.
[in] | coords | Normalized texture coordinates |
Definition at line 966 of file pipeline.cpp.
void GraphicPipeline::setTextureCoordinates | ( | const Point & | leftTop, |
const Point & | rightTop, | ||
const Point & | leftBottom, | ||
const Point & | rightBottom | ||
) |
Specifies texture coordinates for the next rendering pass.
[in] | leftTop | Top left output image corner texture coordinates |
[in] | rightTop | Top right output image corner texture coordinates |
[in] | leftBottom | Bottom left output image corner texture coordinates |
[in] | rightBottom | Bottom right output image corner texture coordinates |
Definition at line 971 of file pipeline.cpp.
|
inline |
Specifies texture coordinates for the next rendering pass.
[in] | area | A closed rectangle in pixels of a texture to sample; all its corners are valid sampling locations. |
[in] | size | Size in pixels of the input texture |
[in] | sampling | Number of resulting samples covering the area |
Definition at line 163 of file pipeline.h.
|
static |
Computes floating-point texture coordinates for pixel-accurate sampling: a texture gets sampled exactly at specified pixel locations.
[in] | area | A closed rectangle in pixels of a texture to sample; all its corners are valid sampling locations. |
[in] | size | Size in pixels of the input texture |
[in] | sampling | Number of resulting samples covering the area |
Definition at line 976 of file pipeline.cpp.
|
friend |
Definition at line 34 of file pipeline.h.
|
private |
Definition at line 37 of file pipeline.h.
|
private |
Definition at line 39 of file pipeline.h.
|
static |
vertex coordinate attribute index in the VBO
Definition at line 66 of file pipeline.h.
|
static |
texture coordinate attribute index in the VBO
Definition at line 67 of file pipeline.h.