mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
TextureCache: Ensure that all render target textures have as many layers as the frame buffer.
Also fixes a case where the D3D code path did not initialize num_layers leading to undefined behaviour.
This commit is contained in:
@ -21,8 +21,6 @@ int FramebufferManager::m_targetHeight;
|
||||
int FramebufferManager::m_msaaSamples;
|
||||
|
||||
GLenum FramebufferManager::m_textureType;
|
||||
int FramebufferManager::m_EFBLayers;
|
||||
|
||||
GLuint FramebufferManager::m_efbFramebuffer;
|
||||
GLuint FramebufferManager::m_xfbFramebuffer;
|
||||
GLuint FramebufferManager::m_efbColor;
|
||||
|
@ -74,8 +74,6 @@ public:
|
||||
// Resolved framebuffer is only used in MSAA mode.
|
||||
static GLuint GetResolvedFramebuffer() { return m_resolvedFramebuffer; }
|
||||
|
||||
static int GetEFBLayers() { return m_EFBLayers; }
|
||||
|
||||
static void SetFramebuffer(GLuint fb);
|
||||
|
||||
// If in MSAA mode, this will perform a resolve of the specified rectangle, and return the resolve target as a texture ID.
|
||||
@ -103,8 +101,6 @@ private:
|
||||
static int m_msaaSamples;
|
||||
|
||||
static GLenum m_textureType;
|
||||
static int m_EFBLayers;
|
||||
|
||||
static GLuint m_efbFramebuffer;
|
||||
static GLuint m_xfbFramebuffer;
|
||||
static GLuint m_efbColor;
|
||||
|
@ -221,10 +221,7 @@ TextureCache::TCacheEntryBase* TextureCache::CreateRenderTargetTexture(
|
||||
gl_type = GL_UNSIGNED_BYTE;
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAX_LEVEL, 0);
|
||||
|
||||
entry->num_layers = FramebufferManager::GetEFBLayers();
|
||||
|
||||
glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, gl_iformat, scaled_tex_w, scaled_tex_h, entry->num_layers, 0, gl_format, gl_type, nullptr);
|
||||
glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, gl_iformat, scaled_tex_w, scaled_tex_h, FramebufferManager::GetEFBLayers(), 0, gl_format, gl_type, nullptr);
|
||||
glBindTexture(GL_TEXTURE_2D_ARRAY, 0);
|
||||
|
||||
glGenFramebuffers(1, &entry->framebuffer);
|
||||
|
Reference in New Issue
Block a user