aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* u_vbuf: fix src_offset alignment in u_vbuf_create_vertex_elements()Brian Paul2015-06-191-1/+2
| | | | | | | | | | | | | | If the driver says PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY=1, the driver should never receive a pipe_vertex_element::src_offset value that's not a multiple of four. But the vbuf code wasn't actually adjusting the src_offset value when creating the vertex element state object. We just need to align the src_offset values put in the driver_attribs[] array. See the piglit gl-1.5-vertex-buffer-offsets test. Reviewed-by: Marek Olšák <[email protected]>
* gallium: whitespace, formatting clean-up in p_state.hBrian Paul2015-06-191-16/+20
| | | | | Remove trailing whitespace, move some braces, 78-column wrapping. Trivial.
* st/wgl: fix WGL_SWAP_METHOD_ARB queryBrian Paul2015-06-191-1/+6
| | | | | | | | | | There are three possible return values (not two): WGL_SWAP_COPY_ARB, WGL_SWAP_EXCHANGE_EXT and WGL_SWAP_UNDEFINED_ARB. VMware bug 1431184 Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* stw: use new stw_get_nop_function() function to avoid Viewperf 12 crashesBrian Paul2015-06-191-3/+20
| | | | | | | Also, print a warning if we do return NULL from wglGetProcAddress() to help spot this sort of problem in the future. Reviewed-by: José Fonseca <[email protected]>
* stw: add some no-op functions for GL_EXT_dsa, GL_NV_half_floatBrian Paul2015-06-193-0/+476
| | | | | | | | | | | | | | | | | | Viewperf 12 calls wglGetProcAddress() to get pointers to some unsupported DSA and half-float functions. We return NULL but Viewperf doesn't check for null before trying to jump through the pointer. That causes a crash. This patch adds no-op functions to call instead (used by the next patch). This avoids the crash but the rendering is incorrect. Some DSA functions are being added to Mesa at this time so we may be able to remove some of these no-ops in the future. More no-op functions may be added as needed. VMware PR1383421 Reviewed-by: José Fonseca <[email protected]>
* st/wgl: Don't return core profile for 3.1 contexts.Jose Fonseca2015-06-191-7/+6
| | | | | | | | | | | | | | | | | | | WGL_CONTEXT_PROFILE_MASK_ARB doesn't apply to desktop OpenGL versions less than 3.2 -- applications can't specify whether they want a core or a compat 3.1 context -- instead they are supposed the check whether the returned context advertises GL_ARB_compatibility extension. Mesa doesn't support compatability contexts for version higher than 3.1, so we used to return core profile context, but this makes several Windows applications unhappy, because they just assume they got a compatability context without checking. So it seems safer to on Windows to never return core profile for 3.1, ie, just fail the context creation. VMware PR1365920. Reviewed-by: Brian Paul <[email protected]>
* st/wgl: set PIPE_BIND_SAMPLER_VIEW for window color buffersBrian Paul2015-06-191-0/+1
| | | | | | | To allow sampling from the surface for things like glCopyPixels or glCopyTexSubImage. Reviewed-by: Charmaine Lee <[email protected]>
* st/wgl: add support for multisample pixel formatsBrian Paul2015-06-191-9/+20
| | | | | | | | | Create pixel formats with 0, 4, 8 and 16 samples per pixel. Add a SVGA_FORCE_MSAA env var to force creating all pixel formats with a particular sample count. This is useful for testing Mesa/GLUT/ etc. programs which don't ordinarily use multisample. Reviewed-by: Matthew McClure <[email protected]>
* st/wgl: respect sample count when creating framebuffer surfacesBrian Paul2015-06-191-0/+1
| | | | | | Use the visual/pixel format's sample count instead of zero. Reviewed-by: Matthew McClure <[email protected]>
* st/wgl: fix WGL_SAMPLE_BUFFERS_ARB queryBrian Paul2015-06-191-1/+1
| | | | | | | Only report 1 for WGL_SAMPLE_BUFFERS_ARB if the number of samples per pixel > 1. Reviewed-by: Matthew McClure <[email protected]>
* tgsi: add comments for ureg_emit_label()Brian Paul2015-06-191-0/+6
|
* tgsi: new comments, assertion for executing TGSI_OPCODE_CALBrian Paul2015-06-191-1/+5
|
* llvmpipe: Truncate the binned constants to max const buffer size.Jose Fonseca2015-06-192-2/+9
| | | | | | | | | Tested with Ilia Mirkin's gzdoom.trace and "arb_uniform_buffer_object-maxuniformblocksize fsexceed" piglit test without my earlier fix to fail linkage when UBO exceeds GL_MAX_UNIFORM_BLOCK_SIZE. Reviewed-by: Roland Scheidegger <[email protected]>
* glsl: Fail linkage when UBO exceeds GL_MAX_UNIFORM_BLOCK_SIZE.Jose Fonseca2015-06-191-0/+7
| | | | | | | | | | | | | | | | | | | | | | | It's not totally clear whether other Mesa drivers can safely cope with over-sized UBOs, but at least for llvmpipe receiving a UBO larger than its limit causes problems, as it won't fit into its internal display lists. This fixes piglit "arb_uniform_buffer_object-maxuniformblocksize fsexceed" without regressions for llvmpipe. NVIDIA driver also fails to link the shader from "arb_uniform_buffer_object-maxuniformblocksize fsexceed". Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65525 PS: I don't recommend cherry-picking this for Mesa stable, as some app might inadvertently been relying on UBOs larger than GL_MAX_UNIFORM_BLOCK_SIZE to work on other drivers, so even if this commit is universally accepted it's probably best to let it mature in master for a while. Reviewed-by: Roland Scheidegger <[email protected]>
* glsl: guard gl_NumSamples enablement on ARB_sample_shadingIlia Mirkin2015-06-181-1/+2
| | | | | | | gl_NumSamples should only be enabled when ARB_sample_shading is enabled. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* i965: Add missing braces around if-statement.Matt Turner2015-06-181-1/+2
| | | | | | | | | | Fixes a performance problem caused by commit b639ed2f. Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Ben Widawsky <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90895
* i965/compute: Fix undefined code with right_mask for SIMD32Jordan Justen2015-06-181-1/+1
| | | | | | | | | Although we don't support SIMD32, krh pointed out that the left shift by 32 is undefined by C/C++ for 32-bit integers. Suggested-by: Kristian Høgsberg <[email protected]> Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: add GL_PROGRAM_PIPELINE support in KHR_debug callsIlia Mirkin2015-06-184-12/+24
| | | | | | | | | | This was apparently missed when ARB_sso support was added. Add label support to pipeline objects just like all the other debug-related objects. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Cc: "10.5 10.6" <[email protected]>
* glsl: add version checks to conditionals for builtin variable enablementIlia Mirkin2015-06-181-5/+5
| | | | | | | | | A number of builtin variables have checks based on the extension being enabled, but were missing enablement via a higher GLSL version. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Cc: "10.5 10.6" <[email protected]>
* glsl: handle conversions to double when comparing param matchesIlia Mirkin2015-06-181-3/+5
| | | | | | | | | This allows mod(int, int) to become selected as float mod when doubles are supported. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Chris Forbes <[email protected]> Cc: "10.6" <[email protected]>
* ilo: remove missing ilo_fence.h from the sources listEmil Velikov2015-06-181-1/+0
| | | | Signed-off-by: Emil Velikov <[email protected]>
* egl/x11: Set version of swrastLoader to 2Boyan Ding2015-06-181-1/+1
| | | | | | | | | | which it actually implements instead of the newest version defined in dri_interface.h Cc: "10.5 10.6" <[email protected]> Signed-off-by: Boyan Ding <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* vc4: Move tile state/alloc allocation into the kernel.Eric Anholt2015-06-179-101/+72
| | | | | | | This avoids a security issue where userspace could have written the tile state/tile alloc behind the GPU's back, and will apparently be necessary for fixing stability bugs (tile state buffers are missing some top bits for the tile alloc's address).
* vc4: Move RCL generation into the kernel.Eric Anholt2015-06-1711-676/+725
| | | | | There weren't that many variations of RCL generation, and this lets us skip all the in-kernel validation for what we generated.
* vc4: Add dumping of VC4_PACKET_TILE_BINNING_MODE_CONFIG.Eric Anholt2015-06-171-1/+32
|
* vc4: Fix memory leak from simple_list conversion.Eric Anholt2015-06-171-3/+2
| | | | | I accidentally shadowed the outside declaration, so we always returned NULL even when we'd found something in the cache.
* vc4: Track the number of BOs allocated and their size.Eric Anholt2015-06-172-7/+100
| | | | This is useful for BO leak debugging.
* i965: Fix textureGrad with cube samplersIago Toral Quiroga2015-06-181-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can't use sampler messages with gradient information (like sample_g or sample_d) to deal with this scenario because according to the PRM: "The r coordinate and its gradients are required only for surface types that use the third coordinate. Usage of this message type on cube surfaces assumes that the u, v, and gradients have already been transformed onto the appropriate face, but still in [-1,+1] range. The r coordinate contains the faceid, and the r gradients are ignored by hardware." Instead, we should lower this to compute the LOD manually based on the gradients and use a different sample message that takes the computed LOD instead of the gradients. This is already being done in brw_lower_texture_gradients.cpp, but it is restricted to shadow samplers only, although there is a comment stating that we should probably do this also for samplerCube and samplerCubeArray. Because of this, both dEQP and Piglit test cases for textureGrad with cube maps currently fail. This patch does two things: 1) Activates the texturegrad lowering pass for all cube samplers. 2) Corrects the computation of the LOD value for cube samplers. I had to do 2) because for cube maps the calculations implemented in the lowering pass always compute a value of rho that is twice the value we want (so we get a LOD value one unit larger than we want). This only happens for cube map samplers (all kinds). I am not sure about why we need to do this, but I suspect that it is related to the fact that cube map coordinates, when transported to a specific face in the cube, are in the range [-1, 1] instead of [0, 1] so we probably need to divide the derivatives by 2 when we compute the LOD. Doing that would produce the same result as dividing the final rho computation by 2 (or removing a unit from the computed LOD, which is what we are doing here). Fixes the following piglit tests: bin/tex-miplevel-selection textureGrad Cube -auto -fbo bin/tex-miplevel-selection textureGrad CubeArray -auto -fbo bin/tex-miplevel-selection textureGrad CubeShadow -auto -fbo Fixes 10 dEQP tests in the following category: dEQP-GLES3.functional.shaders.texture_functions.texturegrad.*cube* Reviewed-by: Ben Widawsky <[email protected]>
* nvc0/ir: can't have a join on a load with an indirect sourceIlia Mirkin2015-06-171-1/+1
| | | | | | | | | | | Triggers an INVALID_OPCODE warning on GK208. Seems rare enough to not warrant verification on other chips. Fixes the new piglits: ubo_array_indexing/fs-nonuniform-control-flow.shader_test ubo_array_indexing/vs-nonuniform-control-flow.shader_test Signed-off-by: Ilia Mirkin <[email protected]> Cc: "10.5 10.6" <[email protected]>
* i965: enable ARB_framebuffer_no_attachments for Gen7+Kevin Rogovin2015-06-172-0/+7
| | | | | | | Enable GL_ARB_framebuffer_no_attachments in i965 for Gen7 and higher. Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Kevin Rogovin <[email protected]>
* i965: execution of frag-shader when it has atomic bufferKevin Rogovin2015-06-172-0/+7
| | | | | | | | Ensure that the GPU spawns the fragment shader thread for those fragment shaders with atomic buffer access. Reviewed-by: Tapani Pälli <[email protected]> Signed-off-by: Kevin Rogovin <[email protected]>
* mesa: function for testing if current frag-shader has atomicsKevin Rogovin2015-06-171-1/+6
| | | | | | | | Add helper function that checks if current fragment shader active of gl_context has atomic buffer access. Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Kevin Rogovin <[email protected]>
* i965: Use _mesa_geometric_ functions appropriatelyKevin Rogovin2015-06-1716-34/+70
| | | | | | | | | | | | | | Change references to gl_framebuffer::Width, Height, MaxNumLayers and Visual::samples to use the _mesa_geometry_ convenience functions for those places where the geometry of the gl_framebuffer is needed (in contrast to the geometry of the intersection of the attachments of the gl_framebuffer). This patch is to pave the way to enable GL_ARB_framebuffer_no_attachments on Gen7 and higher in i965. Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Kevin Rogovin <[email protected]>
* mesa: helper function for scissor box of gl_framebufferKevin Rogovin2015-06-172-15/+35
| | | | | | | | | Add helper convenience function that intersects the scissor values against a passed bounding box. In addition, to avoid replicated code, make the function _mesa_scissor_bounding_box() use this new function. Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Kevin Rogovin <[email protected]>
* mesa: add helper functions for geometry of gl_framebufferKevin Rogovin2015-06-172-1/+35
| | | | | | | | | | Add convenience helper functions for fetching geometry of gl_framebuffer that return the geometry of the gl_framebuffer instead of the geometry of the buffers of the gl_framebuffer when then the gl_framebuffer has no attachments. Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Kevin Rogovin <[email protected]>
* PATCH 03/10] mesa: Complete ARB_framebuffer_no_attachments in Mesa coreKevin Rogovin2015-06-171-29/+182
| | | | | | | | | | Implement GL_ARB_framebuffer_no_attachments in Mesa core - changes to conditions for framebuffer completenss - implement set/get functions for framebuffers for new functions in GL_ARB_framebuffer_no_attachments Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Kevin Rogovin <[email protected]>
* mesa: Constants and functions for ARB_framebuffer_no_attachmentsKevin Rogovin2015-06-179-3/+84
| | | | | | | | Define the enumeration constants, function entry points and glGet for the GL_ARB_framebuffer_no_attachments. Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Kevin Rogovin <[email protected]>
* mesa: Define infrastructure for ARB_framebuffer_no_attachmentsKevin Rogovin2015-06-174-5/+46
| | | | | | | | | Define the infrastructure for the extension GL_ARB_framebuffer_no_attachments: - extension table - additions to gl_framebuffer Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Kevin Rogovin <[email protected]>
* vc4: Make sure that direct texture clamps have a minimum value of 0.Eric Anholt2015-06-162-25/+66
| | | | | | | I was thinking of the MIN opcode in terms of unsigned math, but it's signed, so if you used a negative array index, you could read before the UBO. Fixes segfaults under simulation in piglit array indexing tests with mprotect-based guard pages.
* vc4: Swap around which src we spill to ra31/rb31.Eric Anholt2015-06-161-4/+4
| | | | | | | | I wanted to assert that src1 came from a non-unspilled register in shader validation, and this easily gets us that. And, as a bonus: total instructions in shared programs: 93347 -> 92723 (-0.67%) instructions in affected programs: 60524 -> 59900 (-1.03%)
* vc4: R4 is not a valid register for clamped direct texturing.Eric Anholt2015-06-161-1/+1
| | | | | Our array only goes to R3, and R4 is a special case that shouldn't be used.
* vc4: Factor out the live clamp register getter.Eric Anholt2015-06-161-8/+24
|
* vc4: Drop the unused "stride" field of surfaces.Eric Anholt2015-06-161-1/+0
| | | | We're always looking at the slice anyway, when we would have needed it.
* vc4: Handle refcounting the exec BO like we do in the kernel.Eric Anholt2015-06-164-10/+34
| | | | | This reduces the diff to the kernel, and will be useful when I make the kernel allocate more BOs as part of validation.
* vc4: Use VC4_SET/GET_FIELD for some RCL packets.Eric Anholt2015-06-164-77/+89
|
* vc4: Make symbolic values for packet sizes.Eric Anholt2015-06-164-57/+86
|
* vc4: Use symbolic values in texture ptype validation.Eric Anholt2015-06-161-10/+13
|
* vc4: Move vc4_packet.h to the kernel/ directory, since it's also shared.Eric Anholt2015-06-164-3/+3
| | | | I want to notice discrepancies when I diff -u between Mesa and the kernel.
* i965/gen9: Disable Mip Tail for YF/YS tiled surfacesAnuj Phogat2015-06-162-2/+11
| | | | | | | | | | | | | | | Disabling miptails fixed the buffer corruption happening in FBO which use YF/YS tiled renderbuffer or texture as color attachment. Spec recommends disabling mip tails only for non-mip-mapped surfaces. But, without disabling miptails I couldn't get correct data out of mipmapped YF/YS tiled surface. We need better understanding of miptails before start using them. For now this patch helps move things forward. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Ben Widawsky <[email protected]>
* i965/gen9: Set vertical and horizontal surface alignmentsAnuj Phogat2015-06-161-6/+26
| | | | | | | | | | Patch sets the alignments for texture and renderbuffer surfaces. V3: Make changes inside horizontal_alignment() and vertical_alignment() (Topi) Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>