mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-24 22:55:41 +00:00
Set up vertex input stage properly on GL pipeline view
This commit is contained in:
@@ -44,11 +44,10 @@ struct GLPipelineState
|
||||
|
||||
struct VertexBuffer
|
||||
{
|
||||
VertexBuffer() : Buffer(), Stride(0), Offset(0), PerInstance(false), Divisor(0) {}
|
||||
VertexBuffer() : Buffer(), Stride(0), Offset(0), Divisor(0) {}
|
||||
ResourceId Buffer;
|
||||
uint32_t Stride;
|
||||
uint32_t Offset;
|
||||
bool32 PerInstance;
|
||||
uint32_t Divisor;
|
||||
};
|
||||
rdctype::array<VertexBuffer> vbuffers;
|
||||
|
||||
@@ -284,7 +284,6 @@ void Serialiser::Serialise(const char *name, GLPipelineState::VertexInput::Verte
|
||||
Serialise("", el.Buffer);
|
||||
Serialise("", el.Divisor);
|
||||
Serialise("", el.Offset);
|
||||
Serialise("", el.PerInstance);
|
||||
Serialise("", el.Stride);
|
||||
}
|
||||
|
||||
|
||||
@@ -862,8 +862,6 @@ void GLReplay::SavePipelineState()
|
||||
gl.glGetIntegeri_v(eGL_VERTEX_BINDING_STRIDE, i, (GLint *)&pipe.m_VtxIn.vbuffers[i].Stride);
|
||||
gl.glGetIntegeri_v(eGL_VERTEX_BINDING_OFFSET, i, (GLint *)&pipe.m_VtxIn.vbuffers[i].Offset);
|
||||
gl.glGetIntegeri_v(eGL_VERTEX_BINDING_DIVISOR, i, (GLint *)&pipe.m_VtxIn.vbuffers[i].Divisor);
|
||||
|
||||
pipe.m_VtxIn.vbuffers[i].PerInstance = (pipe.m_VtxIn.vbuffers[i].Divisor != 0);
|
||||
}
|
||||
|
||||
for(GLuint i=0; i < (GLuint)numVAttribBindings; i++)
|
||||
@@ -895,47 +893,47 @@ void GLReplay::SavePipelineState()
|
||||
case eGL_BYTE:
|
||||
fmt.compByteWidth = 1;
|
||||
fmt.compType = intComponent ? eCompType_SInt : eCompType_SNorm;
|
||||
fmt.strname = StringFormat::Fmt("GL_BYTE%d", fmt.compCount) + (intComponent ? "" : "_SNORM");
|
||||
fmt.strname = (fmt.compCount > 1 ? StringFormat::Fmt("GL_BYTE%d", fmt.compCount) : string("GL_BYTE")) + (intComponent ? "" : "_SNORM");
|
||||
break;
|
||||
case eGL_UNSIGNED_BYTE:
|
||||
fmt.compByteWidth = 1;
|
||||
fmt.compType = intComponent ? eCompType_UInt : eCompType_UNorm;
|
||||
fmt.strname = StringFormat::Fmt("GL_UNSIGNED_BYTE%d", fmt.compCount) + (intComponent ? "" : "_UNORM");
|
||||
fmt.strname = (fmt.compCount > 1 ? StringFormat::Fmt("GL_UNSIGNED_BYTE%d", fmt.compCount) : string("GL_UNSIGNED_BYTE")) + (intComponent ? "" : "_UNORM");
|
||||
break;
|
||||
case eGL_SHORT:
|
||||
fmt.compByteWidth = 2;
|
||||
fmt.compType = intComponent ? eCompType_SInt : eCompType_SNorm;
|
||||
fmt.strname = StringFormat::Fmt("GL_SHORT%d", fmt.compCount) + (intComponent ? "" : "_SNORM");
|
||||
fmt.strname = (fmt.compCount > 1 ? StringFormat::Fmt("GL_SHORT%d", fmt.compCount) : string("GL_SHORT")) + (intComponent ? "" : "_SNORM");
|
||||
break;
|
||||
case eGL_UNSIGNED_SHORT:
|
||||
fmt.compByteWidth = 2;
|
||||
fmt.compType = intComponent ? eCompType_UInt : eCompType_UNorm;
|
||||
fmt.strname = StringFormat::Fmt("GL_UNSIGNED_SHORT%d", fmt.compCount) + (intComponent ? "" : "_UNORM");
|
||||
fmt.strname = (fmt.compCount > 1 ? StringFormat::Fmt("GL_UNSIGNED_SHORT%d", fmt.compCount) : string("GL_UNSIGNED_SHORT")) + (intComponent ? "" : "_UNORM");
|
||||
break;
|
||||
case eGL_INT:
|
||||
fmt.compByteWidth = 4;
|
||||
fmt.compType = intComponent ? eCompType_SInt : eCompType_SNorm;
|
||||
fmt.strname = StringFormat::Fmt("GL_INT%d", fmt.compCount) + (intComponent ? "" : "_SNORM");
|
||||
fmt.strname = (fmt.compCount > 1 ? StringFormat::Fmt("GL_INT%d", fmt.compCount) : string("GL_INT")) + (intComponent ? "" : "_SNORM");
|
||||
break;
|
||||
case eGL_UNSIGNED_INT:
|
||||
fmt.compByteWidth = 4;
|
||||
fmt.compType = intComponent ? eCompType_UInt : eCompType_UNorm;
|
||||
fmt.strname = StringFormat::Fmt("GL_UNSIGNED_INT%d", fmt.compCount) + (intComponent ? "" : "_UNORM");
|
||||
fmt.strname = (fmt.compCount > 1 ? StringFormat::Fmt("GL_UNSIGNED_INT%d", fmt.compCount) : string("GL_UNSIGNED_INT")) + (intComponent ? "" : "_UNORM");
|
||||
break;
|
||||
case eGL_FLOAT:
|
||||
fmt.compByteWidth = 4;
|
||||
fmt.compType = eCompType_Float;
|
||||
fmt.strname = StringFormat::Fmt("GL_FLOAT%d", fmt.compCount);
|
||||
fmt.strname = (fmt.compCount > 1 ? StringFormat::Fmt("GL_FLOAT%d", fmt.compCount) : string("GL_FLOAT"));
|
||||
break;
|
||||
case eGL_DOUBLE:
|
||||
fmt.compByteWidth = 8;
|
||||
fmt.compType = eCompType_Double;
|
||||
fmt.strname = StringFormat::Fmt("GL_DOUBLE%d", fmt.compCount);
|
||||
fmt.strname = (fmt.compCount > 1 ? StringFormat::Fmt("GL_DOUBLE%d", fmt.compCount) : string("GL_DOUBLE"));
|
||||
break;
|
||||
case eGL_HALF_FLOAT:
|
||||
fmt.compByteWidth = 2;
|
||||
fmt.compType = eCompType_Float;
|
||||
fmt.strname = StringFormat::Fmt("GL_HALF_FLOAT%d", fmt.compCount);
|
||||
fmt.strname = (fmt.compCount > 1 ? StringFormat::Fmt("GL_HALF_FLOAT%d", fmt.compCount) : string("GL_HALF_FLOAT"));
|
||||
break;
|
||||
case eGL_INT_2_10_10_10_REV:
|
||||
fmt.special = true;
|
||||
|
||||
Reference in New Issue
Block a user