Commit Graph

87767 Commits

Author SHA1 Message Date
Axel Davy 1843e36b03 st/nine: Do not bind the container if forward is false
This doesn't make sense to bind the container in that specific case.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:47:08 +01:00
Axel Davy 2fc8ef1401 st/nine: Comment and simplify iunknown
The behaviour is a bit less obscure now.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:47:08 +01:00
Axel Davy 098ba64c4c st/nine: Detach buffers in swapchain dtor.
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 <axel.davy@ens.fr>
2016-12-20 23:47:08 +01:00
Axel Davy 14875ebd83 st/nine: Fix NineUnknown_Detach
We don't bind the container in AddRef.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:47:08 +01:00
Axel Davy 930f479acf st/nine: Simplify ARG_BIND_REF
Remove some noop operations.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:47:08 +01:00
Axel Davy 9c4b4e8809 st/nine: Avoid flushing the queue for queries GetData
Use the newly introduced counter to know when we don't
need synchronization.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:47:08 +01:00
Patrick Rudolph 8a69343f1e st/nine: Add CSMT_NO_WAIT_WITH_COUNTER
Similar to the other macros, but introduces a counter,
which enables to know when the instructions has been
executed.

Signed-off-by: Patrick Rudolph <siro@das-labor.org>
2016-12-20 23:47:08 +01:00
Axel Davy 884166a251 st/nine: Use nine_context_clear_render_target
Enables to not wait for the worker thread for ColorFill.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:47:08 +01:00
Axel Davy 7b154ac04d st/nine: Optimize ColorFill
When we lock the whole surface to overwrite it, we can use DISCARD.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:23 +01:00
Axel Davy 9bf1da05d9 st/nine: Simplify ColorFill
For render targets, NineSurface9_GetSurface is not
expected to fail.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:23 +01:00
Axel Davy 31262bbce0 st/nine: use get_pipe_acquire/release when possible
Use the acquire/release semantic when we don't need
to wait for any pending command.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:23 +01:00
Axel Davy 22f6d6fbd2 st/nine: Implement Fast path for dynamic buffers and csmt
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 <axel.davy@ens.fr>
2016-12-20 23:44:23 +01:00
Axel Davy 3e8234fff4 st/nine: Add secondary pipe for device
The secondary pipe will be used for operations
that don't need synchronization.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:23 +01:00
Axel Davy 7a7eeefd7d st/nine: Add nine_context_get_pipe_acquire/release
See commit for description.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:23 +01:00
Axel Davy ddb6f1d2d1 st/nine: SYSTEMMEM ignores DISCARD.
Tests show SYSTEMMEM should ignore DISCARD.

Prevents game bugs with following patches reimplementing
DISCARD. Halo is affected.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:23 +01:00
Axel Davy 4f344db8b0 st/nine: Upload Managed buffers just before draw call using them
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 <axel.davy@ens.fr>
2016-12-20 23:44:23 +01:00
Axel Davy e52aded87f st/nine: Track bindings for buffers
Similar code than for textures.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:23 +01:00
Axel Davy 62068c9d90 st/nine: Fix BASETEX_REGISTER_UPDATE
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 <axel.davy@ens.fr>
2016-12-20 23:44:23 +01:00
Axel Davy 804b28cdc4 st/nine: Simplify the logic to bind textures
This makes the code more readable.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:23 +01:00
Patrick Rudolph fef23f6712 st/nine: Use nine_context for resource_copy_region
Use nine_context wrapper for resource_copy_region.
Enables to offload it with CSMT.

Signed-off-by: Patrick Rudolph <siro@das-labor.org>
2016-12-20 23:44:23 +01:00
Patrick Rudolph c8913a06b4 st/nine: Use nine_context for blit
Enables to offload it with CSMT.

Signed-off-by: Patrick Rudolph <siro@das-labor.org>
2016-12-20 23:44:23 +01:00
Patrick Rudolph 0fd5730613 st/nine: Add NINE_DEBUG=tid to turn threadid on or off
To ease debugging.

Signed-off-by: Patrick Rudolph <siro@das-labor.org>
2016-12-20 23:44:23 +01:00
Patrick Rudolph 3098bf03a6 st/nine: Print threadid in debug log
To ease debugging.

Signed-off-by: Patrick Rudolph <siro@das-labor.org>
2016-12-20 23:44:23 +01:00
Patrick Rudolph ac2927335b st/nine: Implement gallium nine CSMT
Use an offloading thread for all nine_context functions.
Macros are used to ease the reading of the code.

Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:23 +01:00
Axel Davy 2c371a25a8 st/nine: Call GetPipe for implicit pipe usages
With csmt, every usage of the pipe in the main thread
has to be protected by calling GetPipe.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:23 +01:00
Patrick Rudolph 1277ceefd1 st/nine: Add struct nine_clipplane
Required to know the size exact size of the plane.

