当前位置: 首页>>代码示例>>C++>>正文


C++ ComPtr::GetDesc方法代码示例

本文整理汇总了C++中microsoft::wrl::ComPtr::GetDesc方法的典型用法代码示例。如果您正苦于以下问题:C++ ComPtr::GetDesc方法的具体用法?C++ ComPtr::GetDesc怎么用?C++ ComPtr::GetDesc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在microsoft::wrl::ComPtr的用法示例。


在下文中一共展示了ComPtr::GetDesc方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: s_b_panel


//.........这里部分代码省略.........
	wxTextCtrl* txt_emulationdir_path = new wxTextCtrl(p_system, wxID_ANY, Emu.GetEmulatorPath());


	wxArrayString ppu_decoder_modes;
	ppu_decoder_modes.Add("Interpreter");
	ppu_decoder_modes.Add("Interpreter 2");
	ppu_decoder_modes.Add("Recompiler (LLVM)");
	rbox_ppu_decoder = new wxRadioBox(p_core, wxID_ANY, "PPU Decoder", wxDefaultPosition, wxSize(215, -1), ppu_decoder_modes, 1);

#if !defined(LLVM_AVAILABLE)
	rbox_ppu_decoder->Enable(2, false);
#endif

	wxArrayString spu_decoder_modes;
	spu_decoder_modes.Add("Interpreter (precise)");
	spu_decoder_modes.Add("Interpreter (fast)");
	spu_decoder_modes.Add("Recompiler (ASMJIT)");
	rbox_spu_decoder = new wxRadioBox(p_core, wxID_ANY, "SPU Decoder", wxDefaultPosition, wxSize(215, -1), spu_decoder_modes, 1);

	cbox_gs_render->Append("Null");
	cbox_gs_render->Append("OpenGL");

#ifdef _WIN32
	Microsoft::WRL::ComPtr<IDXGIFactory4> dxgiFactory;
	Microsoft::WRL::ComPtr<IDXGIAdapter> adapter;

	if (SUCCEEDED(CreateDXGIFactory(IID_PPV_ARGS(&dxgiFactory))))
	{
		cbox_gs_render->Append("DirectX 12");

		for (uint id = 0; dxgiFactory->EnumAdapters(id, adapter.GetAddressOf()) != DXGI_ERROR_NOT_FOUND; id++)
		{
			DXGI_ADAPTER_DESC adapterDesc;
			adapter->GetDesc(&adapterDesc);
			cbox_gs_d3d_adaptater->Append(adapterDesc.Description);
		}
	}
	else
	{
		cbox_gs_d3d_adaptater->Enable(false);
		chbox_gs_overlay->Enable(false);
	}
#endif

	for (int i = 1; i < WXSIZEOF(ResolutionTable); ++i)
	{
		cbox_gs_resolution->Append(wxString::Format("%dx%d", ResolutionTable[i].width.value(), ResolutionTable[i].height.value()));
	}

	cbox_gs_aspect->Append("4:3");
	cbox_gs_aspect->Append("16:9");

	for (auto item : { "Off", "50", "59.94", "30", "60", "Auto" })
		cbox_gs_frame_limit->Append(item);

	cbox_pad_handler->Append("Null");
	cbox_pad_handler->Append("Windows");
#if defined (_WIN32)
	cbox_pad_handler->Append("XInput");
#endif

	//cbox_pad_handler->Append("DirectInput");

	cbox_keyboard_handler->Append("Null");
	cbox_keyboard_handler->Append("Windows");
	//cbox_keyboard_handler->Append("DirectInput");
开发者ID:rodrigonh,项目名称:rpcs3,代码行数:67,代码来源:SettingsDialog.cpp

示例2: ppu_decoder_modes


