Commit Graph

87633 Commits

Author SHA1 Message Date
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
Axel Davy 1ee978fa50 st/nine: Fix check for ff specular
Fix the check for computing ff specular.

This seems to match the opengl behavior,
and give the correct output on windows.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:21 +01:00
Axel Davy 89716b0b38 st/nine: Do not saturate illumination coefficients in ff
Fixes bad rendering of a test app.
Wine has the same behaviour.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:21 +01:00
Axel Davy 877dc0308f st/nine: Fix ff COLOR0 w component computation
The computation was wrong. COLOR0's last component
should be equal to the material diffuse w component.

The behaviour was checked with a test app on Windows.
Wine has the same behaviour.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:21 +01:00
Axel Davy e94ac230a2 st/nine: Fix specular enable for alpha
Apparently specular enable doesn't affect
the alpha channel.

Fixes https://github.com/iXit/Mesa-3D/issues/253

Behaviour comfirmed looking in wine sources.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:21 +01:00
Axel Davy 85811d0e87 st/nine: Ignore MULTISAMPLEMASK when RT is not multisampled
We were ignoring MULTISAMPLEMASK for non-maskable multisample
modes, but we were missing the non-multisampled case.

Fixes a crash in Halo.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:21 +01:00
Axel Davy bce9fe8db2 driconf: Fix missing gettext
DRI_CONF_NINE_OVERRIDEVENDOR was missing gettext for the
description.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:21 +01:00
Axel Davy 59048e7548 st/nine: Add new driconf options to control DISCARD behaviour
See the patch for the new controls added.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:21 +01:00
Axel Davy 06657fa203 st/nine: Rework buffer presentation path
Use the new API for DISCARD.

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