aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* mesa: use gl_vert_attrib enum type in more placesBrian Paul2018-01-303-9/+9
| | | | | | Slightly better readbility. Reviewed-by: Gert Wollny <[email protected]>
* mesa: rename some 'client' array functionsBrian Paul2018-01-306-11/+11
| | | | | | | A long time ago gl_vertex_array was gl_client_array. Update some function names to be consistent. Reviewed-by: Gert Wollny <[email protected]>
* mesa: s/src/attribs/ in _mesa_update_client_array()Brian Paul2018-01-301-9/+9
| | | | Reviewed-by: Gert Wollny <[email protected]>
* mesa: check/assert array index in _mesa_bind_vertex_buffer()Brian Paul2018-01-301-0/+1
| | | | Reviewed-by: Gert Wollny <[email protected]>
* mesa: trivial comment typo fix in arrayobj.cBrian Paul2018-01-301-1/+1
| | | | Reviewed-by: Gert Wollny <[email protected]>
* mesa: add an assertion in _mesa_enable_vertex_array_attrib()Brian Paul2018-01-301-0/+1
| | | | | | | | Some of the enable/disable vertex array functions take a zero-based generic index, while others take a VERT_ATTRIB_GENERIC0-based value. Add an assertion to clarify that in one place. Reviewed-by: Gert Wollny <[email protected]>
* mesa: rename some vars in client_state()Brian Paul2018-01-301-25/+25
| | | | Reviewed-by: Gert Wollny <[email protected]>
* mesa: Care for differences in fog mode only if fog is consumed.Mathias Fröhlich2018-01-301-3/+5
| | | | | | | | | In creating fixed function vertex shader hash keys do only care for producing the varying output if fog is enabled and the varing is consumed in the fragment stage. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Reduce ffvertex_prog state_key to 36 bytes.Mathias Fröhlich2018-01-301-14/+15
| | | | | | | | Using lower alignment restrictions for the state key fields finally yields to a smaller hashing state key. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Remove unused ffvertex_prog texunit_really_enabled.Mathias Fröhlich2018-01-301-4/+0
| | | | | | | | Remove set but not read field from the state key used for hashing fixed function vertex shaders. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Remove unused bit in ffvertex_prog state_key.Mathias Fröhlich2018-01-301-6/+0
| | | | | | | | Remove set but not read field from the state key used for hashing fixed function vertex shaders. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: texgen_enabled is only 1 bit.Mathias Fröhlich2018-01-301-1/+1
| | | | | | | | For the state key for hashing fixed function vertex shaders, the texgen_enabled field requires only a single bit. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Encode fog modes in a 2 bit field.Mathias Fröhlich2018-01-301-38/+37
| | | | | | | | | For the state key for hashing fixed function vertex shaders, encode the different fog modes, including if fog is generally enabled or not, into a 2 bit field. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Move seperate_specular into the lighting section.Mathias Fröhlich2018-01-301-3/+3
| | | | | | | | | For the state key for hashing fixed function vertex shaders, the information is only evaluated if lighting is generally switched on. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Get the point size array state from varying_vp_inputs.Mathias Fröhlich2018-01-301-5/+1
| | | | | | | | | For the state key for hashing fixed function vertex shaders, The varying_vp_inputs bitmask already contains the point size array enabled information. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Remove unused gl_fog_attrib::_Scale.Mathias Fröhlich2018-01-302-17/+0
| | | | | | | The patch removes a variable that is only written to. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* anv/pipeline: lower constant initializers on output variables earlierIago Toral Quiroga2018-01-301-0/+5
| | | | | | | | | | | | | If a shader only writes to an output via a constant initializer we need to lower it before we call nir_remove_dead_variables so that this pass sees the stores from the initializer and doesn't kill the output. Fixes test failures in new work-in-progress CTS tests: dEQP-VK.spirv_assembly.instruction.graphics.variable_init.output_vert dEQP-VK.spirv_assembly.instruction.graphics.variable_init.output_frag Reviewed-by: Jason Ekstrand <[email protected]>
* i965: move disk cache from brw_context to intel_screenTapani Pälli2018-01-305-7/+12
| | | | | | | | | Now every context refers to same disk_cache instance in screen. Signed-off-by: Tapani Pälli <[email protected]> Suggested-by: Emil Velikov <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: Correctly print glTexImage dimensionsElie Tournier2018-01-301-7/+6
| | | | | | | | texture_format_error_check_gles() displays error like "glTexImage%dD". This patch just replace the %d by the correct dimension. Signed-off-by: Elie Tournier <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: shrink size of gl_array_attributes (v2)Brian Paul2018-01-292-9/+16
| | | | | | | | | | | | | | | | | | | Inspired by Marek's earlier patch, but even smaller. Sort fields from largest to smallest. Use bitfields for more fields (sometimes with an extra bit for MSVC). Reduce Stride field to GLshort. Note that some fields cannot be bitfields because they're accessed via pointers (such as for glEnableClientState(GL_VERTEX_ARRAY) to set the Enabled field). Reduces size from 48 to 24 bytes. Also reduces size of gl_vertex_array_object from 3632 to 2864 bytes. And add some assertions in init_array(). v2: use s/GLuint/unsigned/, improve commit comments. Reviewed-by: Marek Olšák <[email protected]>
* mesa: shrink gl_vertex_arrayBrian Paul2018-01-291-10/+11
| | | | | | | | | | Inspired by Marek's earlier patch, but goes a little further. Sort fields from largest to smallest. Use bitfields. Reduced from 48 bytes to 32. Also reduces size of gl_vertex_array_object from 4144 to 3632 Reviewed-by: Marek Olšák <[email protected]>
* mesa: replace GLenum with GLenum16 in common structures (v4)Marek Olšák2018-01-2915-196/+250
| | | | | | | | | | | | | v2: - fix glGet* - also use GLenum16 for DrawBuffers v3: - rebase to top of tree (BrianP) and incorporate Ian's suggestions v4: - fix a GLenum16 bug in VBO/save code, add some STATIC_ASSERT()s gl_context = 152432 -> 136840 bytes vbo_context = 22096 -> 20608 bytes Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: fix incorrect size/error test in _mesa_GetUnsignedBytevEXT()Brian Paul2018-01-291-1/+1
| | | | | | | | | | | get_value_size() returns -1 for an error. The similar check in _mesa_GetUnsignedBytei_vEXT() is correct. Found by chance. There are apparently no Piglit tests which exercise glGetUnsignedBytei_vEXT() or glGetUnsignedBytevEXT(). Reviewed-by: Andres Rodriguez <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* svga: Check rasterization state object before checking poly_stipple_enableNeha Bhende2018-01-291-1/+1
| | | | | | | | | | | | | | Sometimes rasterization state object could be empty. This is causing segfault on hw8,9,10 for some traces. This patch fixes enemy_territory_quake_wars_high, enemy_territory_quake_wars_low, etqw-demo, lightsmark2008, quake1 glretrace crashes on hw 8,9,10. Tested with mtt-glretrace and mtt-piglit. Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* svga: Adjust alpha for S3TC_DXT1_EXT RGB formatsNeha Bhende2018-01-291-0/+4
| | | | | | | | | | | | According to spec, S3TC_DXT1_EXT RGB formats are supposed to be opaque. Correspoding svga formats are not handling it so explicitly setting it to 1.0. This fixes piglit test spec@ext_texture_compression_s3tc@s3tc-targeted Note: This test is testcase for freedesktop bug 100925 Tested with mtt-piglit and mtt-glretrace on 8,9,10,11 and 15 Reviewed-by: Brian Paul <[email protected]>
* mesa/st/glsl_to_tgsi: Mark first write as unconditional when appropriateGert Wollny2018-01-292-1/+47
| | | | | | | | | | | | | In the register lifetime estimation if the first write is unconditional or conditional but not within a loop then this is an unconditional dominant write in the sense of register life time estimation. Add a test case and record the write accordingly. Fixes: 807e2539e512ca6c96f059da855473eb7be99ba1 ("mesa/st/glsl_to_tgsi: Add tracking of ifelse writes in register merging") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104803 Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: skip validation of legality of size/type queries for format queriesRoland Scheidegger2018-01-301-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | The size/type query is always legal (if we made it that far). Removing this causes a difference for GL_TEXTURE_BUFFER - the reason is that these parameters are valid only with GetTexLevelParameter() if gl 3.1 is supported, but not if only ARB_texture_buffer_object is supported. However, while the spec says that these queries return "the same information as querying GetTexLevelParameter" I believe we're not expected to return just zeros here. By definition, these pnames are always valid (unlike for the GetTexLevelParameter() function which would return an error without GL 3.1). The spec is a bit inconsistent there and open to interpretation - while mentioning the "same information as querying GetTexLevelParameter" is returned, it also mentions that 0 is returned for size/type if the target/format is not supported - implying correct results to be returned if it is supported, regardless that GetTexLevelParameter would return an error. (Also, the bit about this returning the same as GetTexLevelParameter also includes querying stencil type, which isn't even possible with GetTexLevelParameter.) This breaks some piglit arb_internalformat_query2 tests (which I believe to be wrong). Reviewed-by: Alejandro Piñeiro <[email protected]
* mesa: restrict formats being supported by target type for formatqueryRoland Scheidegger2018-01-301-10/+21
| | | | | | | | | | | | | | | | | | | The code just considered all formats as being supported if they were either a valid fbo or texture format. This was quite awkward since then the query would return "supported" for e.g. GL_RGB9E5 or compressed formats and target RENDERBUFFER (albeit the driver could still refuse it in theory). However, when then querying for instance the internalformat sizes, it would just return 0 (due to the checks being more strict there). It was also a problem for texture buffer targets, which have a more restricted list of formats which are allowed (and again, it would return supported but then querying sizes would return 0). So only take validation of formats into account which make sense for a given target. Can also toss out some special checks for rgb9e5 later, since we'd never get there if it wasn't supported in the first place. Reviewed-by: Alejandro Piñeiro <[email protected]>
* mesa: (trivial) add TODO comment for default results for internal queriesRoland Scheidegger2018-01-301-0/+6
|
* mesa: remove misleading gles checks for formatqueryRoland Scheidegger2018-01-301-3/+1
| | | | | | | | | Testing for gles there is just confusing - this is about target being supported, if it was valid at all was already determined earlier (in _legal_parameters). It didn't make sense at all in any case, since it would only have said false there for gles for 2d but not 2d arrays etc. Reviewed-by: Alejandro Piñeiro <[email protected]>
* i965: Emit PIPE_CONTROL with ISP bit on older platforms.Rafael Antognolli2018-01-291-1/+1
| | | | | | | Emit it on all platforms since gen7. Signed-off-by: Rafael Antognolli <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv/cmd_buffer: Emit PIPE_CONTROL with ISP bit on older platforms.Rafael Antognolli2018-01-291-4/+2
| | | | | | | Emit it on all platforms since gen7. Signed-off-by: Rafael Antognolli <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* st/glsl_to_nir: remove dead io after conversion to nirTimothy Arceri2018-01-301-0/+4
| | | | | | | This fixes an assert in nir_lower_var_copies() for some bioshock shaders where an unused clipdistance array has no size. Reviewed-by: Marek Olšák <[email protected]>
* radeonsi/nir: add support vs double inputsTimothy Arceri2018-01-301-0/+5
| | | | Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: pass input_idx to declare_nir_input_vs()Timothy Arceri2018-01-301-2/+3
| | | | | | | This make it consistent with declare_nir_input_fs() and will allow us to support doubles. Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: add bitcast_inputs() helperTimothy Arceri2018-01-301-6/+15
| | | | | | Will be used in a following patch to help support doubles. Reviewed-by: Marek Olšák <[email protected]>
* radeonsi/nir: fix num_inputs for doubles in vsTimothy Arceri2018-01-301-5/+8
| | | | Reviewed-by: Marek Olšák <[email protected]>
* nir: partially revert c2acf97fcc9b32eTimothy Arceri2018-01-301-6/+23
| | | | | | | | | | | | | | | | | | c2acf97fcc9b32e changed the use of double_inputs_read to be inconsitent with its previous meaning. Here we re-enable the gather info code that was removed as the modified code from c2acf97fcc9b32e now uses the double_inputs member rather than double_inputs_read. This change allows us to use double_inputs_read with gallium drivers without impacting double_inputs which is used by i965. We also make use of the compiler option vs_inputs_dual_locations to allow for the difference in behaviour between drivers that handle vs inputs as taking up two locations for doubles, versus those that treat them as taking a single location. Reviewed-by: Karol Herbst <[email protected]>
* nir: add vs_inputs_dual_locations compiler optionTimothy Arceri2018-01-304-5/+19
| | | | | | | | | | | | | Allows nir drivers to either use a single or dual locations for vs double inputs. i965 uses dual locations for both OpenGL and Vulkan drivers, for now gallium OpenGL drivers only use a single location. The following patch will also make use of this option when calling nir_shader_gather_info(). Reviewed-by: Karol Herbst <[email protected]>
* compiler: tidy up double_inputs_read usesTimothy Arceri2018-01-308-13/+24
| | | | | | | | | | | | | First we move double_inputs_read into a vs struct in the union, double_inputs_read is only used for vs inputs so this will save space and also allows us to add a new double_inputs field. We add the new field because c2acf97fcc9b changed the behaviour of double_inputs_read, and while it's no longer used to track actual reads in i965 we do still want to track this for gallium drivers. Reviewed-by: Marek Olšák <[email protected]>
* radv/gfx9: fix block compression texture views. (v2)Dave Airlie2018-01-301-4/+49
| | | | | | | | | | | | | | | | This ports a fix from amdvlk, to fix the sizing for mip levels when block compressed images are viewed using uncompressed views. My original fix didn't power the clamping, but it looks like the clamping is required to stop the sizing going too large. Fixes: dEQP-VK.image.texel_view_compatible.graphic.extended*bc* Doesn't crash DOW3 anymore. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Fixes: e38685cc62e 'Revert "radv: disable support for VEGA for now."' Signed-off-by: Dave Airlie <[email protected]>
* radv: Signal fence correctly after sparse binding.Bas Nieuwenhuizen2018-01-291-14/+32
| | | | | | | | | It did not signal syncobjs in the fence, and also signalled too early if there was work on the queue already, as we have to wait till that work is done. Fixes: d27aaae4d2 "radv: Add external fence support." Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa/vbo: replace vbo_draw_method() with _mesa_set_drawing_arrays()Brian Paul2018-01-298-74/+34
| | | | | | | | | | | | | | | | | The arrays specified by ctx->Array._DrawArrays are used for all vertex drawing via vbo_context::draw_prims(). Different arrays are used for immediate mode, vertex arrays, display lists, etc. Changing from one to another requires updating derived/driver array state. Before, we indirectly specifid the arrays with the gl_draw_method values. Now we just directly specify the arrays instead. This is simpler and will allow a subsequent display list optimization. In the future, it might make sense to get rid of ctx->Array._DrawArrays entirely and just pass the arrays as another parameter to vbo_context::draw_prims(). Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: s/[0]/[VERT_ATTRIB_POS]/ in recalculate_input_bindings()Brian Paul2018-01-291-3/+3
| | | | Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: add new VBO_ATTRIBS_ masks to vbo_attrib.hBrian Paul2018-01-291-0/+15
| | | | | | These will be used in a later patch. Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: s/VBO_ATTRIB_INDEX/VBO_ATTRIB_COLOR_INDEX/Brian Paul2018-01-292-12/+13
| | | | | | | | To match the VERT_ATTRIB_COLOR_INDEX name. Give a name to the previously anonymous enum of VBO_ATTRIB_x values. Update the comment on the enum. Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: minor clean-ups in vbo_exec.hBrian Paul2018-01-291-5/+6
| | | | Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: s/_API_NOOP_H/VBO_NOOP_H/ in vbo_noop.hBrian Paul2018-01-291-3/+3
| | | | Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: whitespace/formatting fixes in vbo_exec.hBrian Paul2018-01-291-15/+18
| | | | Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: move, rename vp_mode enums, get_program_mode() functionBrian Paul2018-01-295-22/+27
| | | | | | | Instead of NONE/ARB use FF/SHADER. Move the enum declaration to vbo_private.h where it's used. Reviewed-by: Mathias Fröhlich <[email protected]>