//.........这里部分代码省略.........
	pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Video", "Debug output" }, chbox_gs_debug_output));
	pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Video", "Debug overlay" }, chbox_gs_overlay));
	pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Video", "Use legacy OpenGL buffers (Debug)" }, chbox_gs_gl_legacy_buffers));

	pads.emplace_back(std::make_unique<combobox_pad>(cfg_location{ "Audio", "Renderer" }, cbox_audio_out));
	pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Audio", "Dump to file" }, chbox_audio_dump));
	pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Audio", "Convert to 16-bit" }, chbox_audio_conv));

	pads.emplace_back(std::make_unique<combobox_pad>(cfg_location{ "Input/Output", "Controller" }, cbox_pad_handler));
	pads.emplace_back(std::make_unique<combobox_pad>(cfg_location{ "Input/Output", "Keyboard" }, cbox_keyboard_handler));
	pads.emplace_back(std::make_unique<combobox_pad>(cfg_location{ "Input/Output", "Mouse" }, cbox_mouse_handler));
	pads.emplace_back(std::make_unique<combobox_pad>(cfg_location{ "Input/Output", "Camera" }, cbox_camera));
	pads.emplace_back(std::make_unique<combobox_pad>(cfg_location{ "Input/Output", "Camera type" }, cbox_camera_type));

	pads.emplace_back(std::make_unique<combobox_pad>(cfg_location{ "Net", "Connection status" }, cbox_net_status));

	pads.emplace_back(std::make_unique<combobox_pad>(cfg_location{ "System", "Language" }, cbox_sys_lang));

	pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Miscellaneous", "Exit RPCS3 when process finishes" }, chbox_hle_exitonstop));
	pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Miscellaneous", "Always start after boot" }, chbox_hle_always_start));
	pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Miscellaneous", "Automatically pause at system call" }, chbox_dbg_ap_systemcall));
	pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Miscellaneous", "Automatically pause at function call" }, chbox_dbg_ap_functioncall));

#ifdef _MSC_VER
	Microsoft::WRL::ComPtr<IDXGIFactory4> dxgi_factory;

	if (SUCCEEDED(CreateDXGIFactory(IID_PPV_ARGS(&dxgi_factory))))
	{
		Microsoft::WRL::ComPtr<IDXGIAdapter> adapter;

		for (UINT id = 0; dxgi_factory->EnumAdapters(id, adapter.ReleaseAndGetAddressOf()) != DXGI_ERROR_NOT_FOUND; id++)
		{
			DXGI_ADAPTER_DESC desc;
			adapter->GetDesc(&desc);
			cbox_gs_d3d_adapter->Append(desc.Description);
		}

		pads.emplace_back(std::make_unique<combobox_pad>(cfg_location{ "Video", "D3D12", "Adapter" }, cbox_gs_d3d_adapter));
	}
	else
#endif
	{
		cbox_gs_d3d_adapter->Enable(false);
	}

	// Core
	s_round_core_lle->Add(chbox_list_core_lle, wxSizerFlags().Border(wxALL, 5).Expand());
	s_round_core_lle->Add(s_module_search_box, wxSizerFlags().Border(wxALL, 5).Expand());

	// Rendering
	s_round_gs_render->Add(cbox_gs_render, wxSizerFlags().Border(wxALL, 5).Expand());
	s_round_gs_d3d_adapter->Add(cbox_gs_d3d_adapter, wxSizerFlags().Border(wxALL, 5).Expand());
	s_round_gs_res->Add(cbox_gs_resolution, wxSizerFlags().Border(wxALL, 5).Expand());
	s_round_gs_aspect->Add(cbox_gs_aspect, wxSizerFlags().Border(wxALL, 5).Expand());
	s_round_gs_frame_limit->Add(cbox_gs_frame_limit, wxSizerFlags().Border(wxALL, 5).Expand());

	// Input/Output
	s_round_io_pad_handler->Add(cbox_pad_handler, wxSizerFlags().Border(wxALL, 5).Expand());
	s_round_io_keyboard_handler->Add(cbox_keyboard_handler, wxSizerFlags().Border(wxALL, 5).Expand());
	s_round_io_mouse_handler->Add(cbox_mouse_handler, wxSizerFlags().Border(wxALL, 5).Expand());
	s_round_io_camera->Add(cbox_camera, wxSizerFlags().Border(wxALL, 5).Expand());
	s_round_io_camera_type->Add(cbox_camera_type, wxSizerFlags().Border(wxALL, 5).Expand());

	s_round_audio_out->Add(cbox_audio_out, wxSizerFlags().Border(wxALL, 5).Expand());

	// Networking
开发者ID:Zangetsu38,项目名称:rpcs3,代码行数:67,代码来源:SettingsDialog.cpp

示例3: createShaders

