MCPcopy Create free account
hub / github.com/baldurk/renderdoc / UI_FixedAddMatrixRows

Method UI_FixedAddMatrixRows

qrenderdoc/Windows/BufferViewer.cpp:4123–4180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4121}
4122
4123void BufferViewer::UI_FixedAddMatrixRows(RDTreeWidgetItem *n, const ShaderConstant &c,
4124 const ShaderVariable &v)
4125{
4126 const bool showPadding = ui->showPadding->isChecked() && m_CurCBuffer.bytesBacked;
4127
4128 if(v.rows > 1)
4129 {
4130 uint32_t vecSize = VarTypeByteSize(v.type) * v.columns;
4131
4132 FixedVarTag tag = n->tag().value<FixedVarTag>();
4133 tag.matrix = true;
4134 tag.rowmajor = v.RowMajor();
4135 n->setTag(QVariant::fromValue(tag));
4136
4137 if(v.ColMajor())
4138 vecSize = VarTypeByteSize(v.type) * v.rows;
4139
4140 for(uint32_t r = 0; r < v.rows; r++)
4141 {
4142 n->addChild(new RDTreeWidgetItem({QFormatStr("%1.row%2").arg(v.name).arg(r), RowString(v, r),
4143 QString(), RowTypeString(v)}));
4144
4145 if(showPadding && v.RowMajor() && c.type.matrixByteStride > vecSize)
4146 {
4147 uint32_t size = c.type.matrixByteStride - vecSize;
4148
4149 RDTreeWidgetItem *pad = new RDTreeWidgetItem({
4150 tr(""),
4151 QFormatStr("%1 bytes").arg(Formatter::HumanFormat(size, Formatter::OffsetSize)),
4152 QString(),
4153 tr("Padding"),
4154 });
4155
4156 pad->setItalic(true);
4157 pad->setTag(QVariant::fromValue(FixedVarTag(size)));
4158
4159 n->addChild(pad);
4160 }
4161 }
4162
4163 if(showPadding && v.ColMajor() && c.type.matrixByteStride > vecSize)
4164 {
4165 uint32_t size = c.type.matrixByteStride - vecSize;
4166
4167 RDTreeWidgetItem *pad = new RDTreeWidgetItem({
4168 tr(""),
4169 QFormatStr("%1 bytes each column").arg(Formatter::HumanFormat(size, Formatter::OffsetSize)),
4170 QString(),
4171 tr("Padding"),
4172 });
4173
4174 pad->setItalic(true);
4175 pad->setTag(QVariant::fromValue(FixedVarTag(size)));
4176
4177 n->addChild(pad);
4178 }
4179 }
4180}

Callers

nothing calls this directly

Calls 12

VarTypeByteSizeFunction · 0.85
fromValueFunction · 0.85
RowStringFunction · 0.85
RowTypeStringFunction · 0.85
FixedVarTagClass · 0.85
setTagMethod · 0.80
QStringFunction · 0.50
trFunction · 0.50
tagMethod · 0.45
addChildMethod · 0.45
argMethod · 0.45
setItalicMethod · 0.45

Tested by

no test coverage detected