aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* glsl_to_tgsi: remove code for fixing up TGSI labelsMarek Olšák2016-10-191-90/+2
| | | | | | | I don't know what this was supposed to do, but all TGSI labels were always 0. Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl_to_tgsi: remove subroutine supportMarek Olšák2016-10-192-205/+5
| | | | | | | | Never used. The GLSL compiler doesn't even look at EmitNoFunctions. v2: add back "return" support in "main" Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa_to_tgsi: remove remnants of flow control and subroutine supportMarek Olšák2016-10-191-92/+1
| | | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa_to_tgsi: drop support for instructions that can't occur hereMarek Olšák2016-10-191-72/+0
| | | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl_to_tgsi: allocate glsl_to_tgsi_instruction::tex_offsets on demandMarek Olšák2016-10-191-1/+4
| | | | | | | sizeof(glsl_to_tgsi_instruction): 384 -> 264 Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl_to_tgsi: merge buffer and sampler fields in glsl_to_tgsi_instructionMarek Olšák2016-10-191-32/+31
| | | | | | | sizeof(glsl_to_tgsi_instruction): 416 -> 384 Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl_to_tgsi: reduce the size of glsl_to_tgsi_instruction using bitfieldsMarek Olšák2016-10-191-17/+19
| | | | | | | | sizeof(glsl_to_tgsi_instruction): 464 -> 416 Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl_to_tgsi: reduce the size of st_dst_reg and st_src_regMarek Olšák2016-10-191-31/+40
| | | | | | | | | I noticed that glsl_to_tgsi_instruction is too huge. sizeof(glsl_to_tgsi_instruction): 752 -> 464 (-38%) Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl_to_tgsi: remove unused st_translate::tex_offsetsMarek Olšák2016-10-191-1/+0
| | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl_to_tgsi: remove unused parameters from calc_deref_offsetsMarek Olšák2016-10-191-9/+5
| | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl_to_tgsi: use array_id for temp arrays instead of hacking high bitsMarek Olšák2016-10-191-13/+19
| | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* i965: fix subnr overflow in suboffset()Iago Toral Quiroga2016-10-191-8/+5
| | | | Reviewed-by: Ian Romanick <[email protected]>
* util: move min/max/clamp macros to util macros.hDave Airlie2016-10-191-13/+0
| | | | | | | | | Although the vulkan drivers include mesa macros.h, for radv I'd like to move away from that. Reviewed-by: Nicolai Hähnle <[email protected]> Acked-by: Jason Ekstrand <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* i965: Fix gl_InvocationID in dual object GS where invocations == 1.Kenneth Graunke2016-10-171-1/+4
| | | | | | | | | | | | | | | | | | | | dEQP-GLES31.functional.geometry_shading.instanced.geometry_1_invocations draws using a geometry shader that specifies layout(points, invocations = 1) in; and then uses gl_InvocationID. According to the Haswell PRM, the "GS Instance ID 0" (and 1) thread payload fields are undefined in dual object mode: "If 'dispatch mode' is DUAL_OBJECT this field is not valid." But there's no point in using them - if there's only one invocation, the ID will be 0. So just load a constant. Cc: [email protected] Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* i965: Silence unused parameter warningsIan Romanick2016-10-177-9/+5
| | | | | | | | | | | | | | | | | | | | brw_link.cpp:76:44: warning: unused parameter ‘shader_type’ [-Wunused-parameter] gl_shader_stage shader_type, ^ brw_nir.c: In function ‘brw_nir_lower_vs_inputs’: brw_nir.c:194:55: warning: unused parameter ‘devinfo’ [-Wunused-parameter] const struct gen_device_info *devinfo, ^ brw_vec4_visitor.cpp:914:37: warning: unused parameter ‘sampler’ [-Wunused-parameter] uint32_t sampler, ^ brw_vec4_visitor.cpp:1146:34: warning: unused parameter ‘stream_id’ [-Wunused-parameter] vec4_visitor::gs_emit_vertex(int stream_id) ^ Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* st/glsl_to_tgsi: fix [ui]vec[34] conversion to doubleNicolai Hähnle2016-10-171-2/+3
| | | | | | | | The corresponding opcodes for integers need to be treated the same as F2D. Fixes GL45-CTS.gpu_shader_fp64.conversions. Reviewed-by: Marek Olšák <[email protected]>
* st/glsl_to_tgsi: fix atomic counter addressingNicolai Hähnle2016-10-171-6/+9
| | | | | | | | | | | | | When more than one atomic counter buffer is in use, UniformStorage[n].opaque is set up to contain indices that are contiguous across all used buffers. This appears to be used by i965 via NIR, but for TGSI we do not treat atomic counter buffers as opaque, so using the data in the opaque array is incorrect. Fixes GL45-CTS.compute_shader.resource-atomic-counter. Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]>
* st/glsl_to_tgsi: fix a corner case of std140 layout in uniform buffersNicolai Hähnle2016-10-171-1/+28
| | | | | | | See the comment in the code for an explanation. This fixes GL45-CTS.buffer_storage.map_persistent_draw. Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: fix fragment shader output mappingNicolai Hähnle2016-10-171-4/+13
| | | | | | | | | Properly handle the case where there is a gap in the assigned output locations, e.g. a fragment shader writes to color buffer 2 but not to color buffers 0 & 1. Fixes GL45-CTS.gtf33.GL3Tests.explicit_attrib_location.explicit_attrib_location_pipeline. Reviewed-by: Marek Olšák <[email protected]>
* state_tracker: Fix check for scissor enabled when < 0.Eric Anholt2016-10-161-2/+2
| | | | | | | | | | | | | DEQP's clear tests like to give us x + w < 0 or y + h < 0. Since we were comparing to an unsigned, it would get promoted to unsigned and come out as bignum >= width or height and we would clear the whole fb instead of none of the fb. Fixes 10 tests under deqp-gles2/functional/color_clear. Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Edward O'Callaghan <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* i965: Enable OpenGL 4.5.Kenneth Graunke2016-10-142-2/+2
| | | | | | | | | Everything is in place. There are still conformance issues to sort out, but we may as well turn it on in master. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* intel/blorp: Add a flag to make blorp not re-emit dept/stencil buffersJason Ekstrand2016-10-141-6/+6
| | | | | | | | | | | In Vulkan, we want to be able to use blorp to perform clears inside of a render pass. If blorp stomps the depth/stencil buffers packets then we'll have to re-emit them. This gets tricky when secondary command buffers get involved. Instead, we'll simply guarantee that the depth and stencil buffers we pass to blorp (if any) match those already set in the hardware. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* i915: workaround multiple intelFenceExtension definitionsEmil Velikov2016-10-141-0/+1
| | | | | | | | | | | | | Due to conflicting symbol names (between i915 and i965) in the megadriver, we use a set of defines in i915/intel_screen.h. With a recent commit we've introduced a symbol intelFenceExtension which has different implementation for each driver, yet we forgot to add the define. Fixes: d11515ff1b3 ("i915/sync: Implement DRI2_Fence extension") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98264 Signed-off-by: Emil Velikov <[email protected]>
* i965: Sort some extension namesIan Romanick2016-10-141-3/+3
| | | | | | | Trivial. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eduardo Lima Mitev <[email protected]>
* i915: store reference to the context within struct intel_fence (v2)Mauro Rossi2016-10-141-11/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Porting of the corresponding patch for i965. Here follows the original commit message by Tomasz Figa: "As the spec allows for {server,client}_wait_sync to be called without currently bound context, while our implementation requires context pointer. v2: Add a mutex and acquire it for the duration of brw_fence_client_wait() and brw_fence_is_completed() as suggested by Chad." NOTE: in i915 all references to 'brw' are replaced by 'intel' Marshmallow-x86 boots ok with the following results of Android CTS. Android CTS 6.0_r7 build:2906653 Session Pass Fail Not Executed 0(EGL) 1410 24 0 1(GLES2) 13832 82 0 I get the same results as per i965GM. [Emil Velikov: Include Mauro's test results] Signed-off-by: Emil Velikov <[email protected]>
* i915/sync: Implement DRI2_Fence extensionMauro Rossi2016-10-143-30/+152
| | | | | | | | | | | Here is the porting of corresponding patch for i965, i.e. commit c636284 i965/sync: Implement DRI2_Fence extension Here follows part of original commit message by Chad Versace: "This enables EGL_KHR_fence_sync and EGL_KHR_wait_sync." Signed-off-by: Emil Velikov <[email protected]>
* i915/sync: Replace prefix 'intel_sync' -> 'intel_gl_sync'Mauro Rossi2016-10-142-26/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | This is the porting of corresponding patch for i965, i.e. commit 2516d83 i965/sync: Replace prefix 'intel_sync' -> 'intel_gl_sync' The only difference compared to i965 one is that intel_check_sync() was renamed to intel_gl_check_sync() here, as it is more appropriate. Here follows original commit message by Chad Versace: "I'm about to implement DRI2_Fenc in intel_syncobj.c. To prevent madness, we need to prefix functions for GL_ARB_sync with 'gl' and functions for DRI2_Fence with 'dri'. Otherwise, the file will become a jumble of similiarly named functions. For example: old-name: intel_client_wait_sync() new-name: intel_gl_client_wait_sync() soon-to-come: intel_dri_client_wait_sync() I wrote this renaming commit separately from the commit that implements DRI2_Fence because I wanted the latter diff to be reviewable." [Emil Velikov: rename the outstanding intel_sync instances] Signed-off-by: Emil Velikov <[email protected]>
* mesa: fix indentation in vertex_attrib_binding()Brian Paul2016-10-131-2/+2
| | | | Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa: add sanity check assertion in update_array_formatBrian Paul2016-10-131-0/+3
| | | | | | At most, one of the normalized, integer, doubles bools can be true. Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa: remove needless cast in update_array()Brian Paul2016-10-131-1/+1
| | | | Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa: simplify update_array() with a vao local varBrian Paul2016-10-131-7/+7
| | | | Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: simplify some code in check_draw_elements_data()Brian Paul2016-10-131-5/+4
| | | | | | Use the 'vao' local var in more places. Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa: rename gl_vertex_attrib_array gl_array_attributesBrian Paul2016-10-138-31/+31
| | | | | | | The structure contains the attributes of a vertex array. The old name was kind of confusing. Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa: rename gl_vertex_attrib_array::VertexBindingBrian Paul2016-10-135-26/+26
| | | | | | | | | Rename to gl_vertex_attrib_array::BufferBindingIndex because this field is an index into the array of buffer binding points. This makes some code a little easier to follow since there's also a "VertexBinding" field in gl_vertex_array_object. Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa: rename some vars in arrayobj.cBrian Paul2016-10-131-24/+31
| | | | | | | Use 'vao' instead of 'obj' to be consistent with other code. Plus, add a comment. Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa: replace gl_framebuffer::_IntegerColor wih _IntegerBuffersBrian Paul2016-10-137-10/+15
| | | | | | | | | | | Use a bitmask to indicate which color buffers are integer-valued, rather than a bool. Also, the old field was mis-computed. If an integer buffer was followed by a non-integer buffer, the _IntegerColor field was wrongly set to false. This fixes the new piglit gl-3.1-mixed-int-float-fbo test. Reviewed-by: Marek Olšák <[email protected]>
* mesa: remove 'params' parameter from ctx->Driver.TexParameter()Brian Paul2016-10-138-37/+20
| | | | | | | | | | | None of the drivers which implement this hook do anything with the texture parameter value. Drivers just look at the pname and set a dirty flag if needed. We were doing some ugly casting and type conversion to setup the argument so that all goes away. Reviewed-by: Marek Olšák <[email protected]>
* gallium: add PIPE_RESOURCE_FLAG_TEXTURING_MORE_LIKELYMarek Olšák2016-10-131-1/+2
| | | | | | | | | | | | | | For performance tuning in drivers. It filters out window system framebuffers and OpenGL renderbuffers. radeonsi will use this to guess whether a depth buffer will be read by a shader. There is no guarantee about what will actually happen. This is a departure from PIPE_BIND flags which are defined to be strict but they are useless in practice. Acked-by: Roland Scheidegger <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: fix vertex elements setup for doublesNicolai Hähnle2016-10-131-48/+50
| | | | | | | | | | | | Whether one or two slots are taken up by one API array depends on the vertex shader, not on how the array is configured. When an array is set up with fewer components than the shader expects, the high components are undefined. Fixes GL45-CTS.vertex_attrib_binding.basic-inputL-case1. Cc: [email protected] Reviewed-by: Dave Airlie <[email protected]>
* st/glsl_to_tgsi: remove unnecessary ir_instruction argument from get_opcodeNicolai Hähnle2016-10-131-3/+3
| | | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* st/glsl_to_tgsi: fix textureGatherOffset with indirectly loaded offsetsNicolai Hähnle2016-10-131-1/+17
| | | | | | | Cc: [email protected] Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* st/glsl_to_tgsi: simplify translate_tex_offsetNicolai Hähnle2016-10-131-50/+14
| | | | | | | | | | | | This fixes a bug with offsets from uniforms which seems to have only been noticed as a crash in piglit's arb_gpu_shader5/compiler/builtin-functions/fs-gatherOffset-uniform-offset.frag on radeonsi. Cc: [email protected] Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: only flip stipple pattern for winsys fbo'sIlia Mirkin2016-10-121-3/+7
| | | | | | | | | | | | | Gallium is completely oblivious to whether the fbo is flipped or not. Only flip the stipple pattern when the fbo is flipped as well. Otherwise the driver has no idea when to unflip the pattern. Fixes bin/gl-2.1-polygon-stipple-fs -fbo Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: enable ARB_enhanced_layouts and turn the cap onNicolai Hähnle2016-10-121-0/+7
| | | | | | | v2: mark llvmpipe & softpipe properly as well (Jason Wood) Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* st/glsl_to_tgsi: adjust swizzles and writemasks for explicit componentsNicolai Hähnle2016-10-121-19/+49
| | | | | Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* st/glsl_to_tgsi: explicitly track all input and output declarationNicolai Hähnle2016-10-121-154/+171
| | | | | | | | | | | | | In order to be able to emit overlapping input and output array declarations, we flip the logic of emitting those declarations on its head: rather than iterating over slots and emitting the corresponding declarations, we iterate over the declarations from GLSL and emit those. v2: fix some regressions related to structs v3: fix a regression in geometry and tessellation shader array handling Acked-by: Edward O'Callaghan <[email protected]> (v2) Reviewed-by: Dave Airlie <[email protected]> (v2)
* st/glsl_to_tgsi: mark "gaps" in input/output arrays as usedNicolai Hähnle2016-10-121-8/+24
| | | | | | | | | | | | | | | | In some cases, a shader may have an input/output array but not use some entries in the middle. This happens with eON games, for example. We emit declarations that cover the entire array range even if there are some unused gaps. This patch now reflects that in the InputsRead etc. fields to ensure the various input/outputMapping arrays are actually correct, which will be important when we re-jiggle the way declarations are emitted. v2: fix a typo (Edward O'Callaghan) Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* st/glsl_to_tgsi: disable on-the-fly peephole for 64-bit operationsNicolai Hähnle2016-10-121-0/+4
| | | | | | | | | | | | | | | | | | | | | This optimization is incorrect with 64-bit operations, because the channel-splitting logic in emit_asm ends up being applied twice to the source operands. A lucky coincidence of how the writemask test works resulted in this optimization basically never being applied anyway. As far as I can tell, the only case where it would (incorrectly) have been applied is something like dvec2 d; float x = (float)d.y; which nobody seems to have ever done. But the moral equivalent does occur in one of the component layout piglit test. Cc: [email protected] Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* st/glsl_to_tgsi: simpler fixup of empty writemasksNicolai Hähnle2016-10-121-27/+10
| | | | | | | | | Empty writemasks mean "copy everything", so we can always just use the number of vector elements (which uses the GLSL meaning here, i.e. each double is a single element/writemask bit). Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* st/glsl_to_tgsi: explicit handling of writemask for depth/stencil exportNicolai Hähnle2016-10-121-8/+17
| | | | | Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Dave Airlie <[email protected]>