Commit Graph

69718 Commits

Author SHA1 Message Date
Axel Davy 231be57ee2 st/nine: Remove Managed texture hack.
Previously binding an unitialized managed texture
was causing a crash, and a workaround was added to
prevent the crash.

This patch removes this workaround and instead set the initial
state of managed textures as dirty, so that when the texture is bound
for the first time, it is always initialized.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2015-04-29 08:28:11 +02:00
Axel Davy 58d295d41e st/nine: Enforce LOD 0 for D3DUSAGE_AUTOGENMIPMAP
For D3DUSAGE_AUTOGENMIPMAP textures, applications can only
lock/copy from/get surface descriptor for/etc the first level.
Thus it makes sense to restrict the LOD to 0, and use only the first
level to generate the sublevels.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2015-04-29 08:28:11 +02:00
Axel Davy 6f57e01436 st/nine: Some D3DUSAGE_AUTOGENMIPMAP fixes
Signed-off-by: Axel Davy <axel.davy@ens.fr>
2015-04-29 08:28:11 +02:00
Axel Davy 24eca6a30d st/nine: util_gen_mipmap doesn't need we reset states.
util_gen_mipmap uses pipe->blit, and thus doesn't need
we restore all states after using it.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2015-04-29 08:28:11 +02:00
Axel Davy 7a7758c552 st/nine: D3DUSAGE_AUTOGENMIPMAP is forbidden for volumes
Signed-off-by: Axel Davy <axel.davy@ens.fr>
2015-04-29 08:28:11 +02:00
Axel Davy ec411d9b74 st/nine: Fix NineBaseTexture9_PreLoad
It wasn't uploading the texture when the lod
had changed.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2015-04-29 08:28:11 +02:00
Axel Davy b45fa97a22 st/nine: Rewrite Managed texture uploads
That part of the code was quite obscure.
This new implementation tries to make it clearer
by separating the differents parts, and commenting more.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2015-04-29 08:28:11 +02:00
Axel Davy 090ebc7638 st/nine: Bound the dirty regions to resource size
Signed-off-by: Axel Davy <axel.davy@ens.fr>
2015-04-29 08:28:11 +02:00
Axel Davy 520e36f89c st/nine: Simplify Surface9 Managed resources implementation
Remove the Surface9 code for dirty rects, used only for Managed
resources. Instead convey the information to the parent texture.

According to documentation, this seems to be the expected behaviour,
and if documentation is wrong there, that's not a problem since it can
only leads to more texture updates in corner cases.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2015-04-29 08:28:11 +02:00
Axel Davy 4c2247ac60 st/nine: Remove impossible cases with Managed textures
Copying to/from a Managed texture is forbidden.
Rendering to a Managed texture is forbidden.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2015-04-29 08:28:11 +02:00
Axel Davy e558ce98f2 st/nine: Encapsulate variables for MANAGED resource
Signed-off-by: Axel Davy <axel.davy@ens.fr>
2015-04-29 08:28:11 +02:00
Axel Davy 35fe920e1e st/nine: Rework texture data allocation
Some applications assume the memory for multilevel
textures is allocated per continuous blocks.

This patch implements that behaviour.

v2: cache offsets

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
2015-04-29 08:28:11 +02:00
Axel Davy 54f8e8a18d st/nine: Fix update_vertex_elements bad rebase
This code was supposed to be removed, but a rebase seems to have
made it stay.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
2015-04-29 08:28:11 +02:00
Axel Davy 87868d3832 st/nine: Add debug warning when application uses sw processing
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
2015-04-29 08:28:11 +02:00
Axel Davy 4acbf420d1 st/nine: Rework update_vertex_buffers
Previous code was trying to optimise to call set_vertex_buffers on
big packets, and thus avoids as many calls as possible.

However in practice doing so won't be faster (drivers implement
set_vertex_buffers by a loop over the buffers we want to bind)

