summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* i965: Gut the separate OpenGL ES extension enabling.Kenneth Graunke2012-05-237-148/+4
| | | | | | | | | | | | | | | | | | | | | | | | We should just set the bits of functionality that we support; the GL/ES1/ES2 flags in extensions.c will take care of advertising the appropriate extensions for the current API. This enables the GL_EXT_texture_compression_dxt1 extension on ES1/ES2 when libtxc_dxtn is installed or the force_s3tc driconf option is set. The main extension code set this up properly, but the ES-specific code failed to do so. Otherwise, the extension strings reported by es1_info, es2_info, and glxinfo all remain the same. This patch manually disables the ARB_framebuffer_object bit on ES to preserve the behavior of 1c0f5d8324c4db2720247989ddc4a45315b55a85. v2: Rebase, fix the i915 Makefile, and unconditionally set the OES_draw_texture bit as core Mesa will only apply it to ES1 now. Tested-by: Daniel Charles <[email protected]> [v1] Reviewed-by: Chad Versace <[email protected]> [v1] Signed-off-by: Kenneth Graunke <[email protected]>
* mesa: Remove the OES_draw_texture extension from ES2.Kenneth Graunke2012-05-231-1/+1
| | | | | | | | | This extension appears to be written against ES 1.0. In ES 2.0, you really want to be using FBOs instead. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965: use cut index to handle primitive restart when possibleJordan Justen2012-05-231-1/+80
| | | | | | | | | | | | | If the primitive restart index and the primitive type can be handled by the cut index feature, then use the hardware to handle the primitive restart feature. The VBO module's software handling of primitive restart is used as a fall back. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: add flag to enable cut_indexJordan Justen2012-05-234-1/+12
| | | | | | | | | When brw->prim_restart.enable_cut_index is set, the cut index will be enabled when uploading index_buffer commands. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: create code path to handle primitive restart in hardwareJordan Justen2012-05-237-0/+112
| | | | | | | | | | | | | | For newer hardware we disable the VBO module's software handling of primitive restart. We now handle primitive restarts in brw_handle_primitive_restart. The initial version of brw_handle_primitive_restart simply calls vbo_sw_primitive_restart, and therefore still uses the VBO module software primitive restart support. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Use initializers to configure samplersIan Romanick2012-05-231-32/+9
| | | | | | | | | Now that the linker handles initializers of samplers just like any other uniform, a bunch of this annoying code is unnecessary. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* ir_to_mesa: Don't set initial uniform values againIan Romanick2012-05-231-104/+0
| | | | | | | | | This work is now done by the linker, so we don't need to keep doing it here. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* ir_to_mesa: Propagate initial values in _mesa_associate_uniform_storageIan Romanick2012-05-231-0/+9
| | | | | | | | | The linker may have set initial values for uniforms. Propagate these values to the driver's backing storage when it is first associated. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Initialize samplers to 0, propagate sampler values to the gl_programIan Romanick2012-05-231-0/+1
| | | | | | | | | | | | | The spec requires that samplers be initialized to 0. Since this differs from the 1-to-1 mapping of samplers to texture units assumed by ARB assembly shaders (and the gl_program structure), be sure to propagate this date from the gl_shader_program to the gl_program. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> CC: Vadim Girlin <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49088
* i965/gen6+: Add support for GL_ARB_blend_func_extended.Eric Anholt2012-05-2313-8/+112
| | | | | | | v2: Add support for gen6, and don't turn it on if blending is disabled. (fixes GPU hang), and note it in docs/GL3.txt Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Keep a computed value for dual source blend func with each buffer.Eric Anholt2012-05-233-17/+32
| | | | | | | | | The i965 driver needed this as well for hardware setup, so instead of duplicating the logic, just save it off. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* i965/gen6+: Add support for fast depth clears.Eric Anholt2012-05-238-12/+150
| | | | | | | | | | Improves citybench high-res performance 3.0% +- 0.4%, n=10. Improves Lightsmark 1024x768 performance 0.74% +/- 0.20% (n=78). No significant difference on openarena (n=5, didn't fast clear) or nexuiz (n=3). Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965/gen6: Add CC viewport state setup to blorp code.Eric Anholt2012-05-231-0/+26
| | | | | | | | While it doesn't have the same warning in the simulator as in gen7, let's emit it out of paranoia. We wouldn't want our resolves of some previous clear to get clamped to some current clamping value. Suggested-by: pretty much everyone
* i965/gen7: Add CC viewport setup to blorp code.Eric Anholt2012-05-231-0/+21
| | | | | | | | | | | | | | | When doing fast clears, a fulsim warning said that the batch was being emitted without the viewport set up. While the fast clear pass I was looking at doesn't use the clear value, the later resolves which also didn't set up the vieport would trigger the same. It's not obvious from the error message whether it meant "fast clear value gets clamped to something you haven't defined" or "fast clear value doesn't get clamped, and I saw it was out of the current (uninitialized) range, and you probably wanted it clamped to that (uninitialized) range". Be paranoid and assume the first case. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965: Drop a layer of indirection in doing HiZ resolves.Eric Anholt2012-05-237-120/+9
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965: Replace intel_need_resolve with the hiz ops it maps to.Eric Anholt2012-05-233-17/+21
| | | | | | | | Having this enum separate caused us to need a bunch of helper functions to translate to the op to be executed. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965: Add an interface for doing hiz ops from C code.Eric Anholt2012-05-234-15/+44
| | | | | | | | This required moving gen6_hiz_op, and I put it in intel_resolve_map.h for the next commit. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965: Rename the clear function for this driver.Eric Anholt2012-05-231-2/+2
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965: Simplify the remaining clear logic by relying on the meta clear.Eric Anholt2012-05-231-47/+11
| | | | | | | | The GLSL clear path doesn't need any buffer presence checks, since those are already handled in the normal drawing path code. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965: Switch blit color clears to tri clears on gen4/5.Eric Anholt2012-05-231-28/+2
| | | | | | | | | | | | | | Our understanding is that the 3D engine is supposed to be faster anyway. We used to have more overhead in our tri clear path than we do today, which would have led to this choice. But given that we almost always see a depth clear along with a color clear, the path was hardly exercised anyway. Also, the color mask logic was broken in the presence of GL_EXT_draw_buffers2's per-buffer colormask. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965: Remove dead logic for non-tri depth/stencil clears.Eric Anholt2012-05-231-26/+2
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965: We always have GLSL, so always use it for tri clears.Eric Anholt2012-05-231-4/+1
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i915: Drop gen4+ code from the forked clear code.Eric Anholt2012-05-231-10/+1
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* intel: Fork the intel_clear.c file between i915 and i965.Eric Anholt2012-05-234-8/+209
| | | | | | | | This logic is wasted on i965 when we want to just always do GLSL tri clears. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* st/mesa: set stObj->lastLevel in guess_and_alloc_textureVadim Girlin2012-05-231-0/+2
| | | | | | | | | | Fixes lockups/asserts with depthstencil-render-miplevels tests and r600g. Should also fix https://bugs.freedesktop.org/show_bug.cgi?id=50033 NOTE: This is a candidate for the 8.0 branch. Signed-off-by: Vadim Girlin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* i965: Completely annotate the batch bo when aub dumping.Paul Berry2012-05-226-27/+117
| | | | | | | | | | | | | | | | | | | Previously, when the environment variable INTEL_DEBUG=aub was set, mesa would simply instruct DRM to start dumping data to an .aub file, but we would not provide DRM with any information about the format of the data in various buffers. As a result, a lot of the data in the generate .aub file would be unannotated, making further data analysis difficult. This patch causes the entire contents of each batch buffer to be annotated using the data in brw->state_batch_list (which was previously used only to annotate the output of INTEL_DEBUG=bat). This includes data that was allocated by brw_state_batch, such as binding tables, surface and sampler states, depth/stencil state, and so on. The new annotation mechanism requires DRM version 2.4.34. Reviewed-by: Eric Anholt <[email protected]>
* intel: When AUB dumping, flush before emitting final bitmap command.Paul Berry2012-05-221-1/+3
| | | | | | | | | | | | | When we are generating an AUB dump, we make a final call to aub_dump_bmp() as the context is being destroyed, to ensure that any rendering performed before the application exits can be seen during a simulation run. However, we were doing this before flushing the batch buffer; as a result simulation runs would not always see the effect of all rendering commands. This patch flushes the batch buffer just before making the final call to aub_dump_bmp(), to ensure that all rendering is properly captured in the final bitmap.
* st/mesa: use pipe_sampler_view_release() in st_destroy_context_priv()Brian Paul2012-05-191-1/+1
| | | | | | | | Fixes another case of sampler views being created by one context, shared by another, then deleted by the first, leaving a dangling pipe context pointer. Reviewed-by: José Fonseca <[email protected]>
* mesa: use F_TO_I() instead of IROUND()Brian Paul2012-05-194-130/+130
| | | | | | | | Use it where performance matters more and the exact method of float->int conversion/rounding isn't terribly important. There should no net change here since F_TO_I() is the new name of the old IROUND() function. Reviewed-by: José Fonseca <[email protected]>
* mesa: reimplement IROUND(), add F_TO_I()Brian Paul2012-05-191-21/+36
| | | | | | | | | | | | | | The different implementations of IROUND() behaved differently and in the case of fistp, depended on the current x86 FPU rounding mode. This caused some tests like piglit roundmode-pixelstore and roundmode-getintegerv to fail on 32-bit x86 but pass on 64-bit x86. Now IROUND() always rounds to the nearest integer (away from zero). The new F_TO_I function converts a float to an int by whatever means is fastest. We'll use this where we're more concerned with performance and not too worried to how the conversion is done. Reviewed-by: José Fonseca <[email protected]>
* mesa: fix Z32_FLOAT -> uint conversion functionsBrian Paul2012-05-191-2/+2
| | | | | | | | The IROUND converted all arguments to 0 or 1. That's not what we wanted. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]>
* st/mesa: remove unused pipe variableBrian Paul2012-05-191-1/+0
|
* st/mesa: added st_print_current_vertex_program(), for debuggingBrian Paul2012-05-192-0/+27
|
* mesa: add GLSL_REPORT_ERRORS debug flagBrian Paul2012-05-192-0/+15
| | | | | | | If the MESA_GLSL env var contains "errors", GLSL compilation and link errors will be reported to stderr. Reviewed-by: Ian Romanick <[email protected]>
* mesa: add some comments on shaderapi.c functionsBrian Paul2012-05-191-1/+14
|
* mesa: Remove undefinition of _P symbol.Vinson Lee2012-05-181-6/+0
| | | | | | | IRIX isn't used anymore. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* state_tracker: remove sw_primitive_restart from st_contextJordan Justen2012-05-172-2/+0
| | | | | | | | The VBO module now can handle primitive restart in software if required. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* state_tracker: remove software handling of primitive restartJordan Justen2012-05-171-178/+2
| | | | | | | | The VBO module now can handle primitive restart in software if required. Therefore this support is no londer required. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* state_tracker: set PrimitiveRestartInSoftware if neededJordan Justen2012-05-171-0/+1
| | | | | | | | | If the PIPE_CAP_PRIMITIVE_RESTART screen param is not set, then enable PrimitiveRestartInSoftware to enable software primitive restart support in the VBO module. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* vbo: use software primitive restart in the VBO moduleJordan Justen2012-05-171-6/+37
| | | | | | | | | | When PrimitiveRestartInSoftware is set, the VBO module will handle primitive restart scenarios before calling the vbo->draw_prims drawing function. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: add PrimitiveRestartInSoftware to gl_context.ConstJordan Justen2012-05-172-0/+8
| | | | | | | | | | | If set, then the VBO module will handle all primitive restart scenarios before calling the driver draw_prims. Software primitive restart support is disabled by default. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* vbo: add software primitive restart supportJordan Justen2012-05-174-0/+241
| | | | | | | | | | | vbo_sw_primitive_restart implements primitive restart in software by splitting primitive draws apart. This is based on similar support in mesa/state_tracker/st_draw.c. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Check for framebuffer completeness before looking at the rb.Eric Anholt2012-05-171-6/+6
| | | | | | | | | Otherwise, an incomplete framebuffer could have a NULL _ColorReadBuffer and we'd deref that. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix assertion failure when a cube face is not present.Eric Anholt2012-05-171-1/+2
| | | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965/vs: Fix up swizzle for dereference_array of matrices.Eric Anholt2012-05-171-2/+2
| | | | | | | | | Fixes assertion failure in piglit: vs-mat2-struct-assignment.shader_test vs-mat2-array-assignment.shader_test Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Throw error on glGetActiveUniform inside Begin/End.Eric Anholt2012-05-171-0/+2
| | | | | | | | Fixes piglit GL_ARB_shader_objeccts/getactiveuniform-beginend. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965/fs: Do more register coalescing by using the interference graph.Eric Anholt2012-05-172-0/+62
| | | | | | | | | | | | | | By using the live variables code for determining interference, we can handle coalescing in the presence of control flow, which the other register coalescing path couldn't. Total instructions: 207184 -> 206990 74/1246 programs affected (5.9%) 33993 -> 33799 instructions in affected programs (0.6% reduction) There is a newerth shader that loses out, because of some extra MOVs that now get their dead-code nature obscured by coalescing. This should be fixed by doing better at dead code elimination.
* st/mesa: set PIPE_BIND_STREAM_OUTPUT for TFB target in st_bufferobj_dataChristoph Bumiller2012-05-171-0/+3
|
* i965/blorp: Move exec() out of brw_blorp_params.Paul Berry2012-05-153-6/+9
| | | | | | | | | No functional change. This patch replaces the brw_blorp_params::exec() method with a global function brw_blorp_exec() that performs the operation described by the params data structure. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/gen6: Initial implementation of MSAA.Paul Berry2012-05-1523-121/+662
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch enables MSAA for Gen6, by modifying intel_mipmap_tree to understand multisampled buffers, adapting the rendering pipeline setup to enable multisampled rendering, and adding multisample resolve operations to brw_blorp_blit.cpp. Some preparation work is also included for Gen7, but it is not yet enabled. MSAA support is still fairly preliminary. In particular, the following are not yet supported: - Fully general blits between MSAA and non-MSAA buffers. - Formats other than RGBA8, DEPTH24, and STENCIL8. - Centroid interpolation. - Coverage parameters (glSampleCoverage, GL_SAMPLE_ALPHA_TO_COVERAGE, GL_SAMPLE_ALPHA_TO_ONE, GL_SAMPLE_COVERAGE, GL_SAMPLE_COVERAGE_VALUE, GL_SAMPLE_COVERAGE_INVERT). Fixes piglit tests "EXT_framebuffer_multisample/accuracy" on i965/Gen6. v2: - In intel_alloc_renderbuffer_storage(), quantize the requested number of samples to the next higher sample count supported by the hardware. This ensures that a query of GL_SAMPLES will return the correct value. It also ensures that MSAA is fully disabled on Gen7 for now (since Gen7 MSAA support doesn't work yet). - When reading from a non-MSAA surface, ensure that s_is_zero is true so that we won't try to read from a nonexistent sample.