bool Shader::createShaders(const Microsoft::WRL::ComPtr<ID3D11Device> &pDevice
    , const std::wstring &shaderFile, const std::string &vsFunc, const std::string &psFunc)
{
    // vertex shader
    {
        Microsoft::WRL::ComPtr<ID3DBlob> vblob;
        HRESULT hr = CompileShaderFromFile(shaderFile.c_str(), vsFunc.c_str(), "vs_4_0_level_9_1", &vblob);
        if (FAILED(hr))
            return false;
        hr = pDevice->CreateVertexShader(vblob->GetBufferPointer(), vblob->GetBufferSize(), NULL, &m_pVsh);
        if (FAILED(hr))
            return false;

        // vertex shader reflection
        Microsoft::WRL::ComPtr<ID3D11ShaderReflection> pReflector;
        hr = D3DReflect(vblob->GetBufferPointer(), vblob->GetBufferSize(), IID_ID3D11ShaderReflection, &pReflector);
        if (FAILED(hr))
            return false;

        OutputDebugPrintfA("#### VertexShader ####\n");
		if (!m_constant->Initialize(pDevice, SHADERSTAGE_VERTEX, pReflector)){
			return false;
		}

        D3D11_SHADER_DESC shaderdesc;
        pReflector->GetDesc(&shaderdesc);

        // Create InputLayout
        std::vector<D3D11_INPUT_ELEMENT_DESC> vbElement;
        for (size_t i = 0; i < shaderdesc.InputParameters; ++i){
            D3D11_SIGNATURE_PARAMETER_DESC sigdesc;
            pReflector->GetInputParameterDesc(i, &sigdesc);

            auto format = GetDxgiFormat(sigdesc.ComponentType, sigdesc.Mask);

            D3D11_INPUT_ELEMENT_DESC eledesc = {
                sigdesc.SemanticName
                , sigdesc.SemanticIndex
                , format
                , 0 // 決め打ち
                , D3D11_APPEND_ALIGNED_ELEMENT // 決め打ち
                , D3D11_INPUT_PER_VERTEX_DATA // 決め打ち
                , 0 // 決め打ち
            };
            vbElement.push_back(eledesc);
        }

        if (!vbElement.empty()){
            hr = pDevice->CreateInputLayout(&vbElement[0], vbElement.size(),
                vblob->GetBufferPointer(), vblob->GetBufferSize(), &m_pInputLayout);
            if (FAILED(hr))
                return false;
        }
    }

    // pixel shader
    {
        Microsoft::WRL::ComPtr<ID3DBlob> pblob;
        auto hr = CompileShaderFromFile(shaderFile.c_str(), psFunc.c_str(), "ps_4_0_level_9_1", &pblob);
        if (FAILED(hr))
            return false;
        hr = pDevice->CreatePixelShader(pblob->GetBufferPointer(), pblob->GetBufferSize(), NULL, &m_pPsh);
        if (FAILED(hr))
            return false;

        // pixel shader reflection
        Microsoft::WRL::ComPtr<ID3D11ShaderReflection> pReflector;
        hr = D3DReflect(pblob->GetBufferPointer(), pblob->GetBufferSize(), IID_ID3D11ShaderReflection, 
            &pReflector);
        if (FAILED(hr))
            return false;

        OutputDebugPrintfA("#### PixelShader ####\n");
		if (!m_constant->Initialize(pDevice, SHADERSTAGE_PIXEL, pReflector)){
			return false;
		}
    }

    return true;
}
开发者ID:HatsuneMiku,项目名称:MinTriangle,代码行数:80,代码来源:shader.cpp

示例4: CompileShaderFromFile

/// 生成する
bool D3DShader::Create(DXGIManager *pDxgi)
{
    if(m_pVsh)return true;

    auto pDevice=pDxgi->GetD3DDevice();

    // vertex shader
    {
        Microsoft::WRL::ComPtr<ID3DBlob> vblob;
        HRESULT hr = CompileShaderFromFile(m_info.path, m_info.vs
                , vblob.GetAddressOf());
        if (FAILED(hr)) return false;

        hr = pDevice->CreateVertexShader(
                vblob->GetBufferPointer(), vblob->GetBufferSize()
                , NULL, m_pVsh.ReleaseAndGetAddressOf());
        if (FAILED(hr)) return false;

        // vertex shader reflection
        Microsoft::WRL::ComPtr<ID3D11ShaderReflection> pReflector;
        hr = D3DReflect(vblob->GetBufferPointer(), vblob->GetBufferSize()
                , IID_ID3D11ShaderReflection, &pReflector);
        if (FAILED(hr)) return false;

        D3D11_SHADER_DESC shaderdesc;
        pReflector->GetDesc(&shaderdesc);

        // Create InputLayout
        std::vector<D3D11_INPUT_ELEMENT_DESC> vbElement;
        for (size_t i = 0; i < shaderdesc.InputParameters; ++i){
            D3D11_SIGNATURE_PARAMETER_DESC sigdesc;
            pReflector->GetInputParameterDesc(i, &sigdesc);

            auto format = GetDxgiFormat(sigdesc.ComponentType, sigdesc.Mask);

            D3D11_INPUT_ELEMENT_DESC eledesc = {
                sigdesc.SemanticName
                , sigdesc.SemanticIndex
                , format
                , 0 // 決め打ち
                , D3D11_APPEND_ALIGNED_ELEMENT // 決め打ち
                , D3D11_INPUT_PER_VERTEX_DATA // 決め打ち
                , 0 // 決め打ち
            };
            vbElement.push_back(eledesc);
        }

        if (!vbElement.empty()){
            hr = pDevice->CreateInputLayout(&vbElement[0], vbElement.size(),
                vblob->GetBufferPointer(), vblob->GetBufferSize(), &m_pInputLayout);
            if (FAILED(hr)) return false;
        }
    }

    // pixel shader
    {
        Microsoft::WRL::ComPtr<ID3DBlob> pblob;
        auto hr = CompileShaderFromFile(m_info.path, m_info.ps
                , pblob.GetAddressOf());
        if (FAILED(hr)) return false;

        hr = pDevice->CreatePixelShader(
                pblob->GetBufferPointer(), pblob->GetBufferSize()
                , NULL, m_pPsh.ReleaseAndGetAddressOf());
        if (FAILED(hr)) return false;
    }

    return true;
}
开发者ID:HatsuneMiku,项目名称:MinTriangle,代码行数:70,代码来源:D3DShaderResource.cpp