Signed-off-by: Patrick Rudolph <siro@das-labor.org>
2016-12-20 23:44:22 +01:00
Patrick Rudolph 3af17a671d st/nine: Add nine_queue
This queue mechanism will be used for CSMT.

Signed-off-by: Patrick Rudolph <siro@das-labor.org>
2016-12-20 23:44:22 +01:00
Axel Davy e068d3afe1 st/nine: Create pipe_surfaces on resource creation.
Create the pipe_surfaces on renderable resources creation.

This enables to avoid creating them on the fly.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:22 +01:00
Axel Davy bb666b0297 st/nine: Back swvp in nine_context
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 <axel.davy@ens.fr>
2016-12-20 23:44:22 +01:00
Axel Davy f5f881fd3e st/nine: Change the way nine_shader gets the pipe
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 <axel.davy@ens.fr>
2016-12-20 23:44:22 +01:00
Axel Davy 97e4b65e7f st/nine: Reimplement nine_context_apply_stateblock
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 <axel.davy@ens.fr>
2016-12-20 23:44:22 +01:00
Axel Davy 8d967abb98 st/nine: Decompose nine_context_set_texture
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 <axel.davy@ens.fr>
2016-12-20 23:44:22 +01:00
Axel Davy 69f447752d st/nine: Decompose nine_context_set_indices
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 <axel.davy@ens.fr>
2016-12-20 23:44:22 +01:00
Axel Davy 08b717dfd3 st/nine: Decompose nine_context_set_stream_source
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 <axel.davy@ens.fr>
2016-12-20 23:44:22 +01:00
Axel Davy 7ebdbb573b st/nine: Do not use NineBaseTexture9 in nine_context
Some fields are subject to modification outside of nine_context
(SetLod, etc).

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:22 +01:00
Axel Davy 152d007769 st/nine: Move Managed Pool handling out of nine_context
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 <axel.davy@ens.fr>
2016-12-20 23:44:22 +01:00
Axel Davy eb884a4ac2 st/nine: Integrate nine_pipe_context_clear to nine_context_clear
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 <axel.davy@ens.fr>
2016-12-20 23:44:22 +01:00
Axel Davy b95205b1f2 st/nine: Move pipe and cso to nine_context
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 <axel.davy@ens.fr>
2016-12-20 23:44:22 +01:00
Axel Davy 66ad5b1592 st/nine: Rename pipe to pipe_data in nine_context
This patch it to avoid name conflict when device->pipe
will be moved to nine_context.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:22 +01:00
Axel Davy fc49f7df89 st/nine: Rename cso in nine_context to cso_shader
This patch it to avoid name conflict when device->cso
is moved to nine_context.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:22 +01:00
Axel Davy c7237e2c5c st/nine: Access pipe_context via NineDevice9_GetPipe
Except for nine_ff and nine_state.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:22 +01:00
Axel Davy 4a4eba8c05 st/nine: Remove NineDevice9_GetCSO
Was useless. Remove useless usage in
swapchain9.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:22 +01:00
Axel Davy 6a7541a5aa st/nine: Move query9 pipe calls to nine_context
This will enable to use threading for them.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:22 +01:00
Axel Davy 0a5252d25b st/nine: Use atomics for nine_bind
nine_bind didn't need atomics up to now,
because it's use what always within a protected
mutex. We need to use atomics because with the
next patches several threads may use nine_bind.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:22 +01:00
Axel Davy b748b8fd86 st/nine: Track dirty state groups in nine_context
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 <axel.davy@ens.fr>
2016-12-20 23:44:22 +01:00
Axel Davy a0a18920c7 st/nine: Back User Clip Planes to nine_context
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 <axel.davy@ens.fr>
2016-12-20 23:44:22 +01:00
Axel Davy c6ca7c747e st/nine: Back ps to nine_context
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 <axel.davy@ens.fr>
2016-12-20 23:44:22 +01:00
Axel Davy d671190df9 st/nine: Back ds to nine_context
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 <axel.davy@ens.fr>
2016-12-20 23:44:22 +01:00
Axel Davy 1a735a99d0 st/nine: Back all ff states in nine_context
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 <axel.davy@ens.fr>
2016-12-20 23:44:22 +01:00
Axel Davy bb62ea925a st/nine: Refactor LightEnable
Call a helper function.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:22 +01:00