summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* util: move string_to_uint_map to glslEmil Velikov2017-08-295-4/+483
| | | | | | | | | | | | | | | | | | The functionality is used by glsl and mesa. With the latter already depending on the former. With this in place the src/util/ static library libmesautil.la no longer has a C++ dependency. Thus objects which use it (like libEGL) don't need the C++ link. Cc: "17.2" <[email protected]> Fixes: 02cc35937277 ("egl/wayland: Use linux-dmabuf interface for buffers") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101851 Signed-off-by: Emil Velikov <[email protected]> Suggested-by: Jason Ekstrand <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Tested-by: Mike Lothian <[email protected]> Tested-by: James Harvey <[email protected]>
* st/mesa: fix XPD lowering - don't read dstMarek Olšák2017-08-291-3/+6
| | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102461 Reviewed-by: Brian Paul <[email protected]>
* i965: Fix whitespace issues in intel_buffer_objects.c.Kenneth Graunke2017-08-281-31/+29
| | | | Convert tabs to spaces and rewrap one long line.
* st/mesa: fix handling of vertex array double inputsIlia Mirkin2017-08-281-1/+3
| | | | | | | | | | | | | The is_double_vertex_input needs to be set for arrays of doubles as well. Fixes KHR-GL45.enhanced_layouts.varying_array_locations Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: [email protected]
* i965: Use GEN_GEN and GEN_IS_HASWELL in genX_state_upload.c code.Kenneth Graunke2017-08-251-4/+4
| | | | | | | | We were using brw->gen, brw->is_haswell, and devinfo->gen in a few places, when we could just use GEN_GEN and GEN_IS_HASWELL, which are evaluated at compile time. Reviewed-by: Eduardo Lima Mitev <[email protected]>
* mesa: Implement GL_ARB_polygon_offset_clampAdam Jackson2017-08-259-15/+13
| | | | | | | | | | | Semantically identical to the EXT version (whose string is still valid for GLES), so rename the bit but expose both extension strings. (Suggested by Ilia Mirkin and Ian Romanick.) v3: Fix the entrypoint alias in GL4x.xml (Ilia) Signed-off-by: Adam Jackson <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: Implement GL_ARB_texture_filter_anisotropicAdam Jackson2017-08-258-1/+11
| | | | | | | | | | | The only difference from the EXT version is bumping the minmax to 16, so just hit all the drivers at once. v2: Fix driver names, add to 17.3 release notes (Ilia Mirkin) Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Adam Jackson <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: add KHR_no_error support to glBindBufferOffsetEXT()Samuel Pitoiset2017-08-252-0/+14
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add bind_buffer_offset() helperSamuel Pitoiset2017-08-251-13/+23
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glTransformFeedbackVaryings()Samuel Pitoiset2017-08-252-0/+16
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add transform_feedback_varyings() helperSamuel Pitoiset2017-08-251-26/+37
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glResumeTransformFeedback()Samuel Pitoiset2017-08-252-0/+11
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add resume_transform_feedback() helperSamuel Pitoiset2017-08-251-7/+15
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glPauseTransformFeedback()Samuel Pitoiset2017-08-252-0/+11
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add pause_transform_feedback() helperSamuel Pitoiset2017-08-251-7/+15
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glEndTransformFeedback()Samuel Pitoiset2017-08-252-0/+11
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add end_transform_feedback() helperSamuel Pitoiset2017-08-251-9/+17
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glBeginTransformFeedback()Samuel Pitoiset2017-08-252-0/+11
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add begin_transform_feedback() helperSamuel Pitoiset2017-08-251-20/+35
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glBindTransformFeedback()Samuel Pitoiset2017-08-252-0/+11
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add bind_transform_feedback() helperSamuel Pitoiset2017-08-251-10/+18
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: port the LastLookedUpVAO optimisation to _mesa_lookup_vao()Samuel Pitoiset2017-08-251-4/+16
| | | | | | | It was only used in the errors path. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: don't error check the default buffer object in glBindBufferOffsetEXT()Samuel Pitoiset2017-08-251-6/+5
| | | | | | | | An allocation check is already done when the buffer is created at context creation. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add _fallback suffix to the default transform feedback functionsSamuel Pitoiset2017-08-251-17/+17
| | | | | | | In preparation for KHR_no_error support. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: remove unnecessary check in _mesa_init_transform_feedback_object()Samuel Pitoiset2017-08-251-3/+0
| | | | | | | | All callers already check that, and the common behaviour is to check in the _mesa_new_XXX() helpers anyway. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: check allocation failures in new_transform_feedback()Samuel Pitoiset2017-08-251-0/+4
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: remove unused _mesa_validate_transform_feedback_buffers()Samuel Pitoiset2017-08-252-19/+0
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* glsl: pass shader source keys to the disk cacheTimothy Arceri2017-08-251-1/+1
| | | | | | | We don't actually write them to disk here. That will happen in the following commit. Reviewed-by: Nicolai Hähnle <[email protected]>
* i965: add missing `const` in function signatureEric Engestrom2017-08-241-1/+1
| | | | | | | | | | | | | Gets rid of a few warnings of the form: src/mesa/drivers/dri/i965/intel_screen.c:918:49: warning: passing argument 2 of ‘modifier_is_supported’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] !modifier_is_supported(&screen->devinfo, f, 0, modifier)) ^ src/mesa/drivers/dri/i965/intel_screen.c:301:1: note: expected ‘struct intel_image_format *’ but argument is of type ‘const struct intel_image_format *’ Fixes: 1efd73df39b39589d26f "i965: Advertise the CCS modifier" Cc: Ben Widawsky <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* vbo: fix glVertexAttrib(index=0)Brian Paul2017-08-242-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Depending on which extension or GL spec you read the behavior of glVertexAttrib(index=0) either sets the current value for generic attribute 0, or it emits a vertex just like glVertex(). I believe it should do either, depending on context (see below). The piglit gl-2.0-vertex-const-attr test declares two vertex attributes: attribute vec2 vertex; attribute vec4 attr; and the GLSL linker assigns "vertex" to location 0 and "attr" to location 1. The test passes. But if the declarations were reversed such that "attr" was location 0 and "vertex" was location 1, the test would fail to draw properly. The problem is the call to glVertexAttrib(index=0) to set attr's value was interpreted as glVertex() and did not set generic attribute[0]'s value. Interesting, calling glVertex() outside glBegin/End (which is effectively what the piglit test does) does not generate a GL error. I believe the behavior of glVertexAttrib(index=0) should depend on whether it's called inside or outside of glBegin/glEnd(). If inside glBegin/End(), it should act like glVertex(). Else, it should behave like glVertexAttrib(index > 0). This seems to be what NVIDIA does. This patch makes two changes: 1. Check if we're inside glBegin/End for glVertexAttrib() 2. Fix the vertex array binding for recalculate_input_bindings(). As it was, we were using &vbo->currval[VBO_ATTRIB_POS], but that's interpreted as a zero-stride attribute and doesn't make sense for array drawing. No Piglit regressions. Fixes updated gl-2.0-vertex-const-attr test and passes new gl-2.0-vertex-attrib-0 test. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101941 Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* st/mesa: add const qualifiers in st_extensions.cBrian Paul2017-08-241-5/+5
| | | | Trivial.
* st/mesa: whitespace/indentation fixes in st_init_extensions()Brian Paul2017-08-241-5/+6
|
* mesa: remove duplicate assignments in bind_xfb_buffers()Samuel Pitoiset2017-08-241-3/+0
| | | | | | | | Useless to do that before checking errors. It's now similar to the other bind_XXX_buffers() helpers. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: fix debug/error messages in glColorMaski()Samuel Pitoiset2017-08-241-4/+4
| | | | | | | Trivial. While we are at it, adjust indentation. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* i965: Stop using wm_prog_data->binding_table.render_target_start.Kenneth Graunke2017-08-231-7/+3
| | | | | | | | | | | | | Render target surfaces always start at binding table index 0. This is required for us to use headerless FB writes, which we really want to do. So, we'll never change that. Given that, it's not necessary to look up a wm_prog_data field which we already know contains 0. We can drop the dependency in brw_renderbuffer_surfaces (Gen4-5)...which was already confusingly missing from gen6_renderbuffer_surfaces. Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Add a brw_wm_prog_data::has_render_target_reads field.Kenneth Graunke2017-08-231-4/+2
| | | | | | | State upload code should use prog_data rather than poking at shader_info directly. Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Inline brw_update_renderbuffer_surfaces().Kenneth Graunke2017-08-232-38/+20
| | | | | | Less baklava layers. Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Pass fb into emit_null_surface instead of dimensions.Kenneth Graunke2017-08-231-16/+12
| | | | | | | We either want the framebuffer dimensions or 1x1x1. Passing fb and falling back to 1x1x1 lets us shorten some calls. Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Devirtualize update_renderbuffer_surface.Kenneth Graunke2017-08-234-30/+5
| | | | | | Replace piles of my own boilerplate with 1-2 lines of code. Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Delete update_renderbuffer_surface flags.Kenneth Graunke2017-08-232-21/+5
| | | | | | | | | We don't need yet another set of flags. The function already has access to both brw and the unit, so it can check brw->draw_aux_buffer_disabled itself in one line of code. The layered flag was only used to assert that Gen4-5 doesn't do layered rendering, which isn't that useful. Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Make brw_update_renderbuffer_surface static.Kenneth Graunke2017-08-232-11/+6
| | | | | | | | Also rename it to gen6_update_renderbuffer_surface, as this is the function for Gen6+. Having functions named "brw_*" and "gen4_*" is confusing...if we're using gens, let's stick with those. Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Drop BRW_NEW_BLORP from SURFACE_STATE setup code.Kenneth Graunke2017-08-235-29/+1
| | | | | | | BLORP invalidates the binding tables, but it doesn't destroy any of the existing SURFACE_STATE entries in the statebuffer. We can reuse those. Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Make a BRW_NEW_FAST_CLEAR_COLOR dirty bit.Kenneth Graunke2017-08-238-5/+25
| | | | | | | | | | | | | | | | | | | When changing fast clear colors, we need to emit new SURFACE_STATE with the updated color at the next draw call. Most things work today because the atoms that handle SURFACE_STATE for images (mutable images, textures, render targets) also listen to BRW_NEW_BLORP, causing us to re-emit these on every BLORP operation. However, this is overkill - most BLORP operations don't require us to re-emit SURFACE_STATE. One case where this is broken today is a fast clear to a different color followed by a non-coherent framebuffer fetch. The renderbuffer read atom doesn't listen to BRW_NEW_BLORP, and would not get the new fast clear color. Cc: [email protected] Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Drop Gen7+ nonsense from brw_ff_gs.c.Kenneth Graunke2017-08-231-4/+3
| | | | | | | | | | brw_ff_gs.c is about using the geometry shader to implement things that the fixed function ought to do, but doesn't on old hardware. Gen7+ does not need this. We should drop the misleading comment about Gen7 not using geometry shaders. Reviewed-by: Timothy Arceri <[email protected]>
* i965: Only set key->flat_shade if COL0/COL1 are written.Kenneth Graunke2017-08-231-1/+3
| | | | | | This may reduce some recompiles. Reviewed-by: Timothy Arceri <[email protected]>
* i965: Clean up brwNewProgram().Kenneth Graunke2017-08-231-28/+5
| | | | | | | | | | All shader stages do the exact same thing, so we don't need the switch statement, or the redundant FS case. I believe these used to be different before Tim eliminated the (e.g.) brw_vertex_program subclasses. Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* gallium: remove TGSI opcode SCSMarek Olšák2017-08-222-12/+4
| | | | | | | use COS+SIN instead. Reviewed-by: Roland Scheidegger <[email protected]> Acked-by: Jose Fonseca <[email protected]>
* st/glsl_to_tgsi: fix getting the image type for array of structs (again)Samuel Pitoiset2017-08-221-5/+3
| | | | | | | | | | | We want the type of the field, not of the struct. This fixes a regression in the following piglit test: arb_bindless_texture/compiler/images/arrays-of-struct.frag Fixes: 49d9286a3f ("glsl: stop copying struct and interface member names") Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* gallium: remove TGSI opcode XPDMarek Olšák2017-08-221-7/+11
| | | | | | use MUL+MAD+MOV instead. Reviewed-by: Roland Scheidegger <[email protected]>
* gallium: remove TGSI opcode DPHMarek Olšák2017-08-221-2/+11
| | | | | | use DP4 or DP3 + ADD. Reviewed-by: Roland Scheidegger <[email protected]>