Skip to content

Commit

Permalink
Revert "Update OBS to D3D11"
Browse files Browse the repository at this point in the history
This reverts commit fb3188a.

This was a change that was added to fix support for certain intel
devices, but ultimately I feel like it's just not needed and is trying
to fix something that isn't broken.
  • Loading branch information
jp9000 committed Jan 23, 2015
1 parent ed58b5b commit 691c251
Show file tree
Hide file tree
Showing 17 changed files with 283 additions and 299 deletions.
12 changes: 6 additions & 6 deletions OBS.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
</ClCompile>
<Link>
<AdditionalOptions>/ignore:4049 /ignore:4217 /ignore:4099 %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>Avrt.lib;dwmapi.lib;comctl32.lib;dxgi.lib;dxguid.lib;d3d11.lib;d3dx11.lib;ws2_32.lib;Iphlpapi.lib;Winmm.lib;librtmp.lib;libmp3lame-static.lib;libfaac.lib;dsound.lib;obsapi.lib;shell32.lib;gdiplus.lib;mfplat.lib;Mfuuid.lib;Winhttp.lib;libx264.lib;UxTheme.lib;Xinput9_1_0.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>Avrt.lib;dwmapi.lib;comctl32.lib;dxgi.lib;dxguid.lib;d3d10_1.lib;d3dx10.lib;ws2_32.lib;Iphlpapi.lib;Winmm.lib;librtmp.lib;libmp3lame-static.lib;libfaac.lib;dsound.lib;obsapi.lib;shell32.lib;gdiplus.lib;mfplat.lib;Mfuuid.lib;Winhttp.lib;libx264.lib;UxTheme.lib;Xinput9_1_0.lib;%(AdditionalDependencies)</AdditionalDependencies>
<Version>
</Version>
<AdditionalLibraryDirectories>OBSApi/Debug;x264/libs/32bit;librtmp/debug;lame/output/32bit;libfaac/debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
Expand Down Expand Up @@ -160,7 +160,7 @@
<PrecompiledHeaderFile>Main.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<AdditionalDependencies>Avrt.lib;dwmapi.lib;comctl32.lib;dxgi.lib;dxguid.lib;d3d11.lib;d3dx11.lib;ws2_32.lib;Iphlpapi.lib;Winmm.lib;librtmp.lib;libmp3lame-static.lib;libfaac.lib;dsound.lib;obsapi.lib;shell32.lib;gdiplus.lib;mfplat.lib;Mfuuid.lib;Winhttp.lib;libx264.lib;UxTheme.lib;Xinput9_1_0.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>Avrt.lib;dwmapi.lib;comctl32.lib;dxgi.lib;dxguid.lib;d3d10_1.lib;d3dx10.lib;ws2_32.lib;Iphlpapi.lib;Winmm.lib;librtmp.lib;libmp3lame-static.lib;libfaac.lib;dsound.lib;obsapi.lib;shell32.lib;gdiplus.lib;mfplat.lib;Mfuuid.lib;Winhttp.lib;libx264.lib;UxTheme.lib;Xinput9_1_0.lib;%(AdditionalDependencies)</AdditionalDependencies>
<Version>
</Version>
<AdditionalLibraryDirectories>OBSApi/x64/Debug;x264/libs/64bit;librtmp/x64/debug;lame/output/64bit;libfaac/x64/debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
Expand Down Expand Up @@ -197,7 +197,7 @@
</ClCompile>
<Link>
<AdditionalOptions>/ignore:4049 /ignore:4217 %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>Avrt.lib;dwmapi.lib;comctl32.lib;dxgi.lib;dxguid.lib;d3d11.lib;d3dx11.lib;ws2_32.lib;Iphlpapi.lib;Winmm.lib;librtmp.lib;libmp3lame-static.lib;libfaac.lib;dsound.lib;obsapi.lib;shell32.lib;gdiplus.lib;mfplat.lib;Mfuuid.lib;Winhttp.lib;libx264.lib;UxTheme.lib;Xinput9_1_0.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>Avrt.lib;dwmapi.lib;comctl32.lib;dxgi.lib;dxguid.lib;d3d10_1.lib;d3dx10.lib;ws2_32.lib;Iphlpapi.lib;Winmm.lib;librtmp.lib;libmp3lame-static.lib;libfaac.lib;dsound.lib;obsapi.lib;shell32.lib;gdiplus.lib;mfplat.lib;Mfuuid.lib;Winhttp.lib;libx264.lib;UxTheme.lib;Xinput9_1_0.lib;%(AdditionalDependencies)</AdditionalDependencies>
<Version>
</Version>
<AdditionalLibraryDirectories>OBSApi/Release;x264/libs/32bit;librtmp/release;lame/output/32bit;libfaac/release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
Expand Down Expand Up @@ -239,7 +239,7 @@
<AdditionalOptions>/d2Zi+ %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>Avrt.lib;dwmapi.lib;comctl32.lib;dxgi.lib;dxguid.lib;d3d11.lib;d3dx11.lib;ws2_32.lib;Iphlpapi.lib;Winmm.lib;librtmp.lib;libmp3lame-static.lib;libfaac.lib;dsound.lib;obsapi.lib;shell32.lib;gdiplus.lib;mfplat.lib;Mfuuid.lib;Winhttp.lib;libx264.lib;UxTheme.lib;Xinput9_1_0.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>Avrt.lib;dwmapi.lib;comctl32.lib;dxgi.lib;dxguid.lib;d3d10_1.lib;d3dx10.lib;ws2_32.lib;Iphlpapi.lib;Winmm.lib;librtmp.lib;libmp3lame-static.lib;libfaac.lib;dsound.lib;obsapi.lib;shell32.lib;gdiplus.lib;mfplat.lib;Mfuuid.lib;Winhttp.lib;libx264.lib;UxTheme.lib;Xinput9_1_0.lib;%(AdditionalDependencies)</AdditionalDependencies>
<Version>
</Version>
<AdditionalLibraryDirectories>OBSApi/x64/Release;x264/libs/64bit;librtmp/x64/release;lame/output/64bit;libfaac/x64/release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
Expand Down Expand Up @@ -320,7 +320,7 @@
<ClInclude Include="Source\CodeTokenizer.h" />
<ClInclude Include="Source\CrashDumpHandler.h" />
<ClInclude Include="Source\D3D10System.h" />
<ClInclude Include="Source\DataPacketHelpers.h" />
<ClInclude Include="Source\DataPacketHelpers.h"/>
<ClInclude Include="Source\HTTPClient.h" />
<ClInclude Include="Source\libnsgif.h" />
<ClInclude Include="Source\LogUploader.h" />
Expand Down Expand Up @@ -359,4 +359,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
6 changes: 3 additions & 3 deletions OBS.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@
<ClInclude Include="Source\LogUploader.h">
<Filter>Headers</Filter>
</ClInclude>
<ClInclude Include="Source\DataPacketHelpers.h">
<ClCompile Include="Source\DataPacketHelpers.h">
<Filter>Headers</Filter>
</ClInclude>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="cursor1.cur">
Expand Down Expand Up @@ -293,4 +293,4 @@
<Filter>Resources</Filter>
</ResourceCompile>
</ItemGroup>
</Project>
</Project>
3 changes: 0 additions & 3 deletions OBSApi/GraphicsSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -608,9 +608,6 @@ class BASE_EXPORT GraphicsSystem
private:
virtual void CreateVertexShaderBlob(ShaderBlob &blob, CTSTR lpShader, CTSTR lpFileName) = 0;
virtual void CreatePixelShaderBlob(ShaderBlob &blob, CTSTR lpShader, CTSTR lpFileName) = 0;

