summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Revert "main: _mesa_cube_level_complete checks NumLayers."Laura Ekstrand2015-03-171-4/+0
| | | | | | | | | | | | | | | | | This reverts commit 1ee000a0b6737d6c140d4f07b6044908b8ebfdc7. Failures with the GLES3 conformance suite and Synmark2 OGLHdrBloom revealed that this commit was in error. Extensive testing with Piglit prior to patch review and upstreaming did not reveal this problem because, in the few Piglit tests that test for cube completeness, NumLayers = 6. This is because all of the existing tests use TextureStorage to initialize the texture, which sets NumLayers. A new Piglit test has been sent to the mailing list that reproduces the bug related to this patch ("texturing: Testing glGenerateMipmap(GL_TEXTURE_CUBE_MAP) without glTexStorage2D"). Reviewed-by: Jason Ekstrand <[email protected]>
* i965/skl: Send a message header when doing constant loads SIMD4x2Neil Roberts2015-03-173-6/+53
| | | | | | | | | | | | | | Commit 0ac4c272755c7 made it add a header for the send message when using SIMD4x2 on Skylake because without this it will end up using SIMD8D. However the patch missed the case when a sampler is being used to implement constant loads from a buffer surface in a SIMD4x2 vertex shader. This fixes 29 Piglit tests, mostly related to the ARL instruction in vertex programs. Reviewed-by: Kristian Høgsberg <[email protected]> Tested-by: Anuj Phogat <[email protected]>
* i965/fs: in MAD optimizations, switch last argument to be immediateTapani Pälli2015-03-171-1/+10
| | | | | | | | | | | | | | | | | Commit bb33a31 introduced optimizations that transform cases of MAD in to simpler forms but it did not take in to account that src[0] can not be immediate and did not report progress. Patch switches src[0] and src[1] if src[0] is immediate and adds progress reporting. If both sources are immediates, this is taken care of by the same opt_algebraic pass on later run. v2: Fix for all cases, use temporary fs_reg (Matt, Kenneth) Signed-off-by: Tapani Pälli <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89569 Reviewed-by: Francisco Jerez <[email protected]> (v1) Reviewed-by: Kenneth Graunke <[email protected]> Cc: "10.5" <[email protected]>
* gallivm: abort properly when running out of buffer space in lp_disassemblyRoland Scheidegger2015-03-171-4/+8
| | | | | | | Before this actually ran into an infinite loop printing out "invalid"... Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* st/dri: remove unused include from the automake/scons buildEmil Velikov2015-03-162-2/+0
| | | | | | | st/dri/common hasn't been around for a while. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* auxiliary/os: fix the android build - s/drm_munmap/os_munmap/Emil Velikov2015-03-161-2/+2
| | | | | | | | | Squash this silly typo introduced with commit c63eb5dd5ec(auxiliary/os: get the mmap/munmap wrappers working with android) Cc: "10.4 10.5" <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium/sw/kms: trivial cleanupsEmil Velikov2015-03-161-4/+2
| | | | | | | | Remove the forward declaration and make use of the DEBUG_PRINT macro for debug builds. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* loader: include <sys/stat.h> for non-sysfs buildsEmil Velikov2015-03-161-1/+1
| | | | | | | | | | | Required by fstat(), otherwise we'll error out due to implicit function declaration. Cc: "10.4 10.5" <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89530 Signed-off-by: Emil Velikov <[email protected]> Reported-by: Vadim Rutkovsky <[email protected]> Tested-by: Vadim Rutkovsky <[email protected]>
* radeonsi: implement TGSI_OPCODE_BFI (v2)Marek Olšák2015-03-161-0/+34
| | | | | | | v2: Don't use the intrinsics, the shader backend can recognize these patterns and generates optimal code automatically. Reviewed-by: Tom Stellard <[email protected]>
* radeonsi: add a helper for extracting bitfields from parameters (v2)Marek Olšák2015-03-161-16/+27
| | | | | | | | This will be used a lot (especially by tessellation). v2: don't use the bfe intrinsic Reviewed-by: Tom Stellard <[email protected]>
* i965: Emit IF/ELSE/ENDIF/WHILE JIP with type W on Gen7Antia Puentes2015-03-161-4/+4
| | | | | | | | | | IvyBridge and Haswell PRM say that the JIP should be emitted with type W but we were using UD. The previous implementation did not show adverse effects, but IMHO it is safer to follow the specification thoroughly. Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Antia Puentes <[email protected]>
* radeonsi: move scratch reloc state setupMarek Olšák2015-03-162-15/+22
| | | | | | | | - move it to its own function - do it after all states are emitted - bump SI_MAX_DRAW_CS_DWORDS Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: don't emit PA_SC_LINE_STIPPLE if not rendering linesMarek Olšák2015-03-161-0/+8
| | | | Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: don't emit PA_SC_LINE_STIPPLE after every rasterizer state changeMarek Olšák2015-03-164-7/+7
| | | | | | Do it only when the line stipple state is changed. Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: move PA_SU_SC_MODE_CNTL to rasterizer stateMarek Olšák2015-03-165-30/+14
| | | | | | | | | This requires enabling the optional GL provoking vertex behavior for quads. + some cosmetic changes, so that the register is set exactly the same as on r600. Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: implement line and polygon smoothingMarek Olšák2015-03-164-10/+49
| | | | Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: add shader code for smoothingMarek Olšák2015-03-163-1/+39
| | | | | | | The fragment shader multiplies the alpha channel with gl_SampleMaskIn. If blending is enabled, it looks like MSAA. Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: split sample locations into its own state atomMarek Olšák2015-03-165-0/+18
| | | | | | Sample locations are not updated as often as framebuffers. Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: add basic code for overrasterizationMarek Olšák2015-03-165-16/+28
| | | | | | | This will be used for line and polygon smoothing. This is GCN-only even though it's in shared code. Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: small cleanup in si_shader_selector_keyMarek Olšák2015-03-161-12/+12
| | | | Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: simplify accessing alpha pointer in si_llvm_emit_fs_epilogueMarek Olšák2015-03-161-7/+8
| | | | Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: add support for easy opcodes from ARB_gpu_shader5Marek Olšák2015-03-161-0/+8
| | | | | | | | I have to use the BFE instrinsics, because BFE is one of the most complex instructions that can't be matched easily. BFE has 3 conditional branches and one of them is quite big. In the isel DAG, lowered BFE has 27 nodes (including leafs).
* radeonsi: implement bit-finding opcodes from ARB_gpu_shader5Marek Olšák2015-03-161-0/+92
| | | | Reviewed-by: Glenn Kennard <[email protected]>
* radeonsi: implement gl_SampleMaskInMarek Olšák2015-03-161-0/+4
| | | | Reviewed-by: Glenn Kennard <[email protected]>
* radeonsi: add support for SQRTMarek Olšák2015-03-162-1/+3
| | | | | Reviewed-by: Tom Stellard <[email protected]> Reviewed-by: Glenn Kennard <[email protected]>
* radeonsi: add support for FMAMarek Olšák2015-03-162-1/+4
| | | | | Reviewed-by: Tom Stellard <[email protected]> Reviewed-by: Glenn Kennard <[email protected]>
* gallium/radeon: don't use LLVMReadOnlyAttribute for ALUMarek Olšák2015-03-161-16/+9
| | | | | | | None of the instructions use a pointer argument. (+ small cosmetic changes) Reviewed-by: Tom Stellard <[email protected]>
* tgsi: handle bitwise opcodes in tgsi_opcode_infer_type (v2)Marek Olšák2015-03-161-0/+8
| | | | | | v2: set the same types as the destination type in tgsi_exec Reviewed-by: Ilia Mirkin <[email protected]>
* gallium: add FMA and DFMA opcodes (v3)Marek Olšák2015-03-1620-12/+62
| | | | | | | | | Needed by ARB_gpu_shader5. v2: select DMAD for FMA with double precision v3: add and select DFMA Reviewed-by: Ilia Mirkin <[email protected]>
* freedreno: update generated headersRob Clark2015-03-155-6/+6
| | | | | | | Fix a3xx texture layer-size. Signed-off-by: Rob Clark <[email protected]> Cc: "10.4 10.5" <[email protected]>
* freedreno/ir3: remove old compilerRob Clark2015-03-157-1574/+10
| | | | | | | Now that piglit is no longer falling back to old compiler for any tests, we can remove it. Hurray \o/ Signed-off-by: Rob Clark <[email protected]>
* freedreno/ir3: avoid scheduler deadlockRob Clark2015-03-153-0/+45
| | | | | | | | | | | Deadlock can occur if we schedule an address register write, yet some instructions which depend on that address register value also depend on other unscheduled instructions that depend on a different address register value. To solve this, before scheduling an address register write, ensure that all the other dependencies of the instructions which consume this address register are already scheduled. Signed-off-by: Rob Clark <[email protected]>
* freedreno/ir3: bit of cleanupRob Clark2015-03-153-19/+23
| | | | | | | | Add an array_insert() macro to simplify inserting into dynamically sized arrays, add a comment, and remove unused prototype inherited from the original freedreno.git/fdre-a3xx test code, etc. Signed-off-by: Rob Clark <[email protected]>
* i965: De-duplicate is_expression_commutative() functions.Kenneth Graunke2015-03-154-46/+25
| | | | | | | | Create a backend_inst::is_commutative() method to replace two static functions that did the exact same thing. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* i965/gen4-5: Cope with immutable-format texture revalidationChris Forbes2015-03-141-3/+10
| | | | | | | | | | This is unfortunately sometimes necessary due to rebasing levels when rendering into them. 16 piglits crash -> pass, when building mesa with debug enabled. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* freedreno: fix slice pitch calculationsIlia Mirkin2015-03-131-1/+1
| | | | | | | | | | | | | For example if width were 65, the first slice would get 96 while the second would get 32. However the hardware appears to expect the second pitch to be 64, based on halving the 96 (and aligning up to 32). This fixes texelFetch piglit tests on a3xx below a certain size. Going higher they break again, but most likely due to unrelated reasons. Signed-off-by: Ilia Mirkin <[email protected]> Cc: "10.4 10.5" <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* freedreno/a3xx: use the same layer size for all slicesIlia Mirkin2015-03-131-1/+8
| | | | | | | | | | | | | | | | | | We only program in one layer size per texture, so that means that all levels must share one size. This makes the piglit test bin/texelFetch fs sampler2DArray have the same breakage as its non-array version instead of being completely off, and makes bin/ext_texture_array-gen-mipmap start passing. Signed-off-by: Ilia Mirkin <[email protected]> Cc: "10.4 10.5" <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* i965/vs: Add missing resolve_bool_comparison calls on GEN4 and GEN5Ian Romanick2015-03-131-0/+13
| | | | | | | | | | | | | | | | | | | | | The ir_unop_any problem was discovered by some later optimization passes that generate ir_triop_csel. I was also able to reproduce it by modifying the gl-2.0-vertexattribpointer vertex shader to generate its result using color = mix(vec4(0, 1, 0, 0), vec4(1, 0, 0, 0), bvec4(any(greaterThan(diff, vec4(tolerance))))); instead of an if-statement. This also required using #version 130 and MESA_GLSL_VERSION_OVERRIDE=130. I have not nominated this for stable releases because I don't think there's any way to trigger the problem without GLSL 1.30 or optimizations that don't exist in stable. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Abdiel Janulgue <[email protected]>
* i965/disasm: Fix format stringsChris Forbes2015-03-141-24/+24
| | | | | | | | Most of the brw_inst_* api returns 64bit values. This fixes disassembly of sampler messages, etc. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965/disasm: Mark format() as being printf-style.Chris Forbes2015-03-141-0/+3
| | | | | | | | This allows us to get warnings from GCC when we mess up the format strings. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Expose built-in packing functions under GLSL 4.2.Matt Turner2015-03-131-1/+1
| | | | | | | | | | | | | | ARB_shading_language_packing is part of GLSL 4.2, not 4.0 as I mistakenly believed. The following functions are available only with ARB_shading_language_packing, GLSL 4.2 (not GLSL 4.0), or ES 3.0: - packSnorm2x16 - unpackSnorm2x16 - packHalf2x16 - unpackHalf2x16 Reviewed-by: Carl Worth <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* egl: Create queryable strings in eglInitialize().Matt Turner2015-03-132-125/+112
| | | | | | | | | | | | | | | | | | | | | | | Creating/recreating the strings in eglQueryString() is extra work and isn't thread-safe, as exhibited by shader-db's run.c using libepoxy. Multiple threads in run.c call eglReleaseThread() around the same time. libepoxy calls eglQueryString() to determine whether eglReleaseThread() exists, and our EGL implementation passes a pointer to the version string to libepoxy while simultaneously overwriting the string, leading to a failure in libepoxy. Moreover, the EGL spec says (emphasis mine): "eglQueryString returns a pointer to a *static*, zero-terminated string" This patch moves some auxiliary functions from eglmisc.c to eglapi.c so that they may be used to create the extension, API, and version strings once during eglInitialize(). The auxiliary functions are renamed from _eglUpdate* to _eglCreate*, and some checks made unnecessary by calling the functions from eglInitialize() are removed. Reviewed-by: Chad Versace <[email protected]>
* glsl: optimize (0 cmp x + y) into (-x cmp y).Samuel Iglesias Gonsalvez2015-03-131-3/+12
| | | | | | | | | | | | | The optimization done by commit 34ec1a24d did not take it into account. Fixes: dEQP-GLES3.functional.shaders.random.all_features.fragment.20 Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Cc: "10.4 10.5" <[email protected]>
* mesa: Check for valid PBO access in gl(Compressed)Tex(Sub)Image callsEduardo Lima Mitev2015-03-131-77/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds two types of checks to the gl(Compressed)Tex(Sub)Imgage family of functions when a pixel buffer object is bound to GL_PIXEL_UNPACK_BUFFER: - That the buffer is not mapped. - The total data size is within the boundaries of the buffer size. It does so by calling auxiliary validations functions from PBO API: _mesa_validate_pbo_source() for non-compressed texture calls, and _mesa_validate_pbo_source_compressed() for compressed texture calls. The first check is defined in Section 6.3.2 'Effects of Mapping Buffers on Other GL Commands' of the GLES 3.1 spec, page 57: "Any GL command which attempts to read from, write to, or change the state of a buffer object may generate an INVALID_OPERATION error if all or part of the buffer object is mapped. However, only commands which explicitly describe this error are required to do so. If an error is not generated, using such commands to perform invalid reads, writes, or state changes will have undefined results and may result in GL interruption or termination." Similar wording exists in GL 4.5 spec, page 76. In the case of gl(Compressed)Tex(Sub)Image(2,3)D, the specification doesn't force implemtations to throw an error. However since Mesa don't currently implement checks to determine when it is safe to read/write from/to a mapped PBO, we should always return the error if all or parts of it are mapped. The 2nd check is defined in Section 8.5 'Texture Image Specification' of the OpenGL 4.5 spec, page 203: "An INVALID_OPERATION error is generated if a pixel unpack buffer object is bound and storing texture data would access memory beyond the end of the pixel unpack buffer." Fixes 4 dEQP tests: * dEQP-GLES3.functional.negative_api.texture.compressedteximage2d_invalid_buffer_target * dEQP-GLES3.functional.negative_api.texture.compressedtexsubimage2d_invalid_buffer_target * dEQP-GLES3.functional.negative_api.texture.compressedteximage3d_invalid_buffer_target * dEQP-GLES3.functional.negative_api.texture.compressedtexsubimage3d_invalid_buffer_target Reviewed-by: Laura Ekstrand <[email protected]>
* mesa: Separate PBO validation checks from buffer mapping, to allow reuseEduardo Lima Mitev2015-03-132-31/+100
| | | | | | | | | | | Internal PBO functions such as _mesa_map_validate_pbo_source() and _mesa_validate_pbo_compressed_teximage() perform validation and buffer mapping within the same call. This patch takes out the validation into separate functions to allow reuse of functionality by other code (i.e, gl(Compressed)Tex(Sub)Image). Reviewed-by: Laura Ekstrand <[email protected]>
* mesa: Set the correct image size in _mesa_validate_pbo_access()Eduardo Lima Mitev2015-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _mesa_validate_pbo_access() provides a generic way to check that a requested pixel transfer operation on a PBO falls within the boundaries of the buffer. It is used in various other places, and depending on the caller, some arguments are used or not. In particular, the 'clientMemSize' argument is used only by calls that are knowledgeable of the total size of the user data involved in a pixel transfer, such as the case of compressed texture image calls. Other calls don't provide 'clientMemSize' directly since it is made implicit from the size and format of the texture, and its data type. In these cases, a sufficiently big value is passed to 'clientMemSize' (INT_MAX) to avoid an incorrect constrain. The problem is that _mesa_validate_pbo_access() use uint pointers to make the calculations, which are 64 bits long in 64 bits platforms, meanwhile the dummy INT_MAX passed in 'clientMemSize' is just 32 bits. This causes a constrain that is not desired. This patch fixes that by checking that if 'clientMemSize' is MAX_INT, then UINTPTR_MAX is assumed instead. This is an ugly workaround to the fact that _mesa_validate_pbo_access() intends to be a one function fits all. The clean solution here would be to break it into different functions that provide the adequate API for each of the possible code paths and validation needs. Since there are callers relying on passing INT_MAX to 'clientMemSize', this patch is necessary to deal with the problem above while a cleaner implementation of the PBO API is not implemented. Reviewed-by: Laura Ekstrand <[email protected]>
* meta: Remove error checks for texture <-> pixel-buffer transfers that don't ↵Eduardo Lima Mitev2015-03-131-32/+0
| | | | | | | | | | | | | | | | | belong in driver code The implementation of texture <-> pixel-buffer transfers in drivers common layer includes certain error checks and argument validation that don't belong there, considering how the Mesa codebase is laid out. These are higher level validations that, if necessary, should be performed earlier (i.e, in GL API entry points). This patch simply removes these error checks from driver code. For more information, see discussion at http://lists.freedesktop.org/archives/mesa-dev/2015-February/077417.html. Reviewed-by: Laura Ekstrand <[email protected]>
* util: convert slab macros to inline functionsBrian Paul2015-03-131-2/+11
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* egl: fix cast to silence compiler warningBrian Paul2015-03-131-1/+1
| | | | | | | | | | | | | | | | eglcurrent.c: In function '_eglSetTSD': eglcurrent.c:57:4: warning: passing argument 2 of 'tss_set' discards 'const' qualifier from pointer target type [enabled by default] tss_set(_egl_TSD, (const void *) t); ^ In file included from ../../../include/c11/threads.h:72:0, from eglcurrent.c:32: ../../../include/c11/threads_posix.h:357:1: note: expected 'void *' but argument is of type 'const void *' tss_set(tss_t key, void *val) ^ Reviewed-by: Emil Velikov <[email protected]>
* gallivm: (trivial) Fix typo in comment introduced by 70dc8aAlexandre Demers2015-03-131-1/+1
| | | | | | | Fix typo in comment introduced by 70dc8a Signed-off-by: Alexandre Demers <[email protected]> Signed-off-by: Jose Fonseca <[email protected]>