Overlay_autogen.cpp (38394B)
1 // GENERATED FILE - DO NOT EDIT. 2 // Generated by gen_overlay_widgets.py using data from overlay_widgets.json. 3 // 4 // Copyright 2019 The ANGLE Project Authors. All rights reserved. 5 // Use of this source code is governed by a BSD-style license that can be 6 // found in the LICENSE file. 7 // 8 // Overlay_autogen.cpp: 9 // Autogenerated overlay widget declarations. 10 11 #include "libANGLE/Overlay.h" 12 #include "libANGLE/OverlayWidgets.h" 13 #include "libANGLE/Overlay_font_autogen.h" 14 #include "libANGLE/renderer/driver_utils.h" 15 16 namespace gl 17 { 18 using namespace overlay; 19 20 namespace 21 { 22 int GetFontSize(int fontSize, bool largeFont) 23 { 24 if (largeFont && fontSize > 0) 25 { 26 return fontSize - 1; 27 } 28 return fontSize; 29 } 30 } // anonymous namespace 31 32 void Overlay::initOverlayWidgets() 33 { 34 const bool kLargeFont = rx::IsAndroid(); 35 36 { 37 PerSecond *widget = new PerSecond; 38 { 39 const int32_t fontSize = GetFontSize(kFontMipLarge, kLargeFont); 40 const int32_t offsetX = 10; 41 const int32_t offsetY = 10; 42 const int32_t width = 12 * (kFontGlyphWidth >> fontSize); 43 const int32_t height = (kFontGlyphHeight >> fontSize); 44 45 widget->type = WidgetType::PerSecond; 46 widget->fontSize = fontSize; 47 widget->coords[0] = offsetX; 48 widget->coords[1] = offsetY; 49 widget->coords[2] = offsetX + width; 50 widget->coords[3] = offsetY + height; 51 widget->color[0] = 0.4980392156862745f; 52 widget->color[1] = 0.7490196078431373f; 53 widget->color[2] = 1.0f; 54 widget->color[3] = 1.0f; 55 widget->matchToWidget = nullptr; 56 } 57 mState.mOverlayWidgets[WidgetId::FPS].reset(widget); 58 } 59 60 { 61 Text *widget = new Text; 62 { 63 const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont); 64 const int32_t offsetX = 10; 65 const int32_t offsetY = -10; 66 const int32_t width = 150 * (kFontGlyphWidth >> fontSize); 67 const int32_t height = (kFontGlyphHeight >> fontSize); 68 69 widget->type = WidgetType::Text; 70 widget->fontSize = fontSize; 71 widget->coords[0] = offsetX; 72 widget->coords[1] = offsetY - height; 73 widget->coords[2] = offsetX + width; 74 widget->coords[3] = offsetY; 75 widget->color[0] = 1.0f; 76 widget->color[1] = 0.0f; 77 widget->color[2] = 0.0f; 78 widget->color[3] = 1.0f; 79 widget->matchToWidget = nullptr; 80 } 81 mState.mOverlayWidgets[WidgetId::VulkanLastValidationMessage].reset(widget); 82 } 83 84 { 85 Count *widget = new Count; 86 { 87 const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont); 88 const int32_t offsetX = 10; 89 const int32_t offsetY = 90 mState.mOverlayWidgets[WidgetId::VulkanLastValidationMessage]->coords[1]; 91 const int32_t width = 25 * (kFontGlyphWidth >> fontSize); 92 const int32_t height = (kFontGlyphHeight >> fontSize); 93 94 widget->type = WidgetType::Count; 95 widget->fontSize = fontSize; 96 widget->coords[0] = offsetX; 97 widget->coords[1] = offsetY - height; 98 widget->coords[2] = offsetX + width; 99 widget->coords[3] = offsetY; 100 widget->color[0] = 1.0f; 101 widget->color[1] = 0.0f; 102 widget->color[2] = 0.0f; 103 widget->color[3] = 1.0f; 104 widget->matchToWidget = nullptr; 105 } 106 mState.mOverlayWidgets[WidgetId::VulkanValidationMessageCount].reset(widget); 107 } 108 109 { 110 RunningGraph *widget = new RunningGraph(60); 111 { 112 const int32_t fontSize = GetFontSize(0, kLargeFont); 113 const int32_t offsetX = 10; 114 const int32_t offsetY = 100; 115 const int32_t width = 5 * static_cast<uint32_t>(widget->runningValues.size()); 116 const int32_t height = 100; 117 118 widget->type = WidgetType::RunningGraph; 119 widget->fontSize = fontSize; 120 widget->coords[0] = offsetX; 121 widget->coords[1] = offsetY; 122 widget->coords[2] = offsetX + width; 123 widget->coords[3] = offsetY + height; 124 widget->color[0] = 0.29411764705882354f; 125 widget->color[1] = 0.7843137254901961f; 126 widget->color[2] = 0.0f; 127 widget->color[3] = 0.7843137254901961f; 128 widget->matchToWidget = nullptr; 129 } 130 mState.mOverlayWidgets[WidgetId::VulkanRenderPassCount].reset(widget); 131 { 132 const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont); 133 const int32_t offsetX = 134 mState.mOverlayWidgets[WidgetId::VulkanRenderPassCount]->coords[0]; 135 const int32_t offsetY = 136 mState.mOverlayWidgets[WidgetId::VulkanRenderPassCount]->coords[1]; 137 const int32_t width = 40 * (kFontGlyphWidth >> fontSize); 138 const int32_t height = (kFontGlyphHeight >> fontSize); 139 140 widget->description.type = WidgetType::Text; 141 widget->description.fontSize = fontSize; 142 widget->description.coords[0] = offsetX; 143 widget->description.coords[1] = std::max(offsetY - height, 1); 144 widget->description.coords[2] = offsetX + width; 145 widget->description.coords[3] = offsetY; 146 widget->description.color[0] = 0.29411764705882354f; 147 widget->description.color[1] = 0.7843137254901961f; 148 widget->description.color[2] = 0.0f; 149 widget->description.color[3] = 1.0f; 150 widget->description.matchToWidget = nullptr; 151 } 152 } 153 154 { 155 RunningGraph *widget = new RunningGraph(100); 156 { 157 const int32_t fontSize = GetFontSize(0, kLargeFont); 158 const int32_t offsetX = -50; 159 const int32_t offsetY = 100; 160 const int32_t width = 6 * static_cast<uint32_t>(widget->runningValues.size()); 161 const int32_t height = 100; 162 163 widget->type = WidgetType::RunningGraph; 164 widget->fontSize = fontSize; 165 widget->coords[0] = offsetX - width; 166 widget->coords[1] = offsetY; 167 widget->coords[2] = offsetX; 168 widget->coords[3] = offsetY + height; 169 widget->color[0] = 1.0f; 170 widget->color[1] = 0.7843137254901961f; 171 widget->color[2] = 0.29411764705882354f; 172 widget->color[3] = 0.7843137254901961f; 173 widget->matchToWidget = nullptr; 174 } 175 mState.mOverlayWidgets[WidgetId::VulkanRenderPassBufferCount].reset(widget); 176 { 177 const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont); 178 const int32_t offsetX = 179 mState.mOverlayWidgets[WidgetId::VulkanRenderPassBufferCount]->coords[0]; 180 const int32_t offsetY = 181 mState.mOverlayWidgets[WidgetId::VulkanRenderPassBufferCount]->coords[1]; 182 const int32_t width = 40 * (kFontGlyphWidth >> fontSize); 183 const int32_t height = (kFontGlyphHeight >> fontSize); 184 185 widget->description.type = WidgetType::Text; 186 widget->description.fontSize = fontSize; 187 widget->description.coords[0] = offsetX; 188 widget->description.coords[1] = std::max(offsetY - height, 1); 189 widget->description.coords[2] = std::min(offsetX + width, -1); 190 widget->description.coords[3] = offsetY; 191 widget->description.color[0] = 1.0f; 192 widget->description.color[1] = 0.7843137254901961f; 193 widget->description.color[2] = 0.29411764705882354f; 194 widget->description.color[3] = 1.0f; 195 widget->description.matchToWidget = nullptr; 196 } 197 } 198 199 { 200 RunningHistogram *widget = new RunningHistogram(50); 201 { 202 const int32_t fontSize = GetFontSize(0, kLargeFont); 203 const int32_t offsetX = -50; 204 const int32_t offsetY = 100; 205 const int32_t width = 6 * static_cast<uint32_t>(widget->runningValues.size()); 206 const int32_t height = 100; 207 208 widget->type = WidgetType::RunningHistogram; 209 widget->fontSize = fontSize; 210 widget->coords[0] = offsetX - width; 211 widget->coords[1] = offsetY; 212 widget->coords[2] = offsetX; 213 widget->coords[3] = offsetY + height; 214 widget->color[0] = 1.0f; 215 widget->color[1] = 0.7843137254901961f; 216 widget->color[2] = 0.29411764705882354f; 217 widget->color[3] = 0.7843137254901961f; 218 widget->matchToWidget = nullptr; 219 } 220 mState.mOverlayWidgets[WidgetId::VulkanSecondaryCommandBufferPoolWaste].reset(widget); 221 { 222 const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont); 223 const int32_t offsetX = 224 mState.mOverlayWidgets[WidgetId::VulkanSecondaryCommandBufferPoolWaste]->coords[0]; 225 const int32_t offsetY = 226 mState.mOverlayWidgets[WidgetId::VulkanSecondaryCommandBufferPoolWaste]->coords[1]; 227 const int32_t width = 40 * (kFontGlyphWidth >> fontSize); 228 const int32_t height = (kFontGlyphHeight >> fontSize); 229 230 widget->description.type = WidgetType::Text; 231 widget->description.fontSize = fontSize; 232 widget->description.coords[0] = offsetX; 233 widget->description.coords[1] = std::max(offsetY - height, 1); 234 widget->description.coords[2] = std::min(offsetX + width, -1); 235 widget->description.coords[3] = offsetY; 236 widget->description.color[0] = 1.0f; 237 widget->description.color[1] = 0.7843137254901961f; 238 widget->description.color[2] = 0.29411764705882354f; 239 widget->description.color[3] = 1.0f; 240 widget->description.matchToWidget = nullptr; 241 } 242 } 243 244 { 245 RunningGraph *widget = new RunningGraph(60); 246 { 247 const int32_t fontSize = GetFontSize(0, kLargeFont); 248 const int32_t offsetX = 10; 249 const int32_t offsetY = 220; 250 const int32_t width = 5 * static_cast<uint32_t>(widget->runningValues.size()); 251 const int32_t height = 100; 252 253 widget->type = WidgetType::RunningGraph; 254 widget->fontSize = fontSize; 255 widget->coords[0] = offsetX; 256 widget->coords[1] = offsetY; 257 widget->coords[2] = offsetX + width; 258 widget->coords[3] = offsetY + height; 259 widget->color[0] = 0.29411764705882354f; 260 widget->color[1] = 0.7843137254901961f; 261 widget->color[2] = 0.0f; 262 widget->color[3] = 0.7843137254901961f; 263 widget->matchToWidget = nullptr; 264 } 265 mState.mOverlayWidgets[WidgetId::VulkanWriteDescriptorSetCount].reset(widget); 266 { 267 const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont); 268 const int32_t offsetX = 269 mState.mOverlayWidgets[WidgetId::VulkanWriteDescriptorSetCount]->coords[0]; 270 const int32_t offsetY = 271 mState.mOverlayWidgets[WidgetId::VulkanWriteDescriptorSetCount]->coords[1]; 272 const int32_t width = 40 * (kFontGlyphWidth >> fontSize); 273 const int32_t height = (kFontGlyphHeight >> fontSize); 274 275 widget->description.type = WidgetType::Text; 276 widget->description.fontSize = fontSize; 277 widget->description.coords[0] = offsetX; 278 widget->description.coords[1] = std::max(offsetY - height, 1); 279 widget->description.coords[2] = offsetX + width; 280 widget->description.coords[3] = offsetY; 281 widget->description.color[0] = 0.29411764705882354f; 282 widget->description.color[1] = 0.7843137254901961f; 283 widget->description.color[2] = 0.0f; 284 widget->description.color[3] = 1.0f; 285 widget->description.matchToWidget = nullptr; 286 } 287 } 288 289 { 290 RunningGraph *widget = new RunningGraph(60); 291 { 292 const int32_t fontSize = GetFontSize(0, kLargeFont); 293 const int32_t offsetX = 0; 294 const int32_t offsetY = 250; 295 const int32_t width = 6 * static_cast<uint32_t>(widget->runningValues.size()); 296 const int32_t height = 100; 297 298 widget->type = WidgetType::RunningGraph; 299 widget->fontSize = fontSize; 300 widget->coords[0] = offsetX; 301 widget->coords[1] = offsetY; 302 widget->coords[2] = offsetX + width; 303 widget->coords[3] = offsetY + height; 304 widget->color[0] = 1.0f; 305 widget->color[1] = 0.0f; 306 widget->color[2] = 0.29411764705882354f; 307 widget->color[3] = 0.7843137254901961f; 308 widget->matchToWidget = nullptr; 309 } 310 mState.mOverlayWidgets[WidgetId::VulkanDescriptorSetAllocations].reset(widget); 311 { 312 const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont); 313 const int32_t offsetX = 314 mState.mOverlayWidgets[WidgetId::VulkanDescriptorSetAllocations]->coords[0]; 315 const int32_t offsetY = 316 mState.mOverlayWidgets[WidgetId::VulkanDescriptorSetAllocations]->coords[1]; 317 const int32_t width = 40 * (kFontGlyphWidth >> fontSize); 318 const int32_t height = (kFontGlyphHeight >> fontSize); 319 320 widget->description.type = WidgetType::Text; 321 widget->description.fontSize = fontSize; 322 widget->description.coords[0] = offsetX; 323 widget->description.coords[1] = std::max(offsetY - height, 1); 324 widget->description.coords[2] = offsetX + width; 325 widget->description.coords[3] = offsetY; 326 widget->description.color[0] = 1.0f; 327 widget->description.color[1] = 0.0f; 328 widget->description.color[2] = 0.29411764705882354f; 329 widget->description.color[3] = 1.0f; 330 widget->description.matchToWidget = nullptr; 331 } 332 } 333 334 { 335 RunningGraph *widget = new RunningGraph(60); 336 { 337 const int32_t fontSize = GetFontSize(0, kLargeFont); 338 const int32_t offsetX = -50; 339 const int32_t offsetY = 360; 340 const int32_t width = 6 * static_cast<uint32_t>(widget->runningValues.size()); 341 const int32_t height = 100; 342 343 widget->type = WidgetType::RunningGraph; 344 widget->fontSize = fontSize; 345 widget->coords[0] = offsetX - width; 346 widget->coords[1] = offsetY; 347 widget->coords[2] = offsetX; 348 widget->coords[3] = offsetY + height; 349 widget->color[0] = 1.0f; 350 widget->color[1] = 0.0f; 351 widget->color[2] = 0.29411764705882354f; 352 widget->color[3] = 0.7843137254901961f; 353 widget->matchToWidget = nullptr; 354 } 355 mState.mOverlayWidgets[WidgetId::VulkanShaderResourceDSHitRate].reset(widget); 356 { 357 const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont); 358 const int32_t offsetX = 359 mState.mOverlayWidgets[WidgetId::VulkanShaderResourceDSHitRate]->coords[0]; 360 const int32_t offsetY = 361 mState.mOverlayWidgets[WidgetId::VulkanShaderResourceDSHitRate]->coords[1]; 362 const int32_t width = 40 * (kFontGlyphWidth >> fontSize); 363 const int32_t height = (kFontGlyphHeight >> fontSize); 364 365 widget->description.type = WidgetType::Text; 366 widget->description.fontSize = fontSize; 367 widget->description.coords[0] = offsetX; 368 widget->description.coords[1] = std::max(offsetY - height, 1); 369 widget->description.coords[2] = std::min(offsetX + width, -1); 370 widget->description.coords[3] = offsetY; 371 widget->description.color[0] = 1.0f; 372 widget->description.color[1] = 0.0f; 373 widget->description.color[2] = 0.29411764705882354f; 374 widget->description.color[3] = 1.0f; 375 widget->description.matchToWidget = nullptr; 376 } 377 } 378 379 { 380 RunningGraph *widget = new RunningGraph(120); 381 { 382 const int32_t fontSize = GetFontSize(0, kLargeFont); 383 const int32_t offsetX = -50; 384 const int32_t offsetY = -50; 385 const int32_t width = 5 * static_cast<uint32_t>(widget->runningValues.size()); 386 const int32_t height = 100; 387 388 widget->type = WidgetType::RunningGraph; 389 widget->fontSize = fontSize; 390 widget->coords[0] = offsetX - width; 391 widget->coords[1] = offsetY - height; 392 widget->coords[2] = offsetX; 393 widget->coords[3] = offsetY; 394 widget->color[0] = 0.0f; 395 widget->color[1] = 0.7843137254901961f; 396 widget->color[2] = 0.29411764705882354f; 397 widget->color[3] = 0.7843137254901961f; 398 widget->matchToWidget = nullptr; 399 } 400 mState.mOverlayWidgets[WidgetId::VulkanDynamicBufferAllocations].reset(widget); 401 { 402 const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont); 403 const int32_t offsetX = 404 mState.mOverlayWidgets[WidgetId::VulkanDynamicBufferAllocations]->coords[2]; 405 const int32_t offsetY = 406 mState.mOverlayWidgets[WidgetId::VulkanDynamicBufferAllocations]->coords[1]; 407 const int32_t width = 40 * (kFontGlyphWidth >> fontSize); 408 const int32_t height = (kFontGlyphHeight >> fontSize); 409 410 widget->description.type = WidgetType::Text; 411 widget->description.fontSize = fontSize; 412 widget->description.coords[0] = offsetX - width; 413 widget->description.coords[1] = offsetY - height; 414 widget->description.coords[2] = offsetX; 415 widget->description.coords[3] = offsetY; 416 widget->description.color[0] = 0.0f; 417 widget->description.color[1] = 0.7843137254901961f; 418 widget->description.color[2] = 0.29411764705882354f; 419 widget->description.color[3] = 1.0f; 420 widget->description.matchToWidget = nullptr; 421 } 422 } 423 424 { 425 RunningGraph *widget = new RunningGraph(60); 426 { 427 const int32_t fontSize = GetFontSize(0, kLargeFont); 428 const int32_t offsetX = 0; 429 const int32_t offsetY = 450; 430 const int32_t width = 5 * static_cast<uint32_t>(widget->runningValues.size()); 431 const int32_t height = 100; 432 433 widget->type = WidgetType::RunningGraph; 434 widget->fontSize = fontSize; 435 widget->coords[0] = offsetX; 436 widget->coords[1] = offsetY; 437 widget->coords[2] = offsetX + width; 438 widget->coords[3] = offsetY + height; 439 widget->color[0] = 0.0f; 440 widget->color[1] = 0.7843137254901961f; 441 widget->color[2] = 0.7254901960784313f; 442 widget->color[3] = 0.7843137254901961f; 443 widget->matchToWidget = nullptr; 444 } 445 mState.mOverlayWidgets[WidgetId::VulkanDescriptorCacheSize].reset(widget); 446 { 447 const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont); 448 const int32_t offsetX = 449 mState.mOverlayWidgets[WidgetId::VulkanDescriptorCacheSize]->coords[0]; 450 const int32_t offsetY = 451 mState.mOverlayWidgets[WidgetId::VulkanDescriptorCacheSize]->coords[1]; 452 const int32_t width = 90 * (kFontGlyphWidth >> fontSize); 453 const int32_t height = (kFontGlyphHeight >> fontSize); 454 455 widget->description.type = WidgetType::Text; 456 widget->description.fontSize = fontSize; 457 widget->description.coords[0] = offsetX; 458 widget->description.coords[1] = std::max(offsetY - height, 1); 459 widget->description.coords[2] = offsetX + width; 460 widget->description.coords[3] = offsetY; 461 widget->description.color[0] = 0.0f; 462 widget->description.color[1] = 0.7843137254901961f; 463 widget->description.color[2] = 0.29411764705882354f; 464 widget->description.color[3] = 1.0f; 465 widget->description.matchToWidget = nullptr; 466 } 467 } 468 469 { 470 RunningGraph *widget = new RunningGraph(60); 471 { 472 const int32_t fontSize = GetFontSize(0, kLargeFont); 473 const int32_t offsetX = 0; 474 const int32_t offsetY = 450; 475 const int32_t width = 5 * static_cast<uint32_t>(widget->runningValues.size()); 476 const int32_t height = 100; 477 478 widget->type = WidgetType::RunningGraph; 479 widget->fontSize = fontSize; 480 widget->coords[0] = offsetX; 481 widget->coords[1] = offsetY; 482 widget->coords[2] = offsetX + width; 483 widget->coords[3] = offsetY + height; 484 widget->color[0] = 0.0f; 485 widget->color[1] = 0.7843137254901961f; 486 widget->color[2] = 0.29411764705882354f; 487 widget->color[3] = 0.7843137254901961f; 488 widget->matchToWidget = nullptr; 489 } 490 mState.mOverlayWidgets[WidgetId::VulkanTextureDescriptorCacheSize].reset(widget); 491 { 492 const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont); 493 const int32_t offsetX = 494 mState.mOverlayWidgets[WidgetId::VulkanTextureDescriptorCacheSize]->coords[0]; 495 const int32_t offsetY = 496 mState.mOverlayWidgets[WidgetId::VulkanTextureDescriptorCacheSize]->coords[1]; 497 const int32_t width = 90 * (kFontGlyphWidth >> fontSize); 498 const int32_t height = (kFontGlyphHeight >> fontSize); 499 500 widget->description.type = WidgetType::Text; 501 widget->description.fontSize = fontSize; 502 widget->description.coords[0] = offsetX; 503 widget->description.coords[1] = std::max(offsetY - height, 1); 504 widget->description.coords[2] = offsetX + width; 505 widget->description.coords[3] = offsetY; 506 widget->description.color[0] = 0.0f; 507 widget->description.color[1] = 0.7843137254901961f; 508 widget->description.color[2] = 0.29411764705882354f; 509 widget->description.color[3] = 1.0f; 510 widget->description.matchToWidget = nullptr; 511 } 512 } 513 514 { 515 RunningGraph *widget = new RunningGraph(60); 516 { 517 const int32_t fontSize = GetFontSize(0, kLargeFont); 518 const int32_t offsetX = 0; 519 const int32_t offsetY = 450; 520 const int32_t width = 5 * static_cast<uint32_t>(widget->runningValues.size()); 521 const int32_t height = 100; 522 523 widget->type = WidgetType::RunningGraph; 524 widget->fontSize = fontSize; 525 widget->coords[0] = offsetX; 526 widget->coords[1] = offsetY; 527 widget->coords[2] = offsetX + width; 528 widget->coords[3] = offsetY + height; 529 widget->color[0] = 0.0f; 530 widget->color[1] = 0.7843137254901961f; 531 widget->color[2] = 1.0f; 532 widget->color[3] = 0.7843137254901961f; 533 widget->matchToWidget = nullptr; 534 } 535 mState.mOverlayWidgets[WidgetId::VulkanUniformDescriptorCacheSize].reset(widget); 536 { 537 const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont); 538 const int32_t offsetX = 539 mState.mOverlayWidgets[WidgetId::VulkanUniformDescriptorCacheSize]->coords[0]; 540 const int32_t offsetY = 541 mState.mOverlayWidgets[WidgetId::VulkanUniformDescriptorCacheSize]->coords[1]; 542 const int32_t width = 90 * (kFontGlyphWidth >> fontSize); 543 const int32_t height = (kFontGlyphHeight >> fontSize); 544 545 widget->description.type = WidgetType::Text; 546 widget->description.fontSize = fontSize; 547 widget->description.coords[0] = offsetX; 548 widget->description.coords[1] = std::max(offsetY - height, 1); 549 widget->description.coords[2] = offsetX + width; 550 widget->description.coords[3] = offsetY; 551 widget->description.color[0] = 0.0f; 552 widget->description.color[1] = 0.7843137254901961f; 553 widget->description.color[2] = 0.29411764705882354f; 554 widget->description.color[3] = 1.0f; 555 widget->description.matchToWidget = nullptr; 556 } 557 } 558 559 { 560 Count *widget = new Count; 561 { 562 const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont); 563 const int32_t offsetX = 10; 564 const int32_t offsetY = 100; 565 const int32_t width = 30 * (kFontGlyphWidth >> fontSize); 566 const int32_t height = (kFontGlyphHeight >> fontSize); 567 568 widget->type = WidgetType::Count; 569 widget->fontSize = fontSize; 570 widget->coords[0] = offsetX; 571 widget->coords[1] = offsetY; 572 widget->coords[2] = offsetX + width; 573 widget->coords[3] = offsetY + height; 574 widget->color[0] = 1.0f; 575 widget->color[1] = 1.0f; 576 widget->color[2] = 1.0f; 577 widget->color[3] = 1.0f; 578 widget->matchToWidget = nullptr; 579 } 580 mState.mOverlayWidgets[WidgetId::VulkanDescriptorCacheKeySize].reset(widget); 581 } 582 583 { 584 RunningGraph *widget = new RunningGraph(60); 585 { 586 const int32_t fontSize = GetFontSize(0, kLargeFont); 587 const int32_t offsetX = -50; 588 const int32_t offsetY = 50; 589 const int32_t width = 5 * static_cast<uint32_t>(widget->runningValues.size()); 590 const int32_t height = 100; 591 592 widget->type = WidgetType::RunningGraph; 593 widget->fontSize = fontSize; 594 widget->coords[0] = offsetX - width; 595 widget->coords[1] = offsetY; 596 widget->coords[2] = offsetX; 597 widget->coords[3] = offsetY + height; 598 widget->color[0] = 1.0f; 599 widget->color[1] = 0.0f; 600 widget->color[2] = 0.0f; 601 widget->color[3] = 0.39215686274509803f; 602 widget->matchToWidget = nullptr; 603 } 604 mState.mOverlayWidgets[WidgetId::VulkanAttemptedSubmissions].reset(widget); 605 { 606 const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont); 607 const int32_t offsetX = 608 mState.mOverlayWidgets[WidgetId::VulkanAttemptedSubmissions]->coords[0]; 609 const int32_t offsetY = 610 mState.mOverlayWidgets[WidgetId::VulkanAttemptedSubmissions]->coords[1]; 611 const int32_t width = 45 * (kFontGlyphWidth >> fontSize); 612 const int32_t height = (kFontGlyphHeight >> fontSize); 613 614 widget->description.type = WidgetType::Text; 615 widget->description.fontSize = fontSize; 616 widget->description.coords[0] = offsetX; 617 widget->description.coords[1] = std::max(offsetY - height, 1); 618 widget->description.coords[2] = std::min(offsetX + width, -1); 619 widget->description.coords[3] = offsetY; 620 widget->description.color[0] = 0.7843137254901961f; 621 widget->description.color[1] = 0.0f; 622 widget->description.color[2] = 0.29411764705882354f; 623 widget->description.color[3] = 1.0f; 624 widget->description.matchToWidget = nullptr; 625 } 626 } 627 628 { 629 RunningGraph *widget = new RunningGraph(60); 630 { 631 const int32_t fontSize = GetFontSize(0, kLargeFont); 632 const int32_t offsetX = 633 mState.mOverlayWidgets[WidgetId::VulkanAttemptedSubmissions]->coords[0]; 634 const int32_t offsetY = 635 mState.mOverlayWidgets[WidgetId::VulkanAttemptedSubmissions]->coords[1]; 636 const int32_t width = 5 * static_cast<uint32_t>(widget->runningValues.size()); 637 const int32_t height = 100; 638 639 widget->type = WidgetType::RunningGraph; 640 widget->fontSize = fontSize; 641 widget->coords[0] = offsetX; 642 widget->coords[1] = offsetY; 643 widget->coords[2] = std::min(offsetX + width, -1); 644 widget->coords[3] = offsetY + height; 645 widget->color[0] = 0.0f; 646 widget->color[1] = 1.0f; 647 widget->color[2] = 0.0f; 648 widget->color[3] = 0.7843137254901961f; 649 widget->matchToWidget = 650 mState.mOverlayWidgets[WidgetId::VulkanAttemptedSubmissions].get(); 651 } 652 mState.mOverlayWidgets[WidgetId::VulkanActualSubmissions].reset(widget); 653 { 654 const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont); 655 const int32_t offsetX = 656 mState.mOverlayWidgets[WidgetId::VulkanActualSubmissions]->coords[0]; 657 const int32_t offsetY = 658 mState.mOverlayWidgets[WidgetId::VulkanActualSubmissions]->coords[3]; 659 const int32_t width = 45 * (kFontGlyphWidth >> fontSize); 660 const int32_t height = (kFontGlyphHeight >> fontSize); 661 662 widget->description.type = WidgetType::Text; 663 widget->description.fontSize = fontSize; 664 widget->description.coords[0] = offsetX; 665 widget->description.coords[1] = offsetY; 666 widget->description.coords[2] = std::min(offsetX + width, -1); 667 widget->description.coords[3] = offsetY + height; 668 widget->description.color[0] = 0.0f; 669 widget->description.color[1] = 0.7843137254901961f; 670 widget->description.color[2] = 0.29411764705882354f; 671 widget->description.color[3] = 1.0f; 672 widget->description.matchToWidget = nullptr; 673 } 674 } 675 676 { 677 RunningGraph *widget = new RunningGraph(60); 678 { 679 const int32_t fontSize = GetFontSize(0, kLargeFont); 680 const int32_t offsetX = -50; 681 const int32_t offsetY = -50; 682 const int32_t width = 5 * static_cast<uint32_t>(widget->runningValues.size()); 683 const int32_t height = 100; 684 685 widget->type = WidgetType::RunningGraph; 686 widget->fontSize = fontSize; 687 widget->coords[0] = offsetX - width; 688 widget->coords[1] = offsetY - height; 689 widget->coords[2] = offsetX; 690 widget->coords[3] = offsetY; 691 widget->color[0] = 0.0f; 692 widget->color[1] = 1.0f; 693 widget->color[2] = 0.0f; 694 widget->color[3] = 0.39215686274509803f; 695 widget->matchToWidget = nullptr; 696 } 697 mState.mOverlayWidgets[WidgetId::VulkanPipelineCacheLookups].reset(widget); 698 { 699 const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont); 700 const int32_t offsetX = 701 mState.mOverlayWidgets[WidgetId::VulkanPipelineCacheLookups]->coords[0]; 702 const int32_t offsetY = 703 mState.mOverlayWidgets[WidgetId::VulkanPipelineCacheLookups]->coords[1]; 704 const int32_t width = 45 * (kFontGlyphWidth >> fontSize); 705 const int32_t height = (kFontGlyphHeight >> fontSize); 706 707 widget->description.type = WidgetType::Text; 708 widget->description.fontSize = fontSize; 709 widget->description.coords[0] = offsetX; 710 widget->description.coords[1] = offsetY - height; 711 widget->description.coords[2] = std::min(offsetX + width, -1); 712 widget->description.coords[3] = offsetY; 713 widget->description.color[0] = 0.0f; 714 widget->description.color[1] = 0.7843137254901961f; 715 widget->description.color[2] = 0.29411764705882354f; 716 widget->description.color[3] = 1.0f; 717 widget->description.matchToWidget = nullptr; 718 } 719 } 720 721 { 722 RunningGraph *widget = new RunningGraph(60); 723 { 724 const int32_t fontSize = GetFontSize(0, kLargeFont); 725 const int32_t offsetX = 726 mState.mOverlayWidgets[WidgetId::VulkanPipelineCacheLookups]->coords[0]; 727 const int32_t offsetY = 728 mState.mOverlayWidgets[WidgetId::VulkanPipelineCacheLookups]->coords[1]; 729 const int32_t width = 5 * static_cast<uint32_t>(widget->runningValues.size()); 730 const int32_t height = 100; 731 732 widget->type = WidgetType::RunningGraph; 733 widget->fontSize = fontSize; 734 widget->coords[0] = offsetX; 735 widget->coords[1] = offsetY; 736 widget->coords[2] = std::min(offsetX + width, -1); 737 widget->coords[3] = std::min(offsetY + height, -1); 738 widget->color[0] = 1.0f; 739 widget->color[1] = 0.0f; 740 widget->color[2] = 0.0f; 741 widget->color[3] = 0.7843137254901961f; 742 widget->matchToWidget = 743 mState.mOverlayWidgets[WidgetId::VulkanPipelineCacheLookups].get(); 744 } 745 mState.mOverlayWidgets[WidgetId::VulkanPipelineCacheMisses].reset(widget); 746 { 747 const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont); 748 const int32_t offsetX = mState.mOverlayWidgets[WidgetId::VulkanPipelineCacheLookups] 749 ->getDescriptionWidget() 750 ->coords[0]; 751 const int32_t offsetY = mState.mOverlayWidgets[WidgetId::VulkanPipelineCacheLookups] 752 ->getDescriptionWidget() 753 ->coords[1]; 754 const int32_t width = 45 * (kFontGlyphWidth >> fontSize); 755 const int32_t height = (kFontGlyphHeight >> fontSize); 756 757 widget->description.type = WidgetType::Text; 758 widget->description.fontSize = fontSize; 759 widget->description.coords[0] = offsetX; 760 widget->description.coords[1] = offsetY - height; 761 widget->description.coords[2] = std::min(offsetX + width, -1); 762 widget->description.coords[3] = offsetY; 763 widget->description.color[0] = 0.7843137254901961f; 764 widget->description.color[1] = 0.0f; 765 widget->description.color[2] = 0.29411764705882354f; 766 widget->description.color[3] = 1.0f; 767 widget->description.matchToWidget = nullptr; 768 } 769 } 770 771 { 772 Count *widget = new Count; 773 { 774 const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont); 775 const int32_t offsetX = 776 mState.mOverlayWidgets[WidgetId::VulkanPipelineCacheMisses]->coords[0]; 777 const int32_t offsetY = 778 mState.mOverlayWidgets[WidgetId::VulkanPipelineCacheMisses]->coords[3]; 779 const int32_t width = 45 * (kFontGlyphWidth >> fontSize); 780 const int32_t height = (kFontGlyphHeight >> fontSize); 781 782 widget->type = WidgetType::Count; 783 widget->fontSize = fontSize; 784 widget->coords[0] = offsetX; 785 widget->coords[1] = offsetY; 786 widget->coords[2] = std::min(offsetX + width, -1); 787 widget->coords[3] = std::min(offsetY + height, -1); 788 widget->color[0] = 1.0f; 789 widget->color[1] = 0.0f; 790 widget->color[2] = 0.0f; 791 widget->color[3] = 1.0f; 792 widget->matchToWidget = nullptr; 793 } 794 mState.mOverlayWidgets[WidgetId::VulkanTotalPipelineCacheMissTimeMs].reset(widget); 795 } 796 797 { 798 Count *widget = new Count; 799 { 800 const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont); 801 const int32_t offsetX = 802 mState.mOverlayWidgets[WidgetId::VulkanTotalPipelineCacheMissTimeMs]->coords[0]; 803 const int32_t offsetY = 804 mState.mOverlayWidgets[WidgetId::VulkanTotalPipelineCacheMissTimeMs]->coords[3]; 805 const int32_t width = 45 * (kFontGlyphWidth >> fontSize); 806 const int32_t height = (kFontGlyphHeight >> fontSize); 807 808 widget->type = WidgetType::Count; 809 widget->fontSize = fontSize; 810 widget->coords[0] = offsetX; 811 widget->coords[1] = offsetY; 812 widget->coords[2] = std::min(offsetX + width, -1); 813 widget->coords[3] = std::min(offsetY + height, -1); 814 widget->color[0] = 0.0f; 815 widget->color[1] = 1.0f; 816 widget->color[2] = 0.0f; 817 widget->color[3] = 1.0f; 818 widget->matchToWidget = nullptr; 819 } 820 mState.mOverlayWidgets[WidgetId::VulkanTotalPipelineCacheHitTimeMs].reset(widget); 821 } 822 } 823 824 } // namespace gl