summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* st/nine: Upload on secondary context for Draw*UpAxel Davy2016-12-201-8/+15
| | | | | | | | | | Avoid synchronization by using the secondary context for uploading the vertex data for Draw*Up. v2: Rely on u_upload_mgr to use persistent coherent buffers. Do not flush. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Dirty MANAGED buffers at Lock timeAxel Davy2016-12-201-2/+3
| | | | | | | Tests suggest MANAGED buffers are made dirty at Lock time, not at Unlock time. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Implement new buffer upload pathAxel Davy2016-12-2010-24/+461
| | | | | | | | | | | | | | | | | | | | This new buffer upload path enables to lock faster than the normal path when using DISCARD/NOOVERWRITE. v2: Diverse cleanups and fixes. v3: Fix allocation size for 'lone' buffers and add more debug info. v4: Rewrite of the path to handle when DISCARD/NOOVERWRITE is not used anymore. The resource content is copied to the new resource used. v5: flush for safety after unmap (not sure it is really required here, but safer to flush). v6: Do not use the path if persistent coherent mapping is unavailable. Fix buffer creation flags. v7: Do not flush since it is not needed. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Allow non-zero resource offset for vertex buffersAxel Davy2016-12-203-8/+12
| | | | | | Next patches will introduce an offset. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Do not wait for DEFAULT lock for volumes when we canAxel Davy2016-12-201-1/+8
| | | | | | | If the volumes (and the texture container) are not referenced, then they are no pending operations on them. We can lock directly. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Do not wait for DEFAULT lock for surfaces when we canAxel Davy2016-12-201-1/+11
| | | | | | | If the surfaces (and the texture container) are not referenced, then they are no pending operations on them. We can lock directly. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Add arguments to context's blit and copy_regionAxel Davy2016-12-203-6/+22
| | | | | | | The new arguments enable to reference the objects while the function hasn't run. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Idem for nine_context_gen_mipmapAxel Davy2016-12-203-1/+7
| | | | | | | Will enable to use the bind count as an information for whether the surface/volume is used in the worker thread. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Bind destination for surface/volume uploadsAxel Davy2016-12-204-0/+9
| | | | | | | Will enable to use the bind count as an information for whether the surface/volume is used in the worker thread. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Use nine_context_box_upload for volumesAxel Davy2016-12-202-36/+26
| | | | | | | | | | | | Use nine_context_box_upload for uploads: . systemmem volume to default volume . managed volume internal content to its resource. Check the uploads are executed before any action that can alter the data, that is LockBox and volume destruction. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix leak with volume dtorAxel Davy2016-12-201-1/+1
| | | | | | The last level was not released. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix leak with cubetexture dtorAxel Davy2016-12-201-1/+1
| | | | | | The last level was not released. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Use nine_context_box_upload for surfacesAxel Davy2016-12-202-32/+33
| | | | | | | | | | | | Use nine_context_box_upload for uploads: . systemmem surface to default surface . managed surface internal content to its resource. Check the uploads are executed before any action that can alter the data, that is LockRect, NineSurface9_CopyDefaultToMem and surface destruction. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Implement nine_context_box_uploadAxel Davy2016-12-202-0/+50
| | | | | | This function will be used for surface and volume uploads Signed-off-by: Axel Davy <[email protected]>
* st/nine: Use nine_context_gen_mipmap in BaseTexture9Axel Davy2016-12-201-9/+3
| | | | | | Generate mipmaps in the worker thread. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Implement nine_context_gen_mipmapAxel Davy2016-12-202-0/+22
| | | | | | To offload mipmap generation as well. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Optimize managed buffer uploadAxel Davy2016-12-202-5/+10
| | | | | | | | | | Do the upload in the other thread. Usually managed buffers are used once per frame. It is then very likely pending_upload is 0 at Lock time. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Implement nine_context_range_uploadAxel Davy2016-12-202-0/+19
| | | | | | Will be used to upload buffers. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Do not bind the container if forward is falseAxel Davy2016-12-201-7/+5
| | | | | | This doesn't make sense to bind the container in that specific case. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Comment and simplify iunknownAxel Davy2016-12-202-21/+18
| | | | | | The behaviour is a bit less obscure now. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Detach buffers in swapchain dtor.Axel Davy2016-12-201-1/+1
| | | | | | | | | BackBuffers can survive swapchain dtor if the user has a reference on them. The swapchain itself has no reference on the buffer. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix NineUnknown_DetachAxel Davy2016-12-201-2/+1
| | | | | | We don't bind the container in AddRef. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Simplify ARG_BIND_REFAxel Davy2016-12-201-7/+3
| | | | | | Remove some noop operations. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Avoid flushing the queue for queries GetDataAxel Davy2016-12-204-19/+33
| | | | | | | Use the newly introduced counter to know when we don't need synchronization. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Add CSMT_NO_WAIT_WITH_COUNTERPatrick Rudolph2016-12-201-0/+54
| | | | | | | | Similar to the other macros, but introduces a counter, which enables to know when the instructions has been executed. Signed-off-by: Patrick Rudolph <[email protected]>
* st/nine: Use nine_context_clear_render_targetAxel Davy2016-12-204-15/+29
| | | | | | Enables to not wait for the worker thread for ColorFill. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Optimize ColorFillAxel Davy2016-12-201-1/+1
| | | | | | When we lock the whole surface to overwrite it, we can use DISCARD. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Simplify ColorFillAxel Davy2016-12-201-9/+1
| | | | | | | For render targets, NineSurface9_GetSurface is not expected to fail. Signed-off-by: Axel Davy <[email protected]>
* st/nine: use get_pipe_acquire/release when possibleAxel Davy2016-12-208-16/+34
| | | | | | | Use the acquire/release semantic when we don't need to wait for any pending command. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Implement Fast path for dynamic buffers and csmtAxel Davy2016-12-203-10/+64
| | | | | | | | | | | | Use the secondary pipe for DISCARD/NOOVERWRITE, which avoids stalling to get the pipe from the worker thread. v2: flush at unmap. This is required for example if the driver does hidden draw calls or copies. In the case of unsynchronized it is probably not required, but it is more safe. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Add secondary pipe for deviceAxel Davy2016-12-202-1/+5
| | | | | | | The secondary pipe will be used for operations that don't need synchronization. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Add nine_context_get_pipe_acquire/releaseAxel Davy2016-12-204-0/+91
| | | | | | See commit for description. Signed-off-by: Axel Davy <[email protected]>
* st/nine: SYSTEMMEM ignores DISCARD.Axel Davy2016-12-201-1/+5
| | | | | | | | | Tests show SYSTEMMEM should ignore DISCARD. Prevents game bugs with following patches reimplementing DISCARD. Halo is affected. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Upload Managed buffers just before draw call using themAxel Davy2016-12-202-17/+14
| | | | | | | | | Previously we were uploading Managed buffers at the next draw call after they were set dirty. This is not the expected behaviour. Instead upload just before draw call needing the content. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Track bindings for buffersAxel Davy2016-12-203-6/+55
| | | | | | Similar code than for textures. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix BASETEX_REGISTER_UPDATEAxel Davy2016-12-201-1/+1
| | | | | | | | | | BASETEX_REGISTER_UPDATE was adding the texture to the list of textures to upload in too many cases. tex->base.base.bind will be set to true if the texture is in a stateblock, whereas we want to upload only if bound to the device, which is what bind_count is for. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Simplify the logic to bind texturesAxel Davy2016-12-203-39/+47
| | | | | | This makes the code more readable. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Use nine_context for resource_copy_regionPatrick Rudolph2016-12-203-4/+28
| | | | | | | Use nine_context wrapper for resource_copy_region. Enables to offload it with CSMT. Signed-off-by: Patrick Rudolph <[email protected]>
* st/nine: Use nine_context for blitPatrick Rudolph2016-12-203-2/+15
| | | | | | Enables to offload it with CSMT. Signed-off-by: Patrick Rudolph <[email protected]>
* st/nine: Add NINE_DEBUG=tid to turn threadid on or offPatrick Rudolph2016-12-202-5/+10
| | | | | | To ease debugging. Signed-off-by: Patrick Rudolph <[email protected]>
* st/nine: Print threadid in debug logPatrick Rudolph2016-12-201-6/+18
| | | | | | To ease debugging. Signed-off-by: Patrick Rudolph <[email protected]>
* st/nine: Implement gallium nine CSMTPatrick Rudolph2016-12-2016-179/+899
| | | | | | | | Use an offloading thread for all nine_context functions. Macros are used to ease the reading of the code. Signed-off-by: Patrick Rudolph <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Call GetPipe for implicit pipe usagesAxel Davy2016-12-202-0/+8
| | | | | | | With csmt, every usage of the pipe in the main thread has to be protected by calling GetPipe. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Add struct nine_clipplanePatrick Rudolph2016-12-203-4/+7
| | | | | | Required to know the size exact size of the plane. Signed-off-by: Patrick Rudolph <[email protected]>
* st/nine: Add nine_queuePatrick Rudolph2016-12-203-0/+301
| | | | | | This queue mechanism will be used for CSMT. Signed-off-by: Patrick Rudolph <[email protected]>
* st/nine: Create pipe_surfaces on resource creation.Axel Davy2016-12-202-3/+11
| | | | | | | | Create the pipe_surfaces on renderable resources creation. This enables to avoid creating them on the fly. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Back swvp in nine_contextAxel Davy2016-12-205-5/+23
| | | | | | | | Part of the refactor to move all gallium calls to nine_state.c, and have all internal states required for those calls in nine_context. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Change the way nine_shader gets the pipeAxel Davy2016-12-204-9/+20
| | | | | | | The change is required with csmt, where depending on the thread you don't access the pipe the same way. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Reimplement nine_context_apply_stateblockAxel Davy2016-12-201-0/+206
| | | | | | | | | | | | The new version uses nine_context functions instead of applying the changes directly to nine_context. This will enable it to work with CSMT. v2: Fix nine_context_light_enable_stateblock The memcpy arguments were wrong, and the state wasn't set dirty. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Decompose nine_context_set_textureAxel Davy2016-12-201-25/+48
| | | | | | | | Part of the refactor to move all gallium calls to nine_state.c, and have all internal states required for those calls in nine_context. Signed-off-by: Axel Davy <[email protected]>