summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* 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]>
* 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-298-187/+237
| | | | | | | | | | | | | 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]>
* 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]>
* mesa/vbo: replace vbo_draw_method() with _mesa_set_drawing_arrays()Brian Paul2018-01-294-33/+28
| | | | | | | | | | | | | | | | | 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]>
* mesa: remove MESA_FUNCTIONBrian Paul2018-01-262-4/+2
| | | | | | Just use __func__ in the two macros where it was used. Reviewed-by: Neha Bhende <[email protected]>
* mesa: change gl_link_status enums to uppercaseBrian Paul2018-01-265-14/+14
| | | | | | follow the convention of other enums. Reviewed-by: Neha Bhende <[email protected]>
* mesa: change gl_compile_status enums to uppercaseBrian Paul2018-01-264-8/+8
| | | | | | To follow the convention of other enums. Reviewed-by: Neha Bhende <[email protected]>
* mesa: minor comment reformatting, whitespace fixes in mtypes.hBrian Paul2018-01-261-43/+54
| | | | Trivial.
* mesa: silence MinGW 'may be unused uninitialized' warning in get.cBrian Paul2018-01-261-1/+1
| | | | | | | | The warning happens on line 2114 for the memcpy(data, p, size) call. I'm not sure why that generates the warning but not the earlier use of p in the code. Reviewed-by: Neha Bhende <[email protected]>
* mesa: Pass the translated color logic op dd_function_table::LogicOpcodeIan Romanick2018-01-262-2/+2
| | | | | | | | | | | And delete the resulting dead code. This has only been compile-tested. v2: sed --in-place -e 's/color_logic_ops/gl_logicop_mode/g' $(grep -lr color_logic_ops src/) suggested by Brian. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: Also track a remapped version of the color logic opIan Romanick2018-01-262-0/+58
| | | | | | | | | | | | | | | | | With the exception of NVIDIA hardware, these are is the values that all hardware and Gallium want. The remapping is currently implemented in at least 6 places. This starts the process of consolidating to a single place. v2: sed --in-place -e 's/color_logic_ops/gl_logicop_mode/g' $(grep -lr color_logic_ops src/) suggested by Brian. Added some comments about the selection of bit patterns for gl_logicop_mode and the GLenums. Suggested by Nicolai. Folded the GLenum_to_color_logicop macro into its only users. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> [v1] Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: whitespace fixes in attrib.cBrian Paul2018-01-251-78/+77
| | | | Trivial.
* mesa: whitespace fixes in varray.hBrian Paul2018-01-251-26/+29
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* mesa: include mtypes.h in varray.hBrian Paul2018-01-251-3/+1
| | | | | | | We actually use some of the types from mtypes.h so include it directly instead of relying on indirectly including it via bufferobj.h Reviewed-by: Charmaine Lee <[email protected]>
* mesa: s/gl_vertex_attrib_array/gl_array_attributes/ in commentsBrian Paul2018-01-253-3/+3
| | | | | | | The structure type was renamed some time ago, but some comments were not updated. Reviewed-by: Charmaine Lee <[email protected]>
* mesa: simplify _mesa_delete_list() a bit, add some assertionsBrian Paul2018-01-251-28/+11
| | | | | | | | | All but two cases of the switch did the same n += InstSize[n[0].opcode] instruction. Just move it after the switch. Add some sanity check assertions. Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: add missing RGB9_E5 format in _mesa_base_fbo_formatJuan A. Suarez Romero2018-01-251-0/+3
| | | | | | This fixes KHR-GL45.internalformat.renderbuffer.rgb9_e5. Reviewed-by: Kenneth Graunke <[email protected]>
* vbo: remove vbo_context.h and change includes to use vbo.h insteadBrian Paul2018-01-242-2/+2
| | | | | | Now vbo.h is the public interface to the VBO module. Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: use new _vbo_install_exec_vtxfmt() functionBrian Paul2018-01-241-2/+1
| | | | | | Instead of reaching into the vbo_context object in vtxfmt.c Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: move vbo_count_tessellated_primitives() to api_validate.cBrian Paul2018-01-241-3/+65
| | | | | | It's only used in this file and has nothing VBO-specific about it. Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: update comment on gl_display_listBrian Paul2018-01-241-3/+1
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: whitespace clean-ups in mtypes.hBrian Paul2018-01-241-68/+82
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: remove unused MAT_INDEX_AMBIENT/DIFFUSE/SPECULAR contantsBrian Paul2018-01-241-4/+0
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* vbo: move DLIST_DANGLING_REFS from mtypes.h to vbo_save_api.cBrian Paul2018-01-241-9/+0
| | | | | | It's only used in this file. Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: Only require independent blending for GLES 3.2.Eric Anholt2018-01-211-1/+1
| | | | | | | | | We've been requiring this since GLES 3.0 was introduced, but the GLES 3.2 spec is the one that has "Supporting blending on a per-draw-buffer basis" in the new features. V3D 3.3 would require lowering blending to shader code to implement independent blending. Reviewed-by: Tapani Pälli <[email protected]>
* autotools: include meson build files in tarballDylan Baker2018-01-191-0/+2
| | | | | | | | | | | | This adds the meson.build, meson_options.txt, and a few scripts that are used exclusively by the meson build. v2: - Remove accidentally included changes needed to test make dist with LLVM > 3.9 Signed-off-by: Dylan Baker <[email protected]> Acked-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* mesa: Make numSamples an unsigned intGert Wollny2018-01-194-6/+6
| | | | | | | | | | As a followup to the previous patch propagate the change of numSamples from int to unsigned to gl_config::samples and consequently fix some -Wsign-compare warnings. Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: move gl_external_samplers() to program.[ch]Brian Paul2018-01-171-17/+0
| | | | | | | The function is only called from a couple places. It doesn't make sense to have it in mtypes.h Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: remove unneeded #includes of main/compiler.hBrian Paul2018-01-1711-11/+0
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: include util/macros.h in format_fallback.cBrian Paul2018-01-171-0/+1
| | | | | | To get definition of unreachable() macro. Reviewed-by: Nicolai Hähnle <[email protected]>