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
July 2023
----- 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
865 discussions
Start a n
N
ew thread
Jacek Caban : win32u: Pack messages in WH_CALLWNDPROC hooks.
by Alexandre Julliard
24 Jul '23
24 Jul '23
Module: wine Branch: master Commit: 7cc06fb9999adfb79baea9348d5132e2b42d483d URL:
https://gitlab.winehq.org/wine/wine/-/commit/7cc06fb9999adfb79baea9348d5132…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Jul 19 16:22:32 2023 +0200 win32u: Pack messages in WH_CALLWNDPROC hooks. --- dlls/user32/hook.c | 12 ++++++++++++ dlls/win32u/hook.c | 26 ++++++++++++++++++++------ dlls/win32u/message.c | 6 ++++-- dlls/win32u/win32u_private.h | 2 ++ dlls/wow64win/user.c | 9 +++++++++ 5 files changed, 47 insertions(+), 8 deletions(-) diff --git a/dlls/user32/hook.c b/dlls/user32/hook.c index 1465712adb2..1ae49587688 100644 --- a/dlls/user32/hook.c +++ b/dlls/user32/hook.c @@ -483,6 +483,18 @@ BOOL WINAPI User32CallWindowsHook( struct win_hook_params *params, ULONG size ) ret_size = sizeof(*cbtc.lpcs); } break; + case WH_CALLWNDPROC: + if (ret_size > sizeof(CWPSTRUCT)) + { + CWPSTRUCT *cwp = (CWPSTRUCT *)params->lparam; + size_t offset = (lparam_offset + sizeof(*cwp) + 15) & ~15; + void *buffer = (char *)params + offset; + + unpack_message( cwp->hwnd, cwp->message, &cwp->wParam, &cwp->lParam, + &buffer, size - offset, !params->prev_unicode ); + ret_size = 0; + break; + } } } if (params->module[0] && !(proc = get_hook_proc( proc, params->module, &free_module ))) diff --git a/dlls/win32u/hook.c b/dlls/win32u/hook.c index b880c8d37e0..27b109ce545 100644 --- a/dlls/win32u/hook.c +++ b/dlls/win32u/hook.c @@ -195,7 +195,8 @@ static UINT get_ll_hook_timeout(void) * Call hook either in current thread or send message to the destination * thread. */ -static LRESULT call_hook( struct win_hook_params *info, const WCHAR *module, size_t lparam_size ) +static LRESULT call_hook( struct win_hook_params *info, const WCHAR *module, size_t lparam_size, + size_t message_size, BOOL ansi ) { DWORD_PTR ret = 0; @@ -230,7 +231,7 @@ static LRESULT call_hook( struct win_hook_params *info, const WCHAR *module, siz else if (info->proc) { struct user_thread_info *thread_info = get_user_thread_info(); - size_t size, lparam_offset = 0, message_offset = 0, message_size = 0; + size_t size, lparam_offset = 0, message_offset = 0; size_t lparam_ret_size = lparam_size; HHOOK prev = thread_info->hook; BOOL prev_unicode = thread_info->hook_unicode; @@ -287,6 +288,13 @@ static LRESULT call_hook( struct win_hook_params *info, const WCHAR *module, siz WM_CREATE, lp, FALSE ); } break; + case WH_CALLWNDPROC: + { + CWPSTRUCT *cwp = (CWPSTRUCT *)((char *)params + lparam_offset); + pack_user_message( (char *)params + message_offset, message_size, + cwp->message, cwp->lParam, ansi ); + } + break; } } @@ -357,7 +365,7 @@ LRESULT WINAPI NtUserCallNextHookEx( HHOOK hhook, INT code, WPARAM wparam, LPARA info.wparam = wparam; info.lparam = lparam; info.prev_unicode = thread_info->hook_unicode; - return call_hook( &info, module, 0 ); + return call_hook( &info, module, 0, 0, FALSE ); } LRESULT call_current_hook( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam ) @@ -390,10 +398,11 @@ LRESULT call_current_hook( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam ) info.wparam = wparam; info.lparam = lparam; info.prev_unicode = TRUE; /* assume Unicode for this function */ - return call_hook( &info, module, 0 ); + return call_hook( &info, module, 0, 0, FALSE ); } -LRESULT call_hooks( INT id, INT code, WPARAM wparam, LPARAM lparam, size_t lparam_size ) +LRESULT call_message_hooks( INT id, INT code, WPARAM wparam, LPARAM lparam, size_t lparam_size, + size_t message_size, BOOL ansi ) { struct user_thread_info *thread_info = get_user_thread_info(); struct win_hook_params info; @@ -434,7 +443,7 @@ LRESULT call_hooks( INT id, INT code, WPARAM wparam, LPARAM lparam, size_t lpara info.code = code; info.wparam = wparam; info.lparam = lparam; - ret = call_hook( &info, module, lparam_size ); + ret = call_hook( &info, module, lparam_size, message_size, ansi ); SERVER_START_REQ( finish_hook_chain ) { @@ -445,6 +454,11 @@ LRESULT call_hooks( INT id, INT code, WPARAM wparam, LPARAM lparam, size_t lpara return ret; } +LRESULT call_hooks( INT id, INT code, WPARAM wparam, LPARAM lparam, size_t lparam_size ) +{ + return call_message_hooks( id, code, wparam, lparam, lparam_size, 0, FALSE ); +} + /*********************************************************************** * NtUserSetWinEventHook (win32u.@) */ diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index fe048e0ee38..5aec4c5eb95 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -1530,7 +1530,8 @@ static LRESULT call_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar cwp.wParam = wparam; cwp.message = msg; cwp.hwnd = hwnd = get_full_window_handle( hwnd ); - call_hooks( WH_CALLWNDPROC, HC_ACTION, same_thread, (LPARAM)&cwp, sizeof(cwp) ); + call_message_hooks( WH_CALLWNDPROC, HC_ACTION, same_thread, (LPARAM)&cwp, sizeof(cwp), + packed_size, ansi ); if (size && !(params = malloc( sizeof(*params) + size ))) return 0; if (!init_window_call_params( params, hwnd, msg, wparam, lparam, !unicode, mapping )) @@ -1557,7 +1558,8 @@ static LRESULT call_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar cwpret.wParam = wparam; cwpret.message = msg; cwpret.hwnd = hwnd; - call_hooks( WH_CALLWNDPROCRET, HC_ACTION, same_thread, (LPARAM)&cwpret, sizeof(cwpret) ); + call_message_hooks( WH_CALLWNDPROCRET, HC_ACTION, same_thread, (LPARAM)&cwpret, sizeof(cwpret), + packed_size, ansi ); return result; } diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 8d6fb34776d..b27ba7fab14 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -75,6 +75,8 @@ extern LRESULT handle_nc_hit_test( HWND hwnd, POINT pt ) DECLSPEC_HIDDEN; extern LRESULT call_current_hook( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam ) DECLSPEC_HIDDEN; extern LRESULT call_hooks( INT id, INT code, WPARAM wparam, LPARAM lparam, size_t lparam_size ) DECLSPEC_HIDDEN; +extern LRESULT call_message_hooks( INT id, INT code, WPARAM wparam, LPARAM lparam, + size_t lparam_size, size_t message_size, BOOL ansi ) DECLSPEC_HIDDEN; extern BOOL is_hooked( INT id ) DECLSPEC_HIDDEN; extern BOOL unhook_windows_hook( INT id, HOOKPROC proc ) DECLSPEC_HIDDEN; diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index 1fad0f566fd..94df46cbb90 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -744,6 +744,15 @@ static UINT hook_lparam_64to32( int id, int code, const void *lp, size_t size, v cwp32.message = cwp->message; cwp32.hwnd = HandleToUlong( cwp->hwnd ); memcpy( lp32, &cwp32, sizeof(cwp32) ); + if (size > sizeof(*cwp)) + { + const size_t offset64 = (sizeof(*cwp) + 15) & ~15; + const size_t offset32 = (sizeof(cwp32) + 15) & ~15; + size = packed_message_64to32( cwp32.message, + (const char *)lp + offset64, + (char *)lp32 + offset32, size - offset64 ); + return offset32 + size; + } return sizeof(cwp32); }
1
0
0
0
Jacek Caban : win32u: Use user message packing for HCBT_CREATEWND hooks.
by Alexandre Julliard
24 Jul '23
24 Jul '23
Module: wine Branch: master Commit: af95fc8c4fa0f1afedbfcfd8e05ab65999a13935 URL:
https://gitlab.winehq.org/wine/wine/-/commit/af95fc8c4fa0f1afedbfcfd8e05ab6…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Jul 19 15:45:19 2023 +0200 win32u: Use user message packing for HCBT_CREATEWND hooks. --- dlls/user32/hook.c | 23 ++++++--------- dlls/user32/user_private.h | 2 ++ dlls/user32/winproc.c | 4 +-- dlls/win32u/hook.c | 70 ++++++++++++++++++++------------------------ dlls/win32u/message.c | 4 +-- dlls/win32u/win32u_private.h | 3 ++ dlls/wow64win/user.c | 9 +----- 7 files changed, 50 insertions(+), 65 deletions(-)
1
0
0
0
Jacek Caban : win32u: Use CREATESTRUCTW struct layout to pass WM_CREATE message params to client.
by Alexandre Julliard
24 Jul '23
24 Jul '23
Module: wine Branch: master Commit: 2d8b65c2149603f6ee2b3eedea60756d8fa1ba3a URL:
https://gitlab.winehq.org/wine/wine/-/commit/2d8b65c2149603f6ee2b3eedea6075…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Jul 17 22:06:12 2023 +0200 win32u: Use CREATESTRUCTW struct layout to pass WM_CREATE message params to client. --- dlls/user32/winproc.c | 54 +++++++-------- dlls/win32u/message.c | 187 ++++++++++++++++++++++++++++++++++++++++++++------ dlls/wow64win/user.c | 72 ++++++++++++++++++- 3 files changed, 262 insertions(+), 51 deletions(-)
1
0
0
0
Zebediah Figura : vkd3d-shader/hlsl: Pass an hlsl_block pointer to add_assignment().
by Alexandre Julliard
24 Jul '23
24 Jul '23
Module: vkd3d Branch: master Commit: f95ab2a5e88388618086f3e94f6fab75e0578aed URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/f95ab2a5e88388618086f3e94f6fa…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Mon Nov 14 20:25:55 2022 -0600 vkd3d-shader/hlsl: Pass an hlsl_block pointer to add_assignment(). --- libs/vkd3d-shader/hlsl.y | 40 ++++++++++++++++------------------------ 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index e908ee84..84c9cd49 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -146,14 +146,6 @@ static struct list *block_to_list(struct hlsl_block *block) return &block->instrs; } -static struct hlsl_block *list_to_block(struct list *list) -{ - /* This is a temporary hack to ease the transition from lists to blocks. - * It takes advantage of the fact that an allocated hlsl_block pointer is - * byte-compatible with an allocated list pointer. */ - return CONTAINING_RECORD(list, struct hlsl_block, instrs); -} - static struct hlsl_block *make_empty_block(struct hlsl_ctx *ctx) { struct hlsl_block *block; @@ -1705,7 +1697,7 @@ static bool invert_swizzle(unsigned int *swizzle, unsigned int *writemask, unsig return true; } -static struct hlsl_ir_node *add_assignment(struct hlsl_ctx *ctx, struct list *instrs, struct hlsl_ir_node *lhs, +static struct hlsl_ir_node *add_assignment(struct hlsl_ctx *ctx, struct hlsl_block *block, struct hlsl_ir_node *lhs, enum parse_assign_op assign_op, struct hlsl_ir_node *rhs) { struct hlsl_type *lhs_type = lhs->data_type; @@ -1714,7 +1706,7 @@ static struct hlsl_ir_node *add_assignment(struct hlsl_ctx *ctx, struct list *in if (assign_op == ASSIGN_OP_SUB) { - if (!(rhs = add_unary_arithmetic_expr(ctx, list_to_block(instrs), HLSL_OP1_NEG, rhs, &rhs->loc))) + if (!(rhs = add_unary_arithmetic_expr(ctx, block, HLSL_OP1_NEG, rhs, &rhs->loc))) return NULL; assign_op = ASSIGN_OP_ADD; } @@ -1723,14 +1715,14 @@ static struct hlsl_ir_node *add_assignment(struct hlsl_ctx *ctx, struct list *in enum hlsl_ir_expr_op op = op_from_assignment(assign_op); assert(op); - if (!(rhs = add_binary_arithmetic_expr(ctx, list_to_block(instrs), op, lhs, rhs, &rhs->loc))) + if (!(rhs = add_binary_arithmetic_expr(ctx, block, op, lhs, rhs, &rhs->loc))) return NULL; } if (lhs_type->class <= HLSL_CLASS_LAST_NUMERIC) writemask = (1 << lhs_type->dimx) - 1; - if (!(rhs = add_implicit_conversion(ctx, instrs, rhs, lhs_type, &rhs->loc))) + if (!(rhs = add_implicit_conversion(ctx, block_to_list(block), rhs, lhs_type, &rhs->loc))) return NULL; while (lhs->type != HLSL_IR_LOAD && lhs->type != HLSL_IR_INDEX) @@ -1759,7 +1751,7 @@ static struct hlsl_ir_node *add_assignment(struct hlsl_ctx *ctx, struct list *in { return NULL; } - list_add_tail(instrs, &new_swizzle->entry); + hlsl_block_add_instr(block, new_swizzle); lhs = swizzle->val.node; rhs = new_swizzle; @@ -1805,7 +1797,7 @@ static struct hlsl_ir_node *add_assignment(struct hlsl_ctx *ctx, struct list *in hlsl_cleanup_deref(&resource_deref); return NULL; } - list_add_tail(instrs, &store->entry); + hlsl_block_add_instr(block, store); hlsl_cleanup_deref(&resource_deref); } else if (lhs->type == HLSL_IR_INDEX && hlsl_index_is_noncontiguous(hlsl_ir_index(lhs))) @@ -1824,13 +1816,13 @@ static struct hlsl_ir_node *add_assignment(struct hlsl_ctx *ctx, struct list *in if (!(c = hlsl_new_uint_constant(ctx, i, &lhs->loc))) return NULL; - list_add_tail(instrs, &c->entry); + hlsl_block_add_instr(block, c); if (!(cell = hlsl_new_index(ctx, &row->node, c, &lhs->loc))) return NULL; - list_add_tail(instrs, &cell->entry); + hlsl_block_add_instr(block, cell); - if (!(load = hlsl_add_load_component(ctx, instrs, rhs, k++, &rhs->loc))) + if (!(load = hlsl_add_load_component(ctx, block_to_list(block), rhs, k++, &rhs->loc))) return NULL; if (!hlsl_init_deref_from_index_chain(ctx, &deref, cell)) @@ -1841,7 +1833,7 @@ static struct hlsl_ir_node *add_assignment(struct hlsl_ctx *ctx, struct list *in hlsl_cleanup_deref(&deref); return NULL; } - list_add_tail(instrs, &store->entry); + hlsl_block_add_instr(block, store); hlsl_cleanup_deref(&deref); } } @@ -1858,7 +1850,7 @@ static struct hlsl_ir_node *add_assignment(struct hlsl_ctx *ctx, struct list *in hlsl_cleanup_deref(&deref); return NULL; } - list_add_tail(instrs, &store->entry); + hlsl_block_add_instr(block, store); hlsl_cleanup_deref(&deref); } @@ -1867,7 +1859,7 @@ static struct hlsl_ir_node *add_assignment(struct hlsl_ctx *ctx, struct list *in * the last instruction in the list, we do need to copy. */ if (!(copy = hlsl_new_copy(ctx, rhs))) return NULL; - list_add_tail(instrs, ©->entry); + hlsl_block_add_instr(block, copy); return copy; } @@ -1885,7 +1877,7 @@ static bool add_increment(struct hlsl_ctx *ctx, struct hlsl_block *block, bool d return false; hlsl_block_add_instr(block, one); - if (!add_assignment(ctx, block_to_list(block), lhs, decrement ? ASSIGN_OP_SUB : ASSIGN_OP_ADD, one)) + if (!add_assignment(ctx, block, lhs, decrement ? ASSIGN_OP_SUB : ASSIGN_OP_ADD, one)) return false; if (post) @@ -2233,7 +2225,7 @@ static struct hlsl_block *initialize_vars(struct hlsl_ctx *ctx, struct list *var assert(v->initializer.args_count == 1); hlsl_block_add_instr(v->initializer.instrs, &load->node); - add_assignment(ctx, block_to_list(v->initializer.instrs), &load->node, ASSIGN_OP_ASSIGN, v->initializer.args[0]); + add_assignment(ctx, v->initializer.instrs, &load->node, ASSIGN_OP_ASSIGN, v->initializer.args[0]); } if (var->storage_modifiers & HLSL_STORAGE_STATIC) @@ -3737,7 +3729,7 @@ static struct hlsl_block *add_call(struct hlsl_ctx *ctx, const char *name, goto fail; hlsl_block_add_instr(args->instrs, &load->node); - if (!add_assignment(ctx, block_to_list(args->instrs), arg, ASSIGN_OP_ASSIGN, &load->node)) + if (!add_assignment(ctx, args->instrs, arg, ASSIGN_OP_ASSIGN, &load->node)) goto fail; } } @@ -6468,7 +6460,7 @@ assignment_expr: } hlsl_block_add_block($3, $1); destroy_block($1); - if (!add_assignment(ctx, block_to_list($3), lhs, $2, rhs)) + if (!add_assignment(ctx, $3, lhs, $2, rhs)) YYABORT; $$ = $3; }
1
0
0
0
Zebediah Figura : vkd3d-shader/hlsl: Pass a hlsl_block pointer to hlsl_add_conditional().
by Alexandre Julliard
24 Jul '23
24 Jul '23
Module: vkd3d Branch: master Commit: 7e7a6d36915b64dbb3a31cc154cd06cba259d406 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/7e7a6d36915b64dbb3a31cc154cd0…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Mon Mar 6 20:37:41 2023 -0600 vkd3d-shader/hlsl: Pass a hlsl_block pointer to hlsl_add_conditional(). --- libs/vkd3d-shader/hlsl.h | 2 +- libs/vkd3d-shader/hlsl.y | 6 +++--- libs/vkd3d-shader/hlsl_codegen.c | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index ab91974a..42ad23a4 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -1074,7 +1074,7 @@ struct vkd3d_string_buffer *hlsl_component_to_string(struct hlsl_ctx *ctx, const struct vkd3d_string_buffer *hlsl_modifiers_to_string(struct hlsl_ctx *ctx, unsigned int modifiers); const char *hlsl_node_type_to_string(enum hlsl_ir_node_type type); -struct hlsl_ir_node *hlsl_add_conditional(struct hlsl_ctx *ctx, struct list *instrs, +struct hlsl_ir_node *hlsl_add_conditional(struct hlsl_ctx *ctx, struct hlsl_block *block, struct hlsl_ir_node *condition, struct hlsl_ir_node *if_true, struct hlsl_ir_node *if_false); void hlsl_add_function(struct hlsl_ctx *ctx, char *name, struct hlsl_ir_function_decl *decl); bool hlsl_add_var(struct hlsl_ctx *ctx, struct hlsl_ir_var *decl, bool local_var); diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 96adada7..e908ee84 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -2873,7 +2873,7 @@ static bool intrinsic_fmod(struct hlsl_ctx *ctx, const struct parse_initializer if (!(ge = add_binary_comparison_expr(ctx, params->instrs, HLSL_OP2_GEQUAL, div, zero, loc))) return false; - if (!(select = hlsl_add_conditional(ctx, block_to_list(params->instrs), ge, frac, neg_frac))) + if (!(select = hlsl_add_conditional(ctx, params->instrs, ge, frac, neg_frac))) return false; return !!add_binary_arithmetic_expr(ctx, params->instrs, HLSL_OP2_MUL, select, y, loc); @@ -3036,7 +3036,7 @@ static bool intrinsic_lit(struct hlsl_ctx *ctx, if (!(specular_pow = add_pow_expr(ctx, params->instrs, n_h, m, loc))) return false; - if (!(load = hlsl_add_conditional(ctx, block_to_list(params->instrs), specular_or, zero, specular_pow))) + if (!(load = hlsl_add_conditional(ctx, params->instrs, specular_or, zero, specular_pow))) return false; if (!hlsl_new_store_component(ctx, &block, &var_deref, 2, load)) @@ -6449,7 +6449,7 @@ conditional_expr: if (!(second = add_implicit_conversion(ctx, block_to_list($1), second, common_type, &@5))) YYABORT; - if (!hlsl_add_conditional(ctx, block_to_list($1), cond, first, second)) + if (!hlsl_add_conditional(ctx, $1, cond, first, second)) YYABORT; $$ = $1; } diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 3ca4ceef..25b5ca2f 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -2387,7 +2387,7 @@ static bool lower_casts_to_bool(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr return true; } -struct hlsl_ir_node *hlsl_add_conditional(struct hlsl_ctx *ctx, struct list *instrs, +struct hlsl_ir_node *hlsl_add_conditional(struct hlsl_ctx *ctx, struct hlsl_block *instrs, struct hlsl_ir_node *condition, struct hlsl_ir_node *if_true, struct hlsl_ir_node *if_false) { struct hlsl_block then_block, else_block; @@ -2413,11 +2413,11 @@ struct hlsl_ir_node *hlsl_add_conditional(struct hlsl_ctx *ctx, struct list *ins if (!(iff = hlsl_new_if(ctx, condition, &then_block, &else_block, &condition->loc))) return NULL; - list_add_tail(instrs, &iff->entry); + hlsl_block_add_instr(instrs, iff); if (!(load = hlsl_new_var_load(ctx, var, &condition->loc))) return NULL; - list_add_tail(instrs, &load->node.entry); + hlsl_block_add_instr(instrs, &load->node); return &load->node; } @@ -2485,7 +2485,7 @@ static bool lower_int_division(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, return false; hlsl_block_add_instr(block, neg); - return hlsl_add_conditional(ctx, &block->instrs, and, neg, cast3); + return hlsl_add_conditional(ctx, block, and, neg, cast3); } static bool lower_int_modulus(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, struct hlsl_block *block) @@ -2547,7 +2547,7 @@ static bool lower_int_modulus(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, return false; hlsl_block_add_instr(block, neg); - return hlsl_add_conditional(ctx, &block->instrs, and, neg, cast3); + return hlsl_add_conditional(ctx, block, and, neg, cast3); } static bool lower_int_abs(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, void *context) @@ -2669,7 +2669,7 @@ static bool lower_float_modulus(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr return false; hlsl_block_add_instr(block, neg2); - if (!(cond = hlsl_add_conditional(ctx, &block->instrs, ge, arg2, neg2))) + if (!(cond = hlsl_add_conditional(ctx, block, ge, arg2, neg2))) return false; for (i = 0; i < type->dimx; ++i)
1
0
0
0
Zebediah Figura : vkd3d-shader/hlsl: Use a hlsl_block to build replacement instructions in lower_discard_neg().
by Alexandre Julliard
24 Jul '23
24 Jul '23
Module: vkd3d Branch: master Commit: 80b9f5201011603d0ed4073296c04c8ff290b3f7 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/80b9f5201011603d0ed4073296c04…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Jun 29 23:24:53 2023 -0500 vkd3d-shader/hlsl: Use a hlsl_block to build replacement instructions in lower_discard_neg(). --- libs/vkd3d-shader/hlsl_codegen.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 872ff33b..3ca4ceef 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -2704,8 +2704,8 @@ static bool lower_discard_neg(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, struct hlsl_type *arg_type, *cmp_type; struct hlsl_ir_node *operands[HLSL_MAX_OPERANDS] = { 0 }; struct hlsl_ir_jump *jump; + struct hlsl_block block; unsigned int i, count; - struct list instrs; if (instr->type != HLSL_IR_JUMP) return false; @@ -2713,38 +2713,38 @@ static bool lower_discard_neg(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, if (jump->type != HLSL_IR_JUMP_DISCARD_NEG) return false; - list_init(&instrs); + hlsl_block_init(&block); arg_type = jump->condition.node->data_type; if (!(zero = hlsl_new_constant(ctx, arg_type, &zero_value, &instr->loc))) return false; - list_add_tail(&instrs, &zero->entry); + hlsl_block_add_instr(&block, zero); operands[0] = jump->condition.node; operands[1] = zero; cmp_type = hlsl_get_numeric_type(ctx, arg_type->class, HLSL_TYPE_BOOL, arg_type->dimx, arg_type->dimy); if (!(cmp = hlsl_new_expr(ctx, HLSL_OP2_LESS, operands, cmp_type, &instr->loc))) return false; - list_add_tail(&instrs, &cmp->entry); + hlsl_block_add_instr(&block, cmp); if (!(bool_false = hlsl_new_constant(ctx, hlsl_get_scalar_type(ctx, HLSL_TYPE_BOOL), &zero_value, &instr->loc))) return false; - list_add_tail(&instrs, &bool_false->entry); + hlsl_block_add_instr(&block, bool_false); or = bool_false; count = hlsl_type_component_count(cmp_type); for (i = 0; i < count; ++i) { - if (!(load = hlsl_add_load_component(ctx, &instrs, cmp, i, &instr->loc))) + if (!(load = hlsl_add_load_component(ctx, &block.instrs, cmp, i, &instr->loc))) return false; if (!(or = hlsl_new_binary_expr(ctx, HLSL_OP2_LOGIC_OR, or, load))) return NULL; - list_add_tail(&instrs, &or->entry); + hlsl_block_add_instr(&block, or); } - list_move_tail(&instr->entry, &instrs); + list_move_tail(&instr->entry, &block.instrs); hlsl_src_remove(&jump->condition); hlsl_src_from_node(&jump->condition, or); jump->type = HLSL_IR_JUMP_DISCARD_NZ;
1
0
0
0
Zebediah Figura : vkd3d-shader/hlsl: Use a hlsl_block to build replacement instructions in lower_float_modulus().
by Alexandre Julliard
24 Jul '23
24 Jul '23
Module: vkd3d Branch: master Commit: 3a07df8476ebfe32058cfcbced71bae69df557a0 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/3a07df8476ebfe32058cfcbced71b…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Mon Mar 6 20:31:16 2023 -0600 vkd3d-shader/hlsl: Use a hlsl_block to build replacement instructions in lower_float_modulus(). --- libs/vkd3d-shader/hlsl_codegen.c | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 6dea8367..872ff33b 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -2631,9 +2631,9 @@ static bool lower_int_dot(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, void return false; } -static bool lower_float_modulus(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, void *context) +static bool lower_float_modulus(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, struct hlsl_block *block) { - struct hlsl_ir_node *arg1, *arg2, *mul1, *neg1, *ge, *neg2, *div, *mul2, *frc, *cond, *one; + struct hlsl_ir_node *arg1, *arg2, *mul1, *neg1, *ge, *neg2, *div, *mul2, *frc, *cond, *one, *mul3; struct hlsl_type *type = instr->data_type, *btype; struct hlsl_constant_value one_value; struct hlsl_ir_expr *expr; @@ -2654,47 +2654,45 @@ static bool lower_float_modulus(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr if (!(mul1 = hlsl_new_binary_expr(ctx, HLSL_OP2_MUL, arg2, arg1))) return false; - list_add_before(&instr->entry, &mul1->entry); + hlsl_block_add_instr(block, mul1); if (!(neg1 = hlsl_new_unary_expr(ctx, HLSL_OP1_NEG, mul1, &instr->loc))) return false; - list_add_before(&instr->entry, &neg1->entry); + hlsl_block_add_instr(block, neg1); if (!(ge = hlsl_new_binary_expr(ctx, HLSL_OP2_GEQUAL, mul1, neg1))) return false; ge->data_type = btype; - list_add_before(&instr->entry, &ge->entry); + hlsl_block_add_instr(block, ge); if (!(neg2 = hlsl_new_unary_expr(ctx, HLSL_OP1_NEG, arg2, &instr->loc))) return false; - list_add_before(&instr->entry, &neg2->entry); + hlsl_block_add_instr(block, neg2); - if (!(cond = hlsl_add_conditional(ctx, &instr->entry, ge, arg2, neg2))) + if (!(cond = hlsl_add_conditional(ctx, &block->instrs, ge, arg2, neg2))) return false; for (i = 0; i < type->dimx; ++i) one_value.u[i].f = 1.0f; if (!(one = hlsl_new_constant(ctx, type, &one_value, &instr->loc))) return false; - list_add_before(&instr->entry, &one->entry); + hlsl_block_add_instr(block, one); if (!(div = hlsl_new_binary_expr(ctx, HLSL_OP2_DIV, one, cond))) return false; - list_add_before(&instr->entry, &div->entry); + hlsl_block_add_instr(block, div); if (!(mul2 = hlsl_new_binary_expr(ctx, HLSL_OP2_MUL, div, arg1))) return false; - list_add_before(&instr->entry, &mul2->entry); + hlsl_block_add_instr(block, mul2); if (!(frc = hlsl_new_unary_expr(ctx, HLSL_OP1_FRACT, mul2, &instr->loc))) return false; - list_add_before(&instr->entry, &frc->entry); + hlsl_block_add_instr(block, frc); - expr->op = HLSL_OP2_MUL; - hlsl_src_remove(&expr->operands[0]); - hlsl_src_remove(&expr->operands[1]); - hlsl_src_from_node(&expr->operands[0], frc); - hlsl_src_from_node(&expr->operands[1], cond); + if (!(mul3 = hlsl_new_binary_expr(ctx, HLSL_OP2_MUL, frc, cond))) + return false; + hlsl_block_add_instr(block, mul3); return true; } @@ -4294,7 +4292,7 @@ int hlsl_emit_bytecode(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry lower_ir(ctx, lower_int_division, body); lower_ir(ctx, lower_int_modulus, body); hlsl_transform_ir(ctx, lower_int_abs, body, NULL); - hlsl_transform_ir(ctx, lower_float_modulus, body, NULL); + lower_ir(ctx, lower_float_modulus, body); hlsl_transform_ir(ctx, fold_redundant_casts, body, NULL); do {
1
0
0
0
Zebediah Figura : vkd3d-shader/hlsl: Use a hlsl_block to build replacement instructions in lower_int_modulus().
by Alexandre Julliard
24 Jul '23
24 Jul '23
Module: vkd3d Branch: master Commit: 0dee96ead684a21ab78ba1c3dc22edf690ab53b0 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/0dee96ead684a21ab78ba1c3dc22e…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Mon Mar 6 20:35:59 2023 -0600 vkd3d-shader/hlsl: Use a hlsl_block to build replacement instructions in lower_int_modulus(). --- libs/vkd3d-shader/hlsl_codegen.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 8fee84fa..6dea8367 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -2488,9 +2488,9 @@ static bool lower_int_division(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, return hlsl_add_conditional(ctx, &block->instrs, and, neg, cast3); } -static bool lower_int_modulus(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, void *context) +static bool lower_int_modulus(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, struct hlsl_block *block) { - struct hlsl_ir_node *arg1, *arg2, *and, *abs1, *abs2, *div, *neg, *cast1, *cast2, *cast3, *cond, *high_bit; + struct hlsl_ir_node *arg1, *arg2, *and, *abs1, *abs2, *div, *neg, *cast1, *cast2, *cast3, *high_bit; struct hlsl_type *type = instr->data_type, *utype; struct hlsl_constant_value high_bit_value; struct hlsl_ir_expr *expr; @@ -2513,45 +2513,41 @@ static bool lower_int_modulus(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, high_bit_value.u[i].u = 0x80000000; if (!(high_bit = hlsl_new_constant(ctx, type, &high_bit_value, &instr->loc))) return false; - list_add_before(&instr->entry, &high_bit->entry); + hlsl_block_add_instr(block, high_bit); if (!(and = hlsl_new_binary_expr(ctx, HLSL_OP2_BIT_AND, arg1, high_bit))) return false; - list_add_before(&instr->entry, &and->entry); + hlsl_block_add_instr(block, and); if (!(abs1 = hlsl_new_unary_expr(ctx, HLSL_OP1_ABS, arg1, &instr->loc))) return false; - list_add_before(&instr->entry, &abs1->entry); + hlsl_block_add_instr(block, abs1); if (!(cast1 = hlsl_new_cast(ctx, abs1, utype, &instr->loc))) return false; - list_add_before(&instr->entry, &cast1->entry); + hlsl_block_add_instr(block, cast1); if (!(abs2 = hlsl_new_unary_expr(ctx, HLSL_OP1_ABS, arg2, &instr->loc))) return false; - list_add_before(&instr->entry, &abs2->entry); + hlsl_block_add_instr(block, abs2); if (!(cast2 = hlsl_new_cast(ctx, abs2, utype, &instr->loc))) return false; - list_add_before(&instr->entry, &cast2->entry); + hlsl_block_add_instr(block, cast2); if (!(div = hlsl_new_binary_expr(ctx, HLSL_OP2_MOD, cast1, cast2))) return false; - list_add_before(&instr->entry, &div->entry); + hlsl_block_add_instr(block, div); if (!(cast3 = hlsl_new_cast(ctx, div, type, &instr->loc))) return false; - list_add_before(&instr->entry, &cast3->entry); + hlsl_block_add_instr(block, cast3); if (!(neg = hlsl_new_unary_expr(ctx, HLSL_OP1_NEG, cast3, &instr->loc))) return false; - list_add_before(&instr->entry, &neg->entry); - - if (!(cond = hlsl_add_conditional(ctx, &instr->entry, and, neg, cast3))) - return false; - hlsl_replace_node(instr, cond); + hlsl_block_add_instr(block, neg); - return true; + return hlsl_add_conditional(ctx, &block->instrs, and, neg, cast3); } static bool lower_int_abs(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, void *context) @@ -4296,7 +4292,7 @@ int hlsl_emit_bytecode(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry hlsl_transform_ir(ctx, lower_casts_to_bool, body, NULL); hlsl_transform_ir(ctx, lower_int_dot, body, NULL); lower_ir(ctx, lower_int_division, body); - hlsl_transform_ir(ctx, lower_int_modulus, body, NULL); + lower_ir(ctx, lower_int_modulus, body); hlsl_transform_ir(ctx, lower_int_abs, body, NULL); hlsl_transform_ir(ctx, lower_float_modulus, body, NULL); hlsl_transform_ir(ctx, fold_redundant_casts, body, NULL);
1
0
0
0
Nikolay Sivov : vkd3d-compiler: Add CLI option to specify default matrix packing order.
by Alexandre Julliard
24 Jul '23
24 Jul '23
Module: vkd3d Branch: master Commit: e71b2c091156cab7ebe44086221f9e1cfb8c8e00 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/e71b2c091156cab7ebe44086221f9…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Jul 18 14:52:45 2023 +0200 vkd3d-compiler: Add CLI option to specify default matrix packing order. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- programs/vkd3d-compiler/main.c | 56 +++++++++++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/programs/vkd3d-compiler/main.c b/programs/vkd3d-compiler/main.c index b94272a5..3341e037 100644 --- a/programs/vkd3d-compiler/main.c +++ b/programs/vkd3d-compiler/main.c @@ -35,13 +35,14 @@ #include <term.h> #endif -#define MAX_COMPILE_OPTIONS 4 +#define MAX_COMPILE_OPTIONS 5 enum { OPTION_HELP = CHAR_MAX + 1, OPTION_BUFFER_UAV, OPTION_ENTRY, + OPTION_MATRIX_STORAGE_ORDER, OPTION_OUTPUT, OPTION_PRINT_SOURCE_TYPES, OPTION_PRINT_TARGET_TYPES, @@ -184,6 +185,9 @@ static void print_usage(const char *program_name) " --buffer-uav=<type> Specify the buffer type to use for buffer UAV bindings.\n" " Valid values are 'buffer-texture' (default) and\n" " 'storage-buffer'.\n" + " --matrix-storage-order=<order>\n" + " Specify default matrix storage order. Valid values are\n" + " 'column' (default) and 'row'.\n" " -e, --entry=<name> Use <name> as the entry point (default is \"main\").\n" " -E Preprocess the source code instead of compiling it.\n" " -o, --output=<file> Write the output to <file>. If <file> is '-' or no\n" @@ -332,6 +336,23 @@ static bool parse_formatting(uint32_t *formatting, bool *colour, char *arg) return true; } +static bool parse_matrix_storage_order(enum vkd3d_shader_compile_option_pack_matrix_order *order, const char *arg) +{ + if (!strcmp(arg, "column")) + { + *order = VKD3D_SHADER_COMPILE_OPTION_PACK_MATRIX_COLUMN_MAJOR; + return true; + } + + if (!strcmp(arg, "row")) + { + *order = VKD3D_SHADER_COMPILE_OPTION_PACK_MATRIX_ROW_MAJOR; + return true; + } + + return false; +} + static enum vkd3d_shader_source_type parse_source_type(const char *source) { unsigned int i; @@ -418,22 +439,24 @@ static bool validate_target_type( static bool parse_command_line(int argc, char **argv, struct options *options) { + enum vkd3d_shader_compile_option_pack_matrix_order pack_matrix_order; enum vkd3d_shader_compile_option_buffer_uav buffer_uav; int option; static struct option long_options[] = { - {"help", no_argument, NULL, OPTION_HELP}, - {"buffer-uav", required_argument, NULL, OPTION_BUFFER_UAV}, - {"entry", required_argument, NULL, OPTION_ENTRY}, - {"output", required_argument, NULL, OPTION_OUTPUT}, - {"formatting", required_argument, NULL, OPTION_TEXT_FORMATTING}, - {"print-source-types", no_argument, NULL, OPTION_PRINT_SOURCE_TYPES}, - {"print-target-types", no_argument, NULL, OPTION_PRINT_TARGET_TYPES}, - {"profile", required_argument, NULL, OPTION_PROFILE}, - {"strip-debug", no_argument, NULL, OPTION_STRIP_DEBUG}, - {"version", no_argument, NULL, OPTION_VERSION}, - {NULL, 0, NULL, 0}, + {"help", no_argument, NULL, OPTION_HELP}, + {"buffer-uav", required_argument, NULL, OPTION_BUFFER_UAV}, + {"entry", required_argument, NULL, OPTION_ENTRY}, + {"matrix-storage-order", required_argument, NULL, OPTION_MATRIX_STORAGE_ORDER}, + {"output", required_argument, NULL, OPTION_OUTPUT}, + {"formatting", required_argument, NULL, OPTION_TEXT_FORMATTING}, + {"print-source-types", no_argument, NULL, OPTION_PRINT_SOURCE_TYPES}, + {"print-target-types", no_argument, NULL, OPTION_PRINT_TARGET_TYPES}, + {"profile", required_argument, NULL, OPTION_PROFILE}, + {"strip-debug", no_argument, NULL, OPTION_STRIP_DEBUG}, + {"version", no_argument, NULL, OPTION_VERSION}, + {NULL, 0, NULL, 0}, }; memset(options, 0, sizeof(*options)); @@ -485,6 +508,15 @@ static bool parse_command_line(int argc, char **argv, struct options *options) options->output_filename = optarg; break; + case OPTION_MATRIX_STORAGE_ORDER: + if (!parse_matrix_storage_order(&pack_matrix_order, optarg)) + { + fprintf(stderr, "Invalid matrix storage order '%s' specified.\n", optarg); + return false; + } + add_compile_option(options, VKD3D_SHADER_COMPILE_OPTION_PACK_MATRIX_ORDER, pack_matrix_order); + break; + case OPTION_PROFILE: case 'p': options->profile = optarg;
1
0
0
0
Nikolay Sivov : tests: Add some tests for matrix packing compiler options.
by Alexandre Julliard
24 Jul '23
24 Jul '23
Module: vkd3d Branch: master Commit: 0b77b5f99eb8f1cc7cb7c4c83f7633b246dc5412 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/0b77b5f99eb8f1cc7cb7c4c83f763…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Jul 13 08:09:12 2023 +0200 tests: Add some tests for matrix packing compiler options. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- tests/hlsl/majority-pragma.shader_test | 144 +++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) diff --git a/tests/hlsl/majority-pragma.shader_test b/tests/hlsl/majority-pragma.shader_test index 10778fd0..808313e7 100644 --- a/tests/hlsl/majority-pragma.shader_test +++ b/tests/hlsl/majority-pragma.shader_test @@ -223,3 +223,147 @@ uniform 8 float4 0.0 0.5 0.0 0.0 uniform 12 float4 0.0 0.6 0.0 0.0 draw quad probe all rgba (0.3, 0.4, 0.5, 0.6) + +% Compiler options +[require] +options: row-major + +[pixel shader] +#pragma pack_matrix(column_major) +uniform float4x4 m; + +float4 main() : sv_target +{ + float4 ret; + ret.xy = m[0].yz; + ret.zw = m[1].yz; + return ret; +} + +[test] +uniform 0 float4 0.1 0.5 0.9 1.3 +uniform 4 float4 0.2 0.6 1.0 1.4 +uniform 8 float4 0.3 0.7 1.1 1.5 +uniform 12 float4 0.4 0.8 1.2 1.6 +draw quad +probe all rgba (0.2, 0.3, 0.6, 0.7) 1 + +[require] +options: column-major + +[pixel shader] +uniform float4x4 m; + +float4 main() : sv_target +{ + float4 ret; + ret.xy = m[0].yz; + ret.zw = m[1].yz; + return ret; +} + +[test] +uniform 0 float4 0.1 0.5 0.9 1.3 +uniform 4 float4 0.2 0.6 1.0 1.4 +uniform 8 float4 0.3 0.7 1.1 1.5 +uniform 12 float4 0.4 0.8 1.2 1.6 +draw quad +probe all rgba (0.2, 0.3, 0.6, 0.7) 1 + +[require] +options: row-major + +[pixel shader] +uniform float4x4 m; + +float4 main() : sv_target +{ + float4 ret; + ret.xy = m[0].yz; + ret.zw = m[1].yz; + return ret; +} + +[test] +uniform 0 float4 0.1 0.5 0.9 1.3 +uniform 4 float4 0.2 0.6 1.0 1.4 +uniform 8 float4 0.3 0.7 1.1 1.5 +uniform 12 float4 0.4 0.8 1.2 1.6 +draw quad +probe all rgba (0.5, 0.9, 0.6, 1.0) 1 + +[require] +options: column-major + +[pixel shader] +uniform float4x4 m1; +#pragma pack_matrix(row_major) +uniform float4x4 m2; + +float4 main() : sv_target +{ + float4 ret; + ret.xy = m1[0].zw; + ret.zw = m2[0].zw; + return ret; +} + +[test] +uniform 0 float4 0.1 0.5 0.9 1.3 +uniform 4 float4 0.2 0.6 1.0 1.4 +uniform 8 float4 0.3 0.7 1.1 1.5 +uniform 12 float4 0.4 0.8 1.2 1.6 +uniform 16 float4 1.7 2.1 2.5 2.9 +uniform 20 float4 1.8 2.2 2.6 3.0 +uniform 24 float4 1.9 2.3 2.7 3.1 +uniform 28 float4 2.0 2.4 2.8 3.2 +draw quad +probe all rgba (0.3, 0.4, 2.5, 2.9) 1 + +[require] +options: row-major + +[pixel shader] +uniform float4x4 m1; +#pragma pack_matrix(column_major) +uniform float4x4 m2; + +float4 main() : sv_target +{ + float4 ret; + ret.xy = m1[3].zw; + ret.zw = m2[3].zw; + return ret; +} + +[test] +uniform 0 float4 0.1 0.5 0.9 1.3 +uniform 4 float4 0.2 0.6 1.0 1.4 +uniform 8 float4 0.3 0.7 1.1 1.5 +uniform 12 float4 0.4 0.8 1.2 1.6 +uniform 16 float4 1.7 2.1 2.5 2.9 +uniform 20 float4 1.8 2.2 2.6 3.0 +uniform 24 float4 1.9 2.3 2.7 3.1 +uniform 28 float4 2.0 2.4 2.8 3.2 +draw quad +probe all rgba (1.2, 1.6, 3.1, 3.2) 1 + +[require] +options: column-major row-major + +[pixel shader] +uniform float2x2 m; + +float4 main() : sv_target +{ + float4 ret; + ret.xy = m[0]; + ret.zw = m[1]; + return ret; +} + +[test] +uniform 0 float4 0.1 0.2 0.0 0.0 +uniform 4 float4 0.3 0.4 0.0 0.0 +draw quad +probe all rgba (0.1, 0.3, 0.2, 0.4) 1
1
0
0
0
← Newer
1
...
13
14
15
16
17
18
19
...
87
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
Results per page:
10
25
50
100
200