示例5: DSV

void D3D11GraphicsCommand::SetRenderTarget(const Surface *NewRenderTarget, const Surface *NewDepthStencilTarget)
{
	D3D11Surface *d3dRT = (D3D11Surface *)NewRenderTarget;
	D3D11Surface *d3dDS = (D3D11Surface *)NewDepthStencilTarget;

	Microsoft::WRL::ComPtr<ID3D11RenderTargetView> RTV;
	Microsoft::WRL::ComPtr<ID3D11DepthStencilView> DSV;

	if ( NewRenderTarget )
	{
		RTV = d3dRT->RenderTargetView;
	}
	if ( NewDepthStencilTarget )
	{
		bCurrentDSTIsReadonly = CurrentDepthState.DepthWriteMask == D3D11_DEPTH_WRITE_MASK_ZERO;
		// Set the appropriate depth stencil view depending on whether depth writes are enabled or not
		if ( bCurrentDSTIsReadonly )
		{
			DSV = d3dDS->ReadOnlyDepthStencilView;
		}
		else
		{
			DSV = d3dDS->DepthStencilView;
		}
	}

	bool bMRTSet = false;
	for ( UINT RenderTargetIndex = 1; RenderTargetIndex < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; ++RenderTargetIndex )
	{
		bMRTSet = bMRTSet || CurrentRenderTargets[RenderTargetIndex];
	}

	// Only set the render target if different than the currently bound RT
	if ( RTV != CurrentRenderTargets[0] || DSV != CurrentDepthStencilTarget || bMRTSet )
	{
		// Reset all texture references to this render target
		if ( NewRenderTarget )
		{
			d3dRT->UnsetTextureReferences(m_deviceContext.Get());
		}
		if ( NewDepthStencilTarget )
		{
			d3dDS->UnsetTextureReferences(m_deviceContext.Get());
		}

		CurrentDepthSurface = d3dDS;
		CurrentDepthStencilTarget = DSV;
		CurrentRenderTargets[0] = RTV;
		for ( UINT RenderTargetIndex = 1; RenderTargetIndex < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; ++RenderTargetIndex )
		{
			CurrentRenderTargets[RenderTargetIndex] = nullptr;
		}

		ID3D11RenderTargetView* RTArray[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT];
		for ( UINT RenderTargetIndex = 0; RenderTargetIndex < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; ++RenderTargetIndex )
		{
			RTArray[RenderTargetIndex] = CurrentRenderTargets[RenderTargetIndex].Get();
		}
		m_deviceContext->OMSetRenderTargets(D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT, RTArray, CurrentDepthStencilTarget.Get());

#if _DEBUG	
		// A check to allow you to pinpoint what is using mismatching targets
		// We filter our d3ddebug spew that checks for this as the d3d runtime's check is wrong.
		// For filter code, see D3D11Device.cpp look for "OMSETRENDERTARGETS_INVALIDVIEW"
		if ( RTV && DSV )
		{
			// Set the viewport to the full size of the surface
			D3D11_TEXTURE2D_DESC RTTDesc;
			ID3D11Texture2D *RenderTargetTexture = NULL;
			RTV->GetResource((ID3D11Resource**)&RenderTargetTexture);
			RenderTargetTexture->GetDesc(&RTTDesc);
			RenderTargetTexture->Release();

			D3D11_TEXTURE2D_DESC DTTDesc;
			ID3D11Texture2D *DepthTargetTexture = NULL;
			DSV->GetResource((ID3D11Resource**)&DepthTargetTexture);
			DepthTargetTexture->GetDesc(&DTTDesc);
			DepthTargetTexture->Release();

			// enforce color target is <= depth and MSAA settings match
			if ( RTTDesc.Width > DTTDesc.Width || RTTDesc.Height > DTTDesc.Height ||
				RTTDesc.SampleDesc.Count != DTTDesc.SampleDesc.Count ||
				RTTDesc.SampleDesc.Quality != DTTDesc.SampleDesc.Quality )
			{
				FatalAssert(1 == 0);
#if UE
				appErrorf(TEXT("RTV(%i,%i c=%i,q=%i) and DSV(%i,%i c=%i,q=%i) have mismatching dimensions and/or MSAA levels!"),
					RTTDesc.Width, RTTDesc.Height, RTTDesc.SampleDesc.Count, RTTDesc.SampleDesc.Quality,
					DTTDesc.Width, DTTDesc.Height, DTTDesc.SampleDesc.Count, DTTDesc.SampleDesc.Quality);
#endif
			}
		}
#endif
	}
	
	// Detect when the back buffer is being set, and set the correct viewport.
	// TODO: не нужно - вьюпорт и так поставится
	/*if ( DrawingViewport && (!NewRenderTarget || NewRenderTarget == DrawingViewport->GetBackBuffer()) )
	{
		SetViewport(0, 0, 0.0f, DrawingViewport->GetSizeX(), DrawingViewport->GetSizeY(), 1.0f);
//.........这里部分代码省略.........
开发者ID:liezesil,项目名称:engine,代码行数:101,代码来源:D3D11GraphicsCommand.cpp

示例6: LoadLibrary

emu_settings::Render_Creator::Render_Creator()
{
	// check for dx12 adapters
#ifdef _MSC_VER
	HMODULE D3D12Module = LoadLibrary(L"d3d12.dll");

	if (D3D12Module != NULL)
	{
		Microsoft::WRL::ComPtr<IDXGIAdapter1> pAdapter;
		Microsoft::WRL::ComPtr<IDXGIFactory1> dxgi_factory;
		if (SUCCEEDED(CreateDXGIFactory1(IID_PPV_ARGS(&dxgi_factory))))
		{
			PFN_D3D12_CREATE_DEVICE wrapD3D12CreateDevice = (PFN_D3D12_CREATE_DEVICE)GetProcAddress(D3D12Module, "D3D12CreateDevice");
			if (wrapD3D12CreateDevice != nullptr)
			{
				for (UINT adapterIndex = 0; DXGI_ERROR_NOT_FOUND != dxgi_factory->EnumAdapters1(adapterIndex, pAdapter.ReleaseAndGetAddressOf()); ++adapterIndex)
				{
					if (SUCCEEDED(wrapD3D12CreateDevice(pAdapter.Get(), D3D_FEATURE_LEVEL_11_0, _uuidof(ID3D12Device), nullptr)))
					{
						//A device with D3D12 support found. Init data
						supportsD3D12 = true;

						DXGI_ADAPTER_DESC desc;
						if (SUCCEEDED(pAdapter->GetDesc(&desc)))
							D3D12Adapters.append(QString::fromWCharArray(desc.Description));
					}
				}
			}
		}
	}
#endif

#if defined(WIN32) || defined(HAVE_VULKAN)
	// check for vulkan adapters
	vk::context device_enum_context;
	u32 instance_handle = device_enum_context.createInstance("RPCS3", true);

	if (instance_handle > 0)
	{
		device_enum_context.makeCurrentInstance(instance_handle);
		std::vector<vk::physical_device>& gpus = device_enum_context.enumerateDevices();

		if (gpus.size() > 0)
		{
			//A device with vulkan support found. Init data
			supportsVulkan = true;

			for (auto& gpu : gpus)
			{
				vulkanAdapters.append(qstr(gpu.get_name()));
			}
		}
	}
#endif

	// Graphics Adapter
	D3D12 = Render_Info(name_D3D12, D3D12Adapters, supportsD3D12, emu_settings::D3D12Adapter);
	Vulkan = Render_Info(name_Vulkan, vulkanAdapters, supportsVulkan, emu_settings::VulkanAdapter);
	OpenGL = Render_Info(name_OpenGL);
	NullRender = Render_Info(name_Null);

	renderers = { &D3D12, &Vulkan, &OpenGL, &NullRender };
}
开发者ID:ikki84,项目名称:rpcs3,代码行数:63,代码来源:emu_settings.cpp


注:本文中的microsoft::wrl::ComPtr::GetDesc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。