| 5772 | } |
| 5773 | |
| 5774 | void 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); |
nothing calls this directly
no test coverage detected