AgeCommit message (Collapse)AuthorFilesLines
2013-06-28mesa: Fix build with older gcc since update of glext.hTom Stellard3-10/+0
Reviewed-by: Brian Paul <>
2013-06-28r600g/compute: Accept LDS size from the LLVM backendTom Stellard5-20/+44
And allocate the correct amount before dispatching the kernel. Tested-by: Aaron Watry <>
2013-06-28r600g/compute: Move compute_shader_create() function into evergreen_compute.cTom Stellard3-37/+23
Tested-by: Aaron Watry <>
2013-06-28svga: pass svga_compile_key by reference instead of valueBrian Paul1-7/+7
Reviewed-by: Jose Fonseca <>
2013-06-28svga: use switch statement in svga_shader_type()Brian Paul1-5/+10
Safer in case the PIPE_SHADER_x tokens get renumbered (as Marek wanted to do). Reviewed-by: Jose Fonseca <>
2013-06-28ilo: clean up states that use ilo_view_surfaceChia-I Wu1-13/+10
Use variables that are easier to remember what they are.
2013-06-28ilo: remove ilo_cbuf_state::countChia-I Wu4-17/+12
We can derive it from enabled_mask.
2013-06-28ilo: clean up ilo_set_constant_buffer()Chia-I Wu1-29/+44
Add loops that will be optimized away.
2013-06-28ilo: clean up states that take a start_slotChia-I Wu1-73/+99
They are similar, so clean them up to make them look similar.
2013-06-27glsl: Initialize member variable is_ubo_var in constructor.Vinson Lee1-1/+1
Fixes "Uninitialized scalar field" defect reported by Coverity. Signed-off-by: Vinson Lee <> Reviewed-by: Ian Romanick <>
2013-06-28ilo: use shorter names for dirty flagsChia-I Wu7-141/+138
The new names match those of ilo_context's members respectively, and are shorter.
2013-06-28ilo: track if primitive restart has changedChia-I Wu3-1/+8
Re-emit 3DSTATE_INDEX_BUFFER to enable/disable primitive restart.
2013-06-28ilo: avoid potential dangling pointer dereferenceChia-I Wu1-0/+3
Set pipe_draw_info to NULL after draw_vbo().
2013-06-27mesa: Remove GL_EXT_clip_volume_hintIan Romanick5-16/+2
As far as I can tell, no driver has enabled this extension since c6499a7 back in 2007. Signed-off-by: Ian Romanick <> Reviewed-by: Brian Paul <> Reviewed-by: Kenneth Graunke <>
2013-06-27i965,i915: Return early if miptree allocation failsChad Versace2-0/+4
If allocation fails in intel_miptree_create_layout(), don't proceed to dereference the miptree. Return an early NULL. Fixes static analysis error reported by Klocwork. Note: This is a candidate for the 9.1 branch. Reviewed-by: Ian Romanick <> Reviewed-by: Anuj Phogat <> Signed-off-by: Chad Versace <>
2013-06-27llvmpipe: handle offset_clampRoland Scheidegger3-2/+24
This was just ignored (unless for some reason like unfilled polys draw was handling this). I'm not convinced of that code, putting the float for the clamp in the key isn't really a good idea. Then again the other floats for depth bias are already in there too anyway (should probably have a jit_context for the setup function), so this is just a quick fix. Also, the "minimum resolvable depth difference" used isn't really right as it should be calculated according to the z values of the current primitive and not be a constant (of course, this only makes a difference for float depth buffers), at least for d3d10, so depth biasing is still not quite right. Reviewed-by: Jose Fonseca <>
2013-06-27llvmpipe: remove never reached code for timestamp queries.Roland Scheidegger1-2/+0
timestamp queries are always binned in an active scene, therefore always have a result.
2013-06-27llvmpipe: fix a bug in opaque optimizationRoland Scheidegger3-14/+20
If there are queries active the opaque optimization reseting the bin needs to be disabled. (Not really tested since the bug was discovered by code inspection not an actual test failure.) Reviewed-by: Jose Fonseca <>
2013-06-27radeonsi/compute: Fix memory leak in radeonsi_launch_grid.Vinson Lee1-0/+1
Fixes "Resource leak" defect reported by Coverity. Signed-off-by: Vinson Lee <>
2013-06-27clover: Fix build with LLVM 3.4Tom Stellard1-6/+6
Reported on IRC by lordheavy
2013-06-27docs: updated instructions for Mesa on WindowsBill York1-1/+18
Signed-off-by: Brian Paul <>
2013-06-27postprocess: handle partial intialization failures.Matthew McClure7-95/+281
This patch fixes segfaults observed when enabling the post processing features. When the format is not supported, or a texture cannot be created, the code must gracefully handle failure and report the error to the calling code for proper failure handling. To accomplish this the following changes were made to the filters.h prototypes: - bool return for pp_init_func - Added pp_free_func for filter specific resource destruction Fixes segfaults from backtraces: * util_destroy_blit pp_free * u_transfer_inline_write_vtbl pp_jimenezmlaa_init_run pp_init This patch also uses tgsi_alloc_tokens to allocate temporary tokens in pp_tgsi_to_state, instead of allocating the array on the stack. This fixes the following stack corruption segfault in pp_run.c: * _int_free aaline_delete_fs_state pp_free Bug Number: 1021843 Reviewed-by: Brian Paul <>
2013-06-27glx: return True/False instead of GL_TRUE/GL_FALSEBrian Paul1-11/+11
Just to be consistent with the functions' Bool return type. Reviewed-by: Jose Fonseca <>
2013-06-27glx: move declarations before codeBrian Paul2-9/+9
Reviewed-by: Jose Fonseca <>
2013-06-27mesa: move declarations before codeBrian Paul1-2/+3
Reviewed-by: Jose Fonseca <>
2013-06-27glsl: Use the C99 variadic macro syntax.José Fonseca2-4/+4
MSVC does not support the old GCC syntax. See also
2013-06-27scons: Add dependencies to all .xml files.José Fonseca1-4/+10
Should prevent stuck builds when only some of the included .xml files change.
2013-06-27ilo: plug a potential index buffer leakChia-I Wu1-0/+1
This is harmless since st_context and u_vbuf both set index buffer to NULL before destroying themselves. But we do not want to rely on that behavior.
2013-06-26softpipe: honor predication for clear_render_target and clear_depth_stencilRoland Scheidegger1-2/+40
trivial, copied from llvmpipe Reviewed-by: Jose Fonseca <>
2013-06-26llvmpipe: add support for nested / overlapping queriesRoland Scheidegger10-40/+45
OpenGL doesn't support this but d3d10 does. It is a bit of a pain as it is necessary to keep track of queries still active at the end of a scene, which is also why I cheat a bit and limit the amount of simultaneously active queries to (arbitrary) 16 (simplifies things because don't have to deal with a real list that way). I can't think of a reason why you'd really want large numbers of overlapping/nested queries so it is hopefully fine. (This only affects queries which need to be binned.) v2: don't copy remainder of array when deleting an entry simply replace the deleted entry with the last one (order doesn't matter). Reviewed-by: Jose Fonseca <>
2013-06-26llvmpipe: rework query logicRoland Scheidegger7-81/+92
Previously lp_rast_begin_query commands were always inserted into each bin, and re-issued if the scene was restarted, while lp_rast_end_query commands were executed for each still active query at the end of tile rasterization. Also, the ps_invocations and vis_counter were set to zero when the respective command was encountered. This however cannot work for multiple queries of the same type (note that occlusion counter and occlusion predicate while different type were also affected). So, change the logic to always set the ps_invocations and vis_counter to zero at the start of tile rasterization, and then use "start" and "end" per-thread query values when encountering the begin/end query commands instead, which should work for multiple queries of the same type. This also means queries do not have to be reissued in a new scene, however they still need to be finished at end of tile rasterization, so a list of queries still active at the end of a scene needs to be maintained. Also while here don't bin the queries which don't do anything in rasterization. (This change does not actually handle multiple queries of the same type yet, as the list of active queries is just a simple fixed array and setup can still only have one query active per type.) Reviewed-by: Jose Fonseca <>
2013-06-26i965: Move the remaining intel code to the i965 directory.Eric Anholt67-11392/+11367
Now that i915's forked off, they don't need to live in a shared directory. Acked-by: Kenneth Graunke <> Acked-by: Chad Versace <> Acked-by: Adam Jackson <> (and I hear second hand that idr is OK with it, too)
2013-06-26i915: Fork the shared code from i965.Eric Anholt43-25/+14731
Of this 15000 lines of code in intel/, we've identified 4000 lines that are trivially unnecessary for i915, and another 1000 that are pointless for i965, and expect to find more as time goes on. Split the i915 driver off, so that we can continue active development on i965 without worrying about breaking i915. Acked-by: Kenneth Graunke <> Acked-by: Chad Versace <> Acked-by: Adam Jackson <> (and I hear second hand that idr is OK with it, too)
2013-06-26i915: Remove dead symlink.Eric Anholt1-1/+0
2013-06-26glx: Fix another missed glMultiDrawElementsEXT const change.Eric Anholt1-1/+1
The build was broken for me since b7d9478f36bde0f7b27321378c1bb799fdd4eaa1.
2013-06-26glsl: Move all var decls to the front of the IR list in reverse orderIan Romanick1-0/+18
This has the (intended!) side effect that vertex shader inputs and fragment shader outputs will appear in the IR in the same order that they appeared in the shader code. This results in the locations being assigned in the declared order. Many (arguably buggy) applications depend on this behavior, and it matches what nearly all other drivers do. Fixes the (new) piglit test attrib-assignments. NOTE: This is a candidate for stable release branches (and requires the previous commit to prevent a regression in OpenGL ES 2.0 conformance test stencil_plane_operation). Signed-off-by: Ian Romanick <> Reviewed-by: Chad Versace <>
2013-06-26i965: Be more careful with the interleaved user array upload optimizationIan Romanick1-1/+17
The checks to determine when the data can be uploaded in an interleaved fashion can be tricked by certain data layouts. For example, float data[...]; glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 16, &data[0]); glVertexAttribPointer(1, 4, GL_FLOAT, GL_FALSE, 16, &data[4]); glDrawArrays(GL_POINTS, 0, 1); will hit the interleaved path with an incorrect size (16 bytes instead of 32 bytes). As a result, the data for attribute 1 never gets uploaded. The single element draw case is the only sensible case I can think of for non-interleaved-that-looks-like-interleaved data, but there may be others as well. To fix this, make sure that the end of the element in the array being checked is within the stride "window." Previously the code would check that the begining of the element was within the window. NOTE: This is a candidate for stable branches. Signed-off-by: Ian Romanick <> Reviewed-by: Eric Anholt <> Acked-by: Kenneth Graunke <>
2013-06-26mesa: add const qualifier to glMultiDrawElementsEXT() indices paramBrian Paul3-3/+3
The 20130624 version of glext.h changed this to match the glMultiDrawElements() function which already had the extra const qualifier. Fixes warnings/errors that seem to vary from one compiler to the next. Reviewed-by: Jose Fonseca <>
2013-06-26mesa: remove const from glDebugMessageCallbackARB() function parameterBrian Paul3-4/+4
The new 20130624 version of glext.h removed the const qualifier on the 'userParam' parameter. Reviewed-by: Jose Fonseca <>
2013-06-26i965/vs: Combine code generation's inst->opcode switch statements.Kenneth Graunke1-163/+166
vec4_visitor::generate_code() switches on vec4_instruction::opcode and calls into the brw_eu_emit.c layer to generate code for some of them. It then has a default case which calls generate_vec4_instruction() to handle the rest...which switches on opcode and handles the rest of the cases. The split apparently is that generate_code() handles the actual hardware opcodes (BRW_OPCODE_*) while generate_vec4_instruction() handles the virtual opcodes (SHADER_OPCODE_* and VS_OPCODE_*). But this looks fairly arbitrary, and it makes more sense to combine the two switches. This patch moves the cases from generate_code() into the helper function so that generate_code() isn't as large. Signed-off-by: Kenneth Graunke <> Reviewed-by: Eric Anholt <>
2013-06-26i965: Remove broken source type assertions from brw_alu3().Kenneth Graunke1-14/+5
Commit 526ffdfc033ab01cf133cb7e8290c65d12ccc9be attempted to generalize the source register type assertions to allow D and UD. However, the src1 and src2 assertions actually checked src0.type against D and UD due to a copy and paste bug. It also began setting the source and destination register types based on dest.type, ignoring src0/src1/src2.type completely. BFE and BFI2 may actually pass mixed D/UD types and expect them to be ignored, which is arguably a bit sloppy, but not too crazy either. This patch simply removes the source register assertions as those values aren't used anyway. It also clarifies the comment above the block that sets the register types. Signed-off-by: Kenneth Graunke <> Reviewed-by: Anuj Phogat <>
2013-06-26i965: Add back strict type assertions for MAD and LRP.Kenneth Graunke1-2/+16
Commit 526ffdfc033ab01cf133cb7e8290c65d12ccc9be relaxed the type assertions in brw_alu3 to allow D/UD types (required by BFE and BFI2). This lost us the strict type checking for MAD and LRP, which require all four types to be float. This patch adds a new ALU3F wrapper which checks these once again. Signed-off-by: Kenneth Graunke <> Reviewed-by: Anuj Phogat <>
2013-06-26glsl: Streamline the built-in type handling code.Kenneth Graunke6-694/+424
Over the last few years, the compiler has grown to support 7 different language versions and 6 extensions that add new built-in types. With more and more features being added, some of our core code has devolved into an unmaintainable spaghetti of sorts. A few problems with the old code: 1. Built-in types are declared...where exactly? The types in builtin_types.h were organized in arrays by the language version or extension they were introduced in. It's factored out to avoid duplicates---every type only exists in one array. But that means that sampler1D is declared in 110, sampler2D is in core types, sampler3D is a unique global not in a list...and so on. 2. Spaghetti call-chains with weird parameters: generate_300ES_types calls generate_130_types which calls generate_120_types and generate_EXT_texture_array_types, which calls generate_110_types, which calls generate_100ES_types...and more Except that ES doesn't want 1D types, so we have a skip_1d parameter. add_deprecated also falls into this category. 3. Missing type accessors. Common types have convenience pointers (like glsl_type::vec4_type), but others may not be accessible at all without a symbol table (for example, sampler types). 4. Global variable declarations in a header file? #include "builtin_types.h" in two C++ files would break the build. The new code addresses these problems. All built-in types are declared together in a single table, independent of when they were introduced. The macro that declares a new built-in type also creates a convenience pointer, so every type is available and it won't get out of sync. The code to populate a symbol table with the appropriate types for a particular language version and set of extensions is now a single table-driven function. The table lists the type name and GL/ES versions when it was introduced (similar to how the lexer handles reserved words). A single loop adds types based on the language version. Explicit extension checks then add additional types. If they were already added based on the language version, glsl_symbol_table simply ignores the request to add them a second time, meaning we don't need to worry about duplicates and can simply list types where they belong. v2: Mark uvecs and shadow samplers as ES3 only, and 1DArrayShadow as unsupported in ES entirely. Add a touch more doxygen. Signed-off-by: Kenneth Graunke <> Reviewed-by: Eric Anholt <>
2013-06-26glsl: Don't use random pointers as an array of glsl_type objects.Kenneth Graunke1-1/+1
Using a random glsl_type convenience pointer as an array is a really bad idea, for all the reasons mentioned in the previous commit. The new glsl_type::bvec() function is simpler anyway. Prevents breakage in the next commit. Signed-off-by: Kenneth Graunke <> Reviewed-by: Eric Anholt <>
2013-06-26glsl: Stop being clever with pointer arithmetic when fetching types.Kenneth Graunke1-4/+4
Currently, vector types are linked together closely: the glsl_type objects for float, vec2, vec3, and vec4 are all elements of the same array, in that exact order. This makes it possible to obtain vector types via pointer arithmetic on the scalar type's convenience pointer. For example, float_type + (3 - 1) = vec3. However, relying on this is extremely fragile. There's no particular reason the underlying type objects need to be stored in an array. They could be individual class members, possibly with padding between them. Then the pointer arithmetic would break, and we'd get bad pointers to non-heap allocated data, causing subtle breakage that can't be detected by valgrind. Cue insanity. Or someone could simply reorder the type variables, causing us to get the wrong type entirely. Also cue insanity. Writing this explicitly is much safer. With the new helper functions, it's a bit less code even. Signed-off-by: Kenneth Graunke <> Reviewed-by: Eric Anholt <>
2013-06-26glsl: Add simple vector type accessor helpers.Kenneth Graunke2-0/+61
This patch introduces new functions to quickly grab a pointer to a vector type. For example: glsl_type::bvec(4) returns glsl_type::bvec4_type glsl_type::ivec(3) returns glsl_type::ivec3_type glsl_type::uvec(2) returns glsl_type::uvec2_type glsl_type::vec(1) returns glsl_type::float_type This is less wordy than glsl_type::get_instance(GLSL_TYPE_BOOL, 4, 1), which can help avoid extra word wrapping. Signed-off-by: Kenneth Graunke <> Reviewed-by: Eric Anholt <>
2013-06-26mesa: update glext.h to version 20130624Brian Paul2-10434/+8470
In glapi_priv.h we always need the typedef for the GLclampx type since GL_OES_fixed_point is now defined in glext.h but the GLclampx type is not. GLclampx is not used by anything in glext.h but we need it for GL ES dispatch. This is a huge patch because the structure of the file has been changed. The following extensions are new, however: GL_AMD_interleaved_elements GL_AMD_shader_trinary_minmax GL_IBM_static_data GL_INTEL_map_texture GL_NV_compute_program5 GL_NV_deep_texture3D GL_NV_draw_texture GL_NV_shader_atomic_counters GL_NV_shader_storage_buffer_object GL_NVX_conditional_render GL_OES_byte_coordinates GL_OES_compressed_paletted_texture GL_OES_fixed_point GL_OES_query_matrix GL_OES_single_precision And these extensions were removed: GL_FfdMaskSGIX GL_INGR_palette_buffer GL_INTEL_texture_scissor GL_SGI_depth_pass_instrument GL_SGIX_fog_scale GL_SGIX_impact_pixel_texture GL_SGIX_texture_select Reviewed-by: José Fonseca <>
2013-06-26st/mesa: add casts to silence MSVC warningsBrian Paul5-8/+8
2013-06-26st/mesa: make rtt_level, face, slice unsigned to silence MSVC warningsBrian Paul1-1/+1
2013-06-26hud: add float casts to silence MSVC warningsBrian Paul1-49/+49