Re: [PATCH 4/5] wined3d: Move the decoded stream info into the context.

2013-09-11 Thread Henri Verbeet
On 11 September 2013 11:31, Stefan Dösinger ste...@codeweavers.com wrote:
 @@ -1880,9 +1888,8 @@ struct wined3d_device
  WORD d3d_initialized : 1;
  WORD inScene : 1;   /* A flag to check for proper 
 BeginScene / EndScene call pairs */
  WORD softwareVertexProcessing : 1;  /* process vertex shaders using 
 software or hardware */
 -WORD useDrawStridedSlow : 1;
  WORD filter_messages : 1;
 -WORD padding : 8;
 +WORD padding : 1;
I don't think that's quite right.




Re: [PATCH 4/5] wined3d: Move the decoded stream info into the context.

2013-09-11 Thread Stefan Dösinger
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Am 2013-09-11 13:32, schrieb Henri Verbeet: On 11 September 2013
11:31, Stefan Dösinger ste...@codeweavers.com wrote:
 @@ -1880,9 +1888,8 @@ struct wined3d_device WORD d3d_initialized
 : 1; WORD inScene : 1;   /* A flag to check for
proper BeginScene / EndScene call pairs */
 WORD softwareVertexProcessing : 1;  /* process vertex shaders
using software or hardware */
 -WORD useDrawStridedSlow : 1; WORD filter_messages : 1; -
 WORD padding : 8; +WORD padding : 1;
 I don't think that's quite right.
The next element is a BYTE. The 8 bits padding were stupid considering
that, it just generates a hole. Now I am removing one bit, which
leaves one bit of padding left.

I can send a separate patch that removes the 8 bits if you want, but I
didn't consider that necessary since the padding doesn't do much anyway.

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.20 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIbBAEBAgAGBQJSMFYLAAoJEN0/YqbEcdMwPCEP+JBvqr+U0mPGMoapURDqm8V4
ERRVfT655e+K1G6xPZZfMAq+y+3gCrZTTqMrFx8zTvBScRMjsnbJDLi9NSSMYVNl
mO9Yszk28JYAP5MRN6qpTLkLxrX4qQkb0ZT2xQBeSSo2LCqplvZ2FmAiPlvwhm20
5inqe4j+JOuPmX5QwSMeqHj89ARgc2VZ6l56V0n7QDwTgqVOt5Zhqdge2g+GB6tp
jyxqPeINJBL8qrhom0oVjyxOI6uU/p1G2GMKdAzmCbwh7lKp8yAi8nrbscvAOYXF
ybpHDExZv7RxHMX2DuSnSVgFEULiTgjVqkKdkC+3lOPACjZTPAzgSqUY8RhAQbyc
ZHpHTYpAafovURstJPgp+2fGIWV+n4Z/PH3iy/wCai1sdESwFFvcZf6p7xc+NqEP
LSlGpuMD5YX8DDUxvR13OudqT7WqsB5mAmJJAyahLczxnztpWAMKrHmjnty8H9B2
J/WVhfbYAuqQbMClREVZ5SXDQNY3NKcp1Hpqp56GrtIAu9B6M8oGHyStB7KHvaEa
A4CNUcStrwAACpKO6SZF951C090/y7It1aaYVVklyygU50Cj3M+C0LWWj8m51t2n
nazC7AL79DY7JEjlbyrHE6Qc61ZsIKn1fTDQ92NzzxxFNuWrZIPRItSzASzvvgzf
Q94g3yVHblJMWDZ2CMI=
=7fwi
-END PGP SIGNATURE-




Re: [PATCH 4/5] wined3d: Move the decoded stream info into the context.

2013-09-11 Thread Henri Verbeet
On 11 September 2013 13:37, Stefan Dösinger ste...@codeweavers.com wrote:
 The next element is a BYTE. The 8 bits padding were stupid considering
 that, it just generates a hole. Now I am removing one bit, which
 leaves one bit of padding left.

It doesn't really work like that, the layout is like this:

UINT (4)
WORD (2)
BYTE (1)
char (1)

