Commit Graph

87491 Commits

Author SHA1 Message Date
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
Axel Davy cbe370020e st/nine: Refactor SetLight
Call a helper function to set the light.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:22 +01:00
Axel Davy c5af96aebd st/nine: Put ff data in a separate structure
And make nine_state_access_transform take this
new structure as input.
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 4a6d83ebc2 st/nine: Back viewport 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 9498613607 st/nine: Back scissor 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 7f6e01052b st/nine: Back RT 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 aafbd62955 st/nine: Back current index buffer 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 b13b217243 st/nine: Back all shader constants to nine_context
For device vs shader float constants and may_swvp,
the same tips than for the other constant types is
used.

Also memset the constants properly.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:22 +01:00
Axel Davy 93ac6dfdcc st/nine: Back sampler states 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 2a698c3df2 st/nine: Back vs to nine_context
And move programmable_vs storage and computation.
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:21 +01:00
Axel Davy 43288cf376 st/nine: Back vdecl 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:21 +01:00
Axel Davy 63633e2a08 st/nine: Move stream freq data 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:21 +01:00
Axel Davy 848ffc81e4 st/nine: Move vtxbuf 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:21 +01:00
Axel Davy aea7a019ef st/nine: Move stream_usage_mask 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:21 +01:00
Axel Davy eed47b748f st/nine: Back textures into 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:21 +01:00
Axel Davy 6bbb7b9fc5 st/nine: Move texture setting to nine_context_*
And move samplers_shadow 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:21 +01:00
Axel Davy c1871e829a st/nine: Track changed.texture only for stateblocks
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:21 +01:00
Axel Davy 64e232bd60 st/nine: Move draw calls to nine_state
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.

v2: Release buffers for Draw*Up functions in device9.c,
instead of nine_context. This prevents a leak with csmt
where the wrong pointers were released.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:21 +01:00
Axel Davy f72d8719eb st/nine: Move core of device clear to nine_state
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:21 +01:00
Axel Davy 1b24d5e1f5 st/nine: Introduce nine_context
nine_context is a new structure which goal will be
to contain all internal states. It will be the states
of the second thread in the to-be-introduced CSMT mode.

This patch moves several internal states to nine_context,
while the next patches add the other fields.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:21 +01:00
Axel Davy e3c59fbd25 st/nine: Implement WFOG properly
We were advertising support for WFOG (like all win drivers),
but we weren't implementing it.
This patch implements the behaviour. See comments.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:21 +01:00
Axel Davy b40f12ebf0 st/nine: Fix ff texture coordinate selection
The code was wrongly detecting which texture coordinates
to generate when the coordinate index was different to
the stage index.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:21 +01:00
Axel Davy c75415224f st/nine: Convert redundant check to assert in ff ps
We disable the alpha stage if the color stage is disabled.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:21 +01:00
Axel Davy 32f6f91617 st/nine: Fix two special cases in ff ps
if first alpha stage is disabled and writes to temp,
diffuse alpha is written to temp.
Last stage always writes to current.

Behaviour was deduced by tests with a test app.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:21 +01:00
Axel Davy 1efdc8f594 st/nine: Remove useless code in ff ps
Current is already initialized to Diffuse.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:21 +01:00
Axel Davy 7afea63d4f st/nine: Fix ff cases when stages should be disabled
When a texture is read by a stage for colorop, it should
be disabled, and disable following stages.

When a texture is read for alphaop, 1.0f is read for the input,
which is the behaviour for a dummy texture.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:21 +01:00
Axel Davy 191b90a35c st/nine: Always initialize current in ff ps
The check was not catching all possible cases.
NVE4 should be fine.

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