MythTV  master
mythpaintervulkan.cpp
Go to the documentation of this file.
1 // Qt
2 #include <QGuiApplication>
3 
4 // MythTV
5 #include "mythlogging.h"
6 #include "mythimage.h"
12 #include "vulkan/mythdebugvulkan.h"
14 
15 #define LOC QString("VulkanPainter: ")
16 
18  : MythPainterGPU(Parent)
19 {
20  m_transforms.push(QMatrix4x4());
22 }
23 
25 {
27  m_vulkan->Funcs()->vkQueueWaitIdle(m_vulkan->Window()->graphicsQueue());
28 
29  Teardown();
32 }
33 
35 {
36  ClearCache();
39 }
40 
43 {
45  m_vulkan->Funcs()->vkQueueWaitIdle(m_vulkan->Window()->graphicsQueue());
46 
47  LOG(VB_GENERAL, LOG_INFO, LOC + "Releasing Vulkan resources");
48 
49  delete m_projectionUniform;
50  delete m_textureShader;
51 
53  {
54  m_vulkan->Funcs()->vkDestroyPipeline(m_vulkan->Device(), m_texturePipeline, nullptr);
55  m_vulkan->Funcs()->vkDestroyDescriptorPool(m_vulkan->Device(), m_textureDescriptorPool, nullptr);
56  m_vulkan->Funcs()->vkDestroyDescriptorPool(m_vulkan->Device(), m_projectionDescriptorPool, nullptr);
57  m_vulkan->Funcs()->vkDestroySampler(m_vulkan->Device(), m_textureSampler, nullptr);
59  {
60  m_vulkan->Funcs()->vkFreeCommandBuffers(m_vulkan->Device(),
61  m_vulkan->Window()->graphicsCommandPool(), 1, &m_textureUploadCmd);
62  }
63  }
64 
65  m_ready = false;
66  delete m_vulkan;
67  m_vulkan = nullptr;
69  m_projectionDescriptor = MYTH_NULL_DISPATCH; // destroyed with pool
70  m_projectionUniform = nullptr;
71  m_textureShader = nullptr;
72  m_textureUploadCmd = nullptr;
77  m_availableTextureDescriptors.clear(); // destroyed with pool
78  m_frameStarted = false;
79  m_lastSize = { 0, 0 };
80 
81  LOG(VB_GENERAL, LOG_INFO, LOC + "Finished releasing resources");
82 }
83 
85 {
86  return "Vulkan";
87 }
88 
90 {
91  return true;
92 }
93 
95 {
96  return true;
97 }
98 
100 {
101  return false;
102 }
103 
104 void MythPainterVulkan::PushTransformation(const UIEffects &Fx, QPointF Center)
105 {
106  QMatrix4x4 newtop = m_transforms.top();
107  if (Fx.m_hzoom != 1.0F || Fx.m_vzoom != 1.0F || Fx.m_angle != 0.0F)
108  {
109  newtop.translate(static_cast<float>(Center.x()), static_cast<float>(Center.y()));
110  newtop.scale(Fx.m_hzoom, Fx.m_vzoom);
111  newtop.rotate(Fx.m_angle, 0, 0, 1);
112  newtop.translate(static_cast<float>(-Center.x()), static_cast<float>(-Center.y()));
113  }
114  m_transforms.push(newtop);
115 }
116 
118 {
119  m_transforms.pop();
120 }
121 
123 {
124  if (m_ready)
125  return true;
126 
127  if (!m_vulkan)
128  {
129  // device setup can be delayed by a few frames on startup - check status
130  // before continuing
132  if (!window || !window->device())
133  return false;
134 
136  if (!m_vulkan)
137  return false;
138  }
139 
140  if (!m_textureShader)
141  {
142  std::vector<int> stages = { DefaultVertex450, DefaultFragment450 };
144  if (!m_textureShader)
145  return false;
146  }
147 
148  if (!m_texturePipeline)
149  {
150  QRect viewport(QPoint{0, 0}, m_vulkan->Window()->swapChainImageSize());
152  if (!m_texturePipeline)
153  return false;
154  }
155 
157  {
158  const auto & sizes = m_textureShader->GetPoolSizes(0);
159  VkDescriptorPoolCreateInfo pool { VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO, nullptr,
160  0, 1, static_cast<uint32_t>(sizes.size()), sizes.data() };
161  if (m_vulkan->Funcs()->vkCreateDescriptorPool(m_vulkan->Device(), &pool, nullptr, &m_projectionDescriptorPool) != VK_SUCCESS)
162  {
163  LOG(VB_GENERAL, LOG_ERR, LOC + "Failed to create descriptor pool for projection");
164  return false;
165  }
166  }
167 
168  if (!m_projectionUniform)
169  {
171  if (!m_projectionUniform)
172  return false;
173 
174  m_projection.setToIdentity();
175  QRect viewport(QPoint{0, 0}, m_vulkan->Window()->swapChainImageSize());
176  m_projection.ortho(viewport);
177  m_projection = m_vulkan->Window()->clipCorrectionMatrix() * m_projection;
179  }
180 
182  {
183  // projection is set 0
184  VkDescriptorSetLayout layout = m_textureShader->GetDescSetLayout(0);
185  VkDescriptorSetAllocateInfo alloc { };
186  alloc.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO;
187  alloc.descriptorPool = m_projectionDescriptorPool;
188  alloc.descriptorSetCount = 1;
189  alloc.pSetLayouts = &layout;
190 
191  if (m_vulkan->Funcs()->vkAllocateDescriptorSets(m_vulkan->Device(), &alloc, &m_projectionDescriptor) != VK_SUCCESS)
192  {
193  LOG(VB_GENERAL, LOG_INFO, LOC + "Failed to allocate projection descriptor set");
194  return false;
195  }
196 
197  VkDescriptorBufferInfo buffdesc = m_projectionUniform->GetBufferInfo();
198 
199  VkWriteDescriptorSet write { };
200  write.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
201  write.dstSet = m_projectionDescriptor;
202  write.dstBinding = 0;
203  write.dstArrayElement = 0;
204  write.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
205  write.descriptorCount = 1;
206  write.pBufferInfo = &buffdesc;
207 
208  m_vulkan->Funcs()->vkUpdateDescriptorSets(m_vulkan->Device(), 1, &write, 0, nullptr);
209  }
210 
212  {
213  const auto & sizes = m_textureShader->GetPoolSizes(1);
214  // match total number of individual descriptors with pool size
215  std::vector<VkDescriptorPoolSize> adjsizes;
216  std::transform(sizes.cbegin(), sizes.cend(), std::back_inserter(adjsizes),
217  [](VkDescriptorPoolSize Size){ return VkDescriptorPoolSize { Size.type, MAX_TEXTURE_COUNT }; });
218  VkDescriptorPoolCreateInfo pool { VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO, nullptr,
219  0, MAX_TEXTURE_COUNT, static_cast<uint32_t>(adjsizes.size()), adjsizes.data() };
220  if (m_vulkan->Funcs()->vkCreateDescriptorPool(m_vulkan->Device(), &pool, nullptr, &m_textureDescriptorPool) != VK_SUCCESS)
221  {
222  LOG(VB_GENERAL, LOG_ERR, LOC + "Failed to create descriptor pool");
223  return false;
224  }
225  }
226 
227  if (!m_textureDescriptorsCreated)
228  {
229  // transform and sampler are set 1 (projection is set 0)
230  VkDescriptorSetLayout layout = m_textureShader->GetDescSetLayout(1);
231  m_availableTextureDescriptors.clear();
232  for (int i = 0; i < MAX_TEXTURE_COUNT; ++i)
233  {
234  VkDescriptorSet descset = MYTH_NULL_DISPATCH;
235  VkDescriptorSetAllocateInfo alloc { };
236  alloc.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO;
237  alloc.descriptorPool = m_textureDescriptorPool;
238  alloc.descriptorSetCount = 1;
239  alloc.pSetLayouts = &layout;
240  VkResult res = m_vulkan->Funcs()->vkAllocateDescriptorSets(m_vulkan->Device(), &alloc, &descset);
241  if (res != VK_SUCCESS)
242  LOG(VB_GENERAL, LOG_ERR, LOC + "Failed to allocate descriptor set");
243  m_availableTextureDescriptors.push_back(descset);
244  }
245 
246  m_textureDescriptorsCreated = true;
247  }
248 
249  if (!m_textureSampler)
250  {
251  m_textureSampler = m_vulkan->Render()->CreateSampler(VK_FILTER_LINEAR, VK_FILTER_LINEAR);
252  if (!m_textureSampler)
253  return false;
254  }
255 
256  m_ready = true;
257  return true;
258 }
259 
267 void MythPainterVulkan::Begin(QPaintDevice* /*Parent*/)
268 {
269  if (!Ready())
270  return;
271 
272  // check if we need to adjust cache sizes
273  if (m_lastSize != m_vulkan->Window()->size())
274  {
275  // This will scale the cache depending on the resolution in use
276  static const int s_onehd = 1920 * 1080;
277  static const int s_basesize = 64;
278  m_lastSize = m_vulkan->Window()->size();
279  float hdscreens = (static_cast<float>(m_lastSize.width() + 1) * m_lastSize.height()) / s_onehd;
280  int cpu = qMax(static_cast<int>(hdscreens * s_basesize), s_basesize);
281  int gpu = cpu * 3 / 2;
282  SetMaximumCacheSizes(gpu, cpu);
283  }
284 
285  // Sometimes the UI engine will mark images as 'changed' when moving between
286  // screens. These are then often released here whilst still in use for the
287  // previous frame. To avoid validation errors, wait for the last frame to
288  // complete before continuing - though this feels like a hack and surely
289  // the last frame should already be complete at this point?
290  if (!m_texturesToDelete.empty())
291  {
292  m_vulkan->Funcs()->vkQueueWaitIdle(m_vulkan->Window()->graphicsQueue());
293  DeleteTextures();
294  }
295  m_frameStarted = true;
296 }
297 
299 {
300  if (!(Ready() && m_frameStarted))
301  return;
302 
303  // Complete any texture updates first
304  if (m_textureUploadCmd)
305  {
307  m_textureUploadCmd = nullptr;
308 
309  // release staging buffers which are no longer needed
310  for (auto * texture : m_stagedTextures)
311  texture->StagingFinished();
312  m_stagedTextures.clear();
313  }
314 
315  if (m_queuedTextures.empty())
316  return;
317 
318  if (m_viewControl.testFlag(Framebuffer))
319  {
320  // Tell the renderer that we are requesting a frame start
322 
323  // Signal DIRECTLY to the window to start the frame - which ensures
324  // the event is not delayed and we can start to render immediately.
325  QEvent update(QEvent::UpdateRequest);
326  QGuiApplication::sendEvent(m_vulkan->Window(), &update);
327  }
328 
329  // Retrieve the command buffer
330  VkCommandBuffer currentcmdbuf = m_vulkan->Window()->currentCommandBuffer();
331  if (VERBOSE_LEVEL_CHECK(VB_GPU, LOG_INFO))
332  m_vulkan->Render()->BeginDebugRegion(currentcmdbuf, "PAINTER_RENDER", MythDebugVulkan::kDebugGreen);
333 
334  // Bind our pipeline and retrieve layout once
335  m_vulkan->Funcs()->vkCmdBindPipeline(currentcmdbuf, VK_PIPELINE_BIND_POINT_GRAPHICS, m_texturePipeline);
336  VkPipelineLayout layout = m_textureShader->GetPipelineLayout();
337 
338  // Bind descriptor set 0 - which is the projection, which is 'constant' for all textures
339  m_vulkan->Funcs()->vkCmdBindDescriptorSets(currentcmdbuf, VK_PIPELINE_BIND_POINT_GRAPHICS,
340  layout, 0, 1, &m_projectionDescriptor, 0, nullptr);
341 
342  for (auto * texture : m_queuedTextures)
343  {
344  // Bind descriptor set 1 for this texture - sampler
345  m_vulkan->Funcs()->vkCmdBindDescriptorSets(currentcmdbuf, VK_PIPELINE_BIND_POINT_GRAPHICS,
346  layout, 1, 1, &texture->m_descriptor, 0, nullptr);
347 
348  // Push constants - transform, vertex data and color (alpha)
349  m_vulkan->Funcs()->vkCmdPushConstants(currentcmdbuf, layout, VK_SHADER_STAGE_VERTEX_BIT,
350  0, MYTH_PUSHBUFFER_SIZE, texture->Data());
351  texture->PopData();
352 
353  // Draw
354  m_vulkan->Funcs()->vkCmdDraw(currentcmdbuf, 4, 1, 0, 0);
355  }
356 
357  if (VERBOSE_LEVEL_CHECK(VB_GPU, LOG_INFO))
358  m_vulkan->Render()->EndDebugRegion(currentcmdbuf);
359 
360  m_queuedTextures.clear();
361 
362  if (m_viewControl.testFlag(Framebuffer))
363  m_vulkan->Render()->EndFrame();
364 }
365 
366 void MythPainterVulkan::DrawImage(const QRect Dest, MythImage *Image, const QRect Source, int Alpha)
367 {
368  if (!m_frameStarted)
369  return;
370 
371  MythTextureVulkan* texture = GetTextureFromCache(Image);
372  if (texture)
373  {
374  // Update push constant buffer
375  texture->PushData(m_transforms.top(), Source, Dest, Alpha);
376  // Queue
377  m_queuedTextures.emplace_back(texture);
378  }
379 }
380 
382 {
383  return new MythImage(this);
384 }
385 
387 {
388  if (m_imageToTextureMap.contains(Image))
389  {
390  m_texturesToDelete.push_back(m_imageToTextureMap[Image]);
391  m_imageToTextureMap.remove(Image);
392  m_imageExpire.remove(Image);
393  }
394 }
395 
397 {
398  LOG(VB_GENERAL, LOG_INFO, "Clearing Vulkan painter cache.");
399 
400  QMapIterator<MythImage *, MythTextureVulkan*> it(m_imageToTextureMap);
401  while (it.hasNext())
402  {
403  it.next();
404  m_texturesToDelete.push_back(m_imageToTextureMap[it.key()]);
405  m_imageExpire.remove(it.key());
406  }
407  m_imageToTextureMap.clear();
408 }
409 
411 {
412  if (!(Ready() && Image))
413  return nullptr;
414 
415  if (m_imageToTextureMap.contains(Image))
416  {
417  if (!Image->IsChanged())
418  {
419  m_imageExpire.remove(Image);
420  m_imageExpire.push_back(Image);
421  return m_imageToTextureMap[Image];
422  }
423  DeleteFormatImagePriv(Image);
424  }
425 
426  Image->SetChanged(false);
427 
428  int count = 0; // guard against unexpected texture creation failure
429  MythTextureVulkan* texture = nullptr;
430  while (texture == nullptr)
431  {
432  if (!m_textureUploadCmd)
435  if (texture != nullptr)
436  break;
437 
438  // This can happen if the cached textures are too big for GPU memory
439  if ((count++ > 1000) || m_hardwareCacheSize < (8 * 1024 * 1024))
440  {
441  LOG(VB_GENERAL, LOG_ERR, "Failed to create Vulkan texture.");
442  return nullptr;
443  }
444 
445  // Shrink the cache size
447  LOG(VB_GENERAL, LOG_NOTICE, LOC + QString("Shrinking HW cache size to %1KB")
448  .arg(m_maxHardwareCacheSize / 1024));
449 
451  {
452  MythImage *expired = m_imageExpire.front();
453  m_imageExpire.pop_front();
454  DeleteFormatImagePriv(expired);
455  DeleteTextures();
456  }
457  }
458 
460  {
461  LOG(VB_GENERAL, LOG_ERR, LOC + "No descriptor pool?");
462  delete texture;
463  return nullptr;
464  }
465 
466  // With a reasonable hardware cache size and many small thumbnails and
467  // text images, we can easily hit the max texture count before the cache
468  // size. So ensure we always have a descriptor available.
469 
470  if (m_availableTextureDescriptors.empty())
471  {
472  MythImage *expired = m_imageExpire.front();
473  m_imageExpire.pop_front();
474  DeleteFormatImagePriv(expired);
475  DeleteTextures();
476 
477  if (m_availableTextureDescriptors.empty())
478  {
479  LOG(VB_GENERAL, LOG_WARNING, LOC + "No texture descriptor available??");
480  delete texture;
481  return nullptr;
482  }
483  }
484 
485  VkDescriptorSet descset = m_availableTextureDescriptors.back();
487 
488  auto imagedesc = texture->GetDescriptorImage();
489  VkWriteDescriptorSet write { };
490  write.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
491  write.dstSet = descset;
492  write.dstBinding = 0;
493  write.dstArrayElement = 0;
494  write.descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
495  write.descriptorCount = 1;
496  write.pImageInfo = &imagedesc;
497  m_vulkan->Funcs()->vkUpdateDescriptorSets(m_vulkan->Device(), 1, &write, 0, nullptr);
498  texture->AddDescriptor(descset);
499  m_stagedTextures.emplace_back(texture);
500 
501  CheckFormatImage(Image);
502  m_hardwareCacheSize += texture->m_dataSize;
503  m_imageToTextureMap[Image] = texture;
504  m_imageExpire.push_back(Image);
505 
507  {
508  MythImage *expired = m_imageExpire.front();
509  m_imageExpire.pop_front();
510  DeleteFormatImagePriv(expired);
511  DeleteTextures();
512  }
513 
514  //LOG(VB_GENERAL, LOG_INFO, LOC + QString("Images: %1 Sets: %2 Recycled: %3")
515  // .arg(m_imageToTextureMap.size()).arg(m_allocatedTextureDescriptors).arg(m_availableTextureDescriptors.size()));
516  //LOG(VB_GENERAL, LOG_INFO, LOC + QString("Hardware cache: %1 (Max: %2)")
517  // .arg(m_hardwareCacheSize / (1024 * 1024)).arg(m_maxHardwareCacheSize / (1024 * 1024)));
518 
519  return texture;
520 }
521 
523 {
524  if (!Ready() || m_texturesToDelete.empty())
525  return;
526 
527  while (!m_texturesToDelete.empty())
528  {
529  MythTextureVulkan *texture = m_texturesToDelete.front();
530  m_hardwareCacheSize -= texture->m_dataSize;
531  VkDescriptorSet descriptor = texture->TakeDescriptor();
532  if (descriptor)
533  m_availableTextureDescriptors.emplace_back(descriptor);
534  delete texture;
535  m_texturesToDelete.pop_front();
536  }
537 }
MythShaderVulkan::GetDescSetLayout
VkDescriptorSetLayout GetDescSetLayout(size_t Set) const
Definition: mythshadervulkan.cpp:471
MythTextureVulkan::Create
static MythTextureVulkan * Create(MythVulkanObject *Vulkan, QImage *Image, VkSampler Sampler, VkCommandBuffer CommandBuffer=nullptr)
Definition: mythtexturevulkan.cpp:7
MythPainterVulkan::m_imageExpire
std::list< MythImage * > m_imageExpire
Definition: mythpaintervulkan.h:72
UIEffects::m_angle
float m_angle
Definition: mythuianimation.h:41
MythPainter::m_hardwareCacheSize
int m_hardwareCacheSize
Definition: mythpainter.h:127
MythPainterVulkan::DeleteFormatImagePriv
void DeleteFormatImagePriv(MythImage *Image) override
Definition: mythpaintervulkan.cpp:386
MythTextureVulkan::TakeDescriptor
VkDescriptorSet TakeDescriptor(void)
Definition: mythtexturevulkan.cpp:150
MythUniformBufferVulkan::GetBufferInfo
VkDescriptorBufferInfo GetBufferInfo(void) const
Definition: mythuniformbuffervulkan.cpp:41
mythtexturevulkan.h
MythRenderVulkan::DoFreeResources
void DoFreeResources(void)
MythPainterVulkan::m_projection
QMatrix4x4 m_projection
Definition: mythpaintervulkan.h:75
MythShaderVulkan::GetPoolSizes
const std::vector< VkDescriptorPoolSize > & GetPoolSizes(size_t Set) const
Definition: mythshadervulkan.cpp:463
MythPainterVulkan::GetTextureFromCache
MythTextureVulkan * GetTextureFromCache(MythImage *Image)
Definition: mythpaintervulkan.cpp:410
DefaultVertex450
#define DefaultVertex450
Definition: mythshadersvulkan.h:23
MythPainterVulkan::End
void End() override
Definition: mythpaintervulkan.cpp:298
MythPainterVulkan::MythPainterVulkan
MythPainterVulkan(MythRenderVulkan *VulkanRender, MythMainWindow *Parent)
Definition: mythpaintervulkan.cpp:17
MythPainterVulkan::Begin
void Begin(QPaintDevice *) override
Begin painting.
Definition: mythpaintervulkan.cpp:267
MythPainterVulkan::m_vulkan
MythVulkanObject * m_vulkan
Definition: mythpaintervulkan.h:55
MythPainterVulkan::SupportsAnimation
bool SupportsAnimation() override
Definition: mythpaintervulkan.cpp:94
MythPainterVulkan::FreeResources
void FreeResources() override
Definition: mythpaintervulkan.cpp:34
mythdebugvulkan.h
MythPainterVulkan::Ready
bool Ready()
Definition: mythpaintervulkan.cpp:122
MythPainter::SetMaximumCacheSizes
void SetMaximumCacheSizes(int hardware, int software)
Definition: mythpainter.cpp:607
MythPainterVulkan::GetName
QString GetName() override
Definition: mythpaintervulkan.cpp:84
MythPainterVulkan::m_queuedTextures
std::vector< MythTextureVulkan * > m_queuedTextures
Definition: mythpaintervulkan.h:70
MythPainterVulkan::~MythPainterVulkan
~MythPainterVulkan() override
Definition: mythpaintervulkan.cpp:24
MythPainterVulkan::m_projectionDescriptor
VkDescriptorSet m_projectionDescriptor
Definition: mythpaintervulkan.h:58
MYTH_NULL_DISPATCH
#define MYTH_NULL_DISPATCH
Definition: mythrendervulkan.h:26
MythPainterVulkan::SupportsClipping
bool SupportsClipping() override
Definition: mythpaintervulkan.cpp:99
MythRenderVulkan::GetVulkanRender
static MythRenderVulkan * GetVulkanRender(void)
Definition: mythrendervulkan.cpp:88
mythburn.write
def write(text, progress=True)
Definition: mythburn.py:308
MythPainterVulkan::m_texturePipeline
VkPipeline m_texturePipeline
Definition: mythpaintervulkan.h:62
MythPainterVulkan::m_projectionUniform
MythUniformBufferVulkan * m_projectionUniform
Definition: mythpaintervulkan.h:59
MythComboBufferVulkan::PushData
void PushData(const QMatrix4x4 &Transform, QRect Source, QRect Destination, int Alpha)
Definition: mythcombobuffervulkan.cpp:20
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
MythPainterVulkan::GetFormatImagePriv
MythImage * GetFormatImagePriv() override
Creates a reference counted image, call DecrRef() to delete.
Definition: mythpaintervulkan.cpp:381
MythRenderVulkan::CreateSingleUseCommandBuffer
VkCommandBuffer CreateSingleUseCommandBuffer(void)
Definition: mythrendervulkan.cpp:611
MythPainter::m_maxHardwareCacheSize
int m_maxHardwareCacheSize
Definition: mythpainter.h:128
mythpaintervulkan.h
MythVulkanObject::Create
static MythVulkanObject * Create(MythRenderVulkan *Render)
Definition: mythrendervulkan.cpp:16
MythPainterGPU::m_viewControl
ViewControls m_viewControl
Definition: mythpaintergpu.h:34
MythTextureVulkan
Definition: mythtexturevulkan.h:14
MythPainterVulkan::m_textureUploadCmd
VkCommandBuffer m_textureUploadCmd
Definition: mythpaintervulkan.h:66
MythUniformBufferVulkan::Update
void Update(void *Source)
Definition: mythuniformbuffervulkan.cpp:46
MythPainterVulkan::DrawImage
void DrawImage(QRect Dest, MythImage *Image, QRect Source, int Alpha) override
Definition: mythpaintervulkan.cpp:366
MythPainterVulkan::DeleteTextures
void DeleteTextures()
Definition: mythpaintervulkan.cpp:522
MythShaderVulkan::Create
static MythShaderVulkan * Create(MythVulkanObject *Vulkan, const std::vector< int > &Stages, const MythShaderMap *Sources=nullptr, const MythBindingMap *Bindings=nullptr)
Definition: mythshadervulkan.cpp:260
MythTextureVulkan::AddDescriptor
void AddDescriptor(VkDescriptorSet Descriptor)
Definition: mythtexturevulkan.cpp:145
MythRenderVulkan::GetVulkanWindow
MythWindowVulkan * GetVulkanWindow(void)
Definition: mythrendervulkan.cpp:126
mythcombobuffervulkan.h
MythPainterVulkan::m_imageToTextureMap
QMap< MythImage *, MythTextureVulkan * > m_imageToTextureMap
Definition: mythpaintervulkan.h:71
mythuniformbuffervulkan.h
MythRenderVulkan::BeginDebugRegion
void BeginDebugRegion(VkCommandBuffer CommandBuffer, const char *Name, MythVulkan4F Color)
Definition: mythrendervulkan.cpp:526
MythPainterVulkan::m_transforms
QStack< QMatrix4x4 > m_transforms
Definition: mythpaintervulkan.h:76
mythlogging.h
Source
Definition: channelsettings.cpp:68
MythShaderVulkan::GetPipelineLayout
VkPipelineLayout GetPipelineLayout(void) const
Definition: mythshadervulkan.cpp:458
MAX_TEXTURE_COUNT
#define MAX_TEXTURE_COUNT
Definition: mythpaintervulkan.h:17
MythRenderVulkan::SetFrameExpected
void SetFrameExpected(void)
Definition: mythrendervulkan.cpp:298
MythTextureVulkan::m_dataSize
uint64_t m_dataSize
Definition: mythtexturevulkan.h:27
MythPainterVulkan::m_textureSampler
VkSampler m_textureSampler
Definition: mythpaintervulkan.h:60
MythPainterVulkan::SupportsAlpha
bool SupportsAlpha() override
Definition: mythpaintervulkan.cpp:89
mythshadervulkan.h
MythPainterVulkan::m_stagedTextures
std::vector< MythTextureVulkan * > m_stagedTextures
Definition: mythpaintervulkan.h:69
MythImage::SetChanged
virtual void SetChanged(bool change=true)
Definition: mythimage.h:50
MythVulkanObject::Device
VkDevice Device()
Definition: mythrendervulkan.cpp:73
MythPainter::FreeResources
virtual void FreeResources(void)
Definition: mythpainter.h:51
MythPainterVulkan::m_ready
bool m_ready
Definition: mythpaintervulkan.h:54
MythPainterVulkan::m_availableTextureDescriptors
std::vector< VkDescriptorSet > m_availableTextureDescriptors
Definition: mythpaintervulkan.h:65
MythPainterVulkan::m_texturesToDelete
QVector< MythTextureVulkan * > m_texturesToDelete
Definition: mythpaintervulkan.h:73
MythRenderVulkan::EndDebugRegion
void EndDebugRegion(VkCommandBuffer CommandBuffer)
Definition: mythrendervulkan.cpp:533
MYTH_PUSHBUFFER_SIZE
#define MYTH_PUSHBUFFER_SIZE
Definition: mythcombobuffervulkan.h:24
MythPainterVulkan::DoFreeResources
void DoFreeResources()
Free resources before the render device is released.
Definition: mythpaintervulkan.cpp:42
UIEffects::m_vzoom
float m_vzoom
Definition: mythuianimation.h:40
mythimage.h
MythPainterVulkan::PopTransformation
void PopTransformation() override
Definition: mythpaintervulkan.cpp:117
MythPainterVulkan::PushTransformation
void PushTransformation(const UIEffects &Fx, QPointF Center=QPointF()) override
Definition: mythpaintervulkan.cpp:104
VERBOSE_LEVEL_CHECK
#define VERBOSE_LEVEL_CHECK(_MASK_, _LEVEL_)
Definition: mythlogging.h:14
MythPainterVulkan::m_textureDescriptorPool
VkDescriptorPool m_textureDescriptorPool
Definition: mythpaintervulkan.h:63
MythPainterGPU::Framebuffer
@ Framebuffer
Definition: mythpaintergpu.h:20
MythRenderVulkan::CreatePipeline
VkPipeline CreatePipeline(MythShaderVulkan *Shader, QRect Viewport, std::vector< VkDynamicState > Dynamic={ })
Definition: mythrendervulkan.cpp:639
MythPainterVulkan::m_frameStarted
bool m_frameStarted
Definition: mythpaintervulkan.h:67
MythImage
Definition: mythimage.h:36
MythPainterVulkan::m_textureShader
MythShaderVulkan * m_textureShader
Definition: mythpaintervulkan.h:61
MythVulkanObject::Window
MythWindowVulkan * Window()
Definition: mythrendervulkan.cpp:83
MythRenderVulkan::EndFrame
void EndFrame(void)
Definition: mythrendervulkan.cpp:355
MythPainterGPU::m_lastSize
QSize m_lastSize
Definition: mythpaintergpu.h:37
MythDebugVulkan::kDebugGreen
static const MythVulkan4F kDebugGreen
Definition: mythdebugvulkan.h:12
MythPainterVulkan::m_projectionDescriptorPool
VkDescriptorPool m_projectionDescriptorPool
Definition: mythpaintervulkan.h:57
UIEffects
Definition: mythuianimation.h:12
DefaultFragment450
#define DefaultFragment450
Definition: mythshadersvulkan.h:24
MythVulkanObject::IsValidVulkan
bool IsValidVulkan() const
Definition: mythrendervulkan.cpp:63
MythRenderVulkan
Definition: mythrendervulkan.h:54
MythImage::IsChanged
bool IsChanged() const
Definition: mythimage.h:51
LOC
#define LOC
Definition: mythpaintervulkan.cpp:15
MythTextureVulkan::GetDescriptorImage
VkDescriptorImageInfo GetDescriptorImage(void) const
Definition: mythtexturevulkan.cpp:140
UIEffects::m_hzoom
float m_hzoom
Definition: mythuianimation.h:39
MythVulkanObject::Funcs
QVulkanDeviceFunctions * Funcs()
Definition: mythrendervulkan.cpp:78
MythPainter::Teardown
virtual void Teardown(void)
Definition: mythpainter.cpp:28
MythPainterVulkan::ClearCache
void ClearCache()
Definition: mythpaintervulkan.cpp:396
mythshadersvulkan.h
MythPainter::CheckFormatImage
void CheckFormatImage(MythImage *im)
Definition: mythpainter.cpp:556
MythRenderVulkan::FinishSingleUseCommandBuffer
void FinishSingleUseCommandBuffer(VkCommandBuffer &Buffer)
Definition: mythrendervulkan.cpp:627
MythVulkanObject::Render
MythRenderVulkan * Render()
Definition: mythrendervulkan.cpp:68
MythUniformBufferVulkan::Create
static MythUniformBufferVulkan * Create(MythVulkanObject *Vulkan, VkDeviceSize Size)
Definition: mythuniformbuffervulkan.cpp:4
MythPainterVulkan::m_textureDescriptorsCreated
bool m_textureDescriptorsCreated
Definition: mythpaintervulkan.h:64
MythMainWindow
Definition: mythmainwindow.h:35
MythPainterGPU
Definition: mythpaintergpu.h:11