[D3D12] DXBC STAT writing
This commit is contained in:
@@ -32,6 +32,8 @@ void DxbcShaderTranslator::Reset() {
|
||||
|
||||
rdef_constants_used_ = 0;
|
||||
writes_depth_ = false;
|
||||
|
||||
std::memset(&stat_, 0, sizeof(stat_));
|
||||
}
|
||||
|
||||
std::vector<uint8_t> DxbcShaderTranslator::CompleteTranslation() {
|
||||
@@ -85,6 +87,18 @@ std::vector<uint8_t> DxbcShaderTranslator::CompleteTranslation() {
|
||||
(uint32_t(shader_object_.size()) - chunk_position_dwords - 2) *
|
||||
sizeof(uint32_t);
|
||||
|
||||
// TODO(Triang3l): Write SHEX.
|
||||
|
||||
// Write STATistics.
|
||||
chunk_position_dwords = uint32_t(shader_object_.size());
|
||||
shader_object_[12] = chunk_position_dwords * sizeof(uint32_t);
|
||||
shader_object_.push_back('TATS');
|
||||
shader_object_.push_back(sizeof(stat_));
|
||||
shader_object_.resize(shader_object_.size() +
|
||||
sizeof(stat_) / sizeof(uint32_t));
|
||||
std::memcpy(&shader_object_[chunk_position_dwords + 2], &stat_,
|
||||
sizeof(stat_));
|
||||
|
||||
// Fill the remaining fields of the header and copy bytes out.
|
||||
uint32_t shader_object_size =
|
||||
uint32_t(shader_object_.size() * sizeof(uint32_t));
|
||||
|
||||
Reference in New Issue
Block a user