Changeset 102532 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Dec 7, 2023 5:56:09 PM (14 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-dx-dx11.cpp
r102520 r102532 90 90 typedef struct D3D11BLITTER 91 91 { 92 ID3D11Device 93 ID3D11DeviceContext 92 ID3D11Device1 *pDevice; 93 ID3D11DeviceContext1 *pImmediateContext; 94 94 95 95 ID3D11VertexShader *pVertexShader; 96 96 ID3D11PixelShader *pPixelShader; 97 97 ID3D11SamplerState *pSamplerState; 98 ID3D11RasterizerState 99 ID3D11BlendState 98 ID3D11RasterizerState1 *pRasterizerState; 99 ID3D11BlendState1 *pBlendState; 100 100 } D3D11BLITTER; 101 101 … … 349 349 uint32_t cStreamOutput; /* paStreamOutput */ 350 350 uint32_t cUnorderedAccessView; /* paUnorderedAccessView */ 351 ID3D11BlendState 351 ID3D11BlendState1 **papBlendState; 352 352 ID3D11DepthStencilState **papDepthStencilState; 353 353 ID3D11SamplerState **papSamplerState; 354 ID3D11RasterizerState 354 ID3D11RasterizerState1 **papRasterizerState; 355 355 DXELEMENTLAYOUT *paElementLayout; 356 356 DXVIEW *paRenderTargetView; … … 420 420 static void dxDestroyVideoDecoder(DXVIDEODECODER *pDXVideoDecoder); 421 421 422 static HRESULT BlitInit(D3D11BLITTER *pBlitter, ID3D11Device *pDevice, ID3D11DeviceContext*pImmediateContext);422 static HRESULT BlitInit(D3D11BLITTER *pBlitter, ID3D11Device1 *pDevice, ID3D11DeviceContext1 *pImmediateContext); 423 423 static void BlitRelease(D3D11BLITTER *pBlitter); 424 424 … … 1912 1912 1913 1913 1914 static D3D11_LOGIC_OP dxLogicOp(uint8_t svgaLogicEq) 1915 { 1916 return (D3D11_LOGIC_OP)svgaLogicEq; 1917 } 1918 1919 1914 1920 /** @todo AssertCompile for types like D3D11_COMPARISON_FUNC and SVGA3dComparisonFunc */ 1915 static HRESULT dxBlendStateCreate(DXDEVICE *pDevice, SVGACOTableDXBlendStateEntry const *pEntry, ID3D11BlendState **pp)1916 { 1917 D3D11_BLEND_DESC BlendDesc;1921 static HRESULT dxBlendStateCreate(DXDEVICE *pDevice, SVGACOTableDXBlendStateEntry const *pEntry, ID3D11BlendState1 **pp) 1922 { 1923 D3D11_BLEND_DESC1 BlendDesc; 1918 1924 BlendDesc.AlphaToCoverageEnable = RT_BOOL(pEntry->alphaToCoverageEnable); 1919 1925 BlendDesc.IndependentBlendEnable = RT_BOOL(pEntry->independentBlendEnable); … … 1921 1927 { 1922 1928 BlendDesc.RenderTarget[i].BlendEnable = RT_BOOL(pEntry->perRT[i].blendEnable); 1929 BlendDesc.RenderTarget[i].LogicOpEnable = RT_BOOL(pEntry->perRT[i].logicOpEnable); 1923 1930 BlendDesc.RenderTarget[i].SrcBlend = dxBlendFactorColor(pEntry->perRT[i].srcBlend); 1924 1931 BlendDesc.RenderTarget[i].DestBlend = dxBlendFactorColor(pEntry->perRT[i].destBlend); … … 1927 1934 BlendDesc.RenderTarget[i].DestBlendAlpha = dxBlendFactorAlpha(pEntry->perRT[i].destBlendAlpha); 1928 1935 BlendDesc.RenderTarget[i].BlendOpAlpha = dxBlendOp (pEntry->perRT[i].blendOpAlpha); 1936 BlendDesc.RenderTarget[i].LogicOp = dxLogicOp (pEntry->perRT[i].logicOp); 1929 1937 BlendDesc.RenderTarget[i].RenderTargetWriteMask = pEntry->perRT[i].renderTargetWriteMask; 1930 /** @todo logicOpEnable and logicOp */ 1931 } 1932 1933 HRESULT hr = pDevice->pDevice->CreateBlendState(&BlendDesc, pp); 1938 } 1939 1940 HRESULT hr = pDevice->pDevice->CreateBlendState1(&BlendDesc, pp); 1934 1941 Assert(SUCCEEDED(hr)); 1935 1942 return hr; … … 1999 2006 2000 2007 2001 static HRESULT dxRasterizerStateCreate(DXDEVICE *pDevice, SVGACOTableDXRasterizerStateEntry const *pEntry, ID3D11RasterizerState **pp) 2002 { 2003 D3D11_RASTERIZER_DESC desc; 2008 static D3D11_CULL_MODE dxCullMode(uint8_t svgaCullMode) 2009 { 2010 return (D3D11_CULL_MODE)svgaCullMode; 2011 } 2012 2013 2014 static HRESULT dxRasterizerStateCreate(DXDEVICE *pDevice, SVGACOTableDXRasterizerStateEntry const *pEntry, ID3D11RasterizerState1 **pp) 2015 { 2016 D3D11_RASTERIZER_DESC1 desc; 2004 2017 desc.FillMode = dxFillMode(pEntry->fillMode); 2005 desc.CullMode = (D3D11_CULL_MODE)pEntry->cullMode;2018 desc.CullMode = dxCullMode(pEntry->cullMode); 2006 2019 desc.FrontCounterClockwise = pEntry->frontCounterClockwise; 2007 2020 /** @todo provokingVertexLast */ … … 2013 2026 desc.MultisampleEnable = pEntry->multisampleEnable; 2014 2027 desc.AntialiasedLineEnable = pEntry->antialiasedLineEnable; 2015 /** @todo lineWidth lineStippleEnable lineStippleFactor lineStipplePattern forcedSampleCount */ 2016 2017 HRESULT hr = pDevice->pDevice->CreateRasterizerState(&desc, pp); 2028 desc.ForcedSampleCount = pEntry->forcedSampleCount; 2029 /** @todo lineWidth lineStippleEnable lineStippleFactor lineStipplePattern */ 2030 2031 HRESULT hr = pDevice->pDevice->CreateRasterizerState1(&desc, pp); 2018 2032 Assert(SUCCEEDED(hr)); 2019 2033 return hr; … … 7845 7859 if (blendId != SVGA3D_INVALID_ID) 7846 7860 { 7847 ID3D11BlendState *pBlendState = pDXContext->pBackendDXContext->papBlendState[blendId];7861 ID3D11BlendState1 *pBlendState = pDXContext->pBackendDXContext->papBlendState[blendId]; 7848 7862 pDevice->pImmediateContext->OMSetBlendState(pBlendState, blendFactor, sampleMask); 7849 7863 } … … 7885 7899 if (rasterizerId != SVGA3D_INVALID_ID) 7886 7900 { 7887 ID3D11RasterizerState *pRasterizerState = pDXContext->pBackendDXContext->papRasterizerState[rasterizerId];7901 ID3D11RasterizerState1 *pRasterizerState = pDXContext->pBackendDXContext->papRasterizerState[rasterizerId]; 7888 7902 pDevice->pImmediateContext->RSSetState(pRasterizerState); 7889 7903 } … … 8497 8511 8498 8512 8499 static HRESULT BlitInit(D3D11BLITTER *pBlitter, ID3D11Device *pDevice, ID3D11DeviceContext*pImmediateContext)8513 static HRESULT BlitInit(D3D11BLITTER *pBlitter, ID3D11Device1 *pDevice, ID3D11DeviceContext1 *pImmediateContext) 8500 8514 { 8501 8515 HRESULT hr; … … 8525 8539 HTEST(pBlitter->pDevice->CreateSamplerState(&SamplerDesc, &pBlitter->pSamplerState)); 8526 8540 8527 D3D11_RASTERIZER_DESC RasterizerDesc;8541 D3D11_RASTERIZER_DESC1 RasterizerDesc; 8528 8542 RasterizerDesc.FillMode = D3D11_FILL_SOLID; 8529 8543 RasterizerDesc.CullMode = D3D11_CULL_NONE; … … 8536 8550 RasterizerDesc.MultisampleEnable = FALSE; 8537 8551 RasterizerDesc.AntialiasedLineEnable = FALSE; 8538 HTEST(pBlitter->pDevice->CreateRasterizerState(&RasterizerDesc, &pBlitter->pRasterizerState)); 8539 8540 D3D11_BLEND_DESC BlendDesc; 8552 RasterizerDesc.ForcedSampleCount = 0; 8553 HTEST(pBlitter->pDevice->CreateRasterizerState1(&RasterizerDesc, &pBlitter->pRasterizerState)); 8554 8555 D3D11_BLEND_DESC1 BlendDesc; 8541 8556 BlendDesc.AlphaToCoverageEnable = FALSE; 8542 8557 BlendDesc.IndependentBlendEnable = FALSE; … … 8544 8559 { 8545 8560 BlendDesc.RenderTarget[i].BlendEnable = FALSE; 8561 BlendDesc.RenderTarget[i].LogicOpEnable = FALSE; 8546 8562 BlendDesc.RenderTarget[i].SrcBlend = D3D11_BLEND_SRC_COLOR; 8547 8563 BlendDesc.RenderTarget[i].DestBlend = D3D11_BLEND_ZERO; … … 8550 8566 BlendDesc.RenderTarget[i].DestBlendAlpha = D3D11_BLEND_ZERO; 8551 8567 BlendDesc.RenderTarget[i].BlendOpAlpha = D3D11_BLEND_OP_ADD; 8568 BlendDesc.RenderTarget[i].LogicOp = D3D11_LOGIC_OP_CLEAR; 8552 8569 BlendDesc.RenderTarget[i].RenderTargetWriteMask = 0xF; 8553 8570 } 8554 HTEST(pBlitter->pDevice->CreateBlendState (&BlendDesc, &pBlitter->pBlendState));8571 HTEST(pBlitter->pDevice->CreateBlendState1(&BlendDesc, &pBlitter->pBlendState)); 8555 8572 8556 8573 return S_OK;
Note:
See TracChangeset
for help on using the changeset viewer.