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


C++ Shader::GetBlob方法代码示例

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


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

示例1: Simple

	  GraphicsPipelineStateDesc GraphicsPipelineStateDesc::Simple(
		  const D3D12_INPUT_LAYOUT_DESC & inputLayout,
		  const RootSignature & rootSig,
		  const Shader & vs, const Shader & ps)
	  {
		  ID3DBlob* vsBlob = vs.GetBlob();
		  ID3DBlob* psBlob = ps.GetBlob();
		  GraphicsPipelineStateDesc psoDesc;
		  ZeroMemory(&psoDesc, sizeof(psoDesc));
		  psoDesc.InputLayout = inputLayout;
		  psoDesc.pRootSignature = rootSig.Get();
		  psoDesc.VS = { reinterpret_cast<BYTE*>(vsBlob->GetBufferPointer()), vsBlob->GetBufferSize() };
		  psoDesc.PS = { reinterpret_cast<BYTE*>(psBlob->GetBufferPointer()), psBlob->GetBufferSize() };
		  /*
		  psoDesc.RasterizerState.FillMode = D3D12_FILL_MODE_SOLID;
		  psoDesc.RasterizerState.CullMode = D3D12_CULL_MODE_BACK;
		  psoDesc.RasterizerState.FrontCounterClockwise = FALSE;
		  psoDesc.RasterizerState.DepthBias = D3D12_DEFAULT_DEPTH_BIAS;
		  psoDesc.RasterizerState.DepthBiasClamp = D3D12_DEFAULT_DEPTH_BIAS_CLAMP;
		  psoDesc.RasterizerState.SlopeScaledDepthBias = D3D12_DEFAULT_SLOPE_SCALED_DEPTH_BIAS;
		  psoDesc.RasterizerState.DepthClipEnable = TRUE;
		  psoDesc.RasterizerState.MultisampleEnable = FALSE;
		  psoDesc.RasterizerState.AntialiasedLineEnable = FALSE;
		  psoDesc.RasterizerState.ForcedSampleCount = 0;
		  psoDesc.RasterizerState.ConservativeRaster = D3D12_CONSERVATIVE_RASTERIZATION_MODE_OFF;
		  */

		  psoDesc.RasterizerState = CD3DX12_RASTERIZER_DESC(D3D12_DEFAULT);

		  psoDesc.BlendState.AlphaToCoverageEnable = FALSE;
		  psoDesc.BlendState.IndependentBlendEnable = FALSE;
		  const D3D12_RENDER_TARGET_BLEND_DESC defaultRenderTargetBlendDesc =
		  {
			  FALSE,FALSE,
			  D3D12_BLEND_ONE, D3D12_BLEND_ZERO, D3D12_BLEND_OP_ADD,
			  D3D12_BLEND_ONE, D3D12_BLEND_ZERO, D3D12_BLEND_OP_ADD,
			  D3D12_LOGIC_OP_NOOP,
			  D3D12_COLOR_WRITE_ENABLE_ALL,
		  };
		  
		  for (UINT i = 0; i < D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i)
		  {
			  psoDesc.BlendState.RenderTarget[i] = defaultRenderTargetBlendDesc;
		  }

		  psoDesc.DepthStencilState.DepthEnable = FALSE;
		  psoDesc.DepthStencilState.StencilEnable = FALSE;
		  psoDesc.SampleMask = UINT_MAX;
		  psoDesc.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;
		  psoDesc.NumRenderTargets = 1;
		  psoDesc.RTVFormats[0] = DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
		  psoDesc.SampleDesc.Count = 1;

		  return psoDesc;
	  }
开发者ID:swq0553,项目名称:kaleido3d,代码行数:55,代码来源:PipelineState.cpp


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