Commit eb1295e7 authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf

direct3d11: use D3D11_MAP_WRITE to update the shader constants

Otherwise the other fields are lost when updating one field

(cherry picked from commit 73b5de43)
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent c9aeb3f0
......@@ -1048,7 +1048,7 @@ static void UpdateQuadLuminanceScale(vout_display_t *vd, d3d_quad_t *quad, float
if (quad->f_luminance_scale == luminanceScale)
return;
HRESULT hr = ID3D11DeviceContext_Map(sys->d3d_dev.d3dcontext, (ID3D11Resource *)quad->pPixelShaderConstants[0], 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);
HRESULT hr = ID3D11DeviceContext_Map(sys->d3d_dev.d3dcontext, (ID3D11Resource *)quad->pPixelShaderConstants[0], 0, D3D11_MAP_WRITE, 0, &mappedResource);
if (SUCCEEDED(hr)) {
PS_CONSTANT_BUFFER *dst_data = mappedResource.pData;
quad->f_luminance_scale = luminanceScale;
......@@ -2882,7 +2882,7 @@ static void UpdateQuadOpacity(vout_display_t *vd, const d3d_quad_t *quad, float
vout_display_sys_t *sys = vd->sys;
D3D11_MAPPED_SUBRESOURCE mappedResource;
HRESULT hr = ID3D11DeviceContext_Map(sys->d3d_dev.d3dcontext, (ID3D11Resource *)quad->pPixelShaderConstants[0], 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);
HRESULT hr = ID3D11DeviceContext_Map(sys->d3d_dev.d3dcontext, (ID3D11Resource *)quad->pPixelShaderConstants[0], 0, D3D11_MAP_WRITE, 0, &mappedResource);
if (SUCCEEDED(hr)) {
PS_CONSTANT_BUFFER *dst_data = mappedResource.pData;
dst_data->Opacity = opacity;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment