summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* st/nine: Use ff vertex shader when position_t is usedAxel Davy2016-02-047-14/+35
| | | | | | | | | | | | | | | | | | | | When an application sets a vertex shader, we are supposed to use it, and when no vertex shader are set, we are supposed to revert to fixed function vertex shader. It seems there is an exception: when the vertex declaration has a position_t index, we should revert to fixed function vertex shader. Up to know we were checking if device->state.vs is set to know whether to use programmable shader or not. With this commit we determine whether we use programmable shader or not when vertex shader/declaration are set, but stateblocks do complicate things a bit. Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Patrick Rudolph <[email protected]>
* st/nine: Don't increment refcount on VertexDeclaration creation failurePatrick Rudolph2016-02-041-12/+12
| | | | | | | | | NineUnknown_ctor increments the refcount even in case of an error. Restructure the code to prevent refcount increments. Fixes a couple of wine tests. Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Change StretchRect check orderAxel Davy2016-02-041-3/+4
| | | | | | | | | | Textures in SYSTEMMEM don't have resources attached. Instead of returning an error for them, StretchRect was crashing. This changes the check order to fix that case. Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Patrick Rudolph <[email protected]>
* st/nine: Initialize lights in stateblocksAxel Davy2016-02-041-0/+4
| | | | | | | This fixes a crash. Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Patrick Rudolph <[email protected]>
* st/nine: Fix fixed-function blendweightsPatrick Rudolph2016-02-041-4/+13
| | | | | | | | The last weighted element is one minus the sum of all previous weights. Fixes WINE test visual.c test_vertex_blending. Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Always normalize hitDirPatrick Rudolph2016-02-041-2/+3
| | | | | Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Replace r[0] with tmpPatrick Rudolph2016-02-041-14/+14
| | | | | | | Replace r[0] with tmp to ease code reading. Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Fix ff calculation of midVecPatrick Rudolph2016-02-041-2/+2
| | | | | | | | In case of non local viewer the value has to be subtracted. Fixes failing WINE tests in test_specular_lighting() (visual.c) Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Implement D3DRS_SPECULARENABLEPatrick Rudolph2016-02-041-2/+11
| | | | | | | | Implement fixed function D3DRS_SPECULARENABLE. Fixes failing WINE tests in test_specular_lighting() (visual.c) Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Fix D3DRS_LOCALVIEWER being ignoredPatrick Rudolph2016-02-041-0/+2
| | | | | | | Set key->localviewer to D3DRS_LOCALVIEWER. Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Fix rounding issue with vs1.1 a0 regAxel Davy2016-02-041-22/+7
| | | | | | | | | | | | | | | | vs1.1 rounds a0 to lowest integer, while other versions do round to closest. To use the same path as the other versions (with ARR), we were substracting 0.5 for vs1.1 to get round to lowest. This gives wrong result if a0 is set to 0: round(0 - 0.5) = -1 Instead just use ARL for vs1.1 Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Patrick Rudolph <[email protected]>
* st/nine: Fix D3DPMISCCAPS_FOGANDSPECULARALPHA supportAxel Davy2016-02-042-12/+2
| | | | | | | | | | | | The documentation of the flag doesn't make sense. To sum up the doc, if not set, specular alpha contains fog, and if set specular alpha contains 0 (except for ff). However in practice when the flag is there, apps do use specular alpha as if it could be used normally, which makes much more sense than the doc. Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Patrick Rudolph <[email protected]>
* st/nine: Fix AlphaCmpCapsPatrick Rudolph2016-02-041-1/+2
| | | | | | | | | AlphaCmpCaps should advertise D3DPCMPCAPS_NEVER as well. Fixes https://github.com/iXit/Mesa-3D/issues/142 Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* radeonsi: implement PK2H and UP2H opcodesMarek Olšák2016-02-042-1/+75
| | | | | | | | | | | Based on a gallivm patch by Ilia Mirkin. +8 piglit regressions due to precision issues (I blame the tests) The benefit is that we'll get v_cvt_f32_f16 and v_cvt_f16_f32 instead of emulation with integer instructions. They are GLSL 4.00 intrinsics. Reviewed-by: Michel Dänzer <[email protected]>
* glsl: Ensure glsl/ exists before making the lexer/parser.Matt Turner2016-02-041-0/+2
| | | | | | | Reported-by: Jan Ziak <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93989
* i965/fs: Allocate single register at a time for constants.Matt Turner2016-02-041-3/+3
| | | | | | | | | | | | | | | | | No instruction counts changed, but: total cycles in shared programs: 64834502 -> 64781530 (-0.08%) cycles in affected programs: 16331544 -> 16278572 (-0.32%) helped: 4757 HURT: 4288 GAINED: 66 LOST: 20 I remember trying this when I first wrote the pass, but it wasn't helpful at the time. Reviewed-by: Francisco Jerez <[email protected]>
* radeonsi: fix Hyper-Z on StoneyMarek Olšák2016-02-041-0/+4
| | | | | Cc: 11.0 11.1 <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: Use SSE prefetch instructions rather than 3DNow instructionsPatrick Baggett2016-02-041-20/+20
| | | | | | | | | | 64-bit Pentium 4 CPUs don't have the 3DNow prefetch instructions which results in an Illegal instruction crash. Cc: "11.0 11.1" <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Tested-by: Timothy Arceri <[email protected]> https://bugs.freedesktop.org/show_bug.cgi?id=27512
* nv50/ir: make sure to fetch all sources before creating instructionIlia Mirkin2016-02-031-5/+8
| | | | | | | | | We must fetch all sources into the instruction stream before generating the instruction that uses them. Otherwise we'll define values after using them, which won't work so well. Signed-off-by: Ilia Mirkin <[email protected]> Tested-by: Samuel Pitoiset <[email protected]>
* nv50: avoid freeing the symbols if they're about to be storedIlia Mirkin2016-02-031-2/+7
| | | | | | | Spotted by Coverity Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* st/mesa: fix potential null deref if no shader is passed inIlia Mirkin2016-02-031-1/+3
| | | | | | | Spotted by Coverity Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* glx: update to updated version of EXT_create_context_es2_profileIlia Mirkin2016-02-036-21/+31
| | | | | | | | | | | | | | | | | | | | The EXT spec has been updated to: - logically combine the es2_profile and es_profile exts - allow any legal version to be requested dEQP tests request a specific ES version when using GLX, so this allows dEQP upstream to run against GLX with the appropriate X server patch (which had similar disabling logic). Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Matt Turner <[email protected]> (v1) Reviewed-by: Adam Jackson <[email protected]> (v3) v1 -> v2: - distinguish between DRI_API_GLES{,2,3} - add GLX_EXT_create_context_es_profile client-side support v2 -> v3: - fix error in computing mask
* dir-locals.el: set case-label offset to 0Ilia Mirkin2016-02-031-0/+1
| | | | | | | | While this is the default, private .emacs files might have it set to something else. No harm in forcing it to 0. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* appveyor: Bump shallow clone depth.Jose Fonseca2016-02-031-2/+9
| | | | | | | | | | | | | To prevent build failures when a large patch series is committed, like happened in https://ci.appveyor.com/project/jrfonseca-fdo/mesa/build/322 due to 10 commits between dac2964f3ebd96d5ac227984ab0cd79c2c3b2a1a and 6f428328d34bed16edb8709e4a117eb710d7893d where submitted before the build slave started the git clone. 100 commits should be bigger than any patch series seen in practice, and it takes practically the same time to download as 5 commits. Reviewed-by: Roland Scheidegger <[email protected]>
* Revert "compiler: removed unused Makefile.sources"Rob Clark2016-02-031-0/+222
| | | | | | Whoops, didn't mean to push this one. This reverts commit 78f4c555b93eb0951dcd9c5812109d506dd03023.
* compiler: fix .gitignore for glsl_compilerRob Clark2016-02-032-1/+1
| | | | Signed-off-by: Rob Clark <[email protected]>
* compiler: removed unused Makefile.sourcesRob Clark2016-02-031-222/+0
| | | | | | | We seem to end up w/ duplication between compiler/Makefile.sources and compiler/glsl/Makefile.sources. The latter appears unused. Delete it. Signed-off-by: Rob Clark <[email protected]>
* gallium: fix the documentation of PIPE_CAP_MAX_TEXTURE_BUFFER_SIZENicolai Hähnle2016-02-031-1/+1
| | | | | | | | This parameter is equivalent to the corresponding OpenGL implementation limit which is in texels, not bytes. Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium/radeon: support PIPE_CAP_SURFACE_REINTERPRET_BLOCKSNicolai Hähnle2016-02-033-5/+25
| | | | | | | | | This is already used internally in si_resource_copy_region for compressed textures, so the only real change here is the adjusted surface size computation. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* st/mesa: implement PBO upload for glCompressedTex(Sub)ImageNicolai Hähnle2016-02-031-0/+115
| | | | | | | v2: - use st->pbo_upload.enabled flag Reviewed-by: Edward O'Callaghan <[email protected]>
* st/mesa: redirect CompressedTexSubImage to our own implementationNicolai Hähnle2016-02-031-6/+18
| | | | | | This is where PBO upload will go. Reviewed-by: Edward O'Callaghan <[email protected]>
* st/mesa: inline the implementation of _mesa_store_compressed_teximageNicolai Hähnle2016-02-031-1/+27
| | | | | | | We will write our own version of texsubimage for PBO uploads, and we will want to call that here as well. Reviewed-by: Edward O'Callaghan <[email protected]>
* st/mesa: implement PBO upload for multiple layersNicolai Hähnle2016-02-032-19/+143
| | | | | | | | | | Use instancing to generate two triangles for each destination layer and use a geometry shader to route the layer index. v2: - directly write layer in VS if supported by the driver (Marek Olšák) Reviewed-by: Edward O'Callaghan <[email protected]>
* st/mesa: Accelerate PBO uploadsFredrik Höglund2016-02-034-9/+898
| | | | | | | | | | | | | | | | | | | | | | Create a PIPE_BUFFER sampler view on the pixel-unpack buffer, and draw the image on the texture with a fragment shader that maps fragment coordinates to buffer coordinates. Modifications by Nicolai Hähnle: - various cleanups and fixes (e.g. error handling, corner cases) - split try_pbo_upload into two functions, which will allow code to be shared with compressed texture uploads - modify the source format selection to only test for support against the PIPE_BUFFER target v2: - update handling of TGSI_SEMANTIC_POSITION for recent changes in master - MaxTextureBufferSize is number of texels, not bytes (Ilia Mirkin) - only enable when integers are supported (Marek Olšák) - try harder to hit the TextureBufferOffsetAlignment - remove unnecessary MOV from the fragment shader Reviewed-by: Edward O'Callaghan <[email protected]>
* st/mesa: use the correct address generation functions in st_TexSubImage blitNicolai Hähnle2016-02-031-5/+5
| | | | | | | | | | | | | | | | | | We need to tell the address generation functions about the dimensionality of the texture to correctly implement the part of Section 3.8.1 (Texture Image Specification) of the OpenGL 2.1 specification which says: "For the purposes of decoding the texture image, TexImage2D is equivalent to calling TexImage3D with corresponding arguments and depth of 1, except that ... * UNPACK SKIP IMAGES is ignored." Fixes a low impact bug that was found by chance while browsing the spec and extending piglit tests. Cc: "11.0 11.1" <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* gallium: Add PIPE_CAP_SURFACE_REINTERPRET_BLOCKSNicolai Hähnle2016-02-0316-0/+22
| | | | | | | | | | This cap indicates whether pipe->create_surface can reinterpret a texture as a surface with a format of different block width/height (but equal block size). v2: fix whitespace Reviewed-by: Edward O'Callaghan <[email protected]>
* gallium: Add PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLYNicolai Hähnle2016-02-0316-0/+27
| | | | | | | | | This cap indicates that the driver only supports R, RG, RGB and RGBA formats for PIPE_BUFFER sampler views. v2: move into "unsupported features" section for nouveau (Ilia Mirkin) Reviewed-by: Edward O'Callaghan <[email protected]>
* mesa: add MESA_NO_MINMAX_CACHE environment variableNicolai Hähnle2016-02-032-0/+23
| | | | | | | | | | When set to a truish value, this globally disables the minmax cache for all buffer objects. No #ifdef DEBUG guards because this option can be interesting for benchmarking. Reviewed-by: Marek Olšák <[email protected]>
* vbo: disable the minmax cache when the hit rate is lowNicolai Hähnle2016-02-032-2/+34
| | | | | | | | | | | | | | | | | | When applications stream their index buffers, the caches for those BOs become useless and add overhead, so we want to disable them. The tricky part is coming up with the right heuristic for *when* to disable them. The first question is which hit rate to aim for. Since I'm not aware of any interesting borderline applications that do something like "draw two or three times for each upload", I just kept it simple. The second question is how soon we should give up on the caching. Applications might have a warm-up phase where they fill a buffer gradually but then keep reusing it. For this reason, I count the number of indices that hit and miss (instead of the number of calls that hit or miss), since comparing that to the size of the buffer makes sense. Reviewed-by: Marek Olšák <[email protected]>
* mesa: add USAGE_DISABLE_MINMAX_CACHE flag to buffer UsageHistoryNicolai Hähnle2016-02-032-1/+3
| | | | Reviewed-by: Marek Olšák <[email protected]>
* vbo: cache/memoize the result of vbo_get_minmax_indices (v3)Nicolai Hähnle2016-02-034-1/+186
| | | | | | | | | | | | | | | | | | | | | | | | | Some games developers are unaware that an index buffer in a VBO still needs to be read by the CPU if some varying data comes from a user pointer (unless glDrawRangeElements and friends are used). This is particularly bad when they tell us that the index buffer should live in VRAM. This cache helps, e.g. lifting This War Of Mine (a particularly bad offender) from under 10fps to slightly over 20fps on a Carrizo. Note that there is nothing prohibiting a user from rendering from multiple threads simultaneously with the same index buffer, hence the locking. (The internal buffer map taken for the buffer still leads to a race, but at least the locks are a move in the right direction.) v2: disable the cache on USAGE_TEXTURE_BUFFER as well (Chris Forbes) v3: - use bool instead of GLboolean for MinMaxCacheDirty (Ian Romanick) - replace the sticky USAGE_PERSISTENT_WRITE_MAP bit by a direct AccessFlags check Reviewed-by: Chris Forbes <[email protected]> (v2) Reviewed-by: Marek Olšák <[email protected]>
* vbo: move vbo_get_minmax_indices into its own source fileNicolai Hähnle2016-02-033-148/+180
| | | | | | | | We will add more code for caching/memoization. Moving the existing code into its own file helps keep things modular. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/main: bail earlier for size == 0 in _mesa_clear_buffer_sub_dataNicolai Hähnle2016-02-031-8/+8
| | | | | | | | | Note that the conversion of the clear data (when data != NULL) can fail due to an out of memory condition, but it does not check any error conditions mandated by the spec. Therefore, it is safe to skip when size == 0. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/main: add USAGE_PIXEL_PACK_BUFFER flag to buffer UsageHistoryNicolai Hähnle2016-02-032-0/+10
| | | | | | | | We will want to disable minmax index caching for buffers that are used in this way. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/main: add USAGE_TRANSFORM_FEEDBACK_BUFFER flag to buffer UsageHistoryNicolai Hähnle2016-02-032-0/+4
| | | | | | | | We will want to disable minmax index caching for buffers that are used in this way. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* util/hash_table: add _mesa_hash_table_num_entriesNicolai Hähnle2016-02-032-3/+6
| | | | Reviewed-by: Marek Olšák <[email protected]>
* util/hash_table: add _mesa_hash_table_clear (v4)Nicolai Hähnle2016-02-034-0/+120
| | | | | | v4: coding style change (Matt Turner) Reviewed-by: Ian Romanick <[email protected]> (v3)
* st/omx/dec/h264: fix corruption when scaling matrix present flag setLeo Liu2016-02-021-2/+5
| | | | | | | | | | | The scaling list should be filled out with zig zag scan v2: integrate zig zag scan for list 4x4 to vl(Christian) v3: move list determination out from the loop(Ilia) Cc: "11.0 11.1" <[email protected]> Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Christian König <[email protected]>
* vl: add zig zag scan for list 4x4Leo Liu2016-02-022-0/+8
| | | | | | Cc: "11.0 11.1" <[email protected]> Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Christian König <[email protected]>
* llvmpipe: use scissor_planes_needed helper functionRoland Scheidegger2016-02-033-18/+33
| | | | So it doesn't get out of sync in multiple places.