When we want to unbind a buffer, we were calling set_vertex_buffers
on a buffer with vtxbuf->buffer = NULL. It works on some drivers,
but not on all of them, because it isn't in Gallium spec.
This patch fixes that.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
2015-04-29 08:28:11 +02:00
Xavier Bouchoux 5beb411bf7 st/nine: Fix computation of const_used_size
Was sometimes too large for PS.

Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Xavier Bouchoux <xavierb@gmail.com>
2015-04-29 08:28:10 +02:00
Axel Davy 559342d01d gallium/svga: Remove useless ARRAY_SIZE declaration
This is already declared in util/macros.h

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
2015-04-29 08:28:10 +02:00
Axel Davy 64880d073a util/macros: Move DIV_ROUND_UP to util/macros.h
Move DIV_ROUND_UP to a shared location accessible everywhere

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
2015-04-29 08:28:10 +02:00
Xavier Bouchoux 405c7d7511 st/nine: Fix behaviour of D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING
Ignore D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING when
D3DUSAGE_RENDERTARGET is not specified.

This behaviour matches windows drivers.

Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Xavier Bouchoux <xavierb@gmail.com>
2015-04-29 08:28:10 +02:00
Xavier Bouchoux d838fe8243 st/nine: Improve D3DQUERYTYPE_TIMESTAMP
Avoid blocking when retrieving D3DQUERYTYPE_TIMESTAMP result with
NineQuery9_GetData(), when D3DGETDATA_FLUSH is not specified.
This mimics Win behaviour and gives slightly better performance
for some games.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Xavier Bouchoux <xavierb@gmail.com>
2015-04-29 08:28:10 +02:00
Xavier Bouchoux 851abb9145 st/nine: Fix D3DQUERYTYPE_TIMESTAMPFREQ query
D3DQUERYTYPE_TIMESTAMPFREQ is supposed to give the frequency
at which the clock of D3DQUERYTYPE_TIMESTAMP runs.

PIPE_QUERY_TIMESTAMP returns a value in ns, thus the corresponding
frequency is 1000000000.
PIPE_QUERY_TIMESTAMP_DISJOINT returns the frequency at which
PIPE_QUERY_TIMESTAMP value is updated. It isn't always
1000000000.

Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Xavier Bouchoux <xavierb@gmail.com>
2015-04-29 08:28:10 +02:00
Tiziano Bacocco 31bb4cd5c6 st/nine: Change x86 FPU Control word on device creation
As on wined3d and windows, when D3DCREATE_FPU_PRESERVE is not
specified, change the fpu control word to all exceptions masked,
single precision, round to nearest.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Tiziano Bacocco <tizbac2@gmail.com>
2015-04-29 08:28:10 +02:00
Axel Davy e7b1a1e57c st/nine: Do not advertise D3DDEVCAPS_TEXTURESYSTEMMEMORY
No major vendor advertises it, and we weren't supporting it.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
2015-04-29 08:28:10 +02:00
Axel Davy 907f28f87e st/nine: Fix comment in update_viewport
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
2015-04-29 08:28:10 +02:00
Axel Davy 6e825b69bd st/nine: Workaround barycentrics issue on some cards
Signed-off-by: Axel Davy <axel.davy@ens.fr>
2015-04-29 08:28:10 +02:00
Xavier Bouchoux f3fd06e94d st/nine: Clear struct pipe_blit_info before use.
render_condition_enable was uninitialized.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Xavier Bouchoux <xavierb@gmail.com>
2015-04-29 08:28:10 +02:00
Patrick Rudolph 77a38d2088 st/nine: NineDevice9_Clear skip fastpath for bigger depth-buffers
This adds an additional check to make sure the bound depth-buffer doesn't
exceed the rendertarget size when clearing depth and color buffer at once.
D3D9 clears only a rectangle with the same dimensions as the viewport, leaving
other parts of the depth-buffer intact.

