aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* swrast: remove unneeded __NOT_HAVE_DRM_H defineEmil Velikov2015-07-221-1/+0
| | | | | | No longer applicable since the cleanup of dri_interface.h. Signed-off-by: Emil Velikov <[email protected]>
* dri/common: use HAVE_LIBDRM over __NOT_HAVE_DRM_HEmil Velikov2015-07-224-18/+5
| | | | | | See previous commit message for details. Signed-off-by: Emil Velikov <[email protected]>
* loader: use HAVE_LIBDRM instead of ! __NOT_HAVE_DRM_HEmil Velikov2015-07-225-15/+8
| | | | | | | | Double negatives in English language are normally avoided, plus the former seems cleaner and more consistent. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* st/dri: unwrap/remove __NOT_HAVE_DRM_H magicEmil Velikov2015-07-224-23/+1
| | | | | | | | | | | | | | | With the dri_interface.h clean of the macro, we can remove the final only st/dri specific use of the very same. Seemingly it was incorrectly used, as the build-time presence of dri2 is not libdrm specific. At run-time, the code is already limited to dri2 use-cases plus returning true, when the extension is not present (or too old) will likely lead to a crash as one tries to use it shortly after the dri_with_format() call. As a side effect this gives us a nice cleanup the builds. Signed-off-by: Emil Velikov <[email protected]>
* dri/swrast: automake: add LIBDRM_CFLAGSEmil Velikov2015-07-221-0/+1
| | | | | | | | | | | | | With the follow up commit we'll remove the __NOT_HAVE_DRM_H macro. As requested by Ian HAVE_LIBDRM will be used instead, which will lead to swrast including drm.h when libdrm package is available, even though we don't need/make use of the header. As the define is added after the AM_CFLAGS we cannnot use -UHAVE_LIBDRM, but instead let's just add LIBDRM_CFLAGS. The latter of which will expand to NULL when the libdrm package is not around. Signed-off-by: Emil Velikov <[email protected]>
* mesa: fix typo s/glGetTextImage/glGetTexImage/Brian Paul2015-07-221-1/+1
| | | | Trivial.
* radeonsi: Flush when we're asked to return a fence but don't have one yetMichel Dänzer2015-07-221-1/+2
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: fix misleading commentTimothy Arceri2015-07-221-2/+0
| | | | Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* mesa: fix active sampler conflict validationTimothy Arceri2015-07-221-7/+13
| | | | | | | | | The type stored in gl_uniform_storage is the type of a single array element not the array type so size was always 1. V2: Dont validate sampler units pointing to 0 Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* glsl: check for leading zeros in array index validationTimothy Arceri2015-07-221-0/+4
| | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* swrast: remove unneeded & operators in _swrast_choose_texture_sample_func()Brian Paul2015-07-211-28/+28
| | | | | Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: move check for no-op glShadeModel call earlierBrian Paul2015-07-211-3/+3
| | | | | Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: move check for no-op glAlphaFunc call earlierBrian Paul2015-07-211-3/+3
| | | | | Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: move check for no-op glFrontFace call earlierBrian Paul2015-07-211-3/+3
| | | | | | | If the new mode matches the current mode, there can be no error. Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: s/GLint/GLsizei/ for consistencyBrian Paul2015-07-211-1/+1
| | | | Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: enable GL_ARB_get_texture_sub_image for all driversBrian Paul2015-07-211-0/+1
| | | | Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: add API dispatch for GL_ARB_get_texture_sub_imageBrian Paul2015-07-214-1/+49
| | | | | | | | | | | This adds the new glGetTextureSubImage() and glGetCompressedTextureSubImage() functions. Also update the dispatch sanity test program. v2: remove stray brace, move xi:include line in gl_API.xml, fix extension number typo, s/program/texture/ in xml file. Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: add new _mesa_Get[Compressed]TextureSubImage() functionsBrian Paul2015-07-212-1/+76
| | | | | | Simple implementations in terms of get_[compressed_]texture_image(). Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: overhaul the glGetCompressedTexImage codeBrian Paul2015-07-211-142/+198
| | | | | | | Same idea as the previous patch. v2: a few clean-ups spotted by Ilia Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: overhaul the glGetTexImage codeBrian Paul2015-07-211-195/+428
| | | | | | | | | | | | | | 1. Reorganize the error checking code. 2. Lay groundwork for getting sub images by passing image offset and dimensions to the error checking code. 3. Implement _mesa_GetnTexImageARB(), _mesa_GetTexImage() and _mesa_GetTextureImage() all in terms of get_texture_image(). v2: pass offset/width/height/depth arguments to the error checking function, avoid using magic width/height/depth values. v3: remove unused bufSize param to get_texture_image() Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: 80-column wrapping in texgetimage.cBrian Paul2015-07-211-5/+8
| | | | Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: replace Driver.GetCompressedTexImage() w/ GetCompressedTexSubImage()Brian Paul2015-07-215-20/+30
| | | | | | | For now, pass offsets of zero and width/height/depth equal to the whole image. Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: make _mesa_get_[compressed_]texture_image() staticBrian Paul2015-07-212-19/+12
| | | | | | These functions are only called from teximage.c Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: plumb offset/size parameters through GetTexSubImage codeBrian Paul2015-07-211-57/+80
| | | | | | | | | | | | | | Needed for GL_ARB_get_texture_sub_image. But at this point, the offsets are always zero and the sizes match the whole texture image. v2: Fixes, suggestions from Laura Ekstrand: * Fix calls to ctx->Driver.UnmapTextureImage() to pass the correct slice value. * Added comments and assertions to check zoffset+depth<=tex->Depth before the 'img' loops. * Added a new zoffset==0 assert in get_tex_memcpy(). Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: replace Driver.GetTexImage with GetTexSubImage()Brian Paul2015-07-2110-54/+83
| | | | | | | | | | | | | | | The new driver hook has x/y/zoffset and width/height/depth parameters for the new glGetTextureSubImage() function. The meta code and gallium state tracker are updated to handle the new parameters. Callers to Driver.GetTexSubImage() pass in offsets=0 and sizes equal to the whole texture size. v2: update i965 driver code, s/GLint/GLsizei/ in GetTexSubImage hook Reviewed-by: Ilia Mirkin <[email protected]>
* meta: add offset, width, height parameters to decompress_texture_image()Brian Paul2015-07-211-5/+5
| | | | | | In preparation for decompressing texture sub images. Reviewed-by: Ilia Mirkin <[email protected]>
* meta: handle subimages in _mesa_meta_setup_texture_coords()Brian Paul2015-07-213-33/+65
| | | | | | v2: fix depth, total_depth mix-up in meta.h, per Laura Ekstrand. Reviewed-by: Anuj Phogat <[email protected]>
* mesa: assorted whitespace, formatting fixes in teximage.cBrian Paul2015-07-211-20/+10
| | | | Trivial.
* mesa: allow GL_TEXTURE_CUBE_MAP_ARRAY case for glCompressedTexSubImage3D()Brian Paul2015-07-211-1/+1
| | | | | | | | | | | Since s3tc works for cube maps and 2D arrays, it should also work for cube arrays. NVIDIA's driver supports this too. Seems like the spec should say this. This is a minor follow-on fix for the commit "mesa: fix up some texture error checks". Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: include stdarg.h for va_listJonathan Gray2015-07-211-0/+1
| | | | | | | | | | | Include stdarg.h for va_list. Unbreaks the build on OpenBSD: In file included from mesa/program/dummy_errors.c:24: ../src/mesa/main/errors.h:85: error: expected declaration specifiers or '...' before 'va_list' Signed-off-by: Jonathan Gray <[email protected]> Acked-by: Matt Turner <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* gallium: replace INLINE with inlineIlia Mirkin2015-07-21395-1522/+1515
| | | | | | | | | | | | | | | | Generated by running: git grep -l INLINE src/gallium/ | xargs sed -i 's/\bINLINE\b/inline/g' git grep -l INLINE src/mesa/state_tracker/ | xargs sed -i 's/\bINLINE\b/inline/g' git checkout src/gallium/state_trackers/clover/Doxyfile and manual edits to src/gallium/include/pipe/p_compiler.h src/gallium/README.portability to remove mentions of the inline define. Signed-off-by: Ilia Mirkin <[email protected]> Acked-by: Marek Olšák <[email protected]>
* nvc0: force cache flush when binding a new uboSamuel Pitoiset2015-07-211-0/+2
| | | | | | | | This fixes the following piglit test: ext_transform_feedback-immediate-reuse-uniform-buffer Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* nv50: force cache flush when binding a new uboSamuel Pitoiset2015-07-211-0/+2
| | | | | | | | This fixes the following piglit test: ext_transform_feedback-immediate-reuse-uniform-buffer Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* st/mesa: Silence GCC unused-variable warning.Vinson Lee2015-07-211-0/+1
| | | | | | | | | | | | Silence a release build warning. st_glsl_to_tgsi.cpp: In function 'pipe_error st_translate_program(gl_context*, uint, ureg_program*, glsl_to_tgsi_visitor*, const gl_program*, GLuint, const GLuint*, const GLuint*, const ubyte*, const ubyte*, const GLuint*, const GLuint*, GLuint, const GLuint*, const GLuint*, const ubyte*, const ubyte*, boolean, boolean)': st_glsl_to_tgsi.cpp:5461:36: warning: unused variable 'pscreen' [-Wunused-variable] struct pipe_screen *pscreen = st->pipe->screen; ^ Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* r600/sb: Fix an &/&& mistakeAdam Jackson2015-07-211-1/+1
| | | | | | | | | | | | | | | gcc says: sb/sb_sched.cpp: In member function 'bool r600_sb::alu_group_tracker::try_reserve(r600_sb::alu_node*)': sb/sb_sched.cpp:492:7: warning: suggest parentheses around operand of '!' or change '&' to '&&' or '!' to '~' [-Wparentheses] if (!trans & fbs) It happens to be harmless; if fbs is ever non-zero, it will be VEC_210, which is 5, so (!trans & 5) == 1 and the branch works as expected. But logical AND is clearly what was meant. Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Adam Jackson <[email protected]>
* Revert "i965/gen9: Plugin the code for selecting YF/YS tiling on skl+"Anuj Phogat2015-07-211-92/+17
| | | | | | | | | | | | | | Commit c9dbdc0 introduced some dead code which is supposed to be used once we have Yf/Ys tiling working and performing better. Ken reported the issue that static analysis tool now shows warnings due to the dead code. To fix these warnings, this patch reverts the changes made in commit c9dbdc0. It'll be better to add the Yf/Ys tiling selection code later, when we are ready to use it. Signed-off-by: Anuj Phogat <[email protected]> Acked-by: Kenneth Graunke <[email protected]>
* i965: Fix stride field for the result of emit_uniformize().Francisco Jerez2015-07-214-19/+26
| | | | | | | | | | | | | | | | | | | This is essentially the same problem fixed in an earlier patch for immediates. Setting the stride to zero will be particularly useful for my future SIMD lowering pass, because we will be able to just check whether the stride of a source register is zero and skip emitting the copies required to unzip it in that case. Instead of setting stride to zero in every caller of emit_uniformize() I've changed the function to return the result as its return value (previously it was being written into a caller-provided destination register), because this way we can enforce that the result is used with the correct regioning from the function itself. The changes to the prototype of its VEC4 counterpart are mainly for the sake of symmetry, VEC4 registers don't have stride. Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* i965/fs: Fix stride field for uniforms.Francisco Jerez2015-07-211-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes essentially the same problem as for immediates. Registers of the UNIFORM file are typically accessed according to the formula: read_uniform(r, channel_index, array_index) = read_element(r, channel_index * 0 + array_index * 1) Which matches the general direct addressing formula for stride=0: read_direct(r, channel_index, array_index) = read_element(r, channel_index * stride + array_index * max{1, stride * width}) In either case if reladdr is present the access will be according to the composition of two register regions, the first one determining the per-channel array_index used for the second, like: read_indirect(r, channel_index, array_index) = read_direct(r, channel_index, read(r.reladdr, channel_index, array_index)) where: read(r, channel_index, array_index) = if r.reladdr == NULL then read_direct(r, channel_index, array_index) else read_indirect(r, channel_index, array_index) In conclusion we can handle uniforms consistently with the other register files if we set stride to zero. After lowering to a GRF using VARYING_PULL_CONSTANT_LOAD in demote_pull_constant_loads() the stride of the source is set to one again because the result of VARYING_PULL_CONSTANT_LOAD is generally non-uniform. Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* i965/fs: Fix stride for immediate registers.Francisco Jerez2015-07-212-0/+7
| | | | | | | | | | | | | | | | | | | When the width field was removed from fs_reg the BROADCAST handling code in opt_algebraic() started to miss a number of trivial optimization cases resulting in the ugly indirect-addressing sequence to be emitted unnecessarily for some variable-indexed texturing and UBO loads regardless of one of the sources of BROADCAST being immediate. Apparently the reason was that we were setting the stride field to one for immediates even though they are typically uniform. Width used to be set to one too which is why this optimization used to work previously until the "reg.width == 1" check was removed. The stride field of vector immediates is intentionally left equal to one, because they are strictly speaking not uniform. The assertion in fs_generator makes sure that immediates have the expected stride as consistency check. Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* i965/vec4: Fix liveness analysis with BRW_OPCODE_SELIago Toral Quiroga2015-07-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | We only consider a vgrf defined by a given block if the block writes to it unconditionally. So far we have been checking this by testing that the instruction is not predicated, however, in the case of BRW_OPCODE_SEL, the predication is used to select the value to write, not to decide if the write is actually done. The consequence of this was increased life spans for affected vgrfs, which could lead to additional register pressure. Since NIR generates selects for conditional writes this was causing massive register pressure in a handful of piglit and dEQP tests that had a large number of select operations with the NIR-vec4 backend. Fixes the following piglit tests with the NIR-vec4 backend: spec/glsl-1.50/execution/variable-indexing/vs-output-array-vec4-index-wr-before-gs spec/glsl-1.50/execution/variable-indexing/gs-input-array-vec4-index-rd spec/glsl-1.50/execution/variable-indexing/vs-output-array-vec2-index-wr-before-gs spec/glsl-1.50/execution/variable-indexing/vs-output-array-vec3-index-wr-before-gs spec/glsl-1.50/execution/variable-indexing/vs-output-array-float-index-wr-before-gs Fixes 80 dEQP tests with the NIR-vec4 backend in the following category: dEQP-GLES3.functional.ubo.* Reviewed-by: Francisco Jerez <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Rename _mesa_lookup_enum_by_nr() to _mesa_enum_to_string().Kenneth Graunke2015-07-2086-423/+423
| | | | | | | Generated by sed; no manual changes. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* nouveau: use bool instead of booleanSamuel Pitoiset2015-07-2170-679/+679
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Acked-by: Ilia Mirkin <[email protected]>
* gallivm: Initialize LLVM Modules's DataLayout to an empty string.Tom Stellard2015-07-201-5/+23
| | | | | | | | | | | | | | This fixes crashes in llvmpipe with LLVM 3.8 and also some piglit tests on radeonsi that use the draw module. This is just a temporary solution. The correct solution will require creating a TargetMachine during gallivm initialization and pulling the DataLayout from there. This will be a somewhat invasive change, and it will need to be validatated on multiple LLVM versions. https://llvm.org/bugs/show_bug.cgi?id=24172 Reviewed-by: Roland Scheidegger <[email protected]>
* nvc0: add a missing parameter to nvc0_set_shader_images()Samuel Pitoiset2015-07-201-3/+3
| | | | | | | | | | | This fixes a compilation warning introduced in commit 05a12c5 (gallium: add interface for writable shader images). While we are at it, fix indentation and rename parameters according to the gallium interface. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* nouveau: always align buffers to 0x100Samuel Pitoiset2015-07-201-7/+1
| | | | | | | | | | | | | | Only constbufs must be aligned to 0x100, but since all buffers can be rebinded as constant buffers they must be also aligned. This patch prevents this behaviour by aligning everything to 256-byte increments at buffer creation. This fixes dmesg fails for the following piglit test: ext_transform_feedback-immediate-reuse-uniform-buffer -auto -fbo Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* nv50: limit the maximum number of samplers to 16Samuel Pitoiset2015-07-201-1/+1
| | | | | | | | | | | | | | NV50_3D_BIND_TSC only allows to bind 16 samplers, and since we don't want to do anything with NV50_3D_BIND_TSC2, just limit the maximum number of samplers to 16 like for nvc0. This fixes dmesg fails with the following piglit test: max-samplers But the test still fails. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* nv50: turn samples counts off during blitSamuel Pitoiset2015-07-201-0/+11
| | | | | | | | Fixes the following piglit test: occlusion_query_meta_no_fragments Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* nv50: add nesting support for occlusion queriesSamuel Pitoiset2015-07-202-11/+20
| | | | | | | This is loosely based on nvc0. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* i965/nir/fs: removed unneeded support for global variablesAlejandro Piñeiro2015-07-203-14/+4
| | | | | | | As functions are inlined, and nir_lower_global_vars_to_local gets run, all global variables are lowered to local variables. Reviewed-by: Kenneth Graunke <[email protected]>
* nv50: fix max level clamping on G80Ilia Mirkin2015-07-201-2/+9
| | | | | | | | | It appears that the G80 did not have support for the sampler view first/last clamping. Put the view's last level in the place of the texture's so that it doesn't go past what the sampler view allows. Signed-off-by: Ilia Mirkin <[email protected]> Cc: [email protected]