aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* osx: ld doesn't support --build-idJon Turney2018-02-011-1/+1
| | | | | Signed-off-by: Jon Turney <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* mesa: remove usage of alloca in externalobjects.c v4Andres Rodriguez2018-02-011-12/+48
| | | | | | | | | | | | Don't want an overly large numBufferBarriers/numTextureBarriers to blow up the stack. v2: handle malloc errors v3: fix patch v4: initialize texObjs/bufObjs Suggested-by: Emil Velikov <[email protected]> Signed-off-by: Andres Rodriguez <[email protected]>
* gallium/st/clover: remove unused PIPE_SHADER_IR_LLVMTimothy Arceri2018-02-011-1/+0
| | | | | | This has been unused since 100796c15c3a. Acked-by: Marek Olšák <[email protected]>
* st/glsl_to_nir: add more nir opts to st_nir_opts()Timothy Arceri2018-02-011-16/+20
| | | | | | | | | | | | | | | | All of the current gallium nir driver use these optimisations but they do so in their backends. Having these called in the backend only can cause a number of problems: - Shader compile times are greater because the opts need to do significant passes over all shader variants. - The shader cache is partially defeated due to the significant optimisation passes over variants. - We might miss out on nir linking optimisation opportunities. Adding these passes to st_nir_opts() alleviates these problems. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: perform 2 uploads with dual slot *64*PASSTHRU formats on gen<8Andres Gomez2018-01-311-5/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The emission of vertex attributes corresponding to dvec3 and dvec4 vertex shader input variables was not correct when the <size> passed to the VertexAttribL* commands was <= 2. In 61a8a55f557 ("i965/gen8: Fix vertex attrib upload for dvec3/4 shader inputs"), for gen8+ we needed to determine if the attrib was dual slot to emit 128 or 256-bit, independently of the VAO size. Similarly, for gen < 8 we also need to determine whether the attrib is dual slot to force the emission of 256-bits through 2 uploads. Additionally, we make use of the ISL_FORMAT_R32_FLOAT format in this second upload to fill these unspecified components with zeros, as we also do for gen8+. Fixes the following test on Haswell: KHR-GL46.vertex_attrib_binding.basic-inputL-case1 v2: Added more inline comments to explain why we are using ISL_FORMAT_R32_FLOAT and its consequences, as requested by Alejandro and Antía. Fixes: 75968a668e4 ("i965/gen7: expose OpenGL 4.2 on Haswell when supported") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103006 Cc: Alejandro Piñeiro <[email protected]> Cc: Juan A. Suarez Romero <[email protected]> Cc: Antia Puentes <[email protected]> Cc: Rafael Antognolli <[email protected]> Cc: Kenneth Graunke <[email protected]> Signed-off-by: Andres Gomez <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Antia Puentes <[email protected]> Reviewed-by: Rafael Antognolli <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Make texture validation code use texture objects, not units.Kenneth Graunke2018-01-312-16/+17
| | | | | | | | This requires moving the _MaxLevel handling up to the callers. Another user of intel_finalize_mipmap_tree will be added later that depends on _MaxLevel not being modified. Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Pass tObj into intel_update_max_level instead of intel_obj.Kenneth Graunke2018-01-311-3/+3
| | | | | | | We want both anyway, but this will simplify things a tiny bit in an upcoming patch. Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Delete more misleading comments.Kenneth Graunke2018-01-311-3/+0
| | | | | | | brw_bo_wait_rendering used to take a brw_context pointer for perf_debug messages about stalls. Chris eliminated that in 833108ac14ade91f54cc6e. This message about passing NULL to avoid those warnings is no longer relevant, and just adds confusion. So, drop it.
* st/mesa: whitespace, formatting fixes in st_glsl_to_tgsi.cppBrian Paul2018-01-311-104/+169
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* st/mesa: s/int/GLenum/ in st_glsl_to_tgsi.cppBrian Paul2018-01-311-5/+6
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* Revert "mesa: add missing RGB9_E5 format in _mesa_base_fbo_format"Antia Puentes2018-01-311-3/+0
| | | | | | | | | | | | | | | | | | | | This reverts commit 513c2263cbff45edb105c7b46e58f316e06746ab. _mesa_base_fbo_format_ is used to validate the internalformat passed to RenderbufferStorage, which in the OpenGL 4.6 is said: "An INVALID_ENUM error is generated if internalformat is not one of the color-renderable, depth-renderable, or stencil-renderable formats defined in section 9.4." RGB9_E5 format is not renderable, as stated in the same specification (Bug 9338). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104794 Cc: Juan A. Suarez Romero <[email protected]> Cc: Kenneth Graunke <[email protected]> Reviewed-by: Juan A. Suarez <[email protected]>
* mesa: fix broken glGet*(GL_POLYGON_MODE) queryBrian Paul2018-01-302-3/+3
| | | | | | | | | This reverts part of the patch which introduced the GLenum16 change. Fixes a conform regression found by Roland. Fixes: f96a69f916aed405 ("mesa: replace GLenum with GLenum16 in common structures (v4)") Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: fix glGet MAX_VERTEX_ATTRIB queriesMarek Olšák2018-01-311-3/+3
| | | | | | Broken by f96a69f916aed40519e755d0460a83940a587 Reviewed-by: Brian Paul <[email protected]>
* st/glsl_to_nir: disable io lowering and array splitting of fs inputsTimothy Arceri2018-01-311-4/+18
| | | | | | | | | | | | | | | | | | We need this to be able to support the interpolateAt builtins in a sane way. It also leads to the generation of more optimal code. The lowering and splitting is made conditional on lower_all_io_to_temps because vc4 and freedreno both expect these passes to be enabled and niether support glsl 400 so don't need to deal with the interpolateAt builtins. We leave the other stages for now as to avoid regressions. Ideally we could remove the stage checks and just set the nir options correctly for each stage. However all gallium drivers currently just use return the same nir compiler options for all stages, and it's probably more trouble than its worth to change this. Reviewed-by: Marek Olšák <[email protected]>
* nir/st_glsl_to_nir: add param to disable splitting of inputsTimothy Arceri2018-01-311-1/+1
| | | | | | | | | We need this because we will always copy fs outputs to temps and split the arrays, but do not want to do either of these with fs inputs as it is unnessisary and makes handling interpolateAt builtins difficult. Reviewed-by: Marek Olšák <[email protected]>
* st/glsl_to_nir: copy nir compiler options to contextTimothy Arceri2018-01-312-8/+22
| | | | | | | Various nir passes may expect this to be here as does the nir serialisation pass. Reviewed-by: Marek Olšák <[email protected]>
* mesa: check for invalid index on UUID glGet queriesAndres Rodriguez2018-01-301-0/+4
| | | | | | | | This fixes the piglit test: spec/ext_semaphore/api-errors/usigned-byte-i-v-bad-value Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: fix glGet for ext_external_objects parametersAndres Rodriguez2018-01-302-0/+8
| | | | | | | | This allows the client to actually query the enums specified in the ext_external_objects spec. Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: fix error codes for importing memory/semaphore FDsAndres Rodriguez2018-01-301-2/+2
| | | | | | | | | This fixes the following piglit tests: spec/ext_semaphore_fd/api-errors/import-semaphore-fd-bad-enum spec/ext_memory_object_fd/api-errors/import-memory-fd-bad-enum Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: add support for semaphore object signal/wait v4Andres Rodriguez2018-01-303-7/+134
| | | | | | | | | | | | | | Bits to implement ServerWaitSemaphoreObject/ServerSignalSemaphoreObject v2: - corresponding changes for gallium fence->semaphore rename - flushing moved to mesa/main v3: s/semaphore/fence for pipe objects v4: add bitmap flushing Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: add support for semaphore object signal/wait v3Andres Rodriguez2018-01-302-0/+52
| | | | | | | | | | Memory synchronization is left for a future patch. v2: flush vertices/bitmaps moved to mesa/main v3: removed spaces before/after braces Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: add semaphore parameter stub v2Andres Rodriguez2018-01-301-0/+22
| | | | | | | | | | EXT_semaphore and EXT_semaphore_fd define no pnames. Therefore there isn't much to do besides determining the correct error code. v2: removed useless return Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: add support for semaphore object create/import/delete v3Andres Rodriguez2018-01-305-0/+132
| | | | | | | | | | Add basic semaphore object operations. v2: s/semaphore/fence for pipe objects v3: added missing license headers Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: add support for semaphore object creation/import/delete v3Andres Rodriguez2018-01-305-2/+222
| | | | | | | | | | Used by EXT_semmaphore and EXT_semaphore_fd v2: Removed unnecessary dummy callback initialization v3: Fixed attempting to free the DummySemaphoreObject Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: introduce EXT_semaphore and EXT_semaphore_fd v2Andres Rodriguez2018-01-303-0/+6
| | | | | | | | | Guarded by PIPE_CAP_SEMAPHORE_SIGNAL v2: corresponding changes for PIPE_CAP_SEMAPHORE_SIGNAL rename Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: remove invalid assertion in _mesa_enable_vertex_array_attrib()Brian Paul2018-01-301-1/+0
| | | | | | | | | | The meta module passes some 0-based attrib values. Should fix Piglit regressions reported by Mark Janes. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104863 Fixes: 4ab7e03e1fc7ac ("mesa: add an assertion in _mesa_enable_vertex_array_attrib()") Reviewed-by: Roland Scheidegger <[email protected]>
* 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]>
* 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]>
* 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]