summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* i965, mesa: Use the new DECLARE_R[Z]ALLOC_CXX_OPERATORS macros.Kenneth Graunke2013-09-217-122/+12
| | | | | | | | | | | | | | | | These classes declared a placement new operator, but didn't declare a delete operator. Switching to the macro gives them a delete operator, which probably is a good idea anyway. This also eliminates a lot of boilerplate. v2: Properly use RZALLOC in Mesa IR/TGSI translators. Caught by Eric and Chad. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Use the new DECLARE_R[Z]ALLOC_CXX_OPERATORS in a bunch of places.Kenneth Graunke2013-09-215-121/+7
| | | | | | | | | This eliminates a lot of boilerplate and should be 100% equivalent. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* ralloc: Introduce new macros for defining C++ new/delete operators.Kenneth Graunke2013-09-211-0/+26
| | | | | | | | | | | | | | | | Most of our C++ classes define placement new and delete operators so we can do convenient allocation via: thing *foo = new(mem_ctx) thing(...) Currently, this is done via a lot of boilerplate. By adding simple macros to ralloc, we can condense this to a single line, making it trivial to add this feature to a new class. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* r600g: fast color clears for single-sample buffersGrigori Goronzy2013-09-205-11/+86
| | | | | | | | | | | Allocate a CMASK on demand and use it to fast clear single-sample colorbuffers. Both FBOs and window system colorbuffers are fast cleared. Expand as needed when colorbuffers are mapped or displayed on screen. v2: cosmetics, move transfer expansion into dma_blit Signed-off-by: Marek Olšák <[email protected]>
* r600g: add support for separately allocated CMASKsGrigori Goronzy2013-09-204-10/+60
| | | | | | v2: check for NULL cbufs Signed-off-by: Marek Olšák <[email protected]>
* gallium: add flush_resource context functionMarek Olšák2013-09-2023-3/+188
| | | | | | | | | r600g needs explicit flushing before DRI2 buffers are presented on the screen. v2: add (stub) implementations for all drivers, fix frontbuffer flushing v3: fix galahad Signed-off-by: Marek Olšák <[email protected]>
* radeonsi: simplify and fix MSAA texture sampling for array texturesMarek Olšák2013-09-202-27/+17
| | | | Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: fix textureOffset and texelFetchOffset GLSL functionsMarek Olšák2013-09-201-9/+23
| | | | Reviewed-by: Michel Dänzer <[email protected]>
* llvmpipe: Fix rendering to PIPE_FORMAT_R10G10B10A2_UNORM.José Fonseca2013-09-201-6/+78
| | | | | | | We must take rounding in consideration when re-scaling to narrow normalized channels, such as 2-bit normalized alpha. Reviewed-by: Roland Scheidegger <[email protected]>
* draw: Ensure draw_pt_middle_end::bind_parameters is never NULL.José Fonseca2013-09-202-0/+15
| | | | | | Prevents calling NULL pointer with softpipe in certain cases. Trivial.
* tools/trace: Simple script to compare two traces.José Fonseca2013-09-201-0/+66
| | | | Based on the earlier apitrace tracediff.sh script.
* mesa: Silence GCC warning 'comparison between signed and unsigned integer ↵Ian Romanick2013-09-191-1/+1
| | | | | | | | | expressions' Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* mesa: Fix broken call to print_table_statsIan Romanick2013-09-191-1/+3
| | | | | | | | | | The function takes a parameter, but none was given. Also, in the non-GET_DEBUG case, silence the unused parameter warning. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Set VertexProgram.MaxOutputComponents and ↵Ian Romanick2013-09-191-0/+2
| | | | | | | | | FragmentProgram.MaxInputComponents in standalone scaffolding Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* mesa: Allow several ARB_geometry_shader4 queries in OpenGL 3.2Ian Romanick2013-09-192-4/+10
| | | | | | | | | | | | GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS, GL_MAX_GEOMETRY_OUTPUT_VERTICES, GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS, and GL_MAX_GEOMETRY_UNIFORM_COMPONENTS all have the same enum value and meaning as their _ARB counterparts. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* mesa: Expose MAX_GEOMETRY_{INPUT,OUTPUT}_COMPONENTS on OpenGL 3.2Ian Romanick2013-09-191-1/+3
| | | | | | | | | | | | | | | The comment '# GL 3.0 / GLES3' was incorrect. The MAX_VERTEX_OUTPUT_COMPONENTS and MAX_FRAGMENT_INPUT_COMPONENTS queries were added in OpenGL 3.2 (with geometry shaders) and OpenGL ES 3.0. This just fixes that comment. v2: Add the GEOMETRY queries in the existing '# GL 3.2' section since they have nothing to do with GLES3. Suggested by Paul. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* mesa: Get GL_MAX_FRAGMENT_INPUT_COMPONENTS from ↵Ian Romanick2013-09-192-2/+1
| | | | | | | | | | | | FragmentProgram.MaxInputComponents In OpenGL ES 3.0 the minimum-maximum for GL_MAX_VERTEX_OUTPUT_VECTORS is 16, but the minimum-maximum for GL_MAX_FRAGMENT_INTPUT_VECTORS is 15. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* mesa: Get GL_MAX_VERTEX_OUTPUT_COMPONENTS from VertexProgram.MaxOutputComponentsIan Romanick2013-09-192-2/+1
| | | | | | | | | | In OpenGL ES 3.0 the minimum-maximum for GL_MAX_VERTEX_OUTPUT_VECTORS is 16, but the minimum-maximum for GL_MAX_FRAGMENT_INTPUT_VECTORS is 15. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* i915: Set VertexProgram.MaxOutputComponents and ↵Ian Romanick2013-09-191-0/+2
| | | | | | | | | | | | FragmentProgram.MaxInputComponents This was the only remaining place in Mesa that sets MaxVaryings without also setting these values. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* i965: Set *Program.Max{Input,Output}ComponentsIan Romanick2013-09-191-1/+6
| | | | | | | | | Now that MaxVaryings is > 16, VertexProgram.MaxOutputComponents, GeometryProgram.MaxInputComponents, GeometryProgram.MaxOutputComponents, and FragmentProgram.MaxInputComponents also need to be set. Signed-off-by: Ian Romanick <[email protected]> Cc: Paul Berry <[email protected]>
* mesa: Set default values for Max{Input,Output}Components in init_program_limitsIan Romanick2013-09-191-0/+6
| | | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* mesa: Remove gl_constants::MaxVaryingComponentsIan Romanick2013-09-191-1/+0
| | | | | | | | | | There are no longer any users. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Paul Berry <[email protected]> Cc: Zack Rusin <[email protected]>
* mesa: Use correct data for MAX_{VERTEX,GEOMETRY}_VARYING_COMPONENTS_ARB queriesIan Romanick2013-09-192-3/+6
| | | | | | | | | | | | | | | | | | | | | Previously gl_constants::MaxVaryingComponents was used. Now gl_constants::VertexProgram::MaxOutputs and gl_constants::GeometryProgram::MaxOutputs are used. This means that st_extensions.c had to be updated to set these fields instead of MaxVaryingComponents. It was previously the only place that set MaxVaryingComponents. I believe that the structure is allocated by calloc, so the value should be initialized to zero in non-Gallium drivers before and after my change. Right now nobody enables GL_ARB_geometry_shader4, so it's pretty much dead code anyway. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Paul Berry <[email protected]> Cc: Zack Rusin <[email protected]>
* mesa: Track per-stage shader input and output limits independentlyIan Romanick2013-09-191-0/+24
| | | | | | | | | | | | | | | | | | | | | | | In OpenGL 3.2 these are independently queryable. In addition, the spec has different minimum-maximums for various values. GL_MAX_VERTEX_OUTPUT_COMPONENTS is 64, but GL_MAX_GEOMETRY_OUTPUT_COMPONENTS (and GL_MAX_FRAGMENT_INPUT_COMPONENTS) is 128. In OpenGL ES 3.0 these are also independently queryable. The spec has different minimum-maximums for various values. GL_MAX_VERTEX_OUTPUT_VECTORS is 16, but GL_MAX_FRAGMENT_INTPUT_VECTORS is 15. None of these values are used yet. I have just added space to the structures. Future patches will add users and eventually remove some old fields. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Paul Berry <[email protected]> Cc: Zack Rusin <[email protected]>
* mesa: Support GL_MAX_VERTEX_OUTPUT_COMPONENTS query with ES3Ian Romanick2013-09-192-0/+2
| | | | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Paul Berry <[email protected]> Cc: "9.1 9.2" <[email protected]>
* i965: Refactor Gen4-6 SURFACE_STATE setup for buffer surfaces.Kenneth Graunke2013-09-191-61/+39
| | | | | | | | | | | | | | This was an embarassingly large amount of copy and pasted code, and it wasn't particularly simple code either. By factoring it out into a helper function, we consolidate the complexity. v2: Properly NULL-check bo. Caught by Eric Anholt. v3: Do the subtraction by 1 in gen7_emit_buffer_surface_state, rather than making callers do it. This makes the buffer_size parameter the actual size of the buffer. Suggested by Paul Berry. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Refactor Gen7+ SURFACE_STATE setup for buffer surfaces.Kenneth Graunke2013-09-191-86/+60
| | | | | | | | | | | | | | This was an embarassingly large amount of copy and pasted code, and it wasn't particularly simple code either. By factoring it out into a helper function, we consolidate the complexity. v2: Properly NULL-check bo. Caught by Eric Anholt. v3: Do the subtraction by 1 in gen7_emit_buffer_surface_state, rather than making callers do it. This makes the buffer_size parameter the actual size of the buffer. Suggested by Paul Berry. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Fix off by one errors in texture buffer size calculations.Kenneth Graunke2013-09-192-2/+2
| | | | | | | | | The value that's split into width/height/depth needs to be the size of the buffer minus one. This makes it consistent with the constant buffer and shader time SURFACE_STATE setup code. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Fix writemask != 0 assertions on Sandybridge.Kenneth Graunke2013-09-191-2/+4
| | | | | | | | | | | | | | | | | | | This fixes myriads of regressions since commit 169f9c030c16d1247a3a7629 ("i965: Add an assertion that writemask != NULL for non-ARFs."). On Sandybridge, our control flow handling (such as brw_IF) does: brw_set_dest(p, insn, brw_imm_w(0)); insn->bits1.branch_gen6.jump_count = 0; This results in a IMM destination with zero for the writemask. IMM destinations are rather bizarre, but the code has been working for ages, so I'm loathe to change it. Fixes glxgears on Sandybridge. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glsl: Delete builtin_builder::shader when destroying built-ins.Kenneth Graunke2013-09-191-0/+3
| | | | | | | | | | I would use _mesa_delete_shader, but it's declared static, and we don't really need any of the stuff in it anyway. This fixes a memory leak caught by Valgrind. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Fix brw_gs_prog_data_compare to actually check field members.Kenneth Graunke2013-09-191-1/+1
| | | | | | | | | | | &a and &b are the address of the local stack variables, not the actual structures. Instead of comparing the fields of a and b, we compared ...some stack memory. Not a candidate for stable since GS code doesn't exist in 9.2. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965: Fix brw_vs_prog_data_compare to actually check field members.Kenneth Graunke2013-09-191-1/+1
| | | | | | | | | | | | | &a and &b are the address of the local stack variables, not the actual structures. Instead of comparing the fields of a and b, we compared ...some stack memory. Caught by Valgrind on Piglit's glsl-lod-bias test (among many others). Signed-off-by: Kenneth Graunke <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68233 Reviewed-by: Chad Versace <[email protected]> Cc: [email protected]
* i965: Move binding table code to a new file, brw_binding_tables.c.Kenneth Graunke2013-09-196-187/+243
| | | | | | | | | | | | The code to upload the binding tables for each stage was scattered across brw_{vs,gs,wm}_surface_state.c and brw_misc_state.c, which also contain a lot of code to populate individual SURFACE_STATE structures. This patch brings all the binding table upload code together, and splits it out from the code which fills in SURFACE_STATE entries. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Use brw_upload_binding_table() for the pixel shader as well.Kenneth Graunke2013-09-191-18/+5
| | | | | | | | | | | This is not quite the same: brw_upload_binding_table() also has code to early-return if there are no entries, while the existing code did not. The PS binding table is unlikely to be empty since it will have at least one color buffer. If it ever is empty, early returning seems wise. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Generalize brw_vec4_upload_binding_table() beyond vec4 stages.Kenneth Graunke2013-09-193-16/+19
| | | | | | | | | | | | | | Instead of passing in a brw_vec4_prog_data structure, we can simply pass the one field it needs: the number of entries in the binding table. We also need to pass in the shader time surface index rather than hardcoding SURF_INDEX_VEC4_SHADER_TIME. Since the resulting function is stage-agnostic, this patch removes "vec4_" from the name. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Convert loop to memcpy in brw_vec4_upload_binding_table().Kenneth Graunke2013-09-191-9/+6
| | | | | | | This is probably more efficient. At any rate, it's less code. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Update comments in brw_vec4_upload_binding_table().Kenneth Graunke2013-09-191-6/+1
| | | | | | | | | | The first comment was a bit stale; there are more kinds of surfaces than textures and pull constants. The second was a leftover "to do" comment for something I already did. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* winsys/sw/xlib: fix compile error in xlib_sw_winsys.c.Gaetan Nadon2013-09-191-1/+1
| | | | | | | | | | | | | | | | | xlib_sw_winsys.h:5:22: fatal error: X11/Xlib.h: No such file or directory The compiler cannot find the Xlib.h in the installed system headers. All supplied include directives point to inside the mesa module. The X11_CFLAGS variable is undefined (not defined in config.status). It appears the intent was to use X11_INCLUDES defined in configure.ac. The Xlib.h file is not installed on my workstation. It is supplied in the libx11-dev package. This allows an X developer control over which version of this file is used for X development. Signed-off-by: Gaetan Nadon <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glx: fix compile error in egl_glx.c.Gaetan Nadon2013-09-191-1/+1
| | | | | | | | | | | | | | | | | egl_glx.c:40:22: fatal error: X11/Xlib.h: No such file or directory The compiler cannot find the Xlib.h in the installed system headers. All supplied include directives point to inside the mesa module. The X11_CFLAGS variable is undefined (not defined in config.status). It appears the intent was to use X11_INCLUDES defined in configure.ac. The Xlib.h file is not installed on my workstation. It is supplied in the libx11-dev package. This allows an X developer control over which version of this file is used for X development. Signed-off-by: Gaetan Nadon <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* freedreno/a3xx: fix typo mixup w/ mipfilterRob Clark2013-09-191-1/+1
| | | | Signed-off-by: Rob Clark <[email protected]>
* freedreno: fix glReadPixelsRob Clark2013-09-191-2/+2
| | | | | | | duh, we still need to flush if there are pending draws and it isn't an unsynchronized case. Signed-off-by: Rob Clark <[email protected]>
* gallivm: adjust wrap mode to CLAMP_TO_EDGE always for cube maps.Roland Scheidegger2013-09-191-3/+7
| | | | | | | | | | | | Technically without seamless filtering enabled GL allows any wrap mode, which made sense when supporting true borders (can get seamless effect with border and CLAMP_TO_BORDER), but gallium doesn't support borders and d3d9 requires wrap modes to be ignored and it's a pain to fix up the sampler state (as it makes it texture dependent). It is difficult to imagine a situation where an app really wants another behavior so just cheat here. (It looks like some graphics hw (intel) actually requires this too hence it should be safe.) Reviewed-by: Jose Fonseca <[email protected]>
* android: Remove builtin_compilerAdrian Negreanu2013-09-181-19/+0
| | | | | | | | | | | | The first part was done in: commit c845140a20efa6a30a5465301d1f9b4acea79155 Author: Kenneth Graunke <[email protected]> Date: Tue Sep 3 21:22:17 2013 -0700 Signed-off-by: Adrian Negreanu <[email protected]> Acked-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* util/u_blit: Implement util_blit_pixels via pipe_context::blit.José Fonseca2013-09-181-410/+37
| | | | | | | | | This removes a lot of code, but not everything, as util_blit_pixels_tex is still useful when one needs to override pipe_sampler_view::swizzle_?. Reviewed-by: Zack Rusin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* util/u_blit: Support blits from cubemaps.José Fonseca2013-09-182-3/+32
| | | | | | | | | | | | By calling util_map_texcoords2d_onto_cubemap. A new parameter for util_blit_pixels_tex is necessary, as pipe_sampler_view::first_layer is always supposed to point to the first face when sampling from cubemaps. Reviewed-by: Zack Rusin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* vega: Use pipe_context::blit instead of util_blit_pixels_tex.José Fonseca2013-09-182-20/+26
| | | | | | | | Only compile-tested but it seems straightforward. Reviewed-by: Zack Rusin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* i965: Rename brw_{fs,vec4}_emit.cpp to brw_{fs,vec4}_generator.cpp.Kenneth Graunke2013-09-183-4/+4
| | | | | | | | | | | | | | | | | | The previous names were really confusing to talk about: - brw_fs_visitor() contained methods named emit_whatever(). - brw_fs_generator() contained methods named generate_whatever(), but lived in brw_fs_emit.cpp. So when someone said "the emit layer", or "emit code", we weren't sure whether they meant the visitor's emit() functions or the generator in brw_fs_emit.cpp. By renaming these files, the method names, class names, and file names all match, which is much less confusing. Signed-off-by: Kenneth Graunke <[email protected]> Acked-by: Paul Berry <[email protected]> Acked-by: Eric Anholt <[email protected]>
* glsl: Correctly validate fma()'s types.Matt Turner2013-09-171-0/+6
| | | | | | lrp() can take a scalar as a third argument, and fma() cannot. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Add frexp signatures and implementation.Matt Turner2013-09-171-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I initially implemented frexp() as an IR opcode with a lowering pass, but since it returns a value and has an out-parameter, it would break assumptions our optimization passes make about ir_expressions being pure (i.e., having no side effects). For example, if opt_tree_grafting encounters this code: uniform float u; void main() { int exp; float f = frexp(u, out exp); float g = float(exp)/256.0; float h = float(exp) + 1.0; gl_FragColor = vec4(f, g, h, g + h); } it may try to optimize it to this: uniform float u; void main() { int exp; float g = float(exp)/256.0; float h = float(exp) + 1.0; gl_FragColor = vec4(frexp(u, out exp), g, h, g + h); } Some hardware has an instruction which performs frexp(), but we would need some other compiler infrastructure to be able to generate it, such as an intrinsics system that would allow backends to emit specific code for particular bits of IR. Reviewed-by: Paul Berry <[email protected]>
* i965: Lower ldexp.Matt Turner2013-09-171-1/+2
| | | | | v2: Drop frexp lowering. Reviewed-by: Paul Berry <[email protected]>