From fc28ba75daba2135ade75370a91d77c1cfdc97b3 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 10 Oct 2020 18:27:39 +1000 Subject: [PATCH] GPU/OpenGL: Create the texture stream buffer with its final target Fixes broken texture uploads on Adreno GPUs. --- src/core/gpu_hw_opengl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/gpu_hw_opengl.cpp b/src/core/gpu_hw_opengl.cpp index f91f3c487..bb843d97f 100644 --- a/src/core/gpu_hw_opengl.cpp +++ b/src/core/gpu_hw_opengl.cpp @@ -341,7 +341,10 @@ bool GPU_HW_OpenGL::CreateUniformBuffer() bool GPU_HW_OpenGL::CreateTextureBuffer() { // We use the pixel unpack buffer here because we share it with CPU-decoded VRAM writes. - m_texture_stream_buffer = GL::StreamBuffer::Create(GL_PIXEL_UNPACK_BUFFER, VRAM_UPDATE_TEXTURE_BUFFER_SIZE); + const GLenum target = + (m_use_ssbo_for_vram_writes ? GL_SHADER_STORAGE_BUFFER : + (m_supports_texture_buffer ? GL_TEXTURE_BUFFER : GL_PIXEL_UNPACK_BUFFER)); + m_texture_stream_buffer = GL::StreamBuffer::Create(target, VRAM_UPDATE_TEXTURE_BUFFER_SIZE); if (!m_texture_stream_buffer) return false;