From 670c0ef7e7fbfd954e7b63e1297cc2e33c9f079c Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 3 Dec 2014 23:22:24 +0000 Subject: [PATCH] Handle BGRA vertex attributes --- renderdoc/driver/gl/gl_replay.cpp | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/renderdoc/driver/gl/gl_replay.cpp b/renderdoc/driver/gl/gl_replay.cpp index 2ff127ac4..2a2f32c0f 100644 --- a/renderdoc/driver/gl/gl_replay.cpp +++ b/renderdoc/driver/gl/gl_replay.cpp @@ -960,16 +960,42 @@ void GLReplay::SavePipelineState() fmt.specialFormat = eSpecial_R10G10B10A2; fmt.compCount = 4; fmt.compType = eCompType_SInt; - fmt.strname = "eGL_UNSIGNED_INT_2_10_10_10_REV"; + fmt.strname = "GL_UNSIGNED_INT_2_10_10_10_REV"; break; case eGL_UNSIGNED_INT_10F_11F_11F_REV: fmt.special = true; fmt.specialFormat = eSpecial_R11G11B10; fmt.compCount = 3; fmt.compType = eCompType_SInt; - fmt.strname = "eGL_UNSIGNED_INT_10F_11F_11F_REV"; + fmt.strname = "GL_UNSIGNED_INT_10F_11F_11F_REV"; break; } + + if(fmt.compCount == eGL_BGRA) + { + fmt.compCount = 4; + fmt.special = true; + fmt.specialFormat = eSpecial_B8G8R8A8; + fmt.compType = eCompType_UNorm; + + if(type == eGL_UNSIGNED_BYTE) + { + fmt.specialFormat = eSpecial_B8G8R8A8; + fmt.compType = eCompType_UNorm; + fmt.strname = "GL_BGRA8"; + } + else if(type == eGL_UNSIGNED_INT_2_10_10_10_REV || type == eGL_INT_2_10_10_10_REV) + { + fmt.specialFormat = eSpecial_R10G10B10A2; + fmt.compType = type == eGL_UNSIGNED_INT_2_10_10_10_REV ? eCompType_UInt : eCompType_SInt; + fmt.strname = type == eGL_UNSIGNED_INT_2_10_10_10_REV ? "GL_UNSIGNED_INT_2_10_10_10_REV" : "GL_INT_2_10_10_10_REV"; + } + else + { + RDCERR("Unexpected BGRA type"); + } + RDCASSERT(type == eGL_UNSIGNED_BYTE); + } pipe.m_VtxIn.attributes[i].Format = fmt; }