Re: [PATCH 1/5] wined3d: Send present operations through a command stream.

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

Am 2013-09-27 00:15, schrieb Henri Verbeet:
 -swapchain-swapchain_ops-swapchain_present(swapchain,
 src_rect, dst_rect, dirty_region, flags); +
 wined3d_cs_emit_present(swapchain-device-cs, swapchain,
 src_rect, +dst_rect, dst_window_override, dirty_region,
 flags);
I think we should place comments like This function is called through
the command stream for all functions that are called through the CS,
similar to what we do for context activation.

Also note that swapchain_gl_present contains calls to
wined3d_surface_blt and wined3d_device_clear that are going to cause
problems with the multithreaded CS. I have patches to remove them, so
feel free to ignore this problem for now.

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

iQIcBAEBAgAGBQJSRWaKAAoJEN0/YqbEcdMw9VgP/i2n/G2CHOA8XShC8CZnRzSq
TNzbfIXwAQljQYtf66U98JmbMIoeS3SMPaJ4O1+mMiT062Udi3YddiTk2AVF9bi+
f6X4y9W8Q3jPolcuTxKpZ26/WFkViHtPEUtFaa5oBtksCNGZ0b3A4oK9zbrPBram
EXwovsq649RqCoBf76aidtbypdkFKLfmC6P6KxtjB3C9cdKJ58kMD0YbVsua6zNc
g8gUgExEQ0no9WEyWPtlN7PRf3tQlLtuUeqrRockqnK48cKbwk3VaEgfq8o6+INs
EvgjoZvc2C/+YoEWUT+n7nCtIKo9IiMSG20Ey0sbmak/K/LrvZvsyHl78nQD4ss+
t5jRCS9QZs/VzJc0VakGsZARP9jGBvzapsrAcy6Ittu1d53fpji6ySwKeUrPKim+
wMtWGtu+q0FXtIRtgDYUOofd9b1o1sB3xPqUIpRm7+yBRpXiBvuGqbmbsa/14wBe
vkI5b5S/djskw9M5bV1lAOCgGmo+zFIYyebxwvx8H+sqz4HmYql9uPLTOHqWvHtn
J7iXcETOlcOrC+zOOT8nieR8YYuFcda51auvK5lnXtCTQvoQse5egV16x2hJkkjx
Pujit58jX2/O0WS0hqR5oAfhYtPydqUf2BayXgkLUODiZa0z1UWD2eerlOvGSvcq
AUs+vi2QpDjeWmQH37BZ
=QcW+
-END PGP SIGNATURE-




Re: [PATCH 1/5] wined3d: Send present operations through a command stream.

2013-09-27 Thread Henri Verbeet
On 27 September 2013 13:05, Stefan Dösinger stefandoesin...@gmail.com wrote:
 I think we should place comments like This function is called through
 the command stream for all functions that are called through the CS,
 similar to what we do for context activation.

Perhaps, I'm not sure. For that kind of comment to be useful it should
have a clear set of implications, and I'm not sure it has that until
we work out the details of the multi-threaded implementation.

 Also note that swapchain_gl_present contains calls to
 wined3d_surface_blt and wined3d_device_clear that are going to cause
 problems with the multithreaded CS. I have patches to remove them, so
 feel free to ignore this problem for now.

Sure, this is just getting the basic infrastructure in place. I'm
ignoring e.g. the RECT pointers that aren't necessarily valid after
the present call finishes as well, until the actual multi-threaded
implementation comes along.




Re: [PATCH 1/5] wined3d: Send present operations through a command stream.

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

Am 2013-09-27 14:19, schrieb Henri Verbeet:
 Perhaps, I'm not sure. For that kind of comment to be useful it
 should have a clear set of implications, and I'm not sure it has
 that until we work out the details of the multi-threaded
 implementation.
Works for me.

Afaics the main implication will be that functions that are called
through the CS shouldn't place any commands into the stream. Depending
on the synchronization between writer and reader this may work, but
waiting for the CS to finish inside the command stream will never work
right.

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

iQIcBAEBAgAGBQJSRYblAAoJEN0/YqbEcdMw7IoQAJLgxf8nlDl+wGcdBlZlFhF1
nAL67t31vRSVONK/gjffW5P8V7dwNGw39gwh5sFt08Bsj0by4KAkhQ0N7Rnb6peL
7WzQdqhGWGlg+9RVUgZJeNo1LcWlglWxskfU+33wBbo6yMI3NGoKS+xF0wE1s5dS
UHeuXr/2aJU9rYzcJCXTjtm294kO6r1ortk0n4+ucdg+oK7RB63sVHZaYmP3757m
IDNs26+3YQFGxN49JFRZSAnbc9591QVM5sNp5UUnQkKP2GyV0r4qRO+ZJkAhnRKk
hF59lCkf7+t038/LjcHB2PEvgmmL6rODc6hAPS1T9OsfomGfCnNZcKDe+X8SEpVC
keKWO5OMc1h12D0DUQN9jjIaGOw7r2/zrYv8lWwU6sodFMInxhZaECGaF4edkmmb
kUGuqyFp8I4+OErQbkGPgh5U9srK6866TX6dBzCaLDAxwskk5m2J1Y/ZC2EYS+Eo
Lf88dLDohNg6LARyrIWDO+4ujUtbeCmCe+/UQ5bVPr1K4/3n2/HJY7Ekq1qkpdpr
t7FY5KsqXuC9b38M4UN3SOlGv1juM8n1LYb7rHETYuXqFxrOFHXqapiomrqNBSZt
CaA6OqDfWgq4f4YsAdvuA5J8ihn0TtMKFKV9y1krCowHk15bE8puYbZ37zYQlNDP
mlSk+X5yt03k+WK1T+xu
=6HrB
-END PGP SIGNATURE-




Re: [PATCH 1/5] wined3d: Send present operations through a command stream.

2013-09-27 Thread Henri Verbeet
On 27 September 2013 15:23, Stefan Dösinger stefandoesin...@gmail.com wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Am 2013-09-27 14:19, schrieb Henri Verbeet:
 Perhaps, I'm not sure. For that kind of comment to be useful it
 should have a clear set of implications, and I'm not sure it has
 that until we work out the details of the multi-threaded
 implementation.
 Works for me.

 Afaics the main implication will be that functions that are called
 through the CS shouldn't place any commands into the stream. Depending
 on the synchronization between writer and reader this may work, but
 waiting for the CS to finish inside the command stream will never work
 right.

Yeah, the main things I can think of is that you shouldn't generally
generate CS ops from inside the CS, and you can't access device state.
I'm not sure in how far those are going to be issues that require this
kind of annotation though. The only things that should access device
state are going to be the various device getters and stateblock
capture, but those should only ever have external callers. The main
cases for generating CS ops from inside the CS are probably blits, and
perhaps resource maps. The basic rule should probably be that anything
that makes wined3d_cs_emit_*() calls should only have callers outside
of wined3d, which shouldn't be too hard to verify.