Removing the 8 bits of padding is equivalent to just making the
bitfield a BYTE, and you end up with a hole after the
surface_alignment field.




Re: [PATCH 4/5] wined3d: Move the decoded stream info into the context

2013-09-09 Thread Henri Verbeet
On 9 September 2013 12:56, Stefan Dösinger ste...@codeweavers.com wrote:
 ---
I think this patch does a couple of things at once, and would probably
benefit from being broken up.

  static struct arb_vs_compiled_shader *find_arb_vshader(struct wined3d_shader 
 *shader,
 -const struct arb_vs_compile_args *args,
 +const struct wined3d_context *context, const struct 
 arb_vs_compile_args *args,
  const struct wined3d_shader_signature_element *ps_input_sig)
I think it makes more sense to pass a wined3d_stream_info structure
here instead of a context, or perhaps even just the use_map field.

 -static BOOL buffer_find_decl(struct wined3d_buffer *This)
 +static BOOL buffer_find_decl(struct wined3d_buffer *This, const struct 
 wined3d_context *context)
Same.

 diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
 index 23d32c2..f7ded75 100644
 --- a/dlls/wined3d/wined3d_private.h
 +++ b/dlls/wined3d/wined3d_private.h
 @@ -1086,6 +1086,7 @@ struct wined3d_context
  DWORD padding : 1;
  DWORD texShaderBumpMap : 8; /* MAX_TEXTURES, 8 */
  DWORD lastWasPow2Texture : 8;   /* MAX_TEXTURES, 8 */
 +DWORD use_draw_strided_slow : 1;
  DWORD shader_update_mask;
  DWORD constant_update_mask;
  DWORD   numbered_array_mask;
I think that's an unfortunate place to insert the field, and you
should update the padding.

 @@ -1880,9 +1889,7 @@ struct wined3d_device
  WORD d3d_initialized : 1;
  WORD inScene : 1;   /* A flag to check for proper 
 BeginScene / EndScene call pairs */
  WORD softwareVertexProcessing : 1;  /* process vertex shaders using 
 software or hardware */
 -WORD useDrawStridedSlow : 1;
  WORD filter_messages : 1;
 -WORD padding : 8;
Padding?




Re: [PATCH 4/5] wined3d: Move the decoded stream info into the context

2013-09-09 Thread Stefan Dösinger
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Am 2013-09-09 13:42, schrieb Henri Verbeet:
 I think that's an unfortunate place to insert the field, and you 
 should update the padding.
 
 @@ -1880,9 +1889,7 @@ struct wined3d_device WORD 
 d3d_initialized : 1; WORD inScene : 1;   /* A 
 flag to check for proper BeginScene / EndScene call pairs */ 
 WORD softwareVertexProcessing : 1;  /* process vertex shaders 
 using software or hardware */ -WORD useDrawStridedSlow : 1;
 WORD filter_messages : 1; -WORD padding : 8;
 Padding?
Do we need it? The compiler should take care of it for this structure
- - unlike texture_stage_op, where we don't memset the structure to zero
and explicitly set the padding to 0.

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.20 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSLbW5AAoJEN0/YqbEcdMwRDAP/0coCS3OKzCZw/qcjZ8GbKCY
J2imUtGc6aOhlWPgpzPrIs1yy4JWGosrobYjRKaYpfN7IuxsUgZ011vo0gCSyC0q
YRNIo3ExRgR5gSal4l9v4o6UvPgvWhTiSa/ay9Gwqwy/1FXWhI9wEne0miJ75JLg
5BhVl54kaa2dKOAZac9xD3hL+3lKZadsvKO78VUGenGUYo78IQp7tRlAA2IRwKrS
AfywhobK3v0yA2eA4xMMV7gbjx3lcLBSxG7z4+JvkWlaSTUG13ndSldyDwZ4kCwl
LuD/MaZZem8oVBiYnWLuGbXJ3hfvIcmJTiGKzPFbirE7eZMA3g7wgBJhUGPK5Urx
kRA0zbF6FNq0GfoXg/FVbKL2mcaahzIpm3qOHGkv/U5sv4g+6SSEoGyi69Kyjq6o
ixqOCmuY5Yj+AHTzcorFpcDxWQX0eqOZnlkhwI0yCyiIQm0rNVOcZ5DmzwjVKnfb
jRLcs7TwazoEjVfhfzSMRez+r6cngxsXsQMmbnvp9O4BZactJnYT62OmfRCvJ5Zu
RXrppcDhpIr/adw7j1p7htDqCzWgUVLhKvxQUaNBUeBhRnNCdJjSMlVcCiNGOvkl
VCrFUYYQh0bMpVmhx4BsnjgkcKixxYHsWBSf8VKUOLL7jKwXzg/gjSIC1wPZrKUb
R4MgltrET/xMpgL7j8CB
=KW1K
-END PGP SIGNATURE-




