aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/marshal.h
Commit message (Collapse)AuthorAgeFilesLines
* mesa/marshal: fix Windows buildGrigori Goronzy2017-07-141-3/+3
| | | | | | | This was broken by commit 1ad24faa. Reported by AppVeyor: https://ci.appveyor.com/project/mesa3d/mesa/build/4918
* mesa/marshal: add marshalling for glClearBuffer*Grigori Goronzy2017-07-141-1/+28
| | | | | | | | | Add async marshalling/unmarshalling for all glClearBuffer variants. These entry points are commonly used in general and Alien Isolation specifically uses glClearBufferiv. Slightly reduces the number of thread synchronizations with glthread in that game. Reviewed-by: Marek Olšák <[email protected]>
* mesa/marshal: extract ClearBuffer helpersGrigori Goronzy2017-07-141-2/+3
| | | | | | | | | Extract clear buffer helper functions in preparation for adding marshal/unmarshal functions for the various glClearBuffer variants. v2: Fix command size. Reviewed-by: Marek Olšák <[email protected]>
* mesa/glthread: switch to u_queue and redesign the batch managementMarek Olšák2017-06-261-4/+6
| | | | | | | This mirrors exactly how u_threaded_context works. If you understand this, you also understand u_threaded_context. Reviewed-by: Timothy Arceri <[email protected]>
* mesa/glthread: remove HAVE_PTHREAD guardsMarek Olšák2017-06-261-27/+0
| | | | | | we are switching to util_queue. Reviewed-by: Timothy Arceri <[email protected]>
* mesa/marshal: add custom marshalling for glNamedBuffer(Sub)DataGrigori Goronzy2017-06-261-0/+18
| | | | | | | | | | | | | These entry points are used by Alien Isolation and caused synchronization with glthread. The async marshalling implementation is similar to glBuffer(Sub)Data. However unlike Buffer(Sub)Data we don't need to worry about EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD, as this isn't applicable to these DSA variants. Results in an approximately 6x drop in glthread synchronizations and a ~30% FPS jump in Alien Isolation (Medium preset, Athlon 860K, RX 480). Reviewed-by: Timothy Arceri <[email protected]>
* mesa/glthread: fix misaligned address accessBartosz Tomczyk2017-04-041-2/+4
| | | | | | | | | | | | | | | | | | | | | | | Address sanitizer reports lot of misaligned access: SUMMARY: AddressSanitizer: undefined-behavior main/marshal.c:276:31 in main/marshal.c:276:31: runtime error: load of misaligned address 0x631000104866 for type 'const GLuint' (aka 'const unsigned int'), which requires 4 byte alignment 0x631000104866: note: pointer points here 92 88 00 00 00 00 00 00 4a 03 0c 00 93 88 00 00 00 00 00 00 02 01 0c 00 40 8d 00 00 00 00 00 00 ^ SUMMARY: AddressSanitizer: undefined-behavior main/marshal_generated.c:28725:12 in main/marshal_generated.c:28726:12: runtime error: member access within misaligned address 0x6310003fc874 for type 'struct marshal_cmd_VertexAttribPointer', which requires 8 byte alignment 0x6310003fc874: note: pointer points here 01 00 00 00 7a 02 20 00 00 00 00 00 be be be be be be be be be be be be be be be be be be be be ^ SUMMARY: AddressSanitizer: undefined-behavior main/marshal_generated.c:28726:12 in main/marshal_generated.c:28726:12: runtime error: store to misaligned address 0x6310003fc87c for type 'GLint' (aka 'int'), which requires 8 byte alignment 0x6310003fc87c: note: pointer points here 00 00 00 00 be be be be be be be be be be be be be be be be be be be be be be be be be be be be Reviewed-by: Timothy Arceri <[email protected]>
* mesa: disable glthread when DEBUG_OUTPUT_SYNCHRONOUS is enabledTimothy Arceri2017-04-031-0/+8
| | | | | | | | | | | | | We could re-enable it also but I haven't tested that yet, and I'm not sure we care much anyway. V2: don't disable it from with the call itself. We need a custom marshalling function or we get stuck waiting for thread to finish. V3: tidy up redundant code copied from generated version. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/glthread: print out syncs when MARSHAL_MAX_CMD_SIZE is exceededTimothy Arceri2017-03-301-0/+13
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/glthread: add custom marshalling for ClearBufferfv()Timothy Arceri2017-03-251-0/+9
| | | | | | This is one of the main causes of syncs in Civ6. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/marshal: add custom BufferData/BufferSubData marshallingTimothy Arceri2017-03-241-0/+18
| | | | | | | | | | GL_AMD_pinned_memory requires memory to be aligned correctly, so we skip marshalling in this case. Also copying the data defeats the purpose of EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD. Fixes GL_AMD_pinned_memory piglit tests when glthread is enabled. Acked-by: Edward O'Callaghan <[email protected]>
* mesa: fix glthread marshal build issues on platforms without PTHREADTimothy Arceri2017-03-161-25/+51
|
* mesa: Track the current vertex/element array buffers for glthread.Eric Anholt2017-03-161-0/+57
| | | | | | | | | | | | We want to support glthread on GLES contexts with reasonable apps, and on desktop for apps that use VBOs but haven't completely moved to core GL. To do so, we have to deal with the "the user may or may not pass user pointers to draw calls" problem. Acked-by: Timothy Arceri <[email protected]> Acked-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]> Tested-by: Mike Lothian <[email protected]>
* mesa: Custom thread marshalling for Flush.Paul Berry2017-03-161-0/+8
| | | | | | | Acked-by: Timothy Arceri <[email protected]> Acked-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]> Tested-by: Mike Lothian <[email protected]>
* mesa: Custom thread marshalling for ShaderSource.Paul Berry2017-03-161-0/+10
| | | | | | | Acked-by: Timothy Arceri <[email protected]> Acked-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]> Tested-by: Mike Lothian <[email protected]>
* mesa: Add infrastructure for a worker thread to process GL commands.Eric Anholt2017-03-161-0/+112
v2: Keep an allocated buffer around instead of checking for one at the start of every GL command. Inline the now-small space allocation function. v3: Remove duplicate !glthread->shutdown check, process remaining work before shutdown. v4: Fix leaks on destroy. V5: (Timothy Arceri) fix order of source files in makefile Acked-by: Timothy Arceri <[email protected]> Acked-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]> Tested-by: Mike Lothian <[email protected]>