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

Method CalcColumnWidth

qrenderdoc/Windows/BufferViewer.cpp:5774–5896  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5772}
5773
5774void BufferViewer::CalcColumnWidth(int maxNumRows)
5775{
5776 // while the calculated column widths aren't actually isn't quite based on maxNumRows, it can only
5777 // be affected by a style change so that is good enough for us to cache it and save time
5778 // recalculating this repeatedly.
5779 if(m_ColumnWidthRowCount == maxNumRows)
5780 return;
5781
5782 m_ColumnWidthRowCount = maxNumRows;
5783
5784 ResourceFormat floatFmt;
5785 floatFmt.compByteWidth = 4;
5786 floatFmt.compType = CompType::Float;
5787 floatFmt.compCount = 1;
5788
5789 ResourceFormat intFmt;
5790 intFmt.compByteWidth = 4;
5791 intFmt.compType = CompType::UInt;
5792 intFmt.compCount = 1;
5793
5794 QString headerText = lit("ColumnSizeTest");
5795
5796 BufferConfiguration bufconfig;
5797
5798 BufferElementProperties floatProp, intProp;
5799 floatProp.format = floatFmt;
5800 intProp.format = intFmt;
5801
5802 ShaderConstant elem;
5803 elem.name = headerText;
5804 elem.byteOffset = 0;
5805 elem.type.rows = maxNumRows;
5806 elem.type.columns = 1;
5807
5808 bufconfig.columns.clear();
5809
5810 bufconfig.columns.push_back(elem);
5811 bufconfig.props.push_back(floatProp);
5812
5813 elem.type.rows = 1;
5814 elem.byteOffset = 4;
5815
5816 bufconfig.columns.push_back(elem);
5817 bufconfig.props.push_back(floatProp);
5818
5819 elem.byteOffset = 8;
5820
5821 bufconfig.columns.push_back(elem);
5822 bufconfig.props.push_back(floatProp);
5823
5824 elem.byteOffset = 12;
5825
5826 bufconfig.columns.push_back(elem);
5827 bufconfig.props.push_back(intProp);
5828
5829 elem.byteOffset = 16;
5830
5831 bufconfig.columns.push_back(elem);

Callers

nothing calls this directly

Calls 9

beginResetMethod · 0.80
endResetMethod · 0.80
columnWidthMethod · 0.80
clearMethod · 0.45
push_backMethod · 0.45
derefMethod · 0.45
resizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected