Attach depth array layers and cube faces with the matching GL call

Aperta Adatta ai principianti
#141 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
cpp

Direzione di ricerca

Inizia in source/renderer/ore/gl/ore_context_gl.cpp, in ContextGL::beginRenderPass, e confronta la gestione dell’attachment di profondità con quella dell’attachment di colore menzionata nell’issue. Verifica come le facce cubiche e i layer degli array 2D selezionano le chiamate di attachment e i valori di layer o mip. Il lavoro è completato quando le view cubiche e array di profondità vengono collegate tramite le chiamate GL corrispondenti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Attach depth array layers and cube faces with the matching GL call.

- source/renderer/ore/gl/ore_context_gl.cpp: Ore GL beginRenderPass: attach a layer of a depth array or cube face with the matching call, as color attachments do, instead of always as a 2D texture

diff --git a/source/renderer/ore/gl/ore_context_gl.cpp b/source/renderer/ore/gl/ore_context_gl.cpp
index f6ca307d474486aef4fba23b1785f7b7de0c1251..539a2c5ac2afc290d517afb2284044096bf04669 100644
--- a/source/renderer/ore/gl/ore_context_gl.cpp
+++ b/source/renderer/ore/gl/ore_context_gl.cpp
@@ -1264,6 +1264,24 @@ std::unique_ptr<RenderPass> ContextGL::beginRenderPass(
           GL_RENDERBUFFER,
           depthTexGL->m_glRenderbuffer);
     }
+    else if (depthTexGL->type() == TextureType::cube)
+    {
+      glFramebufferTexture2D(
+          GL_FRAMEBUFFER,
+          depthAttachment,
+          GL_TEXTURE_CUBE_MAP_POSITIVE_X + desc.depthStencil.view->baseLayer(),
+          depthTexGL->m_glTexture,
+          desc.depthStencil.view->baseMipLevel());
+    }
+    else if (depthTexGL->type() == TextureType::array2D)
+    {
+      glFramebufferTextureLayer(
+          GL_FRAMEBUFFER,
+          depthAttachment,
+          depthTexGL->m_glTexture,
+          desc.depthStencil.view->baseMipLevel(),
+          desc.depthStencil.view->baseLayer());
+    }
     else
     {
       glFramebufferTexture2D(
Lingua principale
C++
Stelle
1.2k
Fork
133
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rive-app/rive-runtime

Tutte le issue di rive-app/rive-runtime

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.