Commit Graph

87767 Commits

Author SHA1 Message Date
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
Axel Davy 35ea402a24 st/nine: Fix a leak in Swapchain dtor
Count properly the number of backbuffers,
and use the new info to release the correct
number of buffers

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:21 +01:00
Axel Davy f78cbbdfaa d3dadapter/present: Add precision for WaitBufferReleased
Add precision on the behaviour of WaitBufferReleased.
All implementers and users of the API were expecting
that behaviour.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:21 +01:00
Axel Davy 0eef5491d3 d3dadapter/present: Add new API to ID3DPresent
The API will enable better support for the commonly
used DISCARD swapchain parameter.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:21 +01:00
Axel Davy b2f17e5f62 st/nine: Silent warnings with guid_str
In non-debug build, the variables are unused,
and thus trigger a compilation warning.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:21 +01:00
Axel Davy 2cd8622fb3 st/nine: Do not generate gallium NOP on d3d NOP
Some drivers crash if NOP is generated.
Besides there is no point to generate NOP.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:21 +01:00
Axel Davy 461e03167e st/nine: Fix leak in user constant upload path
The new code properly releases the previous buffers
allocated.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:21 +01:00
Axel Davy c3e5140142 st/nine: Correctly release sw cursor image
cursor.image is used for software cursor
emulation. It wasn't released.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:21 +01:00
Axel Davy 9c0f65e08a st/nine: Handle when cursor stride is not what is expected
SetCursor assumes for now a 32x32 argb cursor with pitch 128.
32x32 argb doesn't have pitch 128 on all hw, thus use a
temporary surface with the correct pitch when needed.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:21 +01:00
Axel Davy e7a0f580a6 st/nine: Avoid crash on empty Draw*Up
Ignore empty draw calls.
Avoid assertion fault when such draw calls happen
in u_upload_mgr.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:20 +01:00
Axel Davy ada0c2ceaa st/nine: Capture texturestage states in pixel stateblocks
pixels stateblocks need to capture these.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:20 +01:00
Axel Davy 8b021be769 st/nine: Add missing changed states to pixel stateblocks
Some states were not properly recorded in pixel stateblocks.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:20 +01:00
Axel Davy b3b593b83b st/nine: Add some debug info in stateblocks
This is useful to check what is exactly recorded.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:20 +01:00
Axel Davy fad0f147fb st/nine: Remove useless check in surface9 ctor
Textures already have the check in BaseTexture9.
Non-Textures cannot be in the MANAGED Pool.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:20 +01:00
Axel Davy 503d729029 st/nine: Fix bad light initialization in stateblocks
src was initialized instead of dst.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:20 +01:00
Axel Davy 9be94d5c1a st/nine: Remove unused ff.changed.group
It was unused.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-12-20 23:44:20 +01:00
Axel Davy 638b70985d st/nine: Fix ps multisample check
We want to use centroid for nonmaskable
multisampling as well.

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