bool was_made_resident = (base_bo->residency_status == d3d12_resident);
if(!was_made_resident) {
ID3D12Pageable *pageable = base_bo->res;
- HRESULT hr = screen->dev->MakeResident(1, &pageable);
+ ASSERTED HRESULT hr = screen->dev->MakeResident(1, &pageable);
assert(SUCCEEDED(hr));
}
}
assert(pD3D12Dec->m_spD3D12VideoDevice);
assert(pD3D12Dec->m_spDecodeCommandQueue);
assert(pD3D12Dec->m_pD3D12Screen);
- struct d3d12_video_buffer *pD3D12VideoBuffer = (struct d3d12_video_buffer *) target;
+ ASSERTED struct d3d12_video_buffer *pD3D12VideoBuffer = (struct d3d12_video_buffer *) target;
assert(pD3D12VideoBuffer);
///
d3d12InputArguments.CompressedBitstream.pBuffer = pD3D12Dec->m_curFrameCompressedBitstreamBuffer.Get();
d3d12InputArguments.CompressedBitstream.Offset = 0u;
- constexpr uint64_t d3d12BitstreamOffsetAlignment =
+ ASSERTED constexpr uint64_t d3d12BitstreamOffsetAlignment =
128u; // specified in
// https://docs.microsoft.com/en-us/windows/win32/api/d3d12video/ne-d3d12video-d3d12_video_decode_tier
assert((d3d12InputArguments.CompressedBitstream.Offset == 0) ||
m_dpbDescriptor(m_dpbDescriptor),
m_formatInfo({ m_dpbDescriptor.Format })
{
- HRESULT hr = m_pD3D12Screen->dev->CheckFeatureSupport(D3D12_FEATURE_FORMAT_INFO, &m_formatInfo, sizeof(m_formatInfo));
+ ASSERTED HRESULT hr = m_pD3D12Screen->dev->CheckFeatureSupport(D3D12_FEATURE_FORMAT_INFO, &m_formatInfo, sizeof(m_formatInfo));
assert(SUCCEEDED(hr));
D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC targetFrameResolution = { static_cast<uint32_t>(m_dpbDescriptor.Width),
m_dpbDescriptor.Height };
// Set the index as the key in this map entry.
m_referenceDXVAIndices[remappedIndex].originalIndex = index;
IUnknown *pUnkHeap = nullptr;
- HRESULT hr = decoderHeap.Get()->QueryInterface(IID_PPV_ARGS(&pUnkHeap));
+ ASSERTED HRESULT hr = decoderHeap.Get()->QueryInterface(IID_PPV_ARGS(&pUnkHeap));
assert(SUCCEEDED(hr));
d3d12_video_reconstructed_picture reconPic = { pTexture2D, subresourceIndex, pUnkHeap };
if (!m_referenceDXVAIndices[index].fUsed) {
d3d12_video_reconstructed_picture reconPicture = m_upD3D12TexturesStorageManager->get_reference_frame(index);
if (reconPicture.pReconstructedPicture != nullptr) {
- bool wasTracked = m_upD3D12TexturesStorageManager->untrack_reconstructed_picture_allocation(reconPicture);
+ ASSERTED bool wasTracked = m_upD3D12TexturesStorageManager->untrack_reconstructed_picture_allocation(reconPicture);
// Untrack this resource, will mark it as free un the underlying storage buffer pool
// if not tracked, must be due to no-copies allocation
assert (wasTracked || is_pipe_buffer_underlying_output_decode_allocation());
void
d3d12_video_encoder_bitstream::flush()
{
- bool isAligned = is_byte_aligned(); // causes side-effects in object state, don't put inside assert()
+ ASSERTED bool isAligned = is_byte_aligned(); // causes side-effects in object state, don't put inside assert()
assert(isAligned);
uint32_t temp = (uint32_t)(32 - m_iBitsToGo);
void
d3d12_video_encoder_bitstream::append_byte_stream(d3d12_video_encoder_bitstream *pStream)
{
- bool isStreamAligned =
+ ASSERTED bool isStreamAligned =
pStream->is_byte_aligned(); // causes side-effects in object state, don't put inside assert()
assert(isStreamAligned);
- bool isThisAligned = is_byte_aligned(); // causes side-effects in object state, don't put inside assert()
+ ASSERTED bool isThisAligned = is_byte_aligned(); // causes side-effects in object state, don't put inside assert()
assert(isThisAligned);
assert(m_iBitsToGo == 32);
pBitstream->put_bits(iLeft, 0);
}
- bool isAligned = pBitstream->is_byte_aligned(); // causes side-effects in object state, don't put inside assert()
+ ASSERTED bool isAligned = pBitstream->is_byte_aligned(); // causes side-effects in object state, don't put inside assert()
assert(isAligned);
}
d3d12_video_encoder_bitstream *pRBSP,
HEVCNaluHeader *pHeader)
{
- bool isAligned = pRBSP->is_byte_aligned(); // causes side-effects in object state, don't put inside assert()
+ ASSERTED bool isAligned = pRBSP->is_byte_aligned(); // causes side-effects in object state, don't put inside assert()
assert(isAligned);
int32_t iBytesWritten = pNALU->get_byte_count();
pBitstream->put_bits(iLeft, 0);
}
- bool isAligned = pBitstream->is_byte_aligned(); // causes side-effects in object state, don't put inside assert()
+ ASSERTED bool isAligned = pBitstream->is_byte_aligned(); // causes side-effects in object state, don't put inside assert()
assert(isAligned);
}
rbsp->put_bits(1, rps->used_by_curr_pic_s1_flag[i]);
}
}
-}
\ No newline at end of file
+}
m_CurrentFrameReferencesData.ReconstructedPicTexture = { nullptr, 0 };
// Reset DPB storage
- uint32_t numPicsBeforeClearInDPB = m_rDPBStorageManager.get_number_of_pics_in_dpb();
- uint32_t cFreedResources = m_rDPBStorageManager.clear_decode_picture_buffer();
+ ASSERTED uint32_t numPicsBeforeClearInDPB = m_rDPBStorageManager.get_number_of_pics_in_dpb();
+ ASSERTED uint32_t cFreedResources = m_rDPBStorageManager.clear_decode_picture_buffer();
assert(numPicsBeforeClearInDPB == cFreedResources);
// Initialize if needed the reconstructed picture allocation for the first IDR picture in the GOP
m_CurrentFrameReferencesData.ReconstructedPicTexture = { nullptr, 0 };
// Reset DPB storage
- uint32_t numPicsBeforeClearInDPB = m_rDPBStorageManager.get_number_of_pics_in_dpb();
- uint32_t cFreedResources = m_rDPBStorageManager.clear_decode_picture_buffer();
+ ASSERTED uint32_t numPicsBeforeClearInDPB = m_rDPBStorageManager.get_number_of_pics_in_dpb();
+ ASSERTED uint32_t cFreedResources = m_rDPBStorageManager.clear_decode_picture_buffer();
assert(numPicsBeforeClearInDPB == cFreedResources);
// Initialize if needed the reconstructed picture allocation for the first IDR picture in the GOP