winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
June
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
March 2020
----- 2025 -----
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
996 discussions
Start a n
N
ew thread
Connor McAdams : d3d10: Implement scalar effect variable set methods.
by Alexandre Julliard
12 Mar '20
12 Mar '20
Module: wine Branch: master Commit: 49d49e5053a78bbbaf087b8edacfa87c57b31883 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=49d49e5053a78bbbaf087b8e…
Author: Connor McAdams <conmanx360(a)gmail.com> Date: Thu Mar 12 14:04:56 2020 +0100 d3d10: Implement scalar effect variable set methods. Signed-off-by: Connor McAdams <conmanx360(a)gmail.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d10/effect.c | 190 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 178 insertions(+), 12 deletions(-) diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 3ee9bf7a35..a760999a2f 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -4212,8 +4212,155 @@ static const struct ID3D10EffectConstantBufferVtbl d3d10_effect_constant_buffer_ d3d10_effect_constant_buffer_GetTextureBuffer, }; + +static BOOL get_value_as_bool(void *src_data, D3D10_SHADER_VARIABLE_TYPE src_type) +{ + switch (src_type) + { + case D3D10_SVT_FLOAT: + case D3D10_SVT_INT: + case D3D10_SVT_BOOL: + if (*(DWORD *)src_data) + return -1; + break; + + default: + break; + } + + return 0; +} + +static int get_value_as_int(void *src_data, D3D10_SHADER_VARIABLE_TYPE src_type) +{ + switch (src_type) + { + case D3D10_SVT_FLOAT: + return (int)(*(float *)src_data); + + case D3D10_SVT_INT: + return *(int *)src_data; + + case D3D10_SVT_BOOL: + return get_value_as_bool(src_data, src_type); + + default: + return 0; + } +} + +static float get_value_as_float(void *src_data, D3D10_SHADER_VARIABLE_TYPE src_type) +{ + switch (src_type) + { + case D3D10_SVT_FLOAT: + return *(float *)src_data; + + case D3D10_SVT_INT: + return (float)(*(int *)src_data); + + case D3D10_SVT_BOOL: + return (float)get_value_as_bool(src_data, src_type); + + default: + return 0.0f; + } +} + +static void get_vector_as_type(BYTE *dst_data, D3D_SHADER_VARIABLE_TYPE dst_type, + BYTE *src_data, D3D_SHADER_VARIABLE_TYPE src_type, unsigned int count) +{ + DWORD *src_data_dword = (DWORD *)src_data; + DWORD *dst_data_dword = (DWORD *)dst_data; + unsigned int i; + + for (i = 0; i < count; ++i, ++dst_data_dword, ++src_data_dword) + { + if (dst_type == src_type) + *dst_data_dword = *src_data_dword; + else + { + switch (dst_type) + { + case D3D10_SVT_FLOAT: + *(float *)dst_data_dword = get_value_as_float(src_data_dword, src_type); + break; + + case D3D10_SVT_INT: + *(int *)dst_data_dword = get_value_as_int(src_data_dword, src_type); + break; + + case D3D10_SVT_BOOL: + *(BOOL *)dst_data_dword = get_value_as_bool(src_data_dword, src_type); + break; + + default: + *dst_data_dword = 0; + break; + } + } + } +} + +static void write_variable_to_buffer(struct d3d10_effect_variable *variable, void *src, + D3D_SHADER_VARIABLE_TYPE src_type) +{ + BYTE *dst = variable->buffer->u.buffer.local_buffer + variable->buffer_offset; + D3D_SHADER_VARIABLE_TYPE dst_type = variable->type->basetype; + + get_vector_as_type(dst, dst_type, src, src_type, variable->type->column_count); + + variable->buffer->u.buffer.changed = TRUE; +} + +static void write_variable_array_to_buffer(struct d3d10_effect_variable *variable, void *src, + D3D_SHADER_VARIABLE_TYPE src_type, unsigned int offset, unsigned int count) +{ + BYTE *dst = variable->buffer->u.buffer.local_buffer + variable->buffer_offset; + D3D_SHADER_VARIABLE_TYPE dst_type = variable->type->basetype; + unsigned int element_size, i; + BYTE *cur_element = src; + + if (!variable->type->element_count) + { + write_variable_to_buffer(variable, src, src_type); + return; + } + + if (offset >= variable->type->element_count) + { + WARN("Offset %u larger than element count %u, ignoring.\n", offset, variable->type->element_count); + return; + } + + if (count > variable->type->element_count - offset) + { + WARN("Offset %u, count %u overruns the variable (element count %u), fixing up.\n", + offset, count, variable->type->element_count); + count = variable->type->element_count - offset; + } + + element_size = variable->type->elementtype->size_packed; + dst += variable->type->stride * offset; + + for (i = 0; i < count; ++i) + { + get_vector_as_type(dst, dst_type, cur_element, src_type, variable->type->column_count); + + cur_element += element_size; + dst += variable->type->stride; + } + + variable->buffer->u.buffer.changed = TRUE; +} + /* ID3D10EffectVariable methods */ +static inline struct d3d10_effect_variable *impl_from_ID3D10EffectScalarVariable(ID3D10EffectScalarVariable *iface) +{ + return CONTAINING_RECORD(iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface); +} + static BOOL STDMETHODCALLTYPE d3d10_effect_scalar_variable_IsValid(ID3D10EffectScalarVariable *iface) { TRACE("iface %p\n", iface); @@ -4370,9 +4517,12 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetRawValue(ID3D10 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetFloat(ID3D10EffectScalarVariable *iface, float value) { - FIXME("iface %p, value %.8e stub!\n", iface, value); + struct d3d10_effect_variable *effect_var = impl_from_ID3D10EffectScalarVariable(iface); - return E_NOTIMPL; + TRACE("iface %p, value %.8e.\n", iface, value); + write_variable_to_buffer(effect_var, &value, D3D10_SVT_FLOAT); + + return S_OK; } static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetFloat(ID3D10EffectScalarVariable *iface, @@ -4383,12 +4533,16 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetFloat(ID3D10Eff return E_NOTIMPL; } +/* Tests show that offset is ignored for scalar variables. */ static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetFloatArray(ID3D10EffectScalarVariable *iface, float *values, UINT offset, UINT count) { - FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count); + struct d3d10_effect_variable *effect_var = impl_from_ID3D10EffectScalarVariable(iface); - return E_NOTIMPL; + TRACE("iface %p, values %p, offset %u, count %u.\n", iface, values, offset, count); + write_variable_array_to_buffer(effect_var, values, D3D10_SVT_FLOAT, 0, count); + + return S_OK; } static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetFloatArray(ID3D10EffectScalarVariable *iface, @@ -4402,9 +4556,12 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetFloatArray(ID3D static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetInt(ID3D10EffectScalarVariable *iface, int value) { - FIXME("iface %p, value %d stub!\n", iface, value); + struct d3d10_effect_variable *effect_var = impl_from_ID3D10EffectScalarVariable(iface); - return E_NOTIMPL; + TRACE("iface %p, value %d.\n", iface, value); + write_variable_to_buffer(effect_var, &value, D3D10_SVT_INT); + + return S_OK; } static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetInt(ID3D10EffectScalarVariable *iface, @@ -4418,9 +4575,12 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetInt(ID3D10Effec static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetIntArray(ID3D10EffectScalarVariable *iface, int *values, UINT offset, UINT count) { - FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count); + struct d3d10_effect_variable *effect_var = impl_from_ID3D10EffectScalarVariable(iface); - return E_NOTIMPL; + TRACE("iface %p, values %p, offset %u, count %u.\n", iface, values, offset, count); + write_variable_array_to_buffer(effect_var, values, D3D10_SVT_INT, 0, count); + + return S_OK; } static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetIntArray(ID3D10EffectScalarVariable *iface, @@ -4434,9 +4594,12 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetIntArray(ID3D10 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetBool(ID3D10EffectScalarVariable *iface, BOOL value) { - FIXME("iface %p, value %d stub!\n", iface, value); + struct d3d10_effect_variable *effect_var = impl_from_ID3D10EffectScalarVariable(iface); - return E_NOTIMPL; + TRACE("iface %p, value %d.\n", iface, value); + write_variable_to_buffer(effect_var, &value, D3D10_SVT_BOOL); + + return S_OK; } static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetBool(ID3D10EffectScalarVariable *iface, @@ -4450,9 +4613,12 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetBool(ID3D10Effe static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetBoolArray(ID3D10EffectScalarVariable *iface, BOOL *values, UINT offset, UINT count) { - FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count); + struct d3d10_effect_variable *effect_var = impl_from_ID3D10EffectScalarVariable(iface); - return E_NOTIMPL; + TRACE("iface %p, values %p, offset %u, count %u.\n", iface, values, offset, count); + write_variable_array_to_buffer(effect_var, values, D3D10_SVT_BOOL, 0, count); + + return S_OK; } static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetBoolArray(ID3D10EffectScalarVariable *iface,
1
0
0
0
Alexandre Julliard : ntdll: Fix heap validation when large heap blocks are present.
by Alexandre Julliard
12 Mar '20
12 Mar '20
Module: wine Branch: master Commit: 33937344a0c36c922aad5709a99ea64acb1e159c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=33937344a0c36c922aad5709…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Mar 12 12:43:48 2020 +0100 ntdll: Fix heap validation when large heap blocks are present. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/heap.c | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index d7232b47d6..af2a489b72 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -1331,7 +1331,7 @@ static BOOL HEAP_IsRealArena( HEAP *heapPtr, /* [in] ptr to the heap */ * does not complain */ { SUBHEAP *subheap; - BOOL ret = TRUE; + BOOL ret = FALSE; const ARENA_LARGE *large_arena; flags &= HEAP_NO_SERIALIZE; @@ -1353,16 +1353,11 @@ static BOOL HEAP_IsRealArena( HEAP *heapPtr, /* [in] ptr to the heap */ ERR("Heap %p: block %p is not inside heap\n", heapPtr, block ); else if (WARN_ON(heap)) WARN("Heap %p: block %p is not inside heap\n", heapPtr, block ); - ret = FALSE; } - else - ret = validate_large_arena( heapPtr, large_arena, quiet ); - } else - ret = HEAP_ValidateInUseArena( subheap, arena, quiet ); - - if (!(flags & HEAP_NO_SERIALIZE)) - RtlLeaveCriticalSection( &heapPtr->critSection ); - return ret; + else ret = validate_large_arena( heapPtr, large_arena, quiet ); + } + else ret = HEAP_ValidateInUseArena( subheap, arena, quiet ); + goto done; } LIST_FOR_EACH_ENTRY( subheap, &heapPtr->subheap_list, SUBHEAP, entry ) @@ -1372,27 +1367,23 @@ static BOOL HEAP_IsRealArena( HEAP *heapPtr, /* [in] ptr to the heap */ { if (*(DWORD *)ptr & ARENA_FLAG_FREE) { - if (!HEAP_ValidateFreeArena( subheap, (ARENA_FREE *)ptr )) { - ret = FALSE; - break; - } + if (!HEAP_ValidateFreeArena( subheap, (ARENA_FREE *)ptr )) goto done; ptr += sizeof(ARENA_FREE) + (*(DWORD *)ptr & ARENA_SIZE_MASK); } else { - if (!HEAP_ValidateInUseArena( subheap, (ARENA_INUSE *)ptr, NOISY )) { - ret = FALSE; - break; - } + if (!HEAP_ValidateInUseArena( subheap, (ARENA_INUSE *)ptr, NOISY )) goto done; ptr += sizeof(ARENA_INUSE) + (*(DWORD *)ptr & ARENA_SIZE_MASK); } } - if (!ret) break; } LIST_FOR_EACH_ENTRY( large_arena, &heapPtr->large_list, ARENA_LARGE, entry ) - if (!(ret = validate_large_arena( heapPtr, large_arena, quiet ))) break; + if (!validate_large_arena( heapPtr, large_arena, quiet )) goto done; + ret = TRUE; + +done: if (!(flags & HEAP_NO_SERIALIZE)) RtlLeaveCriticalSection( &heapPtr->critSection ); return ret; }
1
0
0
0
Gabriel Ivăncescu : jscript: Retrieve the proper 'this' object for bytecodes with named items.
by Alexandre Julliard
12 Mar '20
12 Mar '20
Module: wine Branch: master Commit: c2402a92ae1cb068ae871d5224b5b44381ccdd81 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c2402a92ae1cb068ae871d52…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Wed Mar 11 15:06:30 2020 +0200 jscript: Retrieve the proper 'this' object for bytecodes with named items. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/engine.c | 10 ++++++++-- dlls/jscript/tests/jscript.c | 3 --- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 5a627ea2be..db0863c902 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -1237,8 +1237,14 @@ static HRESULT interp_this(script_ctx_t *ctx) TRACE("\n"); - if(!this_obj) - this_obj = lookup_global_host(ctx); + if(!this_obj) { + named_item_t *item = ctx->call_ctx->bytecode->named_item; + + if(item) + this_obj = (item->flags & SCRIPTITEM_CODEONLY) ? to_disp(item->script_obj) : item->disp; + else + this_obj = lookup_global_host(ctx); + } IDispatch_AddRef(this_obj); return stack_push(ctx, jsval_disp(this_obj)); diff --git a/dlls/jscript/tests/jscript.c b/dlls/jscript/tests/jscript.c index ed56f8ce11..284390b860 100644 --- a/dlls/jscript/tests/jscript.c +++ b/dlls/jscript/tests/jscript.c @@ -1252,7 +1252,6 @@ static void test_named_items(void) SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"this", L"visibleCodeItem", NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); - todo_wine ok(V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == disp, "Unexpected 'this': V_VT = %d, V_DISPATCH = %p\n", V_VT(&var), V_DISPATCH(&var)); VariantClear(&var); @@ -1413,7 +1412,6 @@ static void test_named_items(void) SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"this", L"visibleItem", NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); - todo_wine ok(V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == &visible_named_item, "Unexpected 'this': V_VT = %d, V_DISPATCH = %p\n", V_VT(&var), V_DISPATCH(&var)); VariantClear(&var); @@ -1424,7 +1422,6 @@ static void test_named_items(void) SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"this", L"codeOnlyItem", NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); - todo_wine ok(V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == (IDispatch*)dispex2, "Unexpected 'this': V_VT = %d, V_DISPATCH = %p\n", V_VT(&var), V_DISPATCH(&var)); VariantClear(&var);
1
0
0
0
Zebediah Figura : d2d1: Support GUID_WICPixelFormat32bppPRGBA.
by Alexandre Julliard
12 Mar '20
12 Mar '20
Module: wine Branch: master Commit: ef0f2c7f00183ef16875cd5874c1b509e04a5a29 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ef0f2c7f00183ef16875cd58…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Wed Mar 11 11:40:43 2020 -0500 d2d1: Support GUID_WICPixelFormat32bppPRGBA. Needed by Visio 2016. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d2d1/bitmap.c | 2 ++ dlls/d2d1/tests/d2d1.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) diff --git a/dlls/d2d1/bitmap.c b/dlls/d2d1/bitmap.c index bc958e50a1..7ed57052b9 100644 --- a/dlls/d2d1/bitmap.c +++ b/dlls/d2d1/bitmap.c @@ -527,6 +527,7 @@ HRESULT d2d_bitmap_create_from_wic_bitmap(struct d2d_device_context *context, IW format_lookup[] = { {&GUID_WICPixelFormat32bppPBGRA, {DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED}}, + {&GUID_WICPixelFormat32bppPRGBA, {DXGI_FORMAT_R8G8B8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED}}, {&GUID_WICPixelFormat32bppBGR, {DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_IGNORE}}, }; @@ -579,6 +580,7 @@ HRESULT d2d_bitmap_create_from_wic_bitmap(struct d2d_device_context *context, IW switch (bitmap_desc.pixelFormat.format) { case DXGI_FORMAT_B8G8R8A8_UNORM: + case DXGI_FORMAT_R8G8B8A8_UNORM: bpp = 4; break; diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 1d4db386ab..77899ccd6e 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -9341,6 +9341,77 @@ static void test_dpi(void) DestroyWindow(window); } +static void test_wic_bitmap_format(void) +{ + IWICImagingFactory *wic_factory; + IDXGISwapChain *swapchain; + D2D1_PIXEL_FORMAT format; + IWICBitmap *wic_bitmap; + ID2D1RenderTarget *rt; + ID3D10Device1 *device; + IDXGISurface *surface; + ID2D1Bitmap *bitmap; + unsigned int i; + HWND window; + HRESULT hr; + + static const struct + { + const WICPixelFormatGUID *wic; + D2D1_PIXEL_FORMAT d2d; + } + tests[] = + { + {&GUID_WICPixelFormat32bppPBGRA, {DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED}}, + {&GUID_WICPixelFormat32bppPRGBA, {DXGI_FORMAT_R8G8B8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED}}, + {&GUID_WICPixelFormat32bppBGR, {DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_IGNORE}}, + }; + + if (!(device = create_device())) + { + skip("Failed to create device, skipping tests.\n"); + return; + } + window = create_window(); + swapchain = create_swapchain(device, window, TRUE); + hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface); + ok(hr == S_OK, "Failed to get buffer, hr %#x.\n", hr); + rt = create_render_target(surface); + ok(!!rt, "Failed to create render target.\n"); + CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + + hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, + &IID_IWICImagingFactory, (void **)&wic_factory); + ok(hr == S_OK, "Failed to create WIC imaging factory, hr %#x.\n", hr); + + for (i = 0; i < ARRAY_SIZE(tests); ++i) + { + hr = IWICImagingFactory_CreateBitmap(wic_factory, 16, 16, + tests[i].wic, WICBitmapCacheOnDemand, &wic_bitmap); + ok(hr == S_OK, "%s: Failed to create WIC bitmap, hr %#x.\n", debugstr_guid(tests[i].wic), hr); + + hr = ID2D1RenderTarget_CreateBitmapFromWicBitmap(rt, (IWICBitmapSource *)wic_bitmap, NULL, &bitmap); + ok(hr == S_OK, "%s: Failed to create bitmap from WIC source, hr %#x.\n", debugstr_guid(tests[i].wic), hr); + + format = ID2D1Bitmap_GetPixelFormat(bitmap); + ok(format.format == tests[i].d2d.format, "%s: Got unexpected DXGI format %#x.\n", + debugstr_guid(tests[i].wic), format.format); + ok(format.alphaMode == tests[i].d2d.alphaMode, "%s: Got unexpected alpha mode %#x.\n", + debugstr_guid(tests[i].wic), format.alphaMode); + + ID2D1Bitmap_Release(bitmap); + IWICBitmap_Release(wic_bitmap); + } + + IWICImagingFactory_Release(wic_factory); + CoUninitialize(); + ID2D1RenderTarget_Release(rt); + IDXGISurface_Release(surface); + IDXGISwapChain_Release(swapchain); + ID3D10Device1_Release(device); + DestroyWindow(window); +} + START_TEST(d2d1) { unsigned int argc, i; @@ -9390,6 +9461,7 @@ START_TEST(d2d1) queue_test(test_command_list); queue_test(test_max_bitmap_size); queue_test(test_dpi); + queue_test(test_wic_bitmap_format); run_queued_tests(); }
1
0
0
0
Zebediah Figura : wined3d: Move the alpha blend equation to wined3d_blend_state.
by Alexandre Julliard
12 Mar '20
12 Mar '20
Module: wine Branch: master Commit: 29b2814a26df7f390dee30267112d0c14db3b79b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=29b2814a26df7f390dee3026…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Mar 10 18:06:19 2020 -0500 wined3d: Move the alpha blend equation to wined3d_blend_state. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/device.c | 7 ------- dlls/d3d11/state.c | 1 + dlls/wined3d/device.c | 5 ++++- dlls/wined3d/state.c | 13 +++++-------- include/wine/wined3d.h | 1 + 5 files changed, 11 insertions(+), 16 deletions(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index be1b6f6f00..ab52fb1311 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -736,13 +736,6 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11Devi wined3d_device_set_blend_state(device->wined3d_device, blend_state_impl->wined3d_state, (const struct wined3d_color *)blend_factor); desc = &blend_state_impl->desc; - if (desc->RenderTarget[0].BlendEnable) - { - const D3D11_RENDER_TARGET_BLEND_DESC *d = &desc->RenderTarget[0]; - - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SEPARATEALPHABLENDENABLE, TRUE); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_BLENDOPALPHA, d->BlendOpAlpha); - } wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_COLORWRITEENABLE, desc->RenderTarget[0].RenderTargetWriteMask); wined3d_device_set_render_state(device->wined3d_device, diff --git a/dlls/d3d11/state.c b/dlls/d3d11/state.c index aa94bc2569..3bd10dd547 100644 --- a/dlls/d3d11/state.c +++ b/dlls/d3d11/state.c @@ -395,6 +395,7 @@ HRESULT d3d_blend_state_create(struct d3d_device *device, const D3D11_BLEND_DESC wined3d_desc.op = desc->RenderTarget[0].BlendOp; wined3d_desc.src_alpha = desc->RenderTarget[0].SrcBlendAlpha; wined3d_desc.dst_alpha = desc->RenderTarget[0].DestBlendAlpha; + wined3d_desc.op_alpha = desc->RenderTarget[0].BlendOpAlpha; /* We cannot fail after creating a wined3d_blend_state object. It * would lead to double free. */ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 8ee7f8da34..d94b1e2f2d 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3585,8 +3585,10 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, case WINED3D_RS_SRCBLEND: case WINED3D_RS_DESTBLEND: case WINED3D_RS_BLENDOP: + case WINED3D_RS_SEPARATEALPHABLENDENABLE: case WINED3D_RS_SRCBLENDALPHA: case WINED3D_RS_DESTBLENDALPHA: + case WINED3D_RS_BLENDOPALPHA: set_blend_state = TRUE; break; @@ -3646,7 +3648,6 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, } if (set_blend_state || changed->alpha_to_coverage - || wined3d_bitmap_is_set(changed->renderState, WINED3D_RS_SEPARATEALPHABLENDENABLE) || wined3d_bitmap_is_set(changed->renderState, WINED3D_RS_ADAPTIVETESS_Y)) { struct wined3d_blend_state *blend_state; @@ -3666,11 +3667,13 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, { desc.src_alpha = state->rs[WINED3D_RS_SRCBLENDALPHA]; desc.dst_alpha = state->rs[WINED3D_RS_DESTBLENDALPHA]; + desc.op_alpha = state->rs[WINED3D_RS_BLENDOPALPHA]; } else { desc.src_alpha = state->rs[WINED3D_RS_SRCBLEND]; desc.dst_alpha = state->rs[WINED3D_RS_DESTBLEND]; + desc.op_alpha = state->rs[WINED3D_RS_BLENDOP]; } if (wined3d_bitmap_is_set(changed->renderState, WINED3D_RS_BLENDFACTOR)) diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 17adf984c5..19f47f834e 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -426,18 +426,17 @@ static void blendop(const struct wined3d_state *state, const struct wined3d_gl_i } /* BLENDOPALPHA requires GL_EXT_blend_equation_separate, so make sure it is around */ - if (state->render_states[WINED3D_RS_BLENDOPALPHA] - && !gl_info->supported[EXT_BLEND_EQUATION_SEPARATE]) + if (b->desc.op_alpha && !gl_info->supported[EXT_BLEND_EQUATION_SEPARATE]) { WARN("Unsupported in local OpenGL implementation: glBlendEquationSeparate.\n"); return; } blend_equation = gl_blend_op(gl_info, b->desc.op); - blend_equation_alpha = gl_blend_op(gl_info, state->render_states[WINED3D_RS_BLENDOPALPHA]); + blend_equation_alpha = gl_blend_op(gl_info, b->desc.op_alpha); TRACE("blend_equation %#x, blend_equation_alpha %#x.\n", blend_equation, blend_equation_alpha); - if (state->render_states[WINED3D_RS_SEPARATEALPHABLENDENABLE]) + if (b->desc.op != b->desc.op_alpha) { GL_EXTCALL(glBlendEquationSeparate(blend_equation, blend_equation_alpha)); checkGLcall("glBlendEquationSeparate"); @@ -562,7 +561,7 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st blendop(state, gl_info); - if (state->render_states[WINED3D_RS_SEPARATEALPHABLENDENABLE]) + if (b->desc.src != b->desc.src_alpha || b->desc.dst != b->desc.dst_alpha) { GLenum src_blend_alpha, dst_blend_alpha; @@ -4500,8 +4499,6 @@ const struct wined3d_state_entry_template misc_state_template[] = { STATE_STREAM_OUTPUT, { STATE_STREAM_OUTPUT, state_so, }, WINED3D_GL_VERSION_3_2 }, { STATE_STREAM_OUTPUT, { STATE_STREAM_OUTPUT, state_so_warn, }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_EDGEANTIALIAS), { STATE_RENDER(WINED3D_RS_EDGEANTIALIAS), state_line_antialias}, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3D_RS_SEPARATEALPHABLENDENABLE), { STATE_BLEND, NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3D_RS_BLENDOPALPHA), { STATE_BLEND, NULL }, WINED3D_GL_EXT_NONE }, { STATE_BLEND, { STATE_BLEND, blend }, WINED3D_GL_EXT_NONE }, { STATE_BLEND_FACTOR, { STATE_BLEND_FACTOR, state_blend_factor }, EXT_BLEND_COLOR }, { STATE_BLEND_FACTOR, { STATE_BLEND_FACTOR, state_blend_factor_w}, WINED3D_GL_EXT_NONE }, @@ -5418,7 +5415,7 @@ static void validate_state_table(struct wined3d_state_entry *state_table) {174, 177}, {193, 193}, {195, 197}, - {207, 208}, + {206, 209}, { 0, 0}, }; static const DWORD simple_states[] = diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index aa1b30556b..9ec097ea5f 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2035,6 +2035,7 @@ struct wined3d_blend_state_desc enum wined3d_blend_op op; enum wined3d_blend src_alpha; enum wined3d_blend dst_alpha; + enum wined3d_blend_op op_alpha; }; struct wined3d_rasterizer_state_desc
1
0
0
0
Zebediah Figura : wined3d: Move the destination alpha blend function to wined3d_blend_state.
by Alexandre Julliard
12 Mar '20
12 Mar '20
Module: wine Branch: master Commit: 30e44111fee91218a3ab3bbffe9cb2fae368e87f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=30e44111fee91218a3ab3bbf…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Mar 10 18:06:18 2020 -0500 wined3d: Move the destination alpha blend function to wined3d_blend_state. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/device.c | 1 - dlls/d3d11/state.c | 1 + dlls/wined3d/device.c | 3 +++ dlls/wined3d/state.c | 7 ++----- include/wine/wined3d.h | 1 + 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 42d9ccc3bf..be1b6f6f00 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -741,7 +741,6 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11Devi const D3D11_RENDER_TARGET_BLEND_DESC *d = &desc->RenderTarget[0]; wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SEPARATEALPHABLENDENABLE, TRUE); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DESTBLENDALPHA, d->DestBlendAlpha); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_BLENDOPALPHA, d->BlendOpAlpha); } wined3d_device_set_render_state(device->wined3d_device, diff --git a/dlls/d3d11/state.c b/dlls/d3d11/state.c index 231978b8a5..aa94bc2569 100644 --- a/dlls/d3d11/state.c +++ b/dlls/d3d11/state.c @@ -394,6 +394,7 @@ HRESULT d3d_blend_state_create(struct d3d_device *device, const D3D11_BLEND_DESC wined3d_desc.dst = desc->RenderTarget[0].DestBlend; wined3d_desc.op = desc->RenderTarget[0].BlendOp; wined3d_desc.src_alpha = desc->RenderTarget[0].SrcBlendAlpha; + wined3d_desc.dst_alpha = desc->RenderTarget[0].DestBlendAlpha; /* We cannot fail after creating a wined3d_blend_state object. It * would lead to double free. */ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 303122c2e0..8ee7f8da34 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3586,6 +3586,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, case WINED3D_RS_DESTBLEND: case WINED3D_RS_BLENDOP: case WINED3D_RS_SRCBLENDALPHA: + case WINED3D_RS_DESTBLENDALPHA: set_blend_state = TRUE; break; @@ -3664,10 +3665,12 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, if (state->rs[WINED3D_RS_SEPARATEALPHABLENDENABLE]) { desc.src_alpha = state->rs[WINED3D_RS_SRCBLENDALPHA]; + desc.dst_alpha = state->rs[WINED3D_RS_DESTBLENDALPHA]; } else { desc.src_alpha = state->rs[WINED3D_RS_SRCBLEND]; + desc.dst_alpha = state->rs[WINED3D_RS_DESTBLEND]; } if (wined3d_bitmap_is_set(changed->renderState, WINED3D_RS_BLENDFACTOR)) diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index e0cbf82e14..17adf984c5 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -573,8 +573,7 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st return; } - gl_blend_from_d3d(&src_blend_alpha, &dst_blend_alpha, b->desc.src_alpha, - state->render_states[WINED3D_RS_DESTBLENDALPHA], rt_format); + gl_blend_from_d3d(&src_blend_alpha, &dst_blend_alpha, b->desc.src_alpha, b->desc.dst_alpha, rt_format); GL_EXTCALL(glBlendFuncSeparate(src_blend, dst_blend, src_blend_alpha, dst_blend_alpha)); checkGLcall("glBlendFuncSeparate"); @@ -4502,8 +4501,6 @@ const struct wined3d_state_entry_template misc_state_template[] = { STATE_STREAM_OUTPUT, { STATE_STREAM_OUTPUT, state_so_warn, }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_EDGEANTIALIAS), { STATE_RENDER(WINED3D_RS_EDGEANTIALIAS), state_line_antialias}, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_SEPARATEALPHABLENDENABLE), { STATE_BLEND, NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3D_RS_DESTBLENDALPHA), { STATE_BLEND, NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3D_RS_DESTBLENDALPHA), { STATE_BLEND, NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_BLENDOPALPHA), { STATE_BLEND, NULL }, WINED3D_GL_EXT_NONE }, { STATE_BLEND, { STATE_BLEND, blend }, WINED3D_GL_EXT_NONE }, { STATE_BLEND_FACTOR, { STATE_BLEND_FACTOR, state_blend_factor }, EXT_BLEND_COLOR }, @@ -5421,7 +5418,7 @@ static void validate_state_table(struct wined3d_state_entry *state_table) {174, 177}, {193, 193}, {195, 197}, - {207, 207}, + {207, 208}, { 0, 0}, }; static const DWORD simple_states[] = diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 42dd078ca6..aa1b30556b 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2034,6 +2034,7 @@ struct wined3d_blend_state_desc enum wined3d_blend dst; enum wined3d_blend_op op; enum wined3d_blend src_alpha; + enum wined3d_blend dst_alpha; }; struct wined3d_rasterizer_state_desc
1
0
0
0
Zebediah Figura : wined3d: Move the source alpha blend function to wined3d_blend_state.
by Alexandre Julliard
12 Mar '20
12 Mar '20
Module: wine Branch: master Commit: fc740b872415caaab159cb4a8205c72eb2bc9f41 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fc740b872415caaab159cb4a…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Mar 10 18:06:17 2020 -0500 wined3d: Move the source alpha blend function to wined3d_blend_state. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/device.c | 1 - dlls/d3d11/state.c | 1 + dlls/wined3d/device.c | 10 ++++++++++ dlls/wined3d/state.c | 5 ++--- include/wine/wined3d.h | 1 + 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 8193ec4cf4..42d9ccc3bf 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -741,7 +741,6 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11Devi const D3D11_RENDER_TARGET_BLEND_DESC *d = &desc->RenderTarget[0]; wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SEPARATEALPHABLENDENABLE, TRUE); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SRCBLENDALPHA, d->SrcBlendAlpha); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DESTBLENDALPHA, d->DestBlendAlpha); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_BLENDOPALPHA, d->BlendOpAlpha); } diff --git a/dlls/d3d11/state.c b/dlls/d3d11/state.c index 693bb3df83..231978b8a5 100644 --- a/dlls/d3d11/state.c +++ b/dlls/d3d11/state.c @@ -393,6 +393,7 @@ HRESULT d3d_blend_state_create(struct d3d_device *device, const D3D11_BLEND_DESC wined3d_desc.src = desc->RenderTarget[0].SrcBlend; wined3d_desc.dst = desc->RenderTarget[0].DestBlend; wined3d_desc.op = desc->RenderTarget[0].BlendOp; + wined3d_desc.src_alpha = desc->RenderTarget[0].SrcBlendAlpha; /* We cannot fail after creating a wined3d_blend_state object. It * would lead to double free. */ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 5bb9542891..303122c2e0 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3585,6 +3585,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, case WINED3D_RS_SRCBLEND: case WINED3D_RS_DESTBLEND: case WINED3D_RS_BLENDOP: + case WINED3D_RS_SRCBLENDALPHA: set_blend_state = TRUE; break; @@ -3644,6 +3645,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, } if (set_blend_state || changed->alpha_to_coverage + || wined3d_bitmap_is_set(changed->renderState, WINED3D_RS_SEPARATEALPHABLENDENABLE) || wined3d_bitmap_is_set(changed->renderState, WINED3D_RS_ADAPTIVETESS_Y)) { struct wined3d_blend_state *blend_state; @@ -3659,6 +3661,14 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, desc.src = state->rs[WINED3D_RS_SRCBLEND]; desc.dst = state->rs[WINED3D_RS_DESTBLEND]; desc.op = state->rs[WINED3D_RS_BLENDOP]; + if (state->rs[WINED3D_RS_SEPARATEALPHABLENDENABLE]) + { + desc.src_alpha = state->rs[WINED3D_RS_SRCBLENDALPHA]; + } + else + { + desc.src_alpha = state->rs[WINED3D_RS_SRCBLEND]; + } if (wined3d_bitmap_is_set(changed->renderState, WINED3D_RS_BLENDFACTOR)) wined3d_color_from_d3dcolor(&colour, state->rs[WINED3D_RS_BLENDFACTOR]); diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 8999ab1696..e0cbf82e14 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -573,8 +573,7 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st return; } - gl_blend_from_d3d(&src_blend_alpha, &dst_blend_alpha, - state->render_states[WINED3D_RS_SRCBLENDALPHA], + gl_blend_from_d3d(&src_blend_alpha, &dst_blend_alpha, b->desc.src_alpha, state->render_states[WINED3D_RS_DESTBLENDALPHA], rt_format); GL_EXTCALL(glBlendFuncSeparate(src_blend, dst_blend, src_blend_alpha, dst_blend_alpha)); @@ -4503,7 +4502,6 @@ const struct wined3d_state_entry_template misc_state_template[] = { STATE_STREAM_OUTPUT, { STATE_STREAM_OUTPUT, state_so_warn, }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_EDGEANTIALIAS), { STATE_RENDER(WINED3D_RS_EDGEANTIALIAS), state_line_antialias}, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_SEPARATEALPHABLENDENABLE), { STATE_BLEND, NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3D_RS_SRCBLENDALPHA), { STATE_BLEND, NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_DESTBLENDALPHA), { STATE_BLEND, NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_DESTBLENDALPHA), { STATE_BLEND, NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_BLENDOPALPHA), { STATE_BLEND, NULL }, WINED3D_GL_EXT_NONE }, @@ -5423,6 +5421,7 @@ static void validate_state_table(struct wined3d_state_entry *state_table) {174, 177}, {193, 193}, {195, 197}, + {207, 207}, { 0, 0}, }; static const DWORD simple_states[] = diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 1bb8a8ee44..42dd078ca6 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2033,6 +2033,7 @@ struct wined3d_blend_state_desc enum wined3d_blend src; enum wined3d_blend dst; enum wined3d_blend_op op; + enum wined3d_blend src_alpha; }; struct wined3d_rasterizer_state_desc
1
0
0
0
Zebediah Figura : wined3d: Move the blend operation to wined3d_blend_state.
by Alexandre Julliard
12 Mar '20
12 Mar '20
Module: wine Branch: master Commit: 936310585c533beb50188f4a5d1328983c2c10fb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=936310585c533beb50188f4a…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Mar 10 18:06:16 2020 -0500 wined3d: Move the blend operation to wined3d_blend_state. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/device.c | 1 - dlls/d3d11/state.c | 1 + dlls/wined3d/device.c | 2 ++ dlls/wined3d/state.c | 24 +++++++++++------------- include/wine/wined3d.h | 1 + 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 11265cf1b0..8193ec4cf4 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -740,7 +740,6 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11Devi { const D3D11_RENDER_TARGET_BLEND_DESC *d = &desc->RenderTarget[0]; - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_BLENDOP, d->BlendOp); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SEPARATEALPHABLENDENABLE, TRUE); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SRCBLENDALPHA, d->SrcBlendAlpha); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DESTBLENDALPHA, d->DestBlendAlpha); diff --git a/dlls/d3d11/state.c b/dlls/d3d11/state.c index 4d5bd8d94e..693bb3df83 100644 --- a/dlls/d3d11/state.c +++ b/dlls/d3d11/state.c @@ -392,6 +392,7 @@ HRESULT d3d_blend_state_create(struct d3d_device *device, const D3D11_BLEND_DESC wined3d_desc.enable = desc->RenderTarget[0].BlendEnable; wined3d_desc.src = desc->RenderTarget[0].SrcBlend; wined3d_desc.dst = desc->RenderTarget[0].DestBlend; + wined3d_desc.op = desc->RenderTarget[0].BlendOp; /* We cannot fail after creating a wined3d_blend_state object. It * would lead to double free. */ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index d7175284cf..5bb9542891 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3584,6 +3584,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, case WINED3D_RS_ALPHABLENDENABLE: case WINED3D_RS_SRCBLEND: case WINED3D_RS_DESTBLEND: + case WINED3D_RS_BLENDOP: set_blend_state = TRUE; break; @@ -3657,6 +3658,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, desc.enable = state->rs[WINED3D_RS_ALPHABLENDENABLE]; desc.src = state->rs[WINED3D_RS_SRCBLEND]; desc.dst = state->rs[WINED3D_RS_DESTBLEND]; + desc.op = state->rs[WINED3D_RS_BLENDOP]; if (wined3d_bitmap_is_set(changed->renderState, WINED3D_RS_BLENDFACTOR)) wined3d_color_from_d3dcolor(&colour, state->rs[WINED3D_RS_BLENDFACTOR]); diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 8de2945bf5..8999ab1696 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -390,11 +390,6 @@ static void state_ambient(struct wined3d_context *context, const struct wined3d_ checkGLcall("glLightModel for MODEL_AMBIENT"); } -static void state_blendop_w(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) -{ - WARN("Unsupported in local OpenGL implementation: glBlendEquation\n"); -} - static GLenum gl_blend_op(const struct wined3d_gl_info *gl_info, enum wined3d_blend_op op) { switch (op) @@ -418,12 +413,18 @@ static GLenum gl_blend_op(const struct wined3d_gl_info *gl_info, enum wined3d_bl } } -static void state_blendop(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) +static void blendop(const struct wined3d_state *state, const struct wined3d_gl_info *gl_info) { - const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info; + const struct wined3d_blend_state *b = state->blend_state; GLenum blend_equation_alpha = GL_FUNC_ADD_EXT; GLenum blend_equation = GL_FUNC_ADD_EXT; + if (!gl_info->supported[WINED3D_GL_BLEND_EQUATION]) + { + WARN("Unsupported in local OpenGL implementation: glBlendEquation.\n"); + return; + } + /* BLENDOPALPHA requires GL_EXT_blend_equation_separate, so make sure it is around */ if (state->render_states[WINED3D_RS_BLENDOPALPHA] && !gl_info->supported[EXT_BLEND_EQUATION_SEPARATE]) @@ -432,7 +433,7 @@ static void state_blendop(struct wined3d_context *context, const struct wined3d_ return; } - blend_equation = gl_blend_op(gl_info, state->render_states[WINED3D_RS_BLENDOP]); + blend_equation = gl_blend_op(gl_info, b->desc.op); blend_equation_alpha = gl_blend_op(gl_info, state->render_states[WINED3D_RS_BLENDOPALPHA]); TRACE("blend_equation %#x, blend_equation_alpha %#x.\n", blend_equation, blend_equation_alpha); @@ -559,9 +560,7 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st gl_blend_from_d3d(&src_blend, &dst_blend, b->desc.src, b->desc.dst, rt_format); - /* Re-apply BLENDOP(ALPHA) because of a possible SEPARATEALPHABLENDENABLE change */ - if (!isStateDirty(context, STATE_RENDER(WINED3D_RS_BLENDOP))) - state_blendop(context, state, STATE_RENDER(WINED3D_RS_BLENDOPALPHA)); + blendop(state, gl_info); if (state->render_states[WINED3D_RS_SEPARATEALPHABLENDENABLE]) { @@ -4649,8 +4648,6 @@ const struct wined3d_state_entry_template misc_state_template[] = { STATE_RENDER(WINED3D_RS_DEBUGMONITORTOKEN), { STATE_RENDER(WINED3D_RS_DEBUGMONITORTOKEN), state_debug_monitor }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), state_colorwrite0 }, EXT_DRAW_BUFFERS2 }, { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), state_colorwrite }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3D_RS_BLENDOP), { STATE_RENDER(WINED3D_RS_BLENDOP), state_blendop }, WINED3D_GL_BLEND_EQUATION }, - { STATE_RENDER(WINED3D_RS_BLENDOP), { STATE_RENDER(WINED3D_RS_BLENDOP), state_blendop_w }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1), state_colorwrite1 }, EXT_DRAW_BUFFERS2 }, { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2), state_colorwrite2 }, EXT_DRAW_BUFFERS2 }, @@ -5422,6 +5419,7 @@ static void validate_state_table(struct wined3d_state_entry *state_table) { 61, 127}, {149, 150}, {169, 169}, + {171, 171}, {174, 177}, {193, 193}, {195, 197}, diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 3e43264a76..1bb8a8ee44 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2032,6 +2032,7 @@ struct wined3d_blend_state_desc BOOL enable; enum wined3d_blend src; enum wined3d_blend dst; + enum wined3d_blend_op op; }; struct wined3d_rasterizer_state_desc
1
0
0
0
Zebediah Figura : wined3d: Move the destination blend state to wined3d_blend_state.
by Alexandre Julliard
12 Mar '20
12 Mar '20
Module: wine Branch: master Commit: 04e9d574f522b13e0c10b7c23fd142cbd5492f6e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=04e9d574f522b13e0c10b7c2…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Mar 10 18:06:15 2020 -0500 wined3d: Move the destination blend state to wined3d_blend_state. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/device.c | 1 - dlls/d3d11/state.c | 1 + dlls/wined3d/device.c | 2 ++ dlls/wined3d/state.c | 7 ++----- include/wine/wined3d.h | 1 + 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index f968f1d971..11265cf1b0 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -740,7 +740,6 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11Devi { const D3D11_RENDER_TARGET_BLEND_DESC *d = &desc->RenderTarget[0]; - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DESTBLEND, d->DestBlend); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_BLENDOP, d->BlendOp); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SEPARATEALPHABLENDENABLE, TRUE); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SRCBLENDALPHA, d->SrcBlendAlpha); diff --git a/dlls/d3d11/state.c b/dlls/d3d11/state.c index 1cc579c86a..4d5bd8d94e 100644 --- a/dlls/d3d11/state.c +++ b/dlls/d3d11/state.c @@ -391,6 +391,7 @@ HRESULT d3d_blend_state_create(struct d3d_device *device, const D3D11_BLEND_DESC wined3d_desc.alpha_to_coverage = desc->AlphaToCoverageEnable; wined3d_desc.enable = desc->RenderTarget[0].BlendEnable; wined3d_desc.src = desc->RenderTarget[0].SrcBlend; + wined3d_desc.dst = desc->RenderTarget[0].DestBlend; /* We cannot fail after creating a wined3d_blend_state object. It * would lead to double free. */ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 54efdb05a7..d7175284cf 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3583,6 +3583,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, case WINED3D_RS_BLENDFACTOR: case WINED3D_RS_ALPHABLENDENABLE: case WINED3D_RS_SRCBLEND: + case WINED3D_RS_DESTBLEND: set_blend_state = TRUE; break; @@ -3655,6 +3656,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, desc.alpha_to_coverage = TRUE; desc.enable = state->rs[WINED3D_RS_ALPHABLENDENABLE]; desc.src = state->rs[WINED3D_RS_SRCBLEND]; + desc.dst = state->rs[WINED3D_RS_DESTBLEND]; if (wined3d_bitmap_is_set(changed->renderState, WINED3D_RS_BLENDFACTOR)) wined3d_color_from_d3dcolor(&colour, state->rs[WINED3D_RS_BLENDFACTOR]); diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index aa85193bdd..8de2945bf5 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -557,8 +557,7 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st gl_info->gl_ops.gl.p_glEnable(GL_BLEND); checkGLcall("glEnable(GL_BLEND)"); - gl_blend_from_d3d(&src_blend, &dst_blend, b->desc.src, - state->render_states[WINED3D_RS_DESTBLEND], rt_format); + gl_blend_from_d3d(&src_blend, &dst_blend, b->desc.src, b->desc.dst, rt_format); /* Re-apply BLENDOP(ALPHA) because of a possible SEPARATEALPHABLENDENABLE change */ if (!isStateDirty(context, STATE_RENDER(WINED3D_RS_BLENDOP))) @@ -4503,7 +4502,6 @@ const struct wined3d_state_entry_template misc_state_template[] = { STATE_COMPUTE_UNORDERED_ACCESS_VIEW_BINDING, { STATE_COMPUTE_UNORDERED_ACCESS_VIEW_BINDING, state_uav_warn }, WINED3D_GL_EXT_NONE }, { STATE_STREAM_OUTPUT, { STATE_STREAM_OUTPUT, state_so, }, WINED3D_GL_VERSION_3_2 }, { STATE_STREAM_OUTPUT, { STATE_STREAM_OUTPUT, state_so_warn, }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3D_RS_DESTBLEND), { STATE_BLEND, NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_EDGEANTIALIAS), { STATE_RENDER(WINED3D_RS_EDGEANTIALIAS), state_line_antialias}, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_SEPARATEALPHABLENDENABLE), { STATE_BLEND, NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_SRCBLENDALPHA), { STATE_BLEND, NULL }, WINED3D_GL_EXT_NONE }, @@ -5417,8 +5415,7 @@ static void validate_state_table(struct wined3d_state_entry *state_table) { 1, 1}, { 3, 3}, { 8, 8}, - { 17, 19}, - { 21, 22}, + { 17, 22}, { 27, 27}, { 42, 45}, { 47, 47}, diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index d6a9a079d7..3e43264a76 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2031,6 +2031,7 @@ struct wined3d_blend_state_desc BOOL alpha_to_coverage; BOOL enable; enum wined3d_blend src; + enum wined3d_blend dst; }; struct wined3d_rasterizer_state_desc
1
0
0
0
Paul Gofman : wined3d: Use EXT_framebuffer_multisample_blit_scaled for scaled resolves.
by Alexandre Julliard
12 Mar '20
12 Mar '20
Module: wine Branch: master Commit: 5b6c85d64ab49efba506e11e1f8450da15096cea URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5b6c85d64ab49efba506e11e…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Thu Mar 12 13:37:50 2020 +0330 wined3d: Use EXT_framebuffer_multisample_blit_scaled for scaled resolves. Signed-off-by: Paul Gofman <gofmanp(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/adapter_gl.c | 3 +++ dlls/wined3d/surface.c | 16 ++++++++++++---- dlls/wined3d/wined3d_gl.h | 1 + dlls/wined3d/wined3d_private.h | 1 + 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index 3ad64754ec..c04656173d 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -179,6 +179,8 @@ static const struct wined3d_extension_map gl_extension_map[] = {"GL_EXT_fog_coord", EXT_FOG_COORD }, {"GL_EXT_framebuffer_blit", EXT_FRAMEBUFFER_BLIT }, {"GL_EXT_framebuffer_multisample", EXT_FRAMEBUFFER_MULTISAMPLE }, + {"GL_EXT_framebuffer_multisample_blit_scaled", + EXT_FRAMEBUFFER_MULTISAMPLE_BLIT_SCALED}, {"GL_EXT_framebuffer_object", EXT_FRAMEBUFFER_OBJECT }, {"GL_EXT_memory_object", EXT_MEMORY_OBJECT }, {"GL_EXT_gpu_program_parameters", EXT_GPU_PROGRAM_PARAMETERS }, @@ -5157,6 +5159,7 @@ static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *adapter_ d3d_info->srgb_write_control = !!gl_info->supported[ARB_FRAMEBUFFER_SRGB]; d3d_info->clip_control = !!gl_info->supported[ARB_CLIP_CONTROL]; d3d_info->full_ffp_varyings = !!(shader_caps.wined3d_caps & WINED3D_SHADER_CAP_FULL_FFP_VARYINGS); + d3d_info->scaled_resolve = !!gl_info->supported[EXT_FRAMEBUFFER_MULTISAMPLE_BLIT_SCALED]; d3d_info->feature_level = feature_level_from_caps(gl_info, &shader_caps, &fragment_caps); if (gl_info->supported[ARB_TEXTURE_MULTISAMPLE]) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index c687e63946..b7dd54cb61 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -150,6 +150,7 @@ void texture2d_blt_fbo(struct wined3d_device *device, struct wined3d_context *co const struct wined3d_gl_info *gl_info; struct wined3d_context_gl *context_gl; unsigned int restore_idx; + BOOL scaled_resolve; GLenum gl_filter; GLenum buffer; RECT s, d; @@ -160,10 +161,14 @@ void texture2d_blt_fbo(struct wined3d_device *device, struct wined3d_context *co wined3d_debug_location(src_location), wine_dbgstr_rect(src_rect), dst_texture, dst_sub_resource_idx, wined3d_debug_location(dst_location), wine_dbgstr_rect(dst_rect)); + scaled_resolve = wined3d_texture_gl_is_multisample_location(wined3d_texture_gl(src_texture), src_location) + && (abs(src_rect->bottom - src_rect->top) != abs(dst_rect->bottom - dst_rect->top) + || abs(src_rect->right - src_rect->left) != abs(dst_rect->right - dst_rect->left)); + switch (filter) { case WINED3D_TEXF_LINEAR: - gl_filter = GL_LINEAR; + gl_filter = scaled_resolve ? GL_SCALED_RESOLVE_NICEST_EXT : GL_LINEAR; break; default: @@ -171,7 +176,7 @@ void texture2d_blt_fbo(struct wined3d_device *device, struct wined3d_context *co /* fall through */ case WINED3D_TEXF_NONE: case WINED3D_TEXF_POINT: - gl_filter = GL_NEAREST; + gl_filter = scaled_resolve ? GL_SCALED_RESOLVE_FASTEST_EXT : GL_NEAREST; break; } @@ -2606,8 +2611,11 @@ HRESULT texture2d_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_ if ((flags & WINED3D_BLT_RAW) || (blit_op == WINED3D_BLIT_OP_COLOR_BLIT && !scale && !convert && !resolve)) blit_op = WINED3D_BLIT_OP_RAW_BLIT; + context = context_acquire(device, dst_texture, dst_sub_resource_idx); + if (src_texture->resource.multisample_type != WINED3D_MULTISAMPLE_NONE - && (scale || convert || blit_op != WINED3D_BLIT_OP_COLOR_BLIT)) + && ((scale && !context->d3d_info->scaled_resolve) + || convert || blit_op != WINED3D_BLIT_OP_COLOR_BLIT)) src_location = WINED3D_LOCATION_RB_RESOLVED; else src_location = src_texture->resource.draw_binding; @@ -2620,10 +2628,10 @@ HRESULT texture2d_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_ else dst_location = dst_texture->resource.draw_binding; - context = context_acquire(device, dst_texture, dst_sub_resource_idx); valid_locations = device->blitter->ops->blitter_blit(device->blitter, blit_op, context, src_texture, src_sub_resource_idx, src_location, &src_rect, dst_texture, dst_sub_resource_idx, dst_location, &dst_rect, colour_key, filter); + context_release(context); wined3d_texture_validate_location(dst_texture, dst_sub_resource_idx, valid_locations); diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index 3372b4b6be..2cb25a3776 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -160,6 +160,7 @@ enum wined3d_gl_extension EXT_FOG_COORD, EXT_FRAMEBUFFER_BLIT, EXT_FRAMEBUFFER_MULTISAMPLE, + EXT_FRAMEBUFFER_MULTISAMPLE_BLIT_SCALED, EXT_FRAMEBUFFER_OBJECT, EXT_GPU_PROGRAM_PARAMETERS, EXT_GPU_SHADER4, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 4034ed28f0..9240b0e455 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -224,6 +224,7 @@ struct wined3d_d3d_info uint32_t srgb_write_control : 1; uint32_t clip_control : 1; uint32_t full_ffp_varyings : 1; + uint32_t scaled_resolve : 1; enum wined3d_feature_level feature_level; DWORD multisample_draw_location;
1
0
0
0
← Newer
1
...
64
65
66
67
68
69
70
...
100
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Results per page:
10
25
50
100
200