mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +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;
|
||||
|
||||
+718
-726
File diff suppressed because it is too large
Load Diff
@@ -292,6 +292,9 @@ namespace renderdocui.Windows.PipelineState
|
||||
////////////////////////////////////////////////
|
||||
// Input Assembler
|
||||
|
||||
int vs = 0;
|
||||
|
||||
vs = inputLayouts.VScrollValue();
|
||||
inputLayouts.Nodes.Clear();
|
||||
inputLayouts.BeginUpdate();
|
||||
if (state.m_VtxIn.attributes != null)
|
||||
@@ -303,9 +306,7 @@ namespace renderdocui.Windows.PipelineState
|
||||
{
|
||||
string byteOffs = l.RelativeOffset.ToString();
|
||||
|
||||
var node = inputLayouts.Nodes.Add(new object[] {
|
||||
i, l.Enabled ? "Enabled" : "Disabled", "", l.Format, l.BufferSlot.ToString(), byteOffs,
|
||||
"", "" });
|
||||
var node = inputLayouts.Nodes.Add(new object[] { i, "", l.Format, l.BufferSlot.ToString(), byteOffs, });
|
||||
|
||||
usedVBuffers[l.BufferSlot] = true;
|
||||
|
||||
@@ -321,6 +322,7 @@ namespace renderdocui.Windows.PipelineState
|
||||
}
|
||||
inputLayouts.NodesSelection.Clear();
|
||||
inputLayouts.EndUpdate();
|
||||
inputLayouts.SetVScrollValue(vs);
|
||||
|
||||
PrimitiveTopology topo = draw != null ? draw.topology : PrimitiveTopology.Unknown;
|
||||
|
||||
@@ -366,6 +368,7 @@ namespace renderdocui.Windows.PipelineState
|
||||
break;
|
||||
}
|
||||
|
||||
vs = iabuffers.VScrollValue();
|
||||
iabuffers.Nodes.Clear();
|
||||
iabuffers.BeginUpdate();
|
||||
|
||||
@@ -393,7 +396,7 @@ namespace renderdocui.Windows.PipelineState
|
||||
}
|
||||
}
|
||||
|
||||
var node = iabuffers.Nodes.Add(new object[] { "Index", name, draw != null ? draw.indexByteWidth : 0, 0, length });
|
||||
var node = iabuffers.Nodes.Add(new object[] { "Element", name, draw != null ? draw.indexByteWidth : 0, 0, 0, length });
|
||||
|
||||
node.Image = global::renderdocui.Properties.Resources.action;
|
||||
node.HoverImage = global::renderdocui.Properties.Resources.action_hover;
|
||||
@@ -408,10 +411,9 @@ namespace renderdocui.Windows.PipelineState
|
||||
}
|
||||
else
|
||||
{
|
||||
if (showEmpty.Checked &&
|
||||
(ibufferUsed || showDisabled.Checked))
|
||||
if (ibufferUsed || showEmpty.Checked)
|
||||
{
|
||||
var node = iabuffers.Nodes.Add(new object[] { "Index", "-", "-", "-", "-" });
|
||||
var node = iabuffers.Nodes.Add(new object[] { "Element", "No Buffer Set", "-", "-", "-", "-" });
|
||||
|
||||
node.Image = global::renderdocui.Properties.Resources.action;
|
||||
node.HoverImage = global::renderdocui.Properties.Resources.action_hover;
|
||||
@@ -458,7 +460,7 @@ namespace renderdocui.Windows.PipelineState
|
||||
}
|
||||
}
|
||||
|
||||
var node = iabuffers.Nodes.Add(new object[] { i, name, v.Stride, v.Offset, length });
|
||||
var node = iabuffers.Nodes.Add(new object[] { i, name, v.Stride, v.Offset, v.Divisor, length });
|
||||
|
||||
node.Image = global::renderdocui.Properties.Resources.action;
|
||||
node.HoverImage = global::renderdocui.Properties.Resources.action_hover;
|
||||
@@ -478,6 +480,7 @@ namespace renderdocui.Windows.PipelineState
|
||||
}
|
||||
iabuffers.NodesSelection.Clear();
|
||||
iabuffers.EndUpdate();
|
||||
iabuffers.SetVScrollValue(vs);
|
||||
|
||||
SetShaderState(texs, bufs, state, state.m_VS, vsShader, vsResources, vsSamplers, vsCBuffers, vsClasses);
|
||||
SetShaderState(texs, bufs, state, state.m_GS, gsShader, gsResources, gsSamplers, gsCBuffers, gsClasses);
|
||||
|
||||
Reference in New Issue
Block a user