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
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
May 2016
----- 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
4 participants
542 discussions
Start a n
N
ew thread
Henri Verbeet : d3d10: Introduce a helper function to allocate arrays (AFL ).
by Alexandre Julliard
26 May '16
26 May '16
Module: wine Branch: master Commit: 775c7edbc3d687ee082c9d31d199c4aaa395c4e4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=775c7edbc3d687ee082c9d31d…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed May 25 20:04:01 2016 +0200 d3d10: Introduce a helper function to allocate arrays (AFL). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d10/d3d10_private.h | 7 ++++++ dlls/d3d10/effect.c | 54 ++++++++++++++++------------------------------ 2 files changed, 25 insertions(+), 36 deletions(-) diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index dc41224..6f75295 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -282,6 +282,13 @@ HRESULT WINAPI D3D10CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapte HRESULT parse_dxbc(const char *data, SIZE_T data_size, HRESULT (*chunk_handler)(const char *data, DWORD data_size, DWORD tag, void *ctx), void *ctx) DECLSPEC_HIDDEN; +static inline void *d3d10_calloc(SIZE_T count, SIZE_T size) +{ + if (count > ~(SIZE_T)0 / size) + return NULL; + return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, count * size); +} + static inline void read_dword(const char **ptr, DWORD *d) { memcpy(d, *ptr, sizeof(*d)); diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index df35640..2e1d2c6 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -310,8 +310,7 @@ static HRESULT shader_parse_signature(const char *data, DWORD data_size, struct return E_INVALIDARG; } - e = HeapAlloc(GetProcessHeap(), 0, count * sizeof(*e)); - if (!e) + if (!(e = d3d10_calloc(count, sizeof(*e)))) { ERR("Failed to allocate signature memory.\n"); return E_OUTOFMEMORY; @@ -621,8 +620,7 @@ static HRESULT parse_fx10_type(struct d3d10_effect_type *t, const char *ptr, con t->basetype = 0; t->type_class = D3D10_SVC_STRUCT; - t->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->member_count * sizeof(*t->members)); - if (!t->members) + if (!(t->members = d3d10_calloc(t->member_count, sizeof(*t->members)))) { ERR("Failed to allocate members memory.\n"); return E_OUTOFMEMORY; @@ -866,8 +864,7 @@ static HRESULT copy_variableinfo_from_type(struct d3d10_effect_variable *v) if (v->type->member_count) { - v->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, v->type->member_count * sizeof(*v->members)); - if (!v->members) + if (!(v->members = d3d10_calloc(v->type->member_count, sizeof(*v->members)))) { ERR("Failed to allocate members memory.\n"); return E_OUTOFMEMORY; @@ -909,8 +906,7 @@ static HRESULT copy_variableinfo_from_type(struct d3d10_effect_variable *v) { unsigned int bufferoffset = v->buffer_offset; - v->elements = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, v->type->element_count * sizeof(*v->elements)); - if (!v->elements) + if (!(v->elements = d3d10_calloc(v->type->element_count, sizeof(*v->elements)))) { ERR("Failed to allocate elements memory.\n"); return E_OUTOFMEMORY; @@ -1464,8 +1460,7 @@ static HRESULT parse_fx10_pass(struct d3d10_effect_pass *p, const char **ptr, co read_dword(ptr, &p->annotation_count); TRACE("Pass has %u annotations.\n", p->annotation_count); - p->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, p->annotation_count * sizeof(*p->annotations)); - if (!p->annotations) + if (!(p->annotations = d3d10_calloc(p->annotation_count, sizeof(*p->annotations)))) { ERR("Failed to allocate pass annotations memory.\n"); return E_OUTOFMEMORY; @@ -1482,8 +1477,7 @@ static HRESULT parse_fx10_pass(struct d3d10_effect_pass *p, const char **ptr, co if (FAILED(hr)) return hr; } - p->objects = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, p->object_count * sizeof(*p->objects)); - if (!p->objects) + if (!(p->objects = d3d10_calloc(p->object_count, sizeof(*p->objects)))) { ERR("Failed to allocate effect objects memory.\n"); return E_OUTOFMEMORY; @@ -1528,8 +1522,7 @@ static HRESULT parse_fx10_technique(struct d3d10_effect_technique *t, const char read_dword(ptr, &t->annotation_count); TRACE("Technique has %u annotations.\n", t->annotation_count); - t->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->annotation_count * sizeof(*t->annotations)); - if (!t->annotations) + if (!(t->annotations = d3d10_calloc(t->annotation_count, sizeof(*t->annotations)))) { ERR("Failed to allocate technique annotations memory.\n"); return E_OUTOFMEMORY; @@ -1546,8 +1539,7 @@ static HRESULT parse_fx10_technique(struct d3d10_effect_technique *t, const char if (FAILED(hr)) return hr; } - t->passes = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->pass_count * sizeof(*t->passes)); - if (!t->passes) + if (!(t->passes = d3d10_calloc(t->pass_count, sizeof(*t->passes)))) { ERR("Failed to allocate passes memory\n"); return E_OUTOFMEMORY; @@ -1597,8 +1589,7 @@ static HRESULT parse_fx10_variable(struct d3d10_effect_variable *v, const char * read_dword(ptr, &v->annotation_count); TRACE("Variable has %u annotations.\n", v->annotation_count); - v->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, v->annotation_count * sizeof(*v->annotations)); - if (!v->annotations) + if (!(v->annotations = d3d10_calloc(v->annotation_count, sizeof(*v->annotations)))) { ERR("Failed to allocate variable annotations memory.\n"); return E_OUTOFMEMORY; @@ -1771,8 +1762,7 @@ static HRESULT parse_fx10_local_variable(struct d3d10_effect_variable *v, const read_dword(ptr, &v->annotation_count); TRACE("Variable has %u annotations.\n", v->annotation_count); - v->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, v->annotation_count * sizeof(*v->annotations)); - if (!v->annotations) + if (!(v->annotations = d3d10_calloc(v->annotation_count, sizeof(*v->annotations)))) { ERR("Failed to allocate variable annotations memory.\n"); return E_OUTOFMEMORY; @@ -1860,8 +1850,7 @@ static HRESULT parse_fx10_local_buffer(struct d3d10_effect_variable *l, const ch read_dword(ptr, &l->annotation_count); TRACE("Local buffer has %u annotations.\n", l->annotation_count); - l->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, l->annotation_count * sizeof(*l->annotations)); - if (!l->annotations) + if (!(l->annotations = d3d10_calloc(l->annotation_count, sizeof(*l->annotations)))) { ERR("Failed to allocate local buffer annotations memory.\n"); return E_OUTOFMEMORY; @@ -1878,15 +1867,13 @@ static HRESULT parse_fx10_local_buffer(struct d3d10_effect_variable *l, const ch if (FAILED(hr)) return hr; } - l->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, l->type->member_count * sizeof(*l->members)); - if (!l->members) + if (!(l->members = d3d10_calloc(l->type->member_count, sizeof(*l->members)))) { ERR("Failed to allocate members memory.\n"); return E_OUTOFMEMORY; } - l->type->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, l->type->member_count * sizeof(*l->type->members)); - if (!l->type->members) + if (!(l->type->members = d3d10_calloc(l->type->member_count, sizeof(*l->type->members)))) { ERR("Failed to allocate type members memory.\n"); return E_OUTOFMEMORY; @@ -2048,36 +2035,31 @@ static HRESULT parse_fx10_body(struct d3d10_effect *e, const char *data, DWORD d return E_FAIL; } - e->local_buffers = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->local_buffer_count * sizeof(*e->local_buffers)); - if (!e->local_buffers) + if (!(e->local_buffers = d3d10_calloc(e->local_buffer_count, sizeof(*e->local_buffers)))) { ERR("Failed to allocate local buffer memory.\n"); return E_OUTOFMEMORY; } - e->local_variables = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->local_variable_count * sizeof(*e->local_variables)); - if (!e->local_variables) + if (!(e->local_variables = d3d10_calloc(e->local_variable_count, sizeof(*e->local_variables)))) { ERR("Failed to allocate local variable memory.\n"); return E_OUTOFMEMORY; } - e->anonymous_shaders = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->anonymous_shader_count * sizeof(*e->anonymous_shaders)); - if (!e->anonymous_shaders) + if (!(e->anonymous_shaders = d3d10_calloc(e->anonymous_shader_count, sizeof(*e->anonymous_shaders)))) { ERR("Failed to allocate anonymous shaders memory\n"); return E_OUTOFMEMORY; } - e->used_shaders = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->used_shader_count * sizeof(*e->used_shaders)); - if (!e->used_shaders) + if (!(e->used_shaders = d3d10_calloc(e->used_shader_count, sizeof(*e->used_shaders)))) { ERR("Failed to allocate used shaders memory\n"); return E_OUTOFMEMORY; } - e->techniques = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->technique_count * sizeof(*e->techniques)); - if (!e->techniques) + if (!(e->techniques = d3d10_calloc(e->technique_count, sizeof(*e->techniques)))) { ERR("Failed to allocate techniques memory\n"); return E_OUTOFMEMORY;
1
0
0
0
Jacek Caban : jscript: Added non-zero timezone offset tests.
by Alexandre Julliard
25 May '16
25 May '16
Module: wine Branch: master Commit: b5aeb661b9297a6ee6047335f42543936f593525 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b5aeb661b9297a6ee6047335f…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed May 25 14:08:21 2016 +0200 jscript: Added non-zero timezone offset tests. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/tests/api.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index e5e6350..ca6131b 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -2098,6 +2098,8 @@ ok(Date.parse("Jan 20 2009 UTC") === 1232409600000, "Date.parse(\"Jan 20 2009 UT ok(Date.parse("Jan 20 2009 GMT") === 1232409600000, "Date.parse(\"Jan 20 2009 GMT\") = " + Date.parse("Jan 20 2009 GMT")); ok(Date.parse("Jan 20 2009 UTC-0") === 1232409600000, "Date.parse(\"Jan 20 2009 UTC-0\") = " + Date.parse("Jan 20 2009 UTC-0")); ok(Date.parse("Jan 20 2009 UTC+0000") === 1232409600000, "Date.parse(\"Jan 20 2009 UTC+0000\") = " + Date.parse("Jan 20 2009 UTC+0000")); +ok(Date.parse("Jan 20 2009 UTC-1") === 1232413200000, "Date.parse(\"Jan 20 2009 UTC-1\") = " + Date.parse("Jan 20 2009 UTC-1")); +ok(Date.parse("Jan 20 2009 UTC+1") === 1232406000000, "Date.parse(\"Jan 20 2009 UTC+1\") = " + Date.parse("Jan 20 2009 UTC+1")); ok(Date.parse("Ju 13 79 UTC") === 300672000000, "Date.parse(\"Ju 13 79 UTC\") = " + Date.parse("Ju 13 79 UTC")); ok(Date.parse("12Au91 UTC") === 681955200000, "Date.parse(\"12Au91 UTC\") = " + Date.parse("12Au91 UTC")); ok(Date.parse("7/02/17 UTC") === -1656806400000, "Date.parse(\"7/02/17 UTC\") = " + Date.parse("7/02/17 UTC"));
1
0
0
0
Jacek Caban : jscript: Removed obsolete FIXME comments in tests and add relevant tests.
by Alexandre Julliard
25 May '16
25 May '16
Module: wine Branch: master Commit: a8b5dc84bd98662ddfe4d8b50c4c558bbdf0c22f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a8b5dc84bd98662ddfe4d8b50…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed May 25 14:08:15 2016 +0200 jscript: Removed obsolete FIXME comments in tests and add relevant tests. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/tests/lang.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/jscript/tests/lang.js b/dlls/jscript/tests/lang.js index a9f95f8..ee30836 100644 --- a/dlls/jscript/tests/lang.js +++ b/dlls/jscript/tests/lang.js @@ -208,10 +208,13 @@ function argumentsTest() { return 1; }); } -/* FIXME: It seems that when function is called as an expression, instance object arguments is not set. - * We currently always set it in Wine. */ + argumentsTest(); +(function callAsExprTest() { + ok(callAsExprTest.arguments === null, "callAsExprTest.arguments = " + callAsExprTest.arguments); +})(1,2); + tmp = (function() {1;})(); ok(tmp === undefined, "tmp = " + tmp); tmp = eval("1;");
1
0
0
0
Jacek Caban : jscript: Added RegExp.global getter implementation.
by Alexandre Julliard
25 May '16
25 May '16
Module: wine Branch: master Commit: b1773131ac85567e7781ecefc5ff54740fedf774 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b1773131ac85567e7781ecefc…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed May 25 14:08:03 2016 +0200 jscript: Added RegExp.global getter implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/jsregexp.c | 6 ++++-- dlls/jscript/tests/regexp.js | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/jscript/jsregexp.c b/dlls/jscript/jsregexp.c index be9f8d8..e4fae22 100644 --- a/dlls/jscript/jsregexp.c +++ b/dlls/jscript/jsregexp.c @@ -264,8 +264,10 @@ static HRESULT RegExp_set_source(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t va static HRESULT RegExp_get_global(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + + *r = jsval_bool(!!(regexp_from_jsdisp(jsthis)->jsregexp->flags & REG_GLOB)); + return S_OK; } static HRESULT RegExp_set_global(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value) diff --git a/dlls/jscript/tests/regexp.js b/dlls/jscript/tests/regexp.js index 48f65bc..b200364 100644 --- a/dlls/jscript/tests/regexp.js +++ b/dlls/jscript/tests/regexp.js @@ -663,13 +663,18 @@ ok(/abc/.toString(1, false, "3") === "/abc/", "/abc/.toString(1, false, \"3\") = re = /x/; ok(re.ignoreCase === false, "re.ignoreCase = " + re.ignoreCase); ok(re.multiline === false, "re.multiline = " + re.multiline); +ok(re.global === false, "re.global = " + re.global); re = /x/i; ok(re.ignoreCase === true, "re.ignoreCase = " + re.ignoreCase); ok(re.multiline === false, "re.multiline = " + re.multiline); +ok(re.global === false, "re.global = " + re.global); re = new RegExp("xxx", "gi"); ok(re.ignoreCase === true, "re.ignoreCase = " + re.ignoreCase); ok(re.multiline === false, "re.multiline = " + re.multiline); +ok(re.global === true, "re.global = " + re.global); re = /x/mg; +ok(re.ignoreCase === false, "re.ignoreCase = " + re.ignoreCase); ok(re.multiline === true, "re.multiline = " + re.multiline); +ok(re.global === true, "re.global = " + re.global); reportSuccess();
1
0
0
0
Jacek Caban : jscript: Added RegExp.multiline getter implementation.
by Alexandre Julliard
25 May '16
25 May '16
Module: wine Branch: master Commit: 81cb13af7ac9438a50c7a7dd5bcbb6898edf49d6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=81cb13af7ac9438a50c7a7dd5…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed May 25 14:07:56 2016 +0200 jscript: Added RegExp.multiline getter implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/jsregexp.c | 6 ++++-- dlls/jscript/tests/regexp.js | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/jscript/jsregexp.c b/dlls/jscript/jsregexp.c index 23ed990..be9f8d8 100644 --- a/dlls/jscript/jsregexp.c +++ b/dlls/jscript/jsregexp.c @@ -290,8 +290,10 @@ static HRESULT RegExp_set_ignoreCase(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_ static HRESULT RegExp_get_multiline(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + + *r = jsval_bool(!!(regexp_from_jsdisp(jsthis)->jsregexp->flags & REG_MULTILINE)); + return S_OK; } static HRESULT RegExp_set_multiline(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value) diff --git a/dlls/jscript/tests/regexp.js b/dlls/jscript/tests/regexp.js index 5cab586..48f65bc 100644 --- a/dlls/jscript/tests/regexp.js +++ b/dlls/jscript/tests/regexp.js @@ -662,9 +662,14 @@ ok(/abc/.toString(1, false, "3") === "/abc/", "/abc/.toString(1, false, \"3\") = re = /x/; ok(re.ignoreCase === false, "re.ignoreCase = " + re.ignoreCase); +ok(re.multiline === false, "re.multiline = " + re.multiline); re = /x/i; ok(re.ignoreCase === true, "re.ignoreCase = " + re.ignoreCase); +ok(re.multiline === false, "re.multiline = " + re.multiline); re = new RegExp("xxx", "gi"); ok(re.ignoreCase === true, "re.ignoreCase = " + re.ignoreCase); +ok(re.multiline === false, "re.multiline = " + re.multiline); +re = /x/mg; +ok(re.multiline === true, "re.multiline = " + re.multiline); reportSuccess();
1
0
0
0
Jacek Caban : jscript: Added RegExp.ignoreCase getter implementation.
by Alexandre Julliard
25 May '16
25 May '16
Module: wine Branch: master Commit: 2db16660966cbd736c8dba453fc11e5dc096f75f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2db16660966cbd736c8dba453…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed May 25 14:07:47 2016 +0200 jscript: Added RegExp.ignoreCase getter implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/jsregexp.c | 6 ++++-- dlls/jscript/tests/regexp.js | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dlls/jscript/jsregexp.c b/dlls/jscript/jsregexp.c index 402b527..23ed990 100644 --- a/dlls/jscript/jsregexp.c +++ b/dlls/jscript/jsregexp.c @@ -276,8 +276,10 @@ static HRESULT RegExp_set_global(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t va static HRESULT RegExp_get_ignoreCase(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + + *r = jsval_bool(!!(regexp_from_jsdisp(jsthis)->jsregexp->flags & REG_FOLD)); + return S_OK; } static HRESULT RegExp_set_ignoreCase(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value) diff --git a/dlls/jscript/tests/regexp.js b/dlls/jscript/tests/regexp.js index 25ec91e..5cab586 100644 --- a/dlls/jscript/tests/regexp.js +++ b/dlls/jscript/tests/regexp.js @@ -660,4 +660,11 @@ tmp = new RegExp("abc/", "mgi"); ok(tmp.toString() === "/abc//igm", "(new RegExp(\"abc/\")).toString() = " + tmp.toString()); ok(/abc/.toString(1, false, "3") === "/abc/", "/abc/.toString(1, false, \"3\") = " + /abc/.toString()); +re = /x/; +ok(re.ignoreCase === false, "re.ignoreCase = " + re.ignoreCase); +re = /x/i; +ok(re.ignoreCase === true, "re.ignoreCase = " + re.ignoreCase); +re = new RegExp("xxx", "gi"); +ok(re.ignoreCase === true, "re.ignoreCase = " + re.ignoreCase); + reportSuccess();
1
0
0
0
Józef Kucia : d3d10core/tests: Add test for SM4 if instruction.
by Alexandre Julliard
25 May '16
25 May '16
Module: wine Branch: master Commit: 2ad46661e71fa37c4c370a168d8db627fca38b2a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2ad46661e71fa37c4c370a168…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed May 25 10:51:23 2016 +0200 d3d10core/tests: Add test for SM4 if instruction. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d10core/tests/device.c | 96 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index f4ad5fd..ebd3325 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -6727,6 +6727,101 @@ static void test_shader_stage_input_output_matching(void) release_test_context(&test_context); } +static void test_sm4_if_instruction(void) +{ + struct d3d10core_test_context test_context; + ID3D10PixelShader *ps_if_nz, *ps_if_z; + ID3D10Device *device; + unsigned int bits[4]; + DWORD expected_color; + ID3D10Buffer *cb; + unsigned int i; + HRESULT hr; + + static const DWORD ps_if_nz_code[] = + { +#if 0 + uint bits; + + float4 main() : SV_TARGET + { + if (bits) + return float4(0.0f, 1.0f, 0.0f, 1.0f); + else + return float4(1.0f, 0.0f, 0.0f, 1.0f); + } +#endif + 0x43425844, 0x2a94f6f1, 0xdbe88943, 0x3426a708, 0x09cec990, 0x00000001, 0x00000100, 0x00000003, + 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, + 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, + 0x0000000f, 0x545f5653, 0x45475241, 0xabab0054, 0x52444853, 0x00000088, 0x00000040, 0x00000022, + 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x0404001f, + 0x0020800a, 0x00000000, 0x00000000, 0x08000036, 0x001020f2, 0x00000000, 0x00004002, 0x00000000, + 0x3f800000, 0x00000000, 0x3f800000, 0x0100003e, 0x01000012, 0x08000036, 0x001020f2, 0x00000000, + 0x00004002, 0x3f800000, 0x00000000, 0x00000000, 0x3f800000, 0x0100003e, 0x01000015, 0x0100003e, + }; + static const DWORD ps_if_z_code[] = + { +#if 0 + uint bits; + + float4 main() : SV_TARGET + { + if (!bits) + return float4(0.0f, 1.0f, 0.0f, 1.0f); + else + return float4(1.0f, 0.0f, 0.0f, 1.0f); + } +#endif + 0x43425844, 0x2e3030ca, 0x94c8610c, 0xdf0c1b1f, 0x80f2ca2c, 0x00000001, 0x00000100, 0x00000003, + 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, + 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, + 0x0000000f, 0x545f5653, 0x45475241, 0xabab0054, 0x52444853, 0x00000088, 0x00000040, 0x00000022, + 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x0400001f, + 0x0020800a, 0x00000000, 0x00000000, 0x08000036, 0x001020f2, 0x00000000, 0x00004002, 0x00000000, + 0x3f800000, 0x00000000, 0x3f800000, 0x0100003e, 0x01000012, 0x08000036, 0x001020f2, 0x00000000, + 0x00004002, 0x3f800000, 0x00000000, 0x00000000, 0x3f800000, 0x0100003e, 0x01000015, 0x0100003e, + }; + static unsigned int bit_patterns[] = + { + 0x00000000, 0x00000001, 0x10010001, 0x10000000, 0x80000000, 0xffff0000, 0x0000ffff, 0xffffffff, + }; + + if (!init_test_context(&test_context)) + return; + + device = test_context.device; + + hr = ID3D10Device_CreatePixelShader(device, ps_if_nz_code, sizeof(ps_if_nz_code), &ps_if_nz); + ok(SUCCEEDED(hr), "Failed to create if_nz pixel shader, hr %#x.\n", hr); + hr = ID3D10Device_CreatePixelShader(device, ps_if_z_code, sizeof(ps_if_z_code), &ps_if_z); + ok(SUCCEEDED(hr), "Failed to create if_z pixel shader, hr %#x.\n", hr); + + cb = create_buffer(device, D3D10_BIND_CONSTANT_BUFFER, sizeof(bits), NULL); + ID3D10Device_PSSetConstantBuffers(device, 0, 1, &cb); + + for (i = 0; i < sizeof(bit_patterns) / sizeof(*bit_patterns); ++i) + { + *bits = bit_patterns[i]; + ID3D10Device_UpdateSubresource(device, (ID3D10Resource *)cb, 0, NULL, bits, 0, 0); + + ID3D10Device_PSSetShader(device, ps_if_nz); + expected_color = *bits ? 0xff00ff00 : 0xff0000ff; + draw_quad(&test_context); + check_texture_color(test_context.backbuffer, expected_color, 0); + + ID3D10Device_PSSetShader(device, ps_if_z); + expected_color = *bits ? 0xff0000ff : 0xff00ff00; + draw_quad(&test_context); + check_texture_color(test_context.backbuffer, expected_color, 0); + } + + ID3D10Buffer_Release(cb); + ID3D10PixelShader_Release(ps_if_z); + ID3D10PixelShader_Release(ps_if_nz); + release_test_context(&test_context); +} + START_TEST(device) { test_feature_level(); @@ -6765,4 +6860,5 @@ START_TEST(device) test_clear_depth_stencil_view(); test_draw_depth_only(); test_shader_stage_input_output_matching(); + test_sm4_if_instruction(); }
1
0
0
0
Józef Kucia : d3d11/tests: Add test for SM4 if instruction.
by Alexandre Julliard
25 May '16
25 May '16
Module: wine Branch: master Commit: 8a345fe334f4700aa346565955250486266a8994 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8a345fe334f4700aa34656595…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed May 25 10:51:22 2016 +0200 d3d11/tests: Add test for SM4 if instruction. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/tests/d3d11.c | 98 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 73d411c..e17114e 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -6876,6 +6876,103 @@ static void test_shader_stage_input_output_matching(void) release_test_context(&test_context); } +static void test_sm4_if_instruction(void) +{ + struct d3d11_test_context test_context; + ID3D11PixelShader *ps_if_nz, *ps_if_z; + ID3D11DeviceContext *context; + ID3D11Device *device; + unsigned int bits[4]; + DWORD expected_color; + ID3D11Buffer *cb; + unsigned int i; + HRESULT hr; + + static const DWORD ps_if_nz_code[] = + { +#if 0 + uint bits; + + float4 main() : SV_TARGET + { + if (bits) + return float4(0.0f, 1.0f, 0.0f, 1.0f); + else + return float4(1.0f, 0.0f, 0.0f, 1.0f); + } +#endif + 0x43425844, 0x2a94f6f1, 0xdbe88943, 0x3426a708, 0x09cec990, 0x00000001, 0x00000100, 0x00000003, + 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, + 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, + 0x0000000f, 0x545f5653, 0x45475241, 0xabab0054, 0x52444853, 0x00000088, 0x00000040, 0x00000022, + 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x0404001f, + 0x0020800a, 0x00000000, 0x00000000, 0x08000036, 0x001020f2, 0x00000000, 0x00004002, 0x00000000, + 0x3f800000, 0x00000000, 0x3f800000, 0x0100003e, 0x01000012, 0x08000036, 0x001020f2, 0x00000000, + 0x00004002, 0x3f800000, 0x00000000, 0x00000000, 0x3f800000, 0x0100003e, 0x01000015, 0x0100003e, + }; + static const DWORD ps_if_z_code[] = + { +#if 0 + uint bits; + + float4 main() : SV_TARGET + { + if (!bits) + return float4(0.0f, 1.0f, 0.0f, 1.0f); + else + return float4(1.0f, 0.0f, 0.0f, 1.0f); + } +#endif + 0x43425844, 0x2e3030ca, 0x94c8610c, 0xdf0c1b1f, 0x80f2ca2c, 0x00000001, 0x00000100, 0x00000003, + 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, + 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, + 0x0000000f, 0x545f5653, 0x45475241, 0xabab0054, 0x52444853, 0x00000088, 0x00000040, 0x00000022, + 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x0400001f, + 0x0020800a, 0x00000000, 0x00000000, 0x08000036, 0x001020f2, 0x00000000, 0x00004002, 0x00000000, + 0x3f800000, 0x00000000, 0x3f800000, 0x0100003e, 0x01000012, 0x08000036, 0x001020f2, 0x00000000, + 0x00004002, 0x3f800000, 0x00000000, 0x00000000, 0x3f800000, 0x0100003e, 0x01000015, 0x0100003e, + }; + static unsigned int bit_patterns[] = + { + 0x00000000, 0x00000001, 0x10010001, 0x10000000, 0x80000000, 0xffff0000, 0x0000ffff, 0xffffffff, + }; + + if (!init_test_context(&test_context, NULL)) + return; + + device = test_context.device; + context = test_context.immediate_context; + + hr = ID3D11Device_CreatePixelShader(device, ps_if_nz_code, sizeof(ps_if_nz_code), NULL, &ps_if_nz); + ok(SUCCEEDED(hr), "Failed to create if_nz pixel shader, hr %#x.\n", hr); + hr = ID3D11Device_CreatePixelShader(device, ps_if_z_code, sizeof(ps_if_z_code), NULL, &ps_if_z); + ok(SUCCEEDED(hr), "Failed to create if_z pixel shader, hr %#x.\n", hr); + + cb = create_buffer(device, D3D11_BIND_CONSTANT_BUFFER, sizeof(bits), NULL); + ID3D11DeviceContext_PSSetConstantBuffers(context, 0, 1, &cb); + + for (i = 0; i < sizeof(bit_patterns) / sizeof(*bit_patterns); ++i) + { + *bits = bit_patterns[i]; + ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, bits, 0, 0); + + ID3D11DeviceContext_PSSetShader(context, ps_if_nz, NULL, 0); + expected_color = *bits ? 0xff00ff00 : 0xff0000ff; + draw_quad(&test_context); + check_texture_color(test_context.backbuffer, expected_color, 0); + + ID3D11DeviceContext_PSSetShader(context, ps_if_z, NULL, 0); + expected_color = *bits ? 0xff0000ff : 0xff00ff00; + draw_quad(&test_context); + check_texture_color(test_context.backbuffer, expected_color, 0); + } + + ID3D11Buffer_Release(cb); + ID3D11PixelShader_Release(ps_if_z); + ID3D11PixelShader_Release(ps_if_nz); + release_test_context(&test_context); +} + START_TEST(d3d11) { test_create_device(); @@ -6917,4 +7014,5 @@ START_TEST(d3d11) test_cb_relative_addressing(); test_getdc(); test_shader_stage_input_output_matching(); + test_sm4_if_instruction(); }
1
0
0
0
Józef Kucia : wined3d: Handle SM4 breakc instruction modifiers.
by Alexandre Julliard
25 May '16
25 May '16
Module: wine Branch: master Commit: 56b22347d208b879679cf4c611b0ffd755eb7036 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=56b22347d208b879679cf4c61…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed May 25 10:51:21 2016 +0200 wined3d: Handle SM4 breakc instruction modifiers. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/glsl_shader.c | 3 ++- dlls/wined3d/shader.c | 3 ++- dlls/wined3d/shader_sm4.c | 7 ++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 98d179e..898cabf 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -4207,10 +4207,11 @@ static void shader_glsl_breakc(const struct wined3d_shader_instruction *ins) static void shader_glsl_breakp(const struct wined3d_shader_instruction *ins) { + const char *condition = (ins->flags == WINED3D_SHADER_CONDITIONAL_OP_NZ) ? "bool" : "!bool"; struct glsl_src_param src_param; shader_glsl_add_src_param(ins, &ins->src[0], WINED3DSP_WRITEMASK_0, &src_param); - shader_addline(ins->ctx->buffer, "if (bool(%s)) break;\n", src_param.param_str); + shader_addline(ins->ctx->buffer, "if (%s(%s)) break;\n", condition, src_param.param_str); } static void shader_glsl_label(const struct wined3d_shader_instruction *ins) diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index b410277..ef2f70b 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -2259,7 +2259,8 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe shader_addline(&buffer, "%s", shader_opcode_names[ins.handler_idx]); - if (ins.handler_idx == WINED3DSIH_IF) + if (ins.handler_idx == WINED3DSIH_BREAKP + || ins.handler_idx == WINED3DSIH_IF) { switch (ins.flags) { diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c index 96ea274..eb8e4e5 100644 --- a/dlls/wined3d/shader_sm4.c +++ b/dlls/wined3d/shader_sm4.c @@ -381,7 +381,7 @@ static BOOL shader_sm4_read_src_param(struct wined3d_sm4_data *priv, const DWORD static BOOL shader_sm4_read_dst_param(struct wined3d_sm4_data *priv, const DWORD **ptr, enum wined3d_data_type data_type, struct wined3d_shader_dst_param *dst_param); -static void shader_sm4_read_if(struct wined3d_shader_instruction *ins, +static void shader_sm4_read_conditional_op(struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv) { @@ -618,7 +618,8 @@ static const struct wined3d_sm4_opcode_info opcode_table[] = {WINED3D_SM4_OP_ADD, WINED3DSIH_ADD, "f", "ff"}, {WINED3D_SM4_OP_AND, WINED3DSIH_AND, "u", "uu"}, {WINED3D_SM4_OP_BREAK, WINED3DSIH_BREAK, "", ""}, - {WINED3D_SM4_OP_BREAKC, WINED3DSIH_BREAKP, "", "u"}, + {WINED3D_SM4_OP_BREAKC, WINED3DSIH_BREAKP, "", "u", + shader_sm4_read_conditional_op}, {WINED3D_SM4_OP_CUT, WINED3DSIH_CUT, "", ""}, {WINED3D_SM4_OP_DERIV_RTX, WINED3DSIH_DSX, "f", "f"}, {WINED3D_SM4_OP_DERIV_RTY, WINED3DSIH_DSY, "f", "f"}, @@ -639,7 +640,7 @@ static const struct wined3d_sm4_opcode_info opcode_table[] = {WINED3D_SM4_OP_GE, WINED3DSIH_GE, "u", "ff"}, {WINED3D_SM4_OP_IADD, WINED3DSIH_IADD, "i", "ii"}, {WINED3D_SM4_OP_IF, WINED3DSIH_IF, "", "u", - shader_sm4_read_if}, + shader_sm4_read_conditional_op}, {WINED3D_SM4_OP_IEQ, WINED3DSIH_IEQ, "u", "ii"}, {WINED3D_SM4_OP_IGE, WINED3DSIH_IGE, "u", "ii"}, {WINED3D_SM4_OP_ILT, WINED3DSIH_ILT, "u", "ii"},
1
0
0
0
Józef Kucia : wined3d: Handle SM4 if instruction modifiers.
by Alexandre Julliard
25 May '16
25 May '16
Module: wine Branch: master Commit: 422bf938cdd38d6dba3a80e3ed557dee4871a7a5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=422bf938cdd38d6dba3a80e3e…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed May 25 10:51:20 2016 +0200 wined3d: Handle SM4 if instruction modifiers. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/glsl_shader.c | 3 ++- dlls/wined3d/shader.c | 11 ++++++++++- dlls/wined3d/shader_sm4.c | 14 +++++++++++++- dlls/wined3d/wined3d_private.h | 6 ++++++ 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 8a6215f..98d179e 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -4156,10 +4156,11 @@ static void shader_glsl_rep(const struct wined3d_shader_instruction *ins) static void shader_glsl_if(const struct wined3d_shader_instruction *ins) { + const char *condition = (ins->flags == WINED3D_SHADER_CONDITIONAL_OP_NZ) ? "bool" : "!bool"; struct glsl_src_param src0_param; shader_glsl_add_src_param(ins, &ins->src[0], WINED3DSP_WRITEMASK_0, &src0_param); - shader_addline(ins->ctx->buffer, "if (bool(%s)) {\n", src0_param.param_str); + shader_addline(ins->ctx->buffer, "if (%s(%s)) {\n", condition, src0_param.param_str); } static void shader_glsl_ifc(const struct wined3d_shader_instruction *ins) diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index c843bc1..b410277 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -2259,7 +2259,16 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe shader_addline(&buffer, "%s", shader_opcode_names[ins.handler_idx]); - if (ins.handler_idx == WINED3DSIH_IFC + if (ins.handler_idx == WINED3DSIH_IF) + { + switch (ins.flags) + { + case WINED3D_SHADER_CONDITIONAL_OP_NZ: shader_addline(&buffer, "_nz"); break; + case WINED3D_SHADER_CONDITIONAL_OP_Z: shader_addline(&buffer, "_z"); break; + default: shader_addline(&buffer, "_unrecognized(%#x)", ins.flags); break; + } + } + else if (ins.handler_idx == WINED3DSIH_IFC || ins.handler_idx == WINED3DSIH_BREAKC) { switch (ins.flags) diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c index b922012..96ea274 100644 --- a/dlls/wined3d/shader_sm4.c +++ b/dlls/wined3d/shader_sm4.c @@ -103,6 +103,8 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_bytecode); #define WINED3D_SM4_INSTRUCTION_FLAG_SATURATE 0x4 +#define WINED3D_SM4_CONDITIONAL_NZ (0x1u << 18) + enum wined3d_sm4_opcode { WINED3D_SM4_OP_ADD = 0x00, @@ -379,6 +381,15 @@ static BOOL shader_sm4_read_src_param(struct wined3d_sm4_data *priv, const DWORD static BOOL shader_sm4_read_dst_param(struct wined3d_sm4_data *priv, const DWORD **ptr, enum wined3d_data_type data_type, struct wined3d_shader_dst_param *dst_param); +static void shader_sm4_read_if(struct wined3d_shader_instruction *ins, + DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, + struct wined3d_sm4_data *priv) +{ + shader_sm4_read_src_param(priv, &tokens, WINED3D_DATA_UINT, &priv->src_param[0]); + ins->flags = (opcode_token & WINED3D_SM4_CONDITIONAL_NZ) ? + WINED3D_SHADER_CONDITIONAL_OP_NZ : WINED3D_SHADER_CONDITIONAL_OP_Z; +} + static void shader_sm4_read_shader_data(struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv) @@ -627,7 +638,8 @@ static const struct wined3d_sm4_opcode_info opcode_table[] = {WINED3D_SM4_OP_FTOU, WINED3DSIH_FTOU, "u", "f"}, {WINED3D_SM4_OP_GE, WINED3DSIH_GE, "u", "ff"}, {WINED3D_SM4_OP_IADD, WINED3DSIH_IADD, "i", "ii"}, - {WINED3D_SM4_OP_IF, WINED3DSIH_IF, "", "u"}, + {WINED3D_SM4_OP_IF, WINED3DSIH_IF, "", "u", + shader_sm4_read_if}, {WINED3D_SM4_OP_IEQ, WINED3DSIH_IEQ, "u", "ii"}, {WINED3D_SM4_OP_IGE, WINED3DSIH_IGE, "u", "ii"}, {WINED3D_SM4_OP_ILT, WINED3DSIH_ILT, "u", "ii"}, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index b5a2732..6a8bbcb 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -497,6 +497,12 @@ enum wined3d_shader_rel_op WINED3D_SHADER_REL_OP_LE = 6, }; +enum wined3d_shader_conditional_op +{ + WINED3D_SHADER_CONDITIONAL_OP_NZ = 0, + WINED3D_SHADER_CONDITIONAL_OP_Z = 1 +}; + #define WINED3D_SM1_VS 0xfffeu #define WINED3D_SM1_PS 0xffffu #define WINED3D_SM4_PS 0x0000u
1
0
0
0
← Newer
1
...
8
9
10
11
12
13
14
...
55
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
Results per page:
10
25
50
100
200