public:
virtual LPVOID GetContext()=0;
};


Expand Down
4 changes: 2 additions & 2 deletions Source/BitmapImageSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,8 @@ bool STDCALL ConfigureBitmapSource(XElement *element, bool bCreating)
{
CTSTR lpBitmap = data->GetString(TEXT("path"));

D3DX11_IMAGE_INFO ii;
if(SUCCEEDED(D3DX11GetImageInfoFromFile(lpBitmap, NULL, &ii, NULL)))
D3DX10_IMAGE_INFO ii;
if(SUCCEEDED(D3DX10GetImageInfoFromFile(lpBitmap, NULL, &ii, NULL)))
{
element->SetInt(TEXT("cx"), ii.Width);
element->SetInt(TEXT("cy"), ii.Height);
Expand Down
4 changes: 2 additions & 2 deletions Source/BitmapTransitionSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,8 @@ INT_PTR CALLBACK ConfigureBitmapTransitionProc(HWND hwnd, UINT message, WPARAM w

ConfigBitmapInfo *configInfo = (ConfigBitmapInfo*)GetWindowLongPtr(hwnd, DWLP_USER);

D3DX11_IMAGE_INFO ii;
if(SUCCEEDED(D3DX11GetImageInfoFromFile(bitmapList[0], NULL, &ii, NULL)))
D3DX10_IMAGE_INFO ii;
if(SUCCEEDED(D3DX10GetImageInfoFromFile(bitmapList[0], NULL, &ii, NULL)))
{
configInfo->cx = ii.Width;
configInfo->cy = ii.Height;
Expand Down
8 changes: 4 additions & 4 deletions Source/D3D10OutputDuplicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ DuplicatorInfo D3D10OutputDuplicator::AcquireNextFrame(UINT timeout)

//------------------------------------------

ID3D11Texture2D *texVal;
if(FAILED(hRes = tempResource->QueryInterface(__uuidof(ID3D11Texture2D), (void**)&texVal)))
ID3D10Texture2D *texVal;
if(FAILED(hRes = tempResource->QueryInterface(__uuidof(ID3D10Texture2D), (void**)&texVal)))
{
SafeRelease(tempResource);
AppWarning(TEXT("D3D10OutputDuplicator::AcquireNextFrame: could not query interface, result = 0x%08lX"), hRes);
Expand All @@ -113,7 +113,7 @@ DuplicatorInfo D3D10OutputDuplicator::AcquireNextFrame(UINT timeout)

//------------------------------------------

D3D11_TEXTURE2D_DESC texDesc;
D3D10_TEXTURE2D_DESC texDesc;
texVal->GetDesc(&texDesc);

if(!copyTex || copyTex->Width() != texDesc.Width || copyTex->Height() != texDesc.Height)
Expand All @@ -127,7 +127,7 @@ DuplicatorInfo D3D10OutputDuplicator::AcquireNextFrame(UINT timeout)
if(copyTex)
{
D3D10Texture *d3dCopyTex = (D3D10Texture*)copyTex;
GetD3DCtx()->CopyResource(d3dCopyTex->texture, texVal);
GetD3D()->CopyResource(d3dCopyTex->texture, texVal);
}

SafeRelease(texVal);
Expand Down
30 changes: 15 additions & 15 deletions Source/D3D10Shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ bool D3D10Shader::ProcessData(ShaderProcessor &processor, CTSTR lpFileName)

if(constantSize)
{
D3D11_BUFFER_DESC bd;
D3D10_BUFFER_DESC bd;
zero(&bd, sizeof(bd));

bd.ByteWidth = (constantSize+15)&0xFFFFFFF0; //align to 128bit boundry
bd.Usage = D3D11_USAGE_DYNAMIC;
bd.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
bd.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
bd.Usage = D3D10_USAGE_DYNAMIC;
bd.BindFlags = D3D10_BIND_CONSTANT_BUFFER;
bd.CPUAccessFlags = D3D10_CPU_ACCESS_WRITE;

HRESULT err = GetD3D()->CreateBuffer(&bd, NULL, &constantBuffer);
if(FAILED(err))
Expand All @@ -89,7 +89,7 @@ void D3D10VertexShader::CreateVertexShaderBlob(ShaderBlob &blob, CTSTR lpShader,
LPSTR lpAnsiShader = tstr_createUTF8(lpShader);
LPSTR lpAnsiFileName = tstr_createUTF8(lpFileName);

HRESULT err = D3DX11CompileFromMemory(lpAnsiShader, strlen(lpAnsiShader), lpAnsiFileName, NULL, NULL, "main", lpVSType, D3D10_SHADER_OPTIMIZATION_LEVEL3, 0, NULL, shaderBlob.Assign(), errorMessages.Assign(), NULL);
HRESULT err = D3DX10CompileFromMemory(lpAnsiShader, strlen(lpAnsiShader), lpAnsiFileName, NULL, NULL, "main", lpVSType, D3D10_SHADER_OPTIMIZATION_LEVEL3, 0, NULL, shaderBlob.Assign(), errorMessages.Assign(), NULL);

Free(lpAnsiFileName);
Free(lpAnsiShader);
Expand Down Expand Up @@ -123,10 +123,10 @@ Shader* D3D10VertexShader::CreateVertexShaderFromBlob(ShaderBlob const &blob, CT
if (!blob.size())
return nullptr;

ComPtr<ID3D11VertexShader> vShader;
ID3D11InputLayout *vShaderLayout;
ComPtr<ID3D10VertexShader> vShader;
ID3D10InputLayout *vShaderLayout;

HRESULT err = GetD3D()->CreateVertexShader(&blob.front(), blob.size(), NULL, vShader.Assign());
HRESULT err = GetD3D()->CreateVertexShader(&blob.front(), blob.size(), vShader.Assign());
if (FAILED(err))
{
CrashError(TEXT("Unable to create vertex shader '%s', result = %08lX"), lpFileName, err);
Expand Down Expand Up @@ -177,7 +177,7 @@ void D3D10PixelShader::CreatePixelShaderBlob(ShaderBlob &blob, CTSTR lpShader, C
LPSTR lpAnsiShader = tstr_createUTF8(lpShader);
LPSTR lpAnsiFileName = tstr_createUTF8(lpFileName);

HRESULT err = D3DX11CompileFromMemory(lpAnsiShader, strlen(lpAnsiShader), lpAnsiFileName, NULL, NULL, "main", lpPSType, D3D10_SHADER_OPTIMIZATION_LEVEL3, 0, NULL, shaderBlob.Assign(), errorMessages.Assign(), NULL);
HRESULT err = D3DX10CompileFromMemory(lpAnsiShader, strlen(lpAnsiShader), lpAnsiFileName, NULL, NULL, "main", lpPSType, D3D10_SHADER_OPTIMIZATION_LEVEL3, 0, NULL, shaderBlob.Assign(), errorMessages.Assign(), NULL);

Free(lpAnsiFileName);
Free(lpAnsiShader);
Expand Down Expand Up @@ -211,9 +211,9 @@ Shader *D3D10PixelShader::CreatePixelShaderFromBlob(ShaderBlob const &blob, CTST
if (!blob.size())
return nullptr;

ID3D11PixelShader *pShader;
ID3D10PixelShader *pShader;

HRESULT err = GetD3D()->CreatePixelShader(&blob.front(), blob.size(), NULL, &pShader);
HRESULT err = GetD3D()->CreatePixelShader(&blob.front(), blob.size(), &pShader);
if (FAILED(err))
{
CrashError(TEXT("Unable to create pixel shader '%s', result = %08lX"), lpFileName, err);
Expand Down Expand Up @@ -442,16 +442,16 @@ void D3D10Shader::UpdateParams()

if(bUpload)
{
D3D11_MAPPED_SUBRESOURCE map;
BYTE *outData;

HRESULT err;
if(FAILED(err = GetD3DCtx()->Map(constantBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &map)))
if(FAILED(err = constantBuffer->Map(D3D10_MAP_WRITE_DISCARD, 0, (void**)&outData)))
{
AppWarning(TEXT("D3D10Shader::UpdateParams: could not map constant buffer, result = %08lX"), err);
return;
}

mcpy(map.pData, shaderConstantData.Array(), shaderConstantData.Num());
GetD3DCtx()->Unmap(constantBuffer, 0);
mcpy(outData, shaderConstantData.Array(), shaderConstantData.Num());
constantBuffer->Unmap();
}
}
4 changes: 2 additions & 2 deletions Source/D3D10ShaderProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,12 @@ BOOL ShaderProcessor::ProcessShader(CTSTR input, CTSTR filename)
break;
}

D3D11_INPUT_ELEMENT_DESC inputElement;
D3D10_INPUT_ELEMENT_DESC inputElement;
inputElement.SemanticName = semanticInfo.lpName;
inputElement.SemanticIndex = semanticInfo.index;
inputElement.InputSlot = 0;
inputElement.AlignedByteOffset = 0;
inputElement.InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
inputElement.InputSlotClass = D3D10_INPUT_PER_VERTEX_DATA;
inputElement.InstanceDataStepRate = 0;

if(strSemantic.CompareI(TEXT("color")))
Expand Down
Loading

0 comments on commit 691c251

Please sign in to comment.