summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
...
* mesa: Include stdint.h in mtypes.h for uint32_t symbol.Vinson Lee2013-09-261-0/+2
| | | | | | | | | | | | | This patch fixes the MSVC build error introduced with commit b2e327e08f8519da131dd382adcc99240d433404. api_arrayelt.c src\mesa\main/mtypes.h(1809) : error C2061: syntax error : identifier 'uint32_t' src\mesa\main/mtypes.h(1810) : error C2059: syntax error : '}' src\mesa\main/mtypes.h(1825) : error C2079: 'Minimum' uses undefined union 'gl_perf_monitor_counter_value' src\mesa\main/mtypes.h(1828) : error C2079: 'Maximum' uses undefined union 'gl_perf_monitor_counter_value' Signed-off-by: Vinson Lee <vlee@freedesktop.org>
* i965/fs: Don't double-accept operands of logical and/or/xor operations.Kenneth Graunke2013-09-261-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | If the argument to emit_bool_to_cond_code() is an ir_expression, we loop over the operands, calling accept() on each of them, which generates assembly code to compute that subexpression. We then emit one or two final instruction that perform the top-level operation on those operands. If it's not an expression (say, a boolean-valued variable), we simply call accept() on the whole value. In commit 80ecb8f1 (i965/fs: Avoid generating extra AND instructions on bool logic ops), Eric made logic operations jump out of the expression path to the non-expression path. Unfortunately, this meant that we would first accept() the two operands, skip generating any code that used them, then accept() the whole expression, generating code for the operands a second time. Dead code elimination would always remove the first set of redundant operand assembly, since nothing actually used them. But we shouldn't generate it in the first place. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com>
* i965: Add #define for MI_REPORT_PERF_COUNT on Gen6+.Kenneth Graunke2013-09-261-0/+2
| | | | | | This appears in Volume 1 Part 1 of the Sandybridge PRM on page 48. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
* i965: Add support for GL_AMD_performance_monitor on Ironlake.Kenneth Graunke2013-09-266-0/+420
| | | | | | | | | | | | | | | | | | | Ironlake's counters are always enabled; userspace can simply send a MI_REPORT_PERF_COUNT packet to take a snapshot of them. This makes it easy to implement. The counters are documented in the source code for the intel-gpu-tools intel_perf_counters utility. v2: Adjust for core data structure changes. Add a table mapping buffer object offsets to exposed counters (which changes each generation). Finally, add report ID assertions to sanity check the BO layout (thanks to Carl Worth). v3: Update for core BeginPerfMonitor hook changes (requested by Brian). Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* mesa: Add core support for the GL_AMD_performance_monitor extension.Kenneth Graunke2013-09-269-0/+822
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This provides an interface for applications (and OpenGL-based tools) to access GPU performance counters. Since the exact performance counters available vary between vendors and hardware generations, the extension provides an API the application can use to get the names, types, and minimum/maximum values of all available counters. Counters are also organized into groups. Applications create "performance monitor" objects, select the counters they want to track, and Begin/End monitoring, much like OpenGL's query API. Multiple monitors can be in flight simultaneously. v2: Pass ctx to all driver hooks (suggested by Christoph), and attempt to fix overallocation of bitsets (caught by Christoph). Incomplete. v3: Significantly rework core data structures. Store counters in groups rather than in a global list. Use their array index in the group's counter list as the ID rather than trying to store a globally unique counter ID. Use bitsets for active counters within a group, and also track which groups are active so that's easy to query. v4: Remove _mesa_ prefix on static functions; detect out of memory conditions in new_performance_monitor(); make BeginPerfMonitor hook return a boolean rather than setting m->Active or raising an error. Switch to GLuint/unsigned for NumGroups, NumCounters, and MaxActiveCounters (which also means switching a bunch of temporary variable types). All suggested by Brian Paul. Also, remove commented out code at the bottom of the block. Finally, fix the dispatch sanity test (noticed by Ian Romanick). Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Brian Paul <brianp@vmware.com> [v3] Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* mesa: Remove 'invalidate_state' parameter to _mesa_dirty_texobj().Kenneth Graunke2013-09-266-14/+10
| | | | | | | Every caller passed true. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net>
* mesa: Remove some remaining FEATURE_* detritus.Eric Anholt2013-09-268-47/+1
| | | | | Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* i965: Fix cube array coordinate normalizationChris Forbes2013-09-261-5/+11
| | | | | | | | | | | | | | | | | | | | | | Hardware requires the magnitude of the largest component to not exceed 1; brw_cubemap_normalize ensures that this is the case. Unfortunately, we would previously multiply the array index for cube arrays by the normalization factor. The incorrect array index would then cause the sampler to attempt to access either the wrong cube, or memory outside the cube surface entirely, resulting in garbage rendering or in the worst case, hangs. Alter the normalization pass to only multiply the .xyz components. Fixes broken rendering in the arb_texture_cube_map_array-cubemap piglit, which was recently adjusted to provoke this behavior. V2: Fix indent. Signed-off-by: Chris Forbes <chrisf@ijw.co.nz> Cc: "9.2" mesa-stable@lists.freedesktop.org Reviewed-by: Eric Anholt <eric@anholt.net>
* glsl: Remove unused pointer value.Vinson Lee2013-09-241-1/+1
| | | | | | | Silences "Unused pointer value" defect reported by Coverity. Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Eric Anholt <eric@anholt.net>
* mesa: remove handcounted magic numberDylan Noblesmith2013-09-241-13/+20
| | | | | | Also make it a compile-time error with STATIC_ASSERT. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* mesa: remove outdated commentDylan Noblesmith2013-09-241-1/+0
| | | | | | | | | | | | | | No such argument exists since this commit: commit 92f3fca0ea429dcf07123e63447449db53308266 Author: Ian Romanick <ian.d.romanick@intel.com> AuthorDate: Sun Aug 21 17:23:58 2011 -0700 Commit: Ian Romanick <ian.d.romanick@intel.com> CommitDate: Tue Aug 23 14:52:09 2011 -0700 mesa: Remove target parameter from dd_function_table::BufferSubData Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* mesa: remove stale commentDylan Noblesmith2013-09-241-2/+0
| | | | | | | This line stopped making sense in the great sed replace of commit f9995b30756140724f41daf963fa06167912be7f Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* mesa: Use -Bsymbolic in the linker to locally resolve Mesa-internal symbols.Eric Anholt2013-09-237-7/+12
| | | | | | | | | | | | | Normally, LD_PRELOAD will take precedence over your own symbols, which you want for things like malloc() in libc. But we don't have any local symbols we would want overridden (like hash_table_insert(), for example!), so tell the linker to resolve them internally. This also avoids calls through the PLT. Saves almost 100k on libdricore's size, and gets us a bunch of the performance back that we had with non-dricore. Reviewed-by: Ian Romanick <ian.d.romanick@.intel.com>
* glsl: Hide many classes local to individual .cpp files in anon namespaces.Eric Anholt2013-09-231-2/+14
| | | | | | | | This gives the compiler the chance to inline and not export class symbols even in the absence of LTO. Saves about 60kb on disk. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@.intel.com>
* mesa: Drop an extra copy-and-pasted copy in the program clone function.Eric Anholt2013-09-231-1/+0
| | | | | | Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@.intel.com>
* mesa: Convert some runtime asserts to static asserts.Eric Anholt2013-09-231-2/+2
| | | | | | | | | Noticed while grepping through the code for something else. v2: Don't convert really-runtime asserts to static asserts. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@.intel.com>
* mesa: Shrink the size of the enum string lookup struct.Eric Anholt2013-09-231-0/+9
| | | | | | | | | | Since it's only used for debug information, we can misalign the struct and save the disk space. Another 19k on a 64-bit build. v2: Make a compiler.h macro to only use the attribute if we know we can. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@.intel.com>
* mesa: Remove _mesa_lookup_enum_by_name().Eric Anholt2013-09-232-34/+0
| | | | | | | | It's been unused for a long time. I stopped digging through git history as of 2009. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@.intel.com>
* i965/gen4: Fix fragment program rectangle texture shadow compares.Eric Anholt2013-09-211-4/+4
| | | | | | | | | | | | | | The rescale_texcoord(), if it does something, will return just the GLSL-sized coordinate, leaving out the 3rd and 4th components where we were storing our projected shadow compare and the texture projector. Deref the shadow compare before using the shared rescale-the-coordinate code to fix the problem. Fixes piglit tex-shadow2drect.shader_test and txp-shadow2drect.shader_test Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69525 NOTE: This is a candidate for stable branches. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* i965/gen7.5: Fix missing Shader Channel Select entries on HaswellAbdiel Janulgue2013-09-211-0/+7
| | | | | | | | | | | Probably non-intentional, but the SURFACE_STATE setup refactoring for buffer surfaces had missed the scs bits when creating constant surface states. Fixes broken GLB 2.5 on Haswell where the knight's textures are missing Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* 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 <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* mesa: Silence GCC warning 'comparison between signed and unsigned integer ↵Ian Romanick2013-09-191-1/+1
| | | | | | | | | expressions' Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
* 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 <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
* 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 <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
* 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 <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
* 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 <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
* 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 <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
* 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 <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
* 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 <ian.d.romanick@intel.com> Cc: Paul Berry <stereotype441@gmail.com>
* mesa: Set default values for Max{Input,Output}Components in init_program_limitsIan Romanick2013-09-191-0/+6
| | | | | | | Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
* mesa: Remove gl_constants::MaxVaryingComponentsIan Romanick2013-09-191-1/+0
| | | | | | | | | | There are no longer any users. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Paul Berry <stereotype441@gmail.com> Cc: Zack Rusin <zackr@vmware.com>
* 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 <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Paul Berry <stereotype441@gmail.com> Cc: Zack Rusin <zackr@vmware.com>
* 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 <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Paul Berry <stereotype441@gmail.com> Cc: Zack Rusin <zackr@vmware.com>
* mesa: Support GL_MAX_VERTEX_OUTPUT_COMPONENTS query with ES3Ian Romanick2013-09-192-0/+2
| | | | | | | | Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Paul Berry <stereotype441@gmail.com> Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
* 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 <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net>
* 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 <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net>
* 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 <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net>
* 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 <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net>
* 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 <kenneth@whitecape.org> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
* 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 <kenneth@whitecape.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68233 Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Cc: mesa-stable@lists.freedesktop.org
* 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 <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net>
* 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 <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net>
* 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 <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net>
* 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 <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net>
* 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 <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net>
* 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 <kenneth@whitecape.org> Acked-by: Paul Berry <stereotype441@gmail.com> Acked-by: Eric Anholt <eric@anholt.net>
* i965: Lower ldexp.Matt Turner2013-09-171-1/+2
| | | | | v2: Drop frexp lowering. Reviewed-by: Paul Berry <stereotype441@gmail.com>
* glsl: Add support for ldexp.Matt Turner2013-09-175-0/+10
| | | | | v2: Drop frexp. Rebase on builtins rewrite. Reviewed-by: Paul Berry <stereotype441@gmail.com>
* i965: Add some missing bits to {mesa,brw,cache}_bits[].Paul Berry2013-09-172-0/+14
| | | | | | | | | | | | | These data structures are used for debug output, so it wasn't hurting anything that there were missing bits. But it's good to keep things up to date. This patch also adds static asserts so that the {brw,cache}_bits[] arrays are the proper size, so that we don't forget to add to them in the future. Unfortunately there's no convenient way to assert that mesa_bits[] is the proper size. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* i965/gs: Implement basic gl_PrimitiveIDIn functionality.Paul Berry2013-09-174-0/+11
| | | | | | | | | | | | | | | | | If the geometry shader refers to the built-in variable gl_PrimitiveIDIn, we need to set a bit in 3DSTATE_GS to tell the hardware to dispatch primitive ID to r1, and we need to leave room for it when allocating registers. Note: this feature doesn't yet work properly when software primitive restart is in use (the primitive ID counter will incorrectly reset with each primitive restart, since software primitive restart works by performing multiple draw calls). I plan to address that in a future patch series. Fixes piglit test "spec/glsl-1.50/execution/geometry/primitive-id-in". Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>