summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
Commit message (Collapse)AuthorAgeFilesLines
* 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]>
* i965: Set SWIZZLE_NOOP for unused texture units in the program keys.Kenneth Graunke2012-08-251-3/+2
| | | | | | | | | | | | | | Previously, we left the swizzle key field as zero for unused texture units. The precompile sets all of them to SWIZZLE_NOOP, which meant that we mismatched almost every time. Since either works equally well, change it to SWIZZLE_NOOP to match the precompiles. 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: Remove four and a half year old TODO comments about samplers.Kenneth Graunke2012-08-252-8/+0
| | | | | | | | | | | | | I can't actually understand what these mean, and they seem to essentially say "we should simplify things", which is a nice goal but not very specific. Presumably things got cleaned up at some point. 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: Fix brw_link_shader to return false rather than NULL.Kenneth Graunke2012-08-251-1/+1
| | | | | | | | | | Fixes brw_shader.cpp:101:9: warning: converting to non-pointer type 'GLboolean {aka unsigned char}' from NULL [-Wconversion-null] Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-with-great-enthusiasm-by: Paul Berry <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by Eric Anholt <[email protected]>
* mesa: add texture target field to ChooseTextureFormat() driver hookBrian Paul2012-08-245-3/+8
| | | | | | | | | This will let us choose the actual hardware format depending on the type of texture. v2: fixup radeon, nouveau, intel and swrast drivers too Reviewed-by: Eric Anholt <[email protected]>
* xlib: remove texture compression hackeryBrian Paul2012-08-243-29/+0
| | | | | | I think this was left-over debug code from long ago. Reviewed-by: Ian Romanick <[email protected]>
* build: Only add links to .so files if we're building themMatt Turner2012-08-242-0/+4
| | | | | | Xlib-GLX and OSMesa support static building. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=53962
* build: Add libOSMesa.so.$(VERSION) link to libdirMatt Turner2012-08-241-0/+1
|
* build: Replace OSMESA_VERSION with generic VERSION_NUMBERMatt Turner2012-08-241-1/+1
| | | | Can be used by other modules.
* i965: don't clear resolve map when doing fast depth clears.Paul Berry2012-08-241-4/+2
| | | | | | | | | | | | | | | | | | Previously, when performing a fast depth clear, we would also clear the miptree's resolve map. This destroyed important information, since the resolve map contains information about needed resolves for all levels and layers of the miptree, whereas a depth clear only applies to a single level/layer combination at a time. As a result, resolves would sometimes fail to occur, leading to incorrect rendering. Fixes rendering artifacts with shadow maps in Unigine Heaven and Unigine Sanctuary. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50270 Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965/HiZ: remove assertion from intel_resolve_map_set().Paul Berry2012-08-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | There are three possible resolve map states for each (level, layer) of a depth miptree: "needs HiZ resolve", "needs depth resolve", and "needs neither". When HiZ was first implemented on i965, any attempt to directly transition between "needs HiZ resolve" and "needs depth resolve" without passing through the "needs neither" state would have been a bug indicating that a necessary resolve hadn't been performed. Accordingly, intel_resolve_map_set() contained an assertion to verify that no such direct transition happened. However, now that we support fast depth clears, there is a valid transition from the "needs HiZ resolve" to the "needs depth resolve" state. When doing a fast depth clear, the old state of the buffer is irrelevant, since we are completely replacing it with the clear value, so it is not necessary to do any resolves before clearing--we can transition, if necessary, directly from the "needs HiZ resolve" state to the "needs depth resolve" state. To avoid spurious assertions in this valid case, this patch just removes the assertion. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa: new _mesa_num_tex_faces() helperBrian Paul2012-08-244-8/+9
| | | | | Not a real big help now, but will be useful for the GL_ARB_texture_cube_map_array extension in the future.
* i965/msaa: Add sample-alpha-to-coverage support for multiple render targetsAnuj Phogat2012-08-234-2/+43
| | | | | | | | | | | | | | | | | | | | | | Render Target Write message should include source zero alpha value when sample-alpha-to-coverage is enabled for an FBO with multiple render targets. Source zero alpha value is used as fragment coverage for all the render targets. This patch makes piglit tests draw-buffers-alpha-to-coverage and alpha-to-coverage-no-draw-buffer-zero to pass on Sandybridge. No regressions are observed with piglit all.tests. V2: Revert all the changes made in emit_color_write() function to include src0 alpha for targets > 0. Now handling this case in a if block. V3: Correctly calculate the instruction length for buffer zero. Properly handle the case of dual_src_blend when alpha-to-coverage is enabled. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* meta: Don't modify GL_GENERATE_MIPMAP state when it doesn't existIan Romanick2012-08-231-2/+6
| | | | | | | | | | | | | | | | | | This is a bit of a hack. _mesa_meta_GenerateMipmap shouldn't even be used in contexts where GL_GENERATE_MIPMAP doesn't exist (i.e., core profile and ES2) because it uses fixed-function, and fixed-function doesn't exist there either! A GLSL-based _mesa_meta_GenerateMipmap should be available soon. When that is available, this patch will be irrelevant and should be reverted. v2: Change (ctx->API != API_OPENGLES2 && ctx->API != API_OPENGL_CORE) to (ctx->API == API_OPENGL || ctx->API == API_OPENGLES) based on review comment from Brian Paul. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* build/x11: Force usage of C++ linkerMatt Turner2012-08-221-0/+3
| | | | | Tested-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* build/x11: Don't link against shared-glapiMatt Turner2012-08-221-4/+0
| | | | | Tested-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Fix bug in the old FS backend's projtex() calculation.Eric Anholt2012-08-171-3/+1
| | | | | | | | | | | | In the old backend, we looked at any FS attribute's proj_attrib_mask bits, not just texcoords. Now that we have _mesa_vert_result_to_frag_attrib(), we can fill in the other FS inputs with correct proj_attrib_mask info. NOTE: This is a candidate for stable branches. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46644 Signed-off-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* build: Remove -shared from OSMesa's LDFLAGSMatt Turner2012-08-161-1/+1
| | | | Would break the static build.
* meta: remove unused variableBrian Paul2012-08-161-1/+1
|
* i965: add ARB_texture_rgb10_a2ui supportJordan Justen2012-08-142-0/+2
| | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* meta: allow CopyTexSubImage on integer formatsJordan Justen2012-08-141-6/+10
| | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* intel: Fix rendering to a multisample front bufferChad Versace2012-08-141-0/+10
| | | | | | | | We need to downsample before flushing BUFFER_FAKE_FRONT_LEFT to BUFFER_FRONT_LEFT in intel_flush_front. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* intel: Clean up intel_flush_frontChad Versace2012-08-141-4/+5
| | | | | | | | Stop repeating ourselves. Replace the 4 instances of `driContext->driDrawablePriv` with `driDrawable`. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* intel: Refactor intel_downsample_for_dri2_flushChad Versace2012-08-143-30/+34
| | | | | | | | Move it from intel_screen.c to intel_context.c. Redeclare as non-static. A future commit will use it in multiple files. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* dri_util: Compare against the correct API enumsIan Romanick2012-08-141-2/+2
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Implement ARB_texture_storageIan Romanick2012-08-142-0/+27
| | | | | | | | This is basically cut-and-paste from the swrast implementation, and it could probably be (slightly) more optimal. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Fix the scaling of seconds to ms in perf debug.Eric Anholt2012-08-132-2/+2
| | | | *headdesk*
* i965: Validate API and version in brwCreateContextIan Romanick2012-08-133-5/+46
| | | | | | | v2: Use base-10 for versions like gl_context::Version. Suggested by Ken. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i915: Validate API and version in i915CreateContextIan Romanick2012-08-133-1/+40
| | | | | | | v2: Use base-10 for versions like gl_context::Version. Suggested by Ken. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i830: Validate API and version before calling i830CreateContextIan Romanick2012-08-131-0/+18
| | | | Signed-off-by: Ian Romanick <[email protected]>
* intel: In the i915 driver, the chipset cannot be i965Ian Romanick2012-08-131-8/+5
| | | | | | | | In the i965 dirver, the chipset must be i965. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* dri: Pass API_OPENGL_CORE through to the driversIan Romanick2012-08-136-20/+100
| | | | | | | | | | | This forces the drivers to do at least some validation of context API and version before creating the context. In r100 and r200 drivers, this means that they don't do any post-hoc validation. v2: Actually reject compatibility profile 3.2+ contexts. Thanks Ken. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Reserve enough space to finish occlusion queries on Gen6.Kenneth Graunke2012-08-122-1/+15
| | | | | | | | | | | | | | | | | | | After realizing that brw_finish_batch emitted some final PIPE_CONTROLs to record occlusion queries, Chris noted that we probably hadn't reserved enough space to actually emit them. Reserving a full 60 bytes seems a bit harsh, since we only need that much if occlusion queries are actually active. Plus, 28 bytes would be sufficient for Gen7, and 24 for Gen4-5. We could optimize this in the future, but it doesn't seem too critical. NOTE: This is a candidate for stable release branches. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53311 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Chris Wilson <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* intel: Move finish_batch() call before MI_BATCH_BUFFER_END and padding.Kenneth Graunke2012-08-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | On Gen4+, brw_finish_batch() calls brw_emit_query_end(), which emits some extra PIPE_CONTROLs to capture the current occlusion query data. Unfortunately, it was being called *after* _intel_batchbuffer_flush added the MI_BATCH_BUFFER_END, meaning those PIPE_CONTROLs didn't get inside the batch. Not only does this likely cause bogus occlusion query values, it can also cause crashes: with the recent change to use 64-bit depth count writes on Gen6+, we started emitting an odd-length PIPE_CONTROL, which happened after the MI_NOOP padding. This resulted in an odd-length batch buffer, which resulted in execbuf2 returning -EINVAL and the application dying with an intel_do_flush_locked failure. On older generations, finish_batch() doesn't emit any state, so this change shouldn't have any effect. Huge thanks to Chris Wilson for helping me figure this out. NOTE: This is a candidate for stable release branches. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53311 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Chris Wilson <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Add perf debug for stalls during shader compiles.Eric Anholt2012-08-124-2/+45
| | | | | | | v2: fix bad comment from before I gave up and decided to just use doubles. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>