當前位置: 首頁>>代碼示例>>C++>>正文


C++ CHECK_HRESULT函數代碼示例

本文整理匯總了C++中CHECK_HRESULT函數的典型用法代碼示例。如果您正苦於以下問題:C++ CHECK_HRESULT函數的具體用法?C++ CHECK_HRESULT怎麽用?C++ CHECK_HRESULT使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了CHECK_HRESULT函數的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: CHECK_HRESULT

IAAFClassDefSP AxObject::GetDefinition()
{
    IAAFClassDefSP spIaafClassDef;

    CHECK_HRESULT( _spIaafObject->GetDefinition( &spIaafClassDef ) );

    return spIaafClassDef;
}
開發者ID:nevali,項目名稱:aaf,代碼行數:8,代碼來源:AxObject.cpp

示例2: CHECK_HRESULT

IEnumAAFKLVDataDefsSP AxDictionary::GetKLVDataDefs()
{
    IEnumAAFKLVDataDefsSP spIEnumAAFKLVDataDefs;

    CHECK_HRESULT( _spIaafDictionary->GetKLVDataDefs( &spIEnumAAFKLVDataDefs ) );

    return spIEnumAAFKLVDataDefs;
}
開發者ID:UIKit0,項目名稱:aaf,代碼行數:8,代碼來源:AxDictionary.cpp

示例3: CHECK_HRESULT

aafUInt32 AxMobSlot::GetPhysicalNum()
{
	aafUInt32 num;

	CHECK_HRESULT( _spIaafMobSlot->GetPhysicalNum( &num ) );

	return num;
}
開發者ID:UIKit0,項目名稱:aaf,代碼行數:8,代碼來源:AxMobSlot.cpp

示例4: prepare_render_targets

void D3D12GSRender::clear_surface(u32 arg)
{
	// Ignore clear if surface target is set to CELL_GCM_SURFACE_TARGET_NONE
	if (rsx::method_registers.surface_color_target() == rsx::surface_target::none) return;
	
	std::chrono::time_point<std::chrono::system_clock> start_duration = std::chrono::system_clock::now();

	std::chrono::time_point<std::chrono::system_clock> rtt_duration_start = std::chrono::system_clock::now();
	prepare_render_targets(get_current_resource_storage().command_list.Get());

	std::chrono::time_point<std::chrono::system_clock> rtt_duration_end = std::chrono::system_clock::now();
	m_timers.prepare_rtt_duration += std::chrono::duration_cast<std::chrono::microseconds>(rtt_duration_end - rtt_duration_start).count();

	if (arg & 0x1 || arg & 0x2)
	{
		get_current_resource_storage().depth_stencil_descriptor_heap_index++;

		if (arg & 0x1)
		{
			u32 clear_depth = rsx::method_registers.z_clear_value();
			u32 max_depth_value = get_max_depth_value(rsx::method_registers.surface_depth_fmt());
			get_current_resource_storage().command_list->ClearDepthStencilView(m_rtts.current_ds_handle, D3D12_CLEAR_FLAG_DEPTH, clear_depth / (float)max_depth_value, 0,
				1, &get_scissor(rsx::method_registers.scissor_origin_x(), rsx::method_registers.scissor_origin_y(), rsx::method_registers.scissor_width(), rsx::method_registers.scissor_height()));
		}

		if (arg & 0x2)
			get_current_resource_storage().command_list->ClearDepthStencilView(m_rtts.current_ds_handle, D3D12_CLEAR_FLAG_STENCIL, 0.f, get_clear_stencil(rsx::method_registers.stencil_clear_value()),
				1, &get_scissor(rsx::method_registers.scissor_origin_x(), rsx::method_registers.scissor_origin_y(), rsx::method_registers.scissor_width(), rsx::method_registers.scissor_height()));
	}

	if (arg & 0xF0)
	{
		CD3DX12_CPU_DESCRIPTOR_HANDLE handle = CD3DX12_CPU_DESCRIPTOR_HANDLE(m_rtts.current_rtts_handle);
		size_t rtt_index = get_num_rtt(rsx::method_registers.surface_color_target());
		get_current_resource_storage().render_targets_descriptors_heap_index += rtt_index;
		std::array<float, 4> clear_color =
		{
			rsx::method_registers.clear_color_r() / 255.f,
			rsx::method_registers.clear_color_g() / 255.f,
			rsx::method_registers.clear_color_b() / 255.f,
			rsx::method_registers.clear_color_a() / 255.f,
		};
		for (unsigned i = 0; i < rtt_index; i++)
			get_current_resource_storage().command_list->ClearRenderTargetView(handle.Offset(i, m_descriptor_stride_rtv), clear_color.data(),
				1, &get_scissor(rsx::method_registers.scissor_origin_x(), rsx::method_registers.scissor_origin_y(), rsx::method_registers.scissor_width(), rsx::method_registers.scissor_height()));
	}

	std::chrono::time_point<std::chrono::system_clock> end_duration = std::chrono::system_clock::now();
	m_timers.draw_calls_duration += std::chrono::duration_cast<std::chrono::microseconds>(end_duration - start_duration).count();
	m_timers.draw_calls_count++;

	if (g_cfg_rsx_debug_output)
	{
		CHECK_HRESULT(get_current_resource_storage().command_list->Close());
		m_command_queue->ExecuteCommandLists(1, (ID3D12CommandList**)get_current_resource_storage().command_list.GetAddressOf());
		get_current_resource_storage().set_new_command_list();
	}
}
開發者ID:KitoHo,項目名稱:rpcs3,代碼行數:58,代碼來源:D3D12RenderTargetSets.cpp