This fixes failing WINE test visual.c:depth_buffer_test()

Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
2015-04-29 08:28:10 +02:00
Axel Davy 716bef2643 st/nine: Fix wrong assert in nine_shader
The sampler src index was wrong for texldl and texldd

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
2015-04-29 08:28:10 +02:00
Axel Davy 8d3e063e68 st/nine: Handle special LIT case
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
2015-04-29 08:28:10 +02:00
Jose Fonseca 114ac39a88 mesa: Fix glGetProgramiv(GL_ACTIVE_ATTRIBUTES).
It's returning random values, because RESOURCE_VAR() is casting
different objects into ir_variable pointers.

This updates _mesa_count_active_attribs to filter the resources with the
same logic used in _mesa_longest_attribute_name_length.

https://bugs.freedesktop.org/show_bug.cgi?id=90207

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2015-04-29 06:42:12 +01:00
Marc-André Lureau c66c158e59 egl: misc fixes for EGL_MESA_image_dma_buf_export
Fix define and a function argument name introduced in commit
8f7338f284

Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-04-29 15:13:19 +10:00
Ilia Mirkin 6fe0d4f035 nvc0/ir: flush denorms to zero in non-compute shaders
This will set the FTZ flag (flush denorms to zero) on all opcodes that
can take it.

This resolves issues in Unigine Heaven 4.0 where there were solid-filled
boxes popping up.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89455
Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-04-28 20:17:03 -04:00
Brian Paul 66985d2a6d meta: remove unneeded #include colortab.h
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-04-28 12:27:48 -06:00
Brian Paul 7e8de8219f mesa: remove unneeded #include colortab.h
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-04-28 12:27:48 -06:00
Brian Paul 7c1be009b7 mesa: remove unused options var in compile_shader()
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-04-28 12:27:48 -06:00
Brian Paul 3597a0de94 docs: more details about Viewperf 12 medical-01 test issues 2015-04-28 12:27:48 -06:00
Ilia Mirkin e312a69958 nvc0: expose GLSL version 410
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-04-28 12:48:22 -04:00
Ilia Mirkin b5947984cd st/mesa: allow glsl version up to 410, enable ARB_shader_precision
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2015-04-28 12:48:22 -04:00
Leo Liu 2d4a890c0b st/va: add h264 decoder level support
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2015-04-28 17:42:52 +02:00
Leo Liu b2596efeb7 st/omx/dec: add h264 decoder level support
v2: use sps level idc as level to driver

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2015-04-28 17:42:45 +02:00
Leo Liu 1a5e2bb5ce vl: add level idc in sps
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2015-04-28 17:42:39 +02:00
Leo Liu ef1ae703a9 st/omx/dec: separate create_video_codec to different codecs
v2: get frame size from port info

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2015-04-28 17:42:35 +02:00
Leo Liu d043b51ba4 st/vdpau: add h264 decoder level support
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2015-04-28 17:42:29 +02:00
Leo Liu 4509fc8b94 gallium/util: get h264 level based on number of max references and resolution
v2: add commments for limitation of max references numbers,
and what the caculation is based

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2015-04-28 17:42:25 +02:00
Marek Olšák 6d05396b00 r600g,radeonsi: add a driver query returning GPU load
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-04-28 16:05:45 +02:00
Marek Olšák 0b8e73a6ae r600g,radeonsi: add driver queries for GPU temperature and shader+memory clocks
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-04-28 16:05:45 +02:00
Ilia Mirkin 9143940da2 gm107/ir: add lane/vertex count sysvals
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-04-27 21:25:29 -04:00
Ilia Mirkin 89e0b08794 gk110/ir: add support for writing per-patch and shader outputs
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-04-27 21:25:28 -04:00
Ilia Mirkin 52614f59b7 freedreno/a3xx: color masking works like a blend for some formats
When there is a colormask active that does not cover all the channels,
enable reading in the destination like with a combining blend
operation. This fixes fbo-blending-formats on a3xx.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-04-27 20:17:07 -04:00
Ilia Mirkin 9fc3f47278 freedreno/a3xx: add support for S8 and Z32F_S8
Enables ARB_depth_buffer_float. There is no sampling support for
interleaved Z32F_S8, so we store the two textures separately, one as
Z32F, the other as S8. As a result, we need a lot of additional logic
for restores and transfers.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-04-27 20:17:07 -04:00