summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* i965/blorp: allow unit tests to compile and dump assemblyTopi Pohjolainen2013-12-271-3/+16
| | | | | Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965: dump the disassembly to the given fileTopi Pohjolainen2013-12-271-10/+10
| | | | | | | | instead of ignoring the argument and always dumping to standard output. Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965/fs: allow fs-generator use without gl_fragment_programTopi Pohjolainen2013-12-271-3/+6
| | | | | | | Prepares the generator to accept hand-crafted blorp programs. Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965/fs: generate fs programs also without any 8-width instructionsTopi Pohjolainen2013-12-271-2/+6
| | | | | Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* st/mesa: use pipe_sampler_view_release()Jonathan Liu2013-12-221-1/+1
| | | | | | | | | | | | This fixes a crash where old_view->context was already freed in the pipe_sampler_view_reference function contained in src/gallium/auxiliary/utils/u_inlines.h. As a result, the sampler_view_destroy function pointer contained 0xfeeefeee indicating freed heap memory. Cc: "10.0" <[email protected]> Signed-off-by: Jonathan Liu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* i915: Add support for gl_FragData[0] reads.Henri Verbeet2013-12-221-0/+1
| | | | | | | | | | | Similar to 556a47a2621073185be83a0a721a8ba93392bedb, without this reading from gl_FragData[0] would cause a software fallback. Bugzilla: https://bugs.winehq.org/show_bug.cgi?id=33964 Signed-off-by: Henri Verbeet <[email protected]> Cc: 10.0 9.2 9.1 <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: inline r200 radeon texture format macros to facility search and replaceMark Mueller2013-12-212-102/+70
| | | | | Signed-off-by: Mark Mueller <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: Fix build to properly check for supported compiler flagsLauri Kasanen2013-12-201-1/+5
| | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72708 Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Lauri Kasanen <[email protected]>
* mesa: It is not possible to have GLSL < 1.20Ian Romanick2013-12-202-3/+0
| | | | | | | This hasn't been possible for a long time. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Clean up bad code formatting left from previous commitIan Romanick2013-12-204-20/+18
| | | | | | | Also s/_EXT// on enums that are now part of core. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: GL_EXT_packed_depth_stencil is not optionalIan Romanick2013-12-2012-40/+11
| | | | | | | | Every driver supports it. All current and future Gallium drivers always support it, and all existing classic drivers support it. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* radeon: Sort list of enabled extensionsIan Romanick2013-12-201-6/+5
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* r200: Sort list of enabled extensionsIan Romanick2013-12-201-16/+10
| | | | | | | Note that ARB_occlusion_query was previously enabled twice. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* i965: Set fast color clear mcs_state on newly allocated image miptreesKeith Packard2013-12-201-3/+7
| | | | | | | | | | Just copying code from the dri2 path to set up the fast color clear state. This also removes a couple of bogus intel_region_reference calls. Signed-off-by: Keith Packard <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Correct check for re-bound buffer in intel_update_image_bufferKeith Packard2013-12-201-4/+15
| | | | | | | | | | | The buffer-object is the persistent thing passed through the loader, so when updating an image buffer, check to see if it is already bound to the provided bo. The region, on the other hand, is allocated separately for the miptree, and so will never be the same as that passed back from the loader. Signed-off-by: Keith Packard <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Use RED for depth texture formats rather than INTENSITY.Kenneth Graunke2013-12-201-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While looking through the documentation, I found this in the Sandybridge PRM (Volume 4, Part 1, Page 140): "Use of sample_c with SURFTYPE_CUBE surfaces is undefined with the following surface formats: I24X8_UNORM, L24X8_UNORM, A24X8_UNORM, I32_FLOAT, L32_FLOAT, A32_FLOAT." I haven't observed this to be true, but it suggests that we may want to use other formats. We already perform DEPTH_TEXTURE_MODE swizzling in the shaders, and don't rely on the surface format to splat things appropriately. So using RED should work just as well as INTENSITY. A few notes about the formats: - R24_UNORM_X8_TYPELESS has the exact same properties as I24X8_UNORM. - R16_UNORM and R32_FLOAT are additionally supported as a render target, while the old I16_UNORM/I32_FLOAT formats are not. - R32_FLOAT_X8X24_TYPELESS is not supported as a render target, while the old format (R32G32_FLOAT) was. However, it shares the same properties as the formats we use for Z24, so it should suffice. This makes translate_tex_format and brw_blorp_surface_info::set a bit more similar. No Piglit changes on Sandybridge or Ivybridge. No oglconform changes on Sandybridge. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965/gen6: Fix HiZ hang in WebGL Google MapsChad Versace2013-12-201-0/+15
| | | | | | | | | | | | | | | | | | | | | Emitting flushes before depth and hiz resolves at the top of blorp's state emission fixes the hang. Marchesin and I found the fix experimentally, as opposed to adhering to a documented hardware workaround. A more minimal fix likely exists, but this gets the job done. Fixes HiZ hangs in the new WebGL Google maps on Sandybridge Chrome OS. Tested by zooming in and out continuously for 2 hours. This patch is based on https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/8bc07bb70163c3706fb4ba5f980e57dc942f56dd CC: [email protected] Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70740 Signed-off-by: Stéphane Marchesin <[email protected]> Signed-off-by: Chad Versace <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Store QPitch in intel_mipmap_tree.Kenneth Graunke2013-12-202-6/+10
| | | | | | | | | | | | | | | Broadwell allows us to specify an arbitrary value for QPitch, rather than baking a specific formula into the hardware and requiring software to lay things out to match. The only restriction is that the software provided QPitch needs to be large enough so successive array slices do not overlap. In order to support this flexibility, software needs to specify QPitch in a bunch of packets. Storing QPitch makes that easy, and allows us to adjust it in a single place should we wish to change it in the future. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* i965: Add support for Broadwell's new register types.Kenneth Graunke2013-12-203-1/+19
| | | | | | | | | | | | Broadwell introduces support for Q, UQ, and HF types. It also extends DF support to allow immediate values. Irritatingly, although HF and DF both support immediates, they're represented by a different value depending on the register file. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Add BRW_REGISTER_TYPE_DF.Kenneth Graunke2013-12-203-0/+6
| | | | | | | | | Ivybridge, Baytrail, and Haswell support double float register types, but do not support them as immediate values. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Abstract BRW_REGISTER_TYPE_* into an enum with unique values.Kenneth Graunke2013-12-204-22/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | On released hardware, values 4-6 are overloaded. For normal registers, they mean UB/B/DF. But for immediates, they mean UV/VF/V. Previously, we just created #defines for each name, reusing the same value. This meant we could directly splat the brw_reg::type field into the assembly encoding, which was fairly nice, and worked well. Unfortunately, Broadwell makes this infeasible: the HF and DF types are represented as different numeric values depending on whether the source register is an immediate or not. To preserve sanity, I decided to simply convert BRW_REGISTER_TYPE_* to an abstract enum that has a unique value for each register type, and write translation functions. One nice benefit is that we can add assertions about register files and generations. I've chosen not to convert brw_reg::type to the enum, since converting it caused a lot of trouble due to C++ enum rules (even though it's defined in an extern "C" block...). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Decode three-source register types directly.Kenneth Graunke2013-12-201-25/+14
| | | | | | | | | | | | | | Three-source instructions use a different encoding for register types (and have a much more limited set to choose from). Previously, we translated those into BRW_REGISTER_TYPE_* values, then reused the existing reg_encoding mapping. Doing it directly is more straightforward and actually less code. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Disassemble UV types, not UB types.Kenneth Graunke2013-12-201-2/+2
| | | | | | | | | UB types have never been supported as immediates. On Gen4-5, register encoding 4 is "Reserved." On Gen6+, it means UV. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Add missing BRW_REGISTER_TYPE_UV.Kenneth Graunke2013-12-201-0/+1
| | | | | | | | Sandybridge added support for packed unsigned vectors. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Fix 3DSTATE_PUSH_CONSTANT_ALLOC_PS packet creation.Kenneth Graunke2013-12-201-1/+1
| | | | | | | | | When adding geometry shader support, we accidentally reversed the size and offset parameters. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]> Cc: "10.0" <[email protected]>
* i965: Use {point_sprite,flat}_enable variable names instead of dw*.Kenneth Graunke2013-12-202-10/+14
| | | | | | | | | | | Calling the local variables flat_enable and point_sprite_enable is clearer than dw16 and such. It also matches the names used in calculate_attr_overrides, which computes them. v2: Add /* dw16 */ and /* dw10 */ comments, requested by Jordan. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* i965: Zero out {point_sprite,flat}_enables in calculate_attr_overrides.Kenneth Graunke2013-12-202-6/+3
| | | | | | | | | | | | | | | calculate_attr_overrides is responsible for computing the point sprite and flat-shading enable bitfields. It does so by OR'ing in a bunch of bits. However, it relied on the caller to set the initial value to zero. This is pretty fragile - if the caller neglects to zero out those variables, then the enable bitfields end up full of garbage, which shows up as random things being flat-shaded. This patch moves the zero-initialization into calculate_attr_overrides, so that the computation is completely in one place. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* i965: Delete bogus BRW_REGISTER_TYPE_HF define.Kenneth Graunke2013-12-202-2/+0
| | | | | | | | | | git blame ascribes this to the initial commit of the driver. No released hardware has ever supported half float, according to the documentation for SrcType in the ISA reference. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: Assert variable coming from get_variable() in get_current_attribJuha-Pekka Heikkila2013-12-191-0/+1
| | | | | Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add asserts into emit_fog_instructionsJuha-Pekka Heikkila2013-12-191-0/+3
| | | | | Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st_glsl_to_tgsi: add support for prim id fragment shader inputDave Airlie2013-12-181-0/+5
| | | | | | | | For GLSL 1.50 we can get frag shaders with primitive id as an input, add support to the translator for this. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: add asserts in load_texunit_bumpmapJuha-Pekka Heikkila2013-12-181-0/+2
| | | | | | | | | In load_texunit_bumpmap tc_array is asserted so lets assert rot_mat_0 and rot_mat_1 also which are coming from same path. Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: minor simplification in _mesa_es3_error_check_format_and_type()Brian Paul2013-12-181-3/+1
| | | | The type_valid local was set to true and never changed.
* mesa: Verify memory allocations success in _mesa_PushAttribJuha-Pekka Heikkila2013-12-181-84/+154
| | | | | | | | Check for malloc() returning null to fix Klocwork warnings. Minor clean-ups by BrianP. Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Verify memory allocations success in _mesa_PushClientAttribJuha-Pekka Heikkila2013-12-181-11/+59
| | | | | Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Change save_attrib_data() to return booleanJuha-Pekka Heikkila2013-12-181-1/+3
| | | | | | | Change save_attrib_data() to return true/false depending on success. Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add API/extension checks for 3-component texture buffer formatsBrian Paul2013-12-181-7/+14
| | | | | | | | | | The GL_RGB32F, GL_RGB32UI and GL_RGB32I texture buffer formats are only supposed to be allowed if the GL_ARB_texture_buffer_object_rgb32 extension is supported. Note that the texture buffer extensions require a core profile. This patch adds those checks. Fixes the soon-to-be-added arb_clear_buffer_object-negative-bad-internalformat piglit test.
* mesa: 78-column wrapping in extensions.cBrian Paul2013-12-181-6/+8
|
* mesa: Cleanup mesa/main/bufferobj.hPi Tabred2013-12-181-14/+45
| | | | | | Column wrapping and space between lines. Reviewed-by: Brian Paul <[email protected]>
* Add ARB_clear_buffer_object to list of supported extensionsPi Tabred2013-12-181-0/+1
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/mesa: plug in default buffer object driver functionsBrian Paul2013-12-181-0/+3
| | | | | In particular, this plugs in the new ClearBufferSubData() fallback driver function.
* mesa: Implement functions for clear_buffer_object extensionsPi Tabred2013-12-182-0/+283
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Modify get_buffer() to allow for a variable error codePi Tabred2013-12-181-16/+28
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Add bufferobj_range_mapped functionPi Tabred2013-12-181-32/+59
| | | | | | | | | | | Add function to test if the buffer is already mapped and if so, if the mapped range overlaps the given range. Modify the _mesa_InvalidateBufferSubData function to use the new function. Enable buffer_object_subdata_range_good() to use bufferobj_range_mapped Reviewed-by: Brian Paul <[email protected]>
* mesa: get_texbuffer_format(): differentiate between core and compat contextPi Tabred2013-12-181-80/+87
| | | | | | | | alpha, lumincance and intensity formats are illegal in a core context. Add a check to return MESA_FORMAT_NONE if one of those is requested within a core context. Reviewed-by: Brian Paul <[email protected]>
* mesa: Modify format validation to check for extension not context versionPi Tabred2013-12-181-7/+2
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Make validate_texbuffer_format function available externallyPi Tabred2013-12-182-3/+8
| | | | | | | - change storage class from static to extern - rename validate_texbuffer_format to _mesa_validate_texbuffer_format Reviewed-by: Brian Paul <[email protected]>
* mesa: Add infrastructure for GL_ARB_clear_buffer_objectPi Tabred2013-12-182-2/+8
| | | | | | | | | - add xml file for extension - add reference in gl_API.xml - add pointer to device driver function table (dd.h) - update dispatch_sanity.cpp Reviewed-by: Brian Paul <[email protected]>
* main: Move MESA_SHADER_TYPES outside of gl_shader_type enum.Paul Berry2013-12-171-1/+2
| | | | | | This will avoid spurious compiler warnings in the patch that follows. Reviewed-by: Brian Paul <[email protected]>
* glsl: Don't return bad values from _mesa_shader_type_to_index.Paul Berry2013-12-171-1/+1
| | | | | | | | | | This will avoid compiler warnings in the patch that follows. There should be no user-visible effect because the change only affects the behaviour when an invalid enum is passed to _mesa_shader_type_to_index(), and that can only happen if there is a bug elsewhere in Mesa. Reviewed-by: Brian Paul <[email protected]>