Re: [PATCH 4/5] wined3d: Move the decoded stream info into the context

2013-09-09 Thread Henri Verbeet
On 9 September 2013 13:49, Stefan Dösinger ste...@codeweavers.com wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Am 2013-09-09 13:42, schrieb Henri Verbeet:
 I think that's an unfortunate place to insert the field, and you
 should update the padding.

 @@ -1880,9 +1889,7 @@ struct wined3d_device WORD
 d3d_initialized : 1; WORD inScene : 1;   /* A
 flag to check for proper BeginScene / EndScene call pairs */
 WORD softwareVertexProcessing : 1;  /* process vertex shaders
 using software or hardware */ -WORD useDrawStridedSlow : 1;
 WORD filter_messages : 1; -WORD padding : 8;
 Padding?
 Do we need it?
Not strictly, but I think it helps with keeping track of how much bits
are left and avoiding silly things like holes in the structure.




Re: [PATCH 4/5] wined3d: Move the decoded stream info into the context

2013-09-09 Thread Stefan Dösinger
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Am 2013-09-09 13:55, schrieb Henri Verbeet:
 Not strictly, but I think it helps with keeping track of how much 
 bits are left and avoiding silly things like holes in the 
 structure.
Fair enough. Please ignore patches 4 and 5 for today, I'll take my
time splitting 4 up. I'll resubmit 1 with an updated title.

Thanks,
Stefan


-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.20 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSLcArAAoJEN0/YqbEcdMwmocP/3hCs8OymvtGVOrgykbNFe6w
9JigmRYwhT9R40XiSFwJRTcvyaGQ0zHSUM0q39xWnsA4MXiPfTUBMKa5W9N1pcog
Z4ZrguLzYVjHlgVh2tlY9KruzfCw+9Z1WjqhU2MMFwioMndzQRSmlzN3WCsG3hbz
iGs+5U1R1jt4MemzloAOpUtne9JtRYJonCAZFp4/doQz8GU80IGISKRf1Mp1Z4xO
/yjYeMIt/us3dKhAUlH05nA7yLpuqD34qouoVI3DJwgI7n20VXsv9u4nEMKn+8rs
00pNPwQnG+ZiSTNtHgoHRzBwugI1XTbaR/9HtfBy5s9wWE2o6DCuUAyGIkSsRGrb
/ymCh02HABPMO/bhdCvYDO+vOCrhXmrs8umTJVtQnn4cfaNjmqI89gTHv9c0kpIC
wJ1EdGSk+lLfc5LzBrkIB4epqSx0Rhjx88eT6kSPAgTt/3uc3zUlayn00oPRVv1z
8GJ8MeVhsp3vjSn5zROMTDd6+N5pJEgUBqH9mG5q2Lbu5uHBXJOy7rKBqqI5RVSq
1uEPT/I1LNmbmVf9Ev3dmAoQZXBGYS/D/3gLoYm54dba2wEYd3tpHEEacrC16UhB
0JWz7pQU0DTMhUQVBZ7dZ8upqR5UmegplDdSq39MmpaLqOR/m2/rWkX0bLaqcz3t
WIf4u/+o4dEeKrETIvQK
=fB5u
-END PGP SIGNATURE-