aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
Commit message (Collapse)AuthorAgeFilesLines
...
* radeon: fix free/FREE mistakeBrian Paul2012-09-011-1/+1
|
* mesa: s/FREE/free/Brian Paul2012-09-0118-54/+54
| | | | | | | v2: replace instances in dri/common/ dirs Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: s/CALLOC/calloc/Brian Paul2012-09-018-17/+17
| | | | | | | v2: replace instances in dri/common/ dirs Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: s/MALLOC/malloc/Brian Paul2012-09-012-8/+8
| | | | | | | v2: replace instances in dri/common/ dirs Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Don't use brw->fragment_program in calculate_urb_setup().Kenneth Graunke2012-08-311-1/+1
| | | | | | | | | | | | | | | | | | Reading brw->fragment_program is nonsensical in compiler code: it contains the currently active program (if any), not the one currently being compiled. Attempting to access it may either lead to crashes (null pointer dereference if no program is active) or wrong results. Fixes piglit regressions since 9ef710575b914ddfc8e9a162d98ad554c1c217f7 on pre-Sandybridge hardware. The actual bug was created in commit 7b1fbc688999fd568e65211d79d7678562061594. NOTE: This is a candidate for the 9.0 and 8.0 branches. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54183 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* dri: Rework planar image interfaceJakob Bornecrantz2012-08-312-8/+153
| | | | | | | | | | | | | | | | | | | | | | As discussed with Kristian on #wayland. Pushes the decision of components into the dri driver giving it greater freedom to allow t to implement YUV samplers in hardware, and which mode to use. This interface will also allow drivers like SVGA to implement YUV surfaces without the need to sub-allocate and instead send 3 seperate buffers for each channel, currently not implemented. I have tested these changes on Gallium Svga. Scott tested them on both intel and Gallium Radeon. Kristan and Pekka tested them on intel. v2: Fix typo in dri2_from_planar. v3: Merge in intel changes. Tested-by: Scott Moreau <[email protected]> Tested-by: Pekka Paalanen <[email protected]> Tested-by: Kristian Høgsberg <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Signed-off-by: Jakob Bornecrantz <[email protected]>
* xmlconfig: use __progname when building for AndroidTapani Pälli2012-08-311-1/+1
| | | | | | | __progname symbol and strrchr are available with bionic. Signed-off-by: Tapani Pälli <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* mesa: fix-up and use _mesa_delete_renderbuffer()Brian Paul2012-08-314-4/+4
| | | | | | | | _mesa_delete_renderbuffer() should free the mutex (though that may be a no-op) and then free the renderbuffer object itself. Subclasses of gl_renderbuffer can use this function too. Reviewed-by: José Fonseca <[email protected]>
* i965/msaa: flag _NEW_MULTISAMPLE in the brw_tracked_stateAnuj Phogat2012-08-302-2/+3
| | | | | | | This is required to get the program recompiled when SampleAlphaToCoverage is enabled. Reviewed-by: Paul Berry <[email protected]>
* i965/fs: Remove a dead member from live variables analysis.Eric Anholt2012-08-292-6/+0
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Initialize output_components[] by filling it with zeros.Kenneth Graunke2012-08-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Prior to commit 2f1869822, emit_fb_writes() looped from 0 to 3, writing all four components of a vec4 color output. However, that broke for smaller output types (float, vec2, or vec3). To fix that, I introduced a new variable (output_components[]) containing the size of the output type for each render target. Unfortunately, I forgot to actually initialize it in the constructor, which meant that unless a shader wrote to gl_FragColor, or the specific output for each render target, output_components would contain a garbage value, and we'd loop for a completely non-deterministic amount of time. Not actually emitting any color writes seems like the right approach. We may still need to emit a render target write (to terminate the thread), but don't have to put in any sensible values (the shader didn't write anything, after all). Fixes a regression since 2f18698220d8b27991fab550c4721590d17278e0. NOTE: This is a candidate for stable release branches. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54193 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]> Tested-by: Ian Romanick <[email protected]>
* i965: Allow creation of OpenGL 3.1 contextsIan Romanick2012-08-291-0/+19
| | | | | | | | v2: Fix API_OPENGL_CORE handling when TEXTURE_FLOAT_ENABLED is not defined. Based on review feedback from Eric Anholt. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Advertise GLSL 1.40 and TexBOs in core contextsIan Romanick2012-08-291-1/+9
| | | | Signed-off-by: Ian Romanick <[email protected]>
* intel: Clean up bits of cruft in intelCreateContextIan Romanick2012-08-291-40/+11
| | | | | | This and the previous three commits should probably be squashed together... Signed-off-by: Ian Romanick <[email protected]>
* i965: Set context flagsIan Romanick2012-08-293-2/+12
| | | | Signed-off-by: Ian Romanick <[email protected]>
* mesa/dri: Allow creation of forward-compatible contextsIan Romanick2012-08-291-5/+5
| | | | | | This is done by changing the API to API_OPENGL_CORE. Signed-off-by: Ian Romanick <[email protected]>
* mesa: Enable GL_{ARB,APPLE}_vertex_array_object in all driversIan Romanick2012-08-292-4/+0
| | | | | | | | This is a purely software extension. The drivers don't need to do any work to support it. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Disable the swrast context setup on GL 3.1 core.Eric Anholt2012-08-283-15/+34
| | | | | | | | | | | | | | I've reviewed the code, and the swrast callsites remaining are all in drawpixels/copypixels/bitmap/accum, or _swrast_BlitFramebuffer that shouldn't be hit. A piglit run with the context setup disabled on legacy GL and GLES2 showed regressions only in the copypixels and drawpixels tests. If the context type is forced, this reduces the shader_runner maximum heap size for glsl-algebraic-add-add-1.shader_test from 15,137,496b to 4,165,376b. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965: Replace general sw fallback support with a manual check for rendermode.Eric Anholt2012-08-285-120/+14
| | | | | | | There were no other cases that set it any more. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* intel: Move RenderMode fallback func to i915 driver.Eric Anholt2012-08-285-18/+20
| | | | | | | | The Fallback field of the context struct doesn't work that way on i965, and it's the only caller of FALLBACK() in the driver. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: Drop the old sw fallback for position array being disabled.Eric Anholt2012-08-281-7/+0
| | | | | | | | | This code has been in the driver since the first commit. I think it was trying to stop rendering from happening with a disabled position array. Core mesa has since had changes to deal with disabled position arrays correctly. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: Drop support for forcing drawing through sw fallbacks.Eric Anholt2012-08-282-5/+2
| | | | | | | It turns out it hasn't worked since at least 8.0. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: Move depth resolve for span fallbacks to a simpler place.Eric Anholt2012-08-282-28/+3
| | | | | Reviewed-by: Chad Versace <[email protected]> Acked-by: Ian Romanick <[email protected]>
* i965: Drop manual hiz resolves in span rendering.Eric Anholt2012-08-281-10/+0
| | | | | | | | swrast uses MapRenderbuffer, which leads to intel_miptree_map, which does the depth resolve. Reviewed-by: Chad Versace <[email protected]> Acked-by: Ian Romanick <[email protected]>
* i965: Make VS programs obey the shader_precompile driconf option.Kenneth Graunke2012-08-271-1/+1
| | | | | | | | Now that it's on by default, we may as well make it obey the flag, for consistency's sake if nothing else. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Reenable the fragment shader precompile.Kenneth Graunke2012-08-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | Precompiling the shader at link time often allows us to avoid compiling it at the first use. This moves the expensive compilation and optimization process to game or level load time, rather than at draw time, where we really can't avoid any cycles and don't want to risk stalling the GPU. The downside is that we have to guess the non-orthagonal state the program will have set when it draws with the shader. Previously, we guessed wrong for nearly every shader, so it wasn't useful. With the recent SamplerUnits rework and this series, we've either eliminated state or made smarter guesses, and usually get it right now. In the L4D2 time demo, I now have 39 fragment shader recompiles and no vertex shader recompiles. Before this series and the SamplerUnits rework, I had 206 fragment shader recompiles and 192 vertex shader recompiles. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Set swizzle fields in the VS precompile program key.Kenneth Graunke2012-08-271-0/+11
| | | | | | | | | | | | | | | | | This fixes a regression since 76d1301e8e8e50dc962601a9977bc52148798349: I began setting SWIZZLE_XYZW for unused sampler units in the actual program keys, since this matched the FS precompile behavior. However, the VS precompile was expecting zero, so that commit made essentially every vertex shader (even those not using texturing) mismatch and need to be recompiled. Setting them in the VS precompile key solves the issue. It also is an improvement over our old behavior: previously we guessed that vertex shaders didn't use any textures at all. Now we actually look to see if the VS had any sampler uniforms and guess based on that. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965/vs: Add VS program key dumping to INTEL_DEBUG=perf.Kenneth Graunke2012-08-273-1/+76
| | | | | | | Eric added support for WM key debugging. This adds it for the VS. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965/fs: Assume shadow sampler swizzling is <X, X, X, 1>.Kenneth Graunke2012-08-271-2/+8
| | | | | | | | | | | | | | | | Our previous assumption, SWIZZLE_XYZW, was completely bogus for depth textures. There are no Y, Z, or W components. DEPTH_TEXTURE_MODE has three options: - GL_LUMINANCE: <X, X, X, 1> - GL_INTENSITY: <X, X, X, X> - GL_ALPHA: <0, 0, 0, X> The default value is GL_LUMINANCE, and most applications don't seem to alter DEPTH_TEXTURE_MODE. Make that our precompile guess. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Index sampler program key data by linker-assigned index.Kenneth Graunke2012-08-276-30/+30
| | | | | | | | | Now that most things are based on the linker-assigned index, it makes sense to convert the arrays in the VS/WM program key as well. It seems silly to leave them indexed by texture unit. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Only set proj_attrib_mask for fixed function.Kenneth Graunke2012-08-272-2/+12
| | | | | | | | | | | | | | brw_wm_prog_key's proj_attrib_mask field is designed to enable an optimization for fixed-function programs, letting us avoid projecting attributes where the divisor is 1.0. However, for shaders, this is not useful, and is pretty much impossible to guess when building the FS precompile key. Turning it off for shaders should allow the precompile to work and not lose much. Signed-off-by: Kenneth Graunke <[email protected]> Suggested-by: Eric Anholt <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Don't set stats_wm in the WM program key on Gen6+.Kenneth Graunke2012-08-271-1/+3
| | | | | | | It's only needed for Gen4/5 IZ lookup workarounds. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Don't set vp_outputs_written in the WM program key on Gen6+.Kenneth Graunke2012-08-272-5/+10
| | | | | | | It's only used by on pre-Sandybridge hardware. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Double the size of the state cache.Kenneth Graunke2012-08-271-2/+2
| | | | | | | | We probably want to do something more sophisticated here, but this at least makes it through L4D2 without dumping the program cache. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Move hiz resolve to after renderbuffer resizing (v2)Chad Versace2012-08-271-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Do all pre-draw hiz resolves *after* the renderbuffers are resized by intel_prepare_render. Otherwise, we may resolve buffers that are immediately discarded afterwards. Fixes the assertion failure below when resizing windows in KDE and under some unknown circumstance in Chrome OS: intel_resolve_map.c:46: intel_resolve_map_set: Assertion `(*tail)->need == need' failed. Also, remove the comment that "resolves must occur [...] before setting up any hardware state". That was true when resolves were implemented with meta-ops, but no longer with blorp. v2: - Keep brw_predraw_resolve_buffers in its current position, which is before any brw_context bits are modified. Instead, move the call to intel_prepare_render. Note: This is a candiate for the 8.0 branch. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52252 Reported-by: Lu Hua <[email protected]> Reviewed-by: Paul Berry <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* i965: Remove redundant null checkChad Versace2012-08-271-2/+1
| | | | | | | | intel_renderbuffer_resolve_hiz checks if rb->mt is null, so there is no need for the caller to do so. Reviewed-by: Paul Berry <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* i965: Rewrite the comment describing the query object support.Eric Anholt2012-08-261-10/+12
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965/gen6+: Add support for GL_ARB_timer_query.Eric Anholt2012-08-264-0/+62
| | | | | | Needs updated libdrm. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Add support for GL_ARB_occlusion_query2.Eric Anholt2012-08-261-0/+1
| | | | | | | This extension is just a bit of core code on top of the GL_ARB_occlusion_query support. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Fix accumulator_contains() test to also reject swizzles of the dst.Eric Anholt2012-08-261-1/+1
| | | | | | | | | | | | | | When faced with this sequence: MOV R1, c[1]; MAD R0, R2, R1.x, R1.y; we were concluding that the MOV of R1 set up our accumulator and so we could just use the previous result. Only, it's got R1.xyzw in it instead of the r1.y we're looking for. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46784 NOTE: This is a candidate for the 8.0 branch.
* dri: Remove image write functionJakob Bornecrantz2012-08-262-29/+0
| | | | | | | | Since its not used by anything anymore and no release has gone out where it was being used. Tested-by: Scott Moreau <[email protected]> Signed-off-by: Jakob Bornecrantz <[email protected]>
* i965: Don't set iz_lookup the FS precompile's program key on Gen6+.Kenneth Graunke2012-08-251-7/+10
| | | | | | | | | We already changed the actual program key builder to only set these bits on gen < 6; this patch just brings the precompile state back in line so it doesn't mismatch every time. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965/fs: Fix INTEL_DEBUG=perf program key printing.Kenneth Graunke2012-08-251-18/+18
| | | | | | | | | | | | | | | | | | | | When dumping differences in program keys, it printed messages of the format: [Name of thing that changed] [new]->[old] This was terribly confusing: the right arrow implies "the value changed from this to that", when in fact the message conveyed the opposite. Except that some of the time, it didn't, since we accidentally swapped the arguments to brw_debug_recompile_sampler_key. With two swaps, it would often come out in the expected format. This patch fixes it to properly print: [Name of thing that changed] [old]->[new] Signed-off-by: Kenneth Graunke <[email protected]>
* mesa: Use a new, more specific hook for shader uniform changes.Kenneth Graunke2012-08-251-0/+8
| | | | | | | | | | | | | | | Gallium drivers and i965 don't require special notification when sampler uniforms change. They simply see the _NEW_TEXTURE and adjust their indirection tables. These drivers don't want ProgramStringNotify: it simply causes pointless recompiles. Unfortunately, i915 still requires shader recompiles and needs ProgramStringNotify. Rather than trying to fix that, simply change the hook to a new, more specific one: ShaderUniformChange. On i915, this translates to ProgramStringNotify; others simply ignore it. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Use linker-assigned sampler IDs in instruction encoding.Kenneth Graunke2012-08-255-35/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When assigning uniform locations, the linker assigns each sampler uniform a sequential numerical ID. gl_shader_program::SamplerUnits maps these sampler variable IDs to the actual texture units they reference (specified via glUniform1i). Previously, we encoded this mapping in the SEND instruction encoding: the "sampler" was the texture unit number, and the binding table index was SURF_INDEX_TEXTURE(the texture unit number). This unfortunately meant that whenever the application changed the value of a sampler uniform, we had to recompile the shader to change the SEND instructions. This was horrible for the game Cogs, which repeatedly switches between using texture unit 0 and 1. It also made fragment shader precompiles useless: we'd do the precompile at glLinkShader() time, before the application called glUniform1i to set the sampler values. As soon as it did that, we'd have to recompile, wasting time and space in the program cache. This patch encodes the SamplerUnits indirection in the binding table, sampler state, and sampler default color tables. Instead of baking the texture unit number into the shader, we bake in the sampler variable ID assigned by the linker. Since those never change, we don't need to recompile programs on uniform changes. This does mean that the tables now depend on the linked shader program being used for rendering, rather than simply representing all available texture units. This could cause an increase in state emission. Another plus is that the sampler state and sampler default color tables are now compact: we only emit as many entries as there are sampler uniforms, with no holes in the table since the new sampler IDs are sequential. Previously we had to emit a full 16 entries every time, since the tables tracked the state of all active texture units. Signed-off-by: Kenneth Graunke <[email protected]> Acked-by: Paul Berry <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Add a "sampler state index" parameter to update_sampler_state().Kenneth Graunke2012-08-253-14/+15
| | | | | | | | | | | This represents the index into the sampler state table or sampler default color table (the two are identical). Right now, this is still the texture unit, but that will change shortly. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Un-hardcode WM binding table from update_texture_surface.Kenneth Graunke2012-08-253-20/+31
| | | | | | | | | | Currently, we mirror the VS and WM binding tables' texture entries. That may not continue to be true, so in preparation, pass in the binding table and surface index as arguments. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965/vs: Rename "sampler" to "texunit" in texturing code.Kenneth Graunke2012-08-251-5/+5
| | | | | | | | | | | The number we're passing around is actually the ID of the texture unit, as opposed to the numerical value our of sampler uniforms. Calling it "texunit" clarifies this slightly. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965/fs: Rename "sampler" to "texunit" in texturing code.Kenneth Graunke2012-08-251-14/+14
| | | | | | | | | | | | | | The number we're passing around is actually the ID of the texture unit, as opposed to the numerical value our of sampler uniforms. Calling it "texunit" clarifies this slightly. Don't bother renaming fs_instruction::sampler. Although it's currently the texture unit, this series will change that. No need for the churn. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965/fs: Remove unused 'sampler' parameter in emit_texture_genX().Kenneth Graunke2012-08-252-15/+9
| | | | | | | Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>