Project
Loading...
Searching...
No Matches
GPUDisplayBackendOpenGL.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
15#ifdef GPUCA_DISPLAY_GL3W
16#include "GL/gl3w.h"
17#else
18#include <GL/glew.h>
19#endif
20#if __has_include(<GL/glu.h>)
21#include <GL/glu.h>
22#else
23#define gluErrorString(err) ""
24#endif
25#include "HandMadeMath.h"
26
27#include "GPUCommonDef.h"
29#include "GPUDisplay.h"
30#include "GPULogging.h"
31#include "GPUParam.h"
32#include "GPUTPCGeometry.h"
33
34#define OPENGL_EMULATE_MULTI_DRAW 0
35
36using namespace o2::gpu;
37
38#define GPUCA_DISPLAY_SHADER_TYPE_OPENGL
39#include "GPUDisplayLoadShaders.h"
40
41uint32_t GPUDisplayBackendOpenGL::loadShader(uint32_t type, const char* spirv, size_t size)
42{
45 glSpecializeShader(shader, "main", 0, nullptr, nullptr);
46 return shader;
47}
48
54
56{
57#ifdef GPUCA_DISPLAY_GL3W
58 return gl3wInit();
59#else
60 return glewInit();
61#endif
62}
63
68
69// #define CHKERR(cmd) {cmd;}
70#define CHKERR(cmd) \
71 do { \
72 (cmd); \
73 GLenum err = glGetError(); \
74 while (err != GL_NO_ERROR) { \
75 GPUError("OpenGL Error %d: %s (%s: %d)", (int32_t)err, (const char*)gluErrorString(err), __FILE__, __LINE__); \
76 throw std::runtime_error("OpenGL Failure"); \
77 } \
78 } while (false)
79
80void GPUDisplayBackendOpenGL::createFB(GLfb& fb, bool tex, bool withDepth, bool msaa, uint32_t width, uint32_t height)
81{
82 fb.tex = tex;
83 fb.depth = withDepth;
84 fb.msaa = msaa;
85 GLint drawFboId = 0, readFboId = 0;
90
91 auto createFB_texture = [&](GLuint& id, GLenum storage, GLenum attachment) {
93 CHKERR(glGenTextures(1, &id));
94 CHKERR(glBindTexture(textureType, id));
95 if (fb.msaa) {
97 } else {
98 CHKERR(glTexImage2D(GL_TEXTURE_2D, 0, storage, width, height, 0, storage, GL_UNSIGNED_BYTE, nullptr));
101 }
103 };
104
105 auto createFB_renderbuffer = [&](GLuint& id, GLenum storage, GLenum attachment) {
106 CHKERR(glGenRenderbuffers(1, &id));
108 if (fb.msaa) {
110 } else {
112 }
114 };
115
116 if (tex) {
117 createFB_texture(fb.fbCol_id, GL_RGBA, GL_COLOR_ATTACHMENT0);
118 } else {
119 createFB_renderbuffer(fb.fbCol_id, GL_RGBA, GL_COLOR_ATTACHMENT0);
120 }
121
122 if (withDepth) {
123 if (tex && fb.msaa) {
125 } else {
126 createFB_renderbuffer(fb.fbDepth_id, GL_DEPTH_COMPONENT24, GL_DEPTH_ATTACHMENT);
127 }
128 }
129
131 if (status != GL_FRAMEBUFFER_COMPLETE) {
132 GPUError("Error creating framebuffer (tex %d) - incomplete (%d)", (int32_t)tex, status);
133 exit(1);
134 }
137 fb.created = true;
138}
139
141{
142 if (fb.tex) {
144 } else {
146 }
147 if (fb.depth) {
148 if (fb.tex && fb.msaa) {
150 } else {
152 }
153 }
155 fb.created = false;
156}
157
159{
160 static constexpr GLenum types[3] = {GL_POINTS, GL_LINES, GL_LINE_STRIP};
161 GLenum t = types[tt];
162 auto first = std::get<0>(v);
163 auto count = std::get<1>(v);
164 auto iSector = std::get<2>(v);
165 if (count == 0) {
166 return 0;
167 }
168
169 if (mDisplay->useMultiVBO()) {
172 CHKERR(glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, nullptr));
174 }
175
176 const uint32_t smoothProgram = tt == POINTS ? (mDisplay->cfgL().smoothPoints ? mShaderProgramSmoothPoint : 0) : (mDisplay->cfgL().smoothLines ? mShaderProgramSmoothLine : 0);
177 if (smoothProgram) {
178 CHKERR(glUseProgram(smoothProgram));
179 }
180 if (mDisplay->cfgR().useGLIndirectDraw) {
182 } else if (OPENGL_EMULATE_MULTI_DRAW) {
183 for (uint32_t k = 0; k < count; k++) {
185 }
186 } else {
187 static_assert(sizeof(GLsizei) == sizeof(*mDisplay->vertexBufferCount()[iSector].data()), "Invalid counter size does not match GLsizei");
189 }
190 if (smoothProgram) {
192 }
193 return count;
194}
195
206
208{
209 if (mDisplay->cfgR().drawQualityMSAA > 1) {
211 } else {
213 }
214}
215
217{
218 if (mDisplay->cfgL().depthBuffer) {
219 CHKERR(glEnable(GL_DEPTH_TEST)); // Enables Depth Testing
220 CHKERR(glDepthFunc(GL_LEQUAL)); // The Type Of Depth Testing To Do
221 } else {
223 }
224}
225
227{
228 if (newID == 0) {
231 } else {
233 GLenum drawBuffer = GL_COLOR_ATTACHMENT0;
234 glDrawBuffers(1, &drawBuffer);
235 }
236}
237
239{
240 int32_t status, loglen;
242 if (!status) {
243 printf("failed to compile shader\n");
245 std::vector<char> buf(loglen + 1);
246 glGetShaderInfoLog(shader, loglen, nullptr, buf.data());
247 buf[loglen] = 0;
248 printf("%s\n", buf.data());
249 return 1;
250 }
251 return 0;
252}
253
255{
256 int32_t status, loglen;
258 if (!status) {
259 printf("failed to link program\n");
261 std::vector<char> buf(loglen + 1);
262 glGetProgramInfoLog(program, loglen, nullptr, buf.data());
263 buf[loglen] = 0;
264 printf("%s\n", buf.data());
265 return 1;
266 }
267 return 0;
268}
269
271{
272 for (GLenum err = glGetError(); err != GL_NO_ERROR; err = glGetError()) { // Left by the frontend (freeglut with a core profile context leaves GL_INVALID_ENUM), CHKERR below would report it for the wrong call
273 if (mDisplay->GetProcessingSettings().debugLevel >= 2) {
274 GPUInfo("Ignoring OpenGL error %d from before the backend initialization", (int32_t)err);
275 }
276 }
277 if (mDisplay->GetProcessingSettings().debugLevel >= 2) {
279 GPUInfo("Renderer: %s", (const char*)renderer);
280 }
281
282 int32_t glVersion[2] = {0, 0};
283 glGetIntegerv(GL_MAJOR_VERSION, &glVersion[0]);
284 glGetIntegerv(GL_MINOR_VERSION, &glVersion[1]);
286 GPUError("Unsupported OpenGL runtime %d.%d < %d.%d", glVersion[0], glVersion[1], GPUDisplayFrontend::GL_MIN_VERSION_MAJOR, GPUDisplayFrontend::GL_MIN_VERSION_MINOR);
287 return (1);
288 }
290 GLint value = 0;
291 glGetIntegerv(limit, &value);
292 mMaxRenderSize = std::min<uint32_t>(mMaxRenderSize, value);
293 }
294 mVBOId.resize(GPUTPCGeometry::NSECTORS);
295 CHKERR(glCreateBuffers(mVBOId.size(), mVBOId.data()));
300 setQuality();
301 CHKERR(mVertexShader = loadShader(GL_VERTEX_SHADER, _binary_opengl_vertex_vert_spv_start, _binary_opengl_vertex_vert_spv_len));
302 CHKERR(mFragmentShader = loadShader(GL_FRAGMENT_SHADER, _binary_opengl_fragment_frag_spv_start, _binary_opengl_fragment_frag_spv_len));
303 CHKERR(mVertexShaderTexture = loadShader(GL_VERTEX_SHADER, _binary_opengl_vertexTexture_vert_spv_start, _binary_opengl_vertexTexture_vert_spv_len));
304 CHKERR(mFragmentShaderTexture = loadShader(GL_FRAGMENT_SHADER, _binary_opengl_fragmentTexture_frag_spv_start, _binary_opengl_fragmentTexture_frag_spv_len));
305 CHKERR(mFragmentShaderText = loadShader(GL_FRAGMENT_SHADER, _binary_opengl_fragmentText_frag_spv_start, _binary_opengl_fragmentText_frag_spv_len));
306 CHKERR(mVertexShaderFullscreen = loadShader(GL_VERTEX_SHADER, _binary_opengl_vertexFullscreen_vert_spv_start, _binary_opengl_vertexFullscreen_vert_spv_len));
307 CHKERR(mFragmentShaderDownsample = loadShader(GL_FRAGMENT_SHADER, _binary_opengl_fragmentDownsample_frag_spv_start, _binary_opengl_fragmentDownsample_frag_spv_len));
308 CHKERR(mVertexShaderSmoothPoint = loadShader(GL_VERTEX_SHADER, _binary_opengl_vertexSmoothPoint_vert_spv_start, _binary_opengl_vertexSmoothPoint_vert_spv_len));
309 CHKERR(mFragmentShaderSmoothPoint = loadShader(GL_FRAGMENT_SHADER, _binary_opengl_fragmentSmoothPoint_frag_spv_start, _binary_opengl_fragmentSmoothPoint_frag_spv_len));
310 CHKERR(mVertexShaderSmoothLine = loadShader(GL_VERTEX_SHADER, _binary_opengl_vertexSmoothLine_vert_spv_start, _binary_opengl_vertexSmoothLine_vert_spv_len));
311 CHKERR(mFragmentShaderSmoothLine = loadShader(GL_FRAGMENT_SHADER, _binary_opengl_fragmentSmoothLine_frag_spv_start, _binary_opengl_fragmentSmoothLine_frag_spv_len));
313 return 1;
314 }
320 return 1;
321 }
327 return 1;
328 }
334 return 1;
335 }
341 return 1;
342 }
348 return 1;
349 }
355 return 1;
356 }
358
363 CHKERR(glBufferData(GL_ARRAY_BUFFER, sizeof(float) * 6 * 4, nullptr, GL_DYNAMIC_DRAW));
365 CHKERR(glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 4 * sizeof(float), nullptr));
367
369 return 0;
370}
371
373{
375 CHKERR(glDeleteBuffers(mVBOId.size(), mVBOId.data()));
394
396
399
403 for (auto& symbol : mFontSymbols) {
404 CHKERR(glDeleteTextures(1, &symbol.texId));
405 }
406 }
409 }
410}
411
413{
414 if (mDisplay->cfgL().invertColors && !alphaOnly) {
415 CHKERR(glClearColor(1.0f, 1.0f, 1.0f, 1.0f));
416 } else {
417 CHKERR(glClearColor(0.0f, 0.0f, 0.0f, 1.0f));
418 }
419 if (alphaOnly) {
420 glColorMask(false, false, false, true);
422 glColorMask(true, true, true, true);
423 } else {
424 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen And Depth Buffer
425 }
426}
427
429{
430 if (mDisplay->useMultiVBO()) {
431 for (uint32_t i = 0; i < GPUTPCGeometry::NSECTORS; i++) {
433 }
434 } else {
435 CHKERR(glBindBuffer(GL_ARRAY_BUFFER, mVBOId[0])); // Bind ahead of time, since it is not going to change
436 CHKERR(glNamedBufferData(mVBOId[0], totalVertizes * sizeof(mDisplay->vertexBuffer()[0][0]), mDisplay->vertexBuffer()[0].data(), GL_STATIC_DRAW));
437 }
438
439 if (mDisplay->cfgR().useGLIndirectDraw) {
442 mCmdBuffer.clear();
443 }
444}
445
446bool GPUDisplayBackendOpenGL::prepareDraw(const hmm_mat4& proj, const hmm_mat4& view, bool requestScreenshot, bool toMixBuffer, float includeMixImage)
447{
448 if (mDisplay->updateRenderPipeline() || mDownsampleFactor != getDownsampleFactor(requestScreenshot)) {
449 updateRenderer(requestScreenshot);
450 }
451 if (toMixBuffer && !mMixBuffer.created) { // Only allocated when mixing is used, freed with the other offscreen buffers
452 createFB(mMixBuffer, true, true, false, mRenderWidth, mRenderHeight);
453 }
456 } else if (toMixBuffer) {
458 } else if (mOffscreenBuffer.created) {
460 } else {
462 }
463 clearScreen();
466
470 CHKERR(glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, nullptr));
472
473 const hmm_mat4 modelViewProj = proj * view;
475 if (mDisplay->cfgL().smoothPoints) {
477 }
478 if (mDisplay->cfgL().smoothLines) {
481 }
483 CHKERR(glNamedBufferSubData(mFieldModelViewBuffer, 0, sizeof(modelViewProj), &modelViewProj));
484 }
485 return true;
486}
487
488void GPUDisplayBackendOpenGL::finishDraw(bool doScreenshot, bool toMixBuffer, float includeMixImage)
489{
492
494 uint32_t dstId = toMixBuffer ? mMixBuffer.fb_id : (mDownsampleFactor != 1 ? mOffscreenBuffer.fb_id : 0);
496 }
497 if (includeMixImage > 0) {
499 mixImages(includeMixImage);
500 }
501 if (mDownsampleFactor == 2 && !toMixBuffer) { // The linear blit is only exact for factor 2
503 } else if (mDownsampleFactor != 1 && !toMixBuffer) {
505 }
506
507 if (doScreenshot && !toMixBuffer) {
509 }
510}
511
513{
514 int32_t scaleFactor = mDisplay->cfgR().screenshotScaleFactor;
515 uint32_t width = mScreenWidth * scaleFactor;
516 uint32_t height = mScreenHeight * scaleFactor;
517 GLfb tmpBuffer;
518 if (mDisplay->cfgR().drawQualityDownsampleFSAA && mDisplay->cfgR().screenshotScaleFactor != 1) {
519 createFB(tmpBuffer, false, true, false, width, height);
521 if (factor > 2) {
523 } else {
525 }
526 }
527 setFrameBuffer(tmpBuffer.created ? tmpBuffer.fb_id : (scaleFactor != 1 ? mOffscreenBuffer.fb_id : 0));
529 CHKERR(glReadBuffer(scaleFactor != 1 ? GL_COLOR_ATTACHMENT0 : GL_BACK));
530 mScreenshotPixels.resize(width * height * 4);
532 if (tmpBuffer.created) {
533 deleteFB(tmpBuffer);
534 }
535}
536
537void GPUDisplayBackendOpenGL::finishFrame(bool doScreenshot, bool toMixBuffer, float includeMixImage) {}
538
553
562
563void GPUDisplayBackendOpenGL::drawDownsample(uint32_t srcTexture, uint32_t dstFramebuffer, uint32_t width, uint32_t height, int32_t factor)
564{
565 setFrameBuffer(dstFramebuffer);
566 CHKERR(glViewport(0, 0, width, height));
572 CHKERR(glBindTexture(GL_TEXTURE_2D, srcTexture));
573 CHKERR(glBindVertexArray(VAO_texture)); // Any VAO, the full-screen triangle has no vertex input
580}
581
600
609
611{
612 float width = mDisplay->cfgL().lineWidth * mDownsampleFactor * factor;
613 if (mDisplay->cfgL().smoothLines) {
616 width *= 1.4143f; // Wide lines are parallelograms in OpenGL, widen so that the perpendicular width is covered
617 }
619}
620
621void GPUDisplayBackendOpenGL::addFontSymbol(int32_t symbol, int32_t sizex, int32_t sizey, int32_t offsetx, int32_t offsety, int32_t advance, void* data)
622{
623 int32_t oldAlign;
626 if (symbol != (int32_t)mFontSymbols.size()) {
627 throw std::runtime_error("Incorrect symbol ID");
628 }
629 uint32_t texId;
630 glGenTextures(1, &texId);
631 std::vector<uint8_t> tmp;
632 if (!smoothFont()) {
633 tmp.resize(sizex * sizey);
634 uint8_t* src = (uint8_t*)data;
635 for (int32_t i = 0; i < sizex * sizey; i++) {
636 tmp[i] = src[i] > 128 ? 255 : 0;
637 }
638 data = tmp.data();
639 }
640 mFontSymbols.emplace_back(FontSymbolOpenGL{{{sizex, sizey}, {offsetx, offsety}, advance}, texId});
641 if (sizex == 0 || sizey == 0) {
642 return;
643 }
651}
652
654{
657 for (auto& symbol : mFontSymbols) {
658 CHKERR(glDeleteTextures(1, &symbol.texId));
659 }
660 mFontSymbols.clear();
661}
662
675
676void GPUDisplayBackendOpenGL::GLPrintText(const char* s, float x, float y, float* color, float scale, uint32_t nCharacters)
677{
679 return;
680 }
682
683 if (smoothFont()) {
684 scale *= 0.25f; // Font size is 48 to have nice bitmap, scale to size 12
685 }
686 for (const unsigned char* c = (const unsigned char*)s; *c && (nCharacters == 0 || c < (const unsigned char*)s + nCharacters); c++) {
687 if (*c < 32 || *c >= SOLID_GLYPH) { // Printable ASCII only, SOLID_GLYPH is not a character
688 GPUError("Trying to draw unsupported symbol: %d", (int32_t)*c);
689 continue;
690 }
692 if (sym.size[0] && sym.size[1]) {
693 float xpos = x + sym.offset[0] * scale;
694 float ypos = y - (sym.size[1] - sym.offset[1]) * scale;
695 float w = sym.size[0] * scale;
696 float h = sym.size[1] * scale;
697 float vertices[6][4] = {
698 {xpos, ypos + h, 0.0f, 0.0f},
699 {xpos, ypos, 0.0f, 1.0f},
700 {xpos + w, ypos, 1.0f, 1.0f},
701 {xpos, ypos + h, 0.0f, 0.0f},
702 {xpos + w, ypos, 1.0f, 1.0f},
703 {xpos + w, ypos + h, 1.0f, 0.0f}};
704 drawTextVertices(vertices, sym.texId);
705 }
706 x += (sym.advance >> 6) * scale; // shift is in 1/64th of a pixel
707 }
708 if (!mDisplay->useMultiVBO()) {
709 CHKERR(glBindBuffer(GL_ARRAY_BUFFER, mVBOId[0])); // If we don't use multiple buffers, we keep the default buffer bound
710 }
711}
712
713void GPUDisplayBackendOpenGL::drawTextVertices(const float (&vertices)[6][4], uint32_t texId)
714{
717 CHKERR(glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(vertices), vertices));
720}
721
722void GPUDisplayBackendOpenGL::GLDrawQuad(const float (&corners)[4][2], const float* color)
723{
725 return;
726 }
728 static constexpr int32_t order[6] = {0, 1, 2, 0, 2, 3};
729 float vertices[6][4];
730 for (int32_t i = 0; i < 6; i++) {
731 vertices[i][0] = corners[order[i]][0];
732 vertices[i][1] = corners[order[i]][1];
733 vertices[i][2] = vertices[i][3] = 0.5f; // Center of the opaque glyph
734 }
735 drawTextVertices(vertices, mFontSymbols[SOLID_GLYPH].texId);
736 if (!mDisplay->useMultiVBO()) {
737 CHKERR(glBindBuffer(GL_ARRAY_BUFFER, mVBOId[0])); // As in GLPrintText
738 }
739}
740
753
755{
758
759 updateRenderer(false);
760}
761
763{
764 mDownsampleFactor = getDownsampleFactor(withScreenshot);
768 if (mDisplay->cfgR().drawQualityMSAA > 1) {
770 }
771 if (mDownsampleFactor != 1) {
772 createFB(mOffscreenBuffer, mDownsampleFactor != 2, true, false, mRenderWidth, mRenderHeight); // Texture for shader downsampling (factor != 2), screenshot downsampling uses the shader only if this factor is != 2 as well
773 }
774 setQuality();
775
776 float vertices[6][4] = {// Mix quad at render size
777 {0, (float)mRenderHeight, 0.0f, 1.0f},
778 {0, 0, 0.0f, 0.0f},
779 {(float)mRenderWidth, 0, 1.0f, 0.0f},
780 {0, (float)mRenderHeight, 0.0f, 1.0f},
781 {(float)mRenderWidth, 0, 1.0f, 0.0f},
782 {(float)mRenderWidth, (float)mRenderHeight, 1.0f, 1.0f}};
784 CHKERR(glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(vertices), vertices));
785 CHKERR(glBindBuffer(GL_ARRAY_BUFFER, mDisplay->useMultiVBO() ? 0 : mVBOId[0])); // If we don't use multiple buffers, we keep the default buffer bound (also called from prepareDraw before the vertex pointers are set)
786}
unsigned char uint8_t
unsigned int uint32_t
int32_t i
#define CHKERR(cmd)
#define OPENGL_EMULATE_MULTI_DRAW
uint32_t iSector
configStandalone Light OpenGL display display_light Apply smoothing to points Enable Z buffer Highlight links Highlight seeds Highlight sector tracks Highlight final tracks Show individual Show related Highlight grid Show only individual collision Color clusters belonging to track objects Set line Enable drawing TPC data Enable drawing TOF data Enable drawing magnetic field Set field line step count Invert colors configStandalone Heavy OpenGL display display_heavy Show tracks with ITS contribution Show tracks with TOF contribution Enable propagation of loopers Show clusters at nominal x of pad row for early transformed data Split CE tracks when they cross the central Mark clusters Mark adjacent clusters Hide rejected tracks Apply filter on tracks to be displayed Separate increase X h renderer
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error s
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs fits all iterations but the last one in projections Use material lookup table for TPC refit Apply workarounds to avoid cyclic merge should not be needed tpc dyn configStandalone Processing proc_rtc Replace constant variables static by constexpr expressions Compile RTC in deterministic with NO_FAST_MATH flags and GPUCA_DETERMINISTIC_MODE define Use RTC to optimize GPU code h configStandalone Processing proc_rtctech Use a file lock to serialize access to the cache folder int32_t
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by factor
configStandalone Reconstruction rec_tpc float
HMM_INLINE hmm_mat4 HMM_Orthographic(float Left, float Right, float Bottom, float Top, float Near, float Far)
uint32_t c
Definition RawData.h:2
Class for time synchronization of RawReader instances.
void lineWidthFactor(float factor) override
static constexpr int32_t UNIFORM_LOCATION_LINE_WIDTH
void resizeScene(uint32_t width, uint32_t height) override
void loadDataToGPU(size_t totalVertizes) override
bool prepareDraw(const hmm_mat4 &proj, const hmm_mat4 &view, bool requestScreenshot, bool toMixBuffer, float includeMixImage) override
void drawTextVertices(const float(&vertices)[6][4], uint32_t texId)
void GLDrawQuad(const float(&corners)[4][2], const float *color) override
static uint32_t loadShader(uint32_t type, const char *spirv, size_t size)
void drawDownsample(uint32_t srcTexture, uint32_t dstFramebuffer, uint32_t width, uint32_t height, int32_t factor)
void finishDraw(bool doScreenshot, bool toMixBuffer, float includeMixImage) override
void GLPrintText(const char *s, float x, float y, float *color, float scale, uint32_t nCharacters) override
uint32_t drawVertices(const vboList &v, const drawType t) override
static int32_t checkProgramStatus(uint32_t program)
void createFB(GLfb &fb, bool tex, bool withDepth, bool msaa, uint32_t width, uint32_t height)
void pointSizeFactor(float factor) override
static int32_t checkShaderStatus(uint32_t shader)
static constexpr int32_t UNIFORM_LOCATION_POINT_SIZE
static constexpr int32_t UNIFORM_LOCATION_VIEWPORT
static constexpr int32_t UNIFORM_LOCATION_COLOR
std::vector< FontSymbolOpenGL > mFontSymbols
void finishFrame(bool doScreenshot, bool toMixBuffer, float includeMixImage) override
void addFontSymbol(int32_t symbol, int32_t sizex, int32_t sizey, int32_t offsetx, int32_t offsety, int32_t advance, void *data) override
void ActivateColor(std::array< float, 4 > &color) override
static constexpr int32_t UNIFORM_LOCATION_MATRIX
static constexpr int32_t SOLID_GLYPH
vecpod< DrawArraysIndirectCommand > mCmdBuffer
std::vector< int32_t > mIndirectSectorOffset
static constexpr float SMOOTH_LINE_EXTRA_WIDTH
std::vector< char > mScreenshotPixels
static constexpr float SMOOTH_POINT_EXTRA_SIZE
std::unique_ptr< GPUDisplayMagneticField > mMagneticFieldVisualization
float getDownsampleFactor(bool screenshot=false)
std::tuple< uint32_t, uint32_t, int32_t > vboList
static constexpr int32_t GL_MIN_VERSION_MAJOR
static constexpr int32_t GL_MIN_VERSION_MINOR
const GPUSettingsDisplayLight & cfgL() const
Definition GPUDisplay.h:73
int32_t updateRenderPipeline() const
Definition GPUDisplay.h:78
const GPUSettingsDisplayRenderer & cfgR() const
Definition GPUDisplay.h:72
vecpod< vtx > * vertexBuffer()
Definition GPUDisplay.h:86
GPUDisplayFrontend * frontend()
Definition GPUDisplay.h:89
const vecpod< uint32_t > * vertexBufferCount() const
Definition GPUDisplay.h:81
bool useMultiVBO() const
Definition GPUDisplay.h:76
vecpod< int32_t > * vertexBufferStart()
Definition GPUDisplay.h:80
const GPUSettingsProcessing & GetProcessingSettings() const
Definition GPUDisplay.h:88
#define glNamedBufferData
Definition gl3w.h:1077
#define glGetError
Definition gl3w.h:932
#define glAttachShader
Definition gl3w.h:727
#define glClearColor
Definition gl3w.h:778
#define glGenBuffers
Definition gl3w.h:897
#define glUniformMatrix4fv
Definition gl3w.h:1278
#define glSpecializeShader
Definition gl3w.h:1183
#define glCheckFramebufferStatus
Definition gl3w.h:768
#define glUniform1f
Definition gl3w.h:1234
#define glDeleteVertexArrays
Definition gl3w.h:842
#define glCreateBuffers
Definition gl3w.h:815
#define glProgramUniform2f
Definition gl3w.h:1118
#define glUniform4fv
Definition gl3w.h:1259
#define glPixelStorei
Definition gl3w.h:1095
#define glGetShaderInfoLog
Definition gl3w.h:985
#define glBindBuffer
Definition gl3w.h:733
#define glDrawBuffer
Definition gl3w.h:860
#define glEnable
Definition gl3w.h:875
#define glFramebufferTexture2D
Definition gl3w.h:893
#define glProgramUniform1f
Definition gl3w.h:1110
int gl3wInit(void)
#define glBindVertexArray
Definition gl3w.h:751
#define glCreateShader
Definition gl3w.h:822
#define glGetProgramiv
Definition gl3w.h:969
#define glRenderbufferStorageMultisample
Definition gl3w.h:1166
#define glMultiDrawArrays
Definition gl3w.h:1070
#define glDepthFunc
Definition gl3w.h:843
#define glDeleteBuffers
Definition gl3w.h:831
#define glReadBuffer
Definition gl3w.h:1161
#define glTexParameteri
Definition gl3w.h:1201
#define glReadPixels
Definition gl3w.h:1162
#define glEnableVertexAttribArray
Definition gl3w.h:877
#define glGetIntegerv
Definition gl3w.h:944
#define glGenVertexArrays
Definition gl3w.h:905
#define glShaderBinary
Definition gl3w.h:1180
#define glGetString
Definition gl3w.h:989
#define glColorMask
Definition gl3w.h:792
#define glTexImage2D
Definition gl3w.h:1193
#define glBindFramebuffer
Definition gl3w.h:740
#define glProgramUniformMatrix4fv
Definition gl3w.h:1153
#define glPointSize
Definition gl3w.h:1100
#define glGenTextures
Definition gl3w.h:903
#define glDrawArrays
Definition gl3w.h:856
#define glVertexAttribPointer
Definition gl3w.h:1377
#define glGenRenderbuffers
Definition gl3w.h:901
#define glBufferData
Definition gl3w.h:765
#define glDeleteProgram
Definition gl3w.h:833
#define glBindTexture
Definition gl3w.h:747
#define glBindRenderbuffer
Definition gl3w.h:744
#define glBlitNamedFramebuffer
Definition gl3w.h:764
#define glDeleteFramebuffers
Definition gl3w.h:832
#define glFramebufferRenderbuffer
Definition gl3w.h:890
#define glMultiDrawArraysIndirect
Definition gl3w.h:1071
#define glTexImage2DMultisample
Definition gl3w.h:1194
#define glBufferSubData
Definition gl3w.h:767
#define glViewport
Definition gl3w.h:1379
#define glNamedBufferSubData
Definition gl3w.h:1079
#define glUniform1i
Definition gl3w.h:1236
#define glDeleteShader
Definition gl3w.h:838
#define glLineWidth
Definition gl3w.h:1060
#define glCreateProgram
Definition gl3w.h:817
#define glGetProgramInfoLog
Definition gl3w.h:959
#define glLinkProgram
Definition gl3w.h:1061
#define glDeleteRenderbuffers
Definition gl3w.h:836
#define glUseProgram
Definition gl3w.h:1286
#define glRenderbufferStorage
Definition gl3w.h:1165
#define glDisable
Definition gl3w.h:850
#define glDrawBuffers
Definition gl3w.h:861
#define glProgramUniform4fv
Definition gl3w.h:1135
#define glGetShaderiv
Definition gl3w.h:988
#define glDeleteTextures
Definition gl3w.h:840
#define glActiveTexture
Definition gl3w.h:726
#define glGenFramebuffers
Definition gl3w.h:898
#define glBlendFunc
Definition gl3w.h:759
#define glClear
Definition gl3w.h:771
#define GL_MAX_RENDERBUFFER_SIZE
Definition glcorearb.h:1117
GLint GLenum GLint x
Definition glcorearb.h:403
#define GL_MAX_TEXTURE_SIZE
Definition glcorearb.h:194
#define GL_TEXTURE0
Definition glcorearb.h:483
#define GL_TEXTURE_MIN_FILTER
Definition glcorearb.h:260
#define GL_FRAGMENT_SHADER
Definition glcorearb.h:728
#define GL_TEXTURE_WRAP_S
Definition glcorearb.h:261
#define GL_MAX_FRAMEBUFFER_WIDTH
Definition glcorearb.h:2298
#define GL_MAJOR_VERSION
Definition glcorearb.h:1012
GLint GLsizei count
Definition glcorearb.h:399
GLsizeiptr size
Definition glcorearb.h:659
const GLdouble * v
Definition glcorearb.h:832
#define GL_PACK_ALIGNMENT
Definition glcorearb.h:193
GLsizei GLenum GLenum * types
Definition glcorearb.h:2516
#define GL_DEPTH_TEST
Definition glcorearb.h:153
#define GL_LINEAR
Definition glcorearb.h:254
#define GL_LINE_STRIP
Definition glcorearb.h:99
#define GL_COLOR_ATTACHMENT0
Definition glcorearb.h:1147
#define GL_SRC_ALPHA
Definition glcorearb.h:116
#define GL_LINES
Definition glcorearb.h:97
#define GL_BGRA
Definition glcorearb.h:456
GLuint shader
Definition glcorearb.h:780
GLbitfield GLuint program
Definition glcorearb.h:1905
GLint GLsizei GLsizei height
Definition glcorearb.h:270
#define GL_TRIANGLES
Definition glcorearb.h:100
GLint first
Definition glcorearb.h:399
GLint GLsizei width
Definition glcorearb.h:270
#define GL_BACK
Definition glcorearb.h:129
#define GL_FLOAT
Definition glcorearb.h:211
#define GL_ARRAY_BUFFER
Definition glcorearb.h:625
GLint y
Definition glcorearb.h:270
GLsizei const GLfloat * value
Definition glcorearb.h:819
#define GL_SHADER_BINARY_FORMAT_SPIR_V
Definition glcorearb.h:2863
#define GL_FRAMEBUFFER_COMPLETE
Definition glcorearb.h:1140
GLint GLint GLsizei GLint GLenum GLenum type
Definition glcorearb.h:275
#define GL_RED
Definition glcorearb.h:236
#define GL_DRAW_FRAMEBUFFER
Definition glcorearb.h:1132
#define GL_UNSIGNED_BYTE
Definition glcorearb.h:206
#define GL_NO_ERROR
Definition glcorearb.h:133
#define GL_RENDERBUFFER
Definition glcorearb.h:1182
#define GL_COMPILE_STATUS
Definition glcorearb.h:756
#define GL_LEQUAL
Definition glcorearb.h:107
#define GL_POINTS
Definition glcorearb.h:96
#define GL_UNPACK_ALIGNMENT
Definition glcorearb.h:187
int GLsizei
Definition glcorearb.h:85
#define GL_COLOR_BUFFER_BIT
Definition glcorearb.h:93
#define GL_FRAMEBUFFER
Definition glcorearb.h:1181
#define GL_RGBA
Definition glcorearb.h:241
#define GL_BLEND
Definition glcorearb.h:170
#define GL_MULTISAMPLE
Definition glcorearb.h:516
#define GL_ONE_MINUS_SRC_ALPHA
Definition glcorearb.h:117
#define GL_TEXTURE_2D_MULTISAMPLE
Definition glcorearb.h:1548
#define GL_DRAW_FRAMEBUFFER_BINDING
Definition glcorearb.h:1129
#define GL_READ_FRAMEBUFFER
Definition glcorearb.h:1131
#define GL_STATIC_DRAW
Definition glcorearb.h:639
#define GL_FALSE
Definition glcorearb.h:94
#define GL_DYNAMIC_DRAW
Definition glcorearb.h:642
#define GL_TEXTURE_WRAP_T
Definition glcorearb.h:262
#define GL_DEPTH_ATTACHMENT
Definition glcorearb.h:1179
#define GL_TEXTURE_MAG_FILTER
Definition glcorearb.h:259
#define GL_VERTEX_SHADER
Definition glcorearb.h:729
int GLint
Definition glcorearb.h:84
#define GL_MINOR_VERSION
Definition glcorearb.h:1013
#define GL_TEXTURE_2D
Definition glcorearb.h:198
#define GL_DEPTH_COMPONENT24
Definition glcorearb.h:572
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition glcorearb.h:2514
GLenum attachment
Definition glcorearb.h:1302
#define GL_RENDERER
Definition glcorearb.h:250
GLubyte GLubyte GLubyte GLubyte w
Definition glcorearb.h:852
GLuint id
Definition glcorearb.h:650
#define GL_LINK_STATUS
Definition glcorearb.h:757
#define GL_READ_FRAMEBUFFER_BINDING
Definition glcorearb.h:1133
#define GL_INFO_LOG_LENGTH
Definition glcorearb.h:759
#define GL_CLAMP_TO_EDGE
Definition glcorearb.h:459
#define GL_MAX_FRAMEBUFFER_HEIGHT
Definition glcorearb.h:2299
#define GL_DEPTH_BUFFER_BIT
Definition glcorearb.h:91
#define GL_DRAW_INDIRECT_BUFFER
Definition glcorearb.h:1698
float Elements[4][4]