示例5: CHECK_HRESULT

void resource_storage::init(ID3D12Device *device)
{
	in_use = false;
	m_device = device;
	ram_framebuffer = nullptr;
	// Create a global command allocator
	CHECK_HRESULT(device->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT, IID_PPV_ARGS(command_allocator.GetAddressOf())));

	CHECK_HRESULT(m_device->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, command_allocator.Get(), nullptr, IID_PPV_ARGS(command_list.GetAddressOf())));
	CHECK_HRESULT(command_list->Close());

	D3D12_DESCRIPTOR_HEAP_DESC descriptor_heap_desc = { D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, 10000, D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE };
	CHECK_HRESULT(device->CreateDescriptorHeap(&descriptor_heap_desc, IID_PPV_ARGS(&descriptors_heap)));

	D3D12_DESCRIPTOR_HEAP_DESC sampler_heap_desc = { D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER , 2048, D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE };
	CHECK_HRESULT(device->CreateDescriptorHeap(&sampler_heap_desc, IID_PPV_ARGS(&sampler_descriptor_heap[0])));
	CHECK_HRESULT(device->CreateDescriptorHeap(&sampler_heap_desc, IID_PPV_ARGS(&sampler_descriptor_heap[1])));

	D3D12_DESCRIPTOR_HEAP_DESC ds_descriptor_heap_desc = { D3D12_DESCRIPTOR_HEAP_TYPE_DSV , 10000};
	device->CreateDescriptorHeap(&ds_descriptor_heap_desc, IID_PPV_ARGS(&depth_stencil_descriptor_heap));

	D3D12_DESCRIPTOR_HEAP_DESC rtv_descriptor_heap_desc = { D3D12_DESCRIPTOR_HEAP_TYPE_RTV , 10000 };
	device->CreateDescriptorHeap(&rtv_descriptor_heap_desc, IID_PPV_ARGS(&render_targets_descriptors_heap));

	frame_finished_handle = CreateEventEx(nullptr, FALSE, FALSE, EVENT_ALL_ACCESS);
	fence_value = 0;
	CHECK_HRESULT(device->CreateFence(fence_value++, D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(frame_finished_fence.GetAddressOf())));
}
開發者ID:Majkel86,項目名稱:rpcs3,代碼行數:28,代碼來源:D3D12MemoryHelpers.cpp

示例6: CHECK_HRESULT

void resource_storage::set_new_command_list()
{
	CHECK_HRESULT(command_list->Reset(command_allocator.Get(), nullptr));

	ID3D12DescriptorHeap *descriptors[] =
	{
		descriptors_heap.Get(),
		sampler_descriptor_heap[sampler_descriptors_heap_index].Get(),
	};
	command_list->SetDescriptorHeaps(2, descriptors);
}
開發者ID:Endika,項目名稱:rpcs3,代碼行數:11,代碼來源:D3D12MemoryHelpers.cpp

示例7: CHECK_HRESULT

	void VssCopy::Init()
	{
		CHECK_HRESULT( ::CoInitialize(NULL) );

		CHECK_HRESULT( ::CreateVssBackupComponents(&pBackupComponents_) );
		CHECK_HRESULT( pBackupComponents_->InitializeForBackup() );

		CComPtr<IVssAsync> pWriterMetadataStatus;
		CHECK_HRESULT( pBackupComponents_->GatherWriterMetadata(&pWriterMetadataStatus) );
		WaitAndQueryStatus(pWriterMetadataStatus);

		GUID snapshotSetId = GUID_NULL;
		CHECK_HRESULT( pBackupComponents_->StartSnapshotSet(&snapshotSetId) );

		wchar_t volumePathName[MAX_PATH];
		if (! ::GetVolumePathName(sourcePath_, volumePathName, MAX_PATH))
		{
			AtlThrowLastWin32();
		}

		GUID snapshotId;
		CHECK_HRESULT( pBackupComponents_->AddToSnapshotSet(volumePathName, GUID_NULL, &snapshotId) );
		CHECK_HRESULT( pBackupComponents_->SetBackupState(TRUE, FALSE, VSS_BT_FULL) );

		CComPtr<IVssAsync> pPrepareForBackupResults;
		CHECK_HRESULT( pBackupComponents_->PrepareForBackup(&pPrepareForBackupResults) );
		WaitAndQueryStatus(pPrepareForBackupResults);
		backupState_ = TRUE;

		CComPtr<IVssAsync> pDoSnapshotSetResults;
		CHECK_HRESULT( pBackupComponents_->DoSnapshotSet(&pDoSnapshotSetResults) );
		WaitAndQueryStatus(pDoSnapshotSetResults);

		snapshotProperties_ = new VSS_SNAPSHOT_PROP;
		CHECK_HRESULT( pBackupComponents_->GetSnapshotProperties(snapshotId, snapshotProperties_) );

		snapshotDeviceObject_ = snapshotProperties_->m_pwszSnapshotDeviceObject;

		return;
	}
開發者ID:z3v2cicidi,項目名稱:ditsnap,代碼行數:40,代碼來源:VssCopy.cpp

示例8: WaitForSingleObjectEx

void resource_storage::wait_and_clean()
{
	if (in_use)
		WaitForSingleObjectEx(frame_finished_handle, INFINITE, FALSE);
	else
		CHECK_HRESULT(command_list->Close());

	reset();

	dirty_textures.clear();

	ram_framebuffer = nullptr;
}
開發者ID:Majkel86,項目名稱:rpcs3,代碼行數:13,代碼來源:D3D12MemoryHelpers.cpp


注:本文中的CHECK_HRESULT函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。