summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
...
* mesa/main: simplify pipeline-statistics query validationErik Faye-Lund2018-11-231-2/+1
| | | | | | | | | | | | The _mesa_has_ARB_pipeline_statistics_query(ctx)-helper will already check the GLES-version according to the extension-table, so if this extension would ever be back-ported to ES, we only need to update the table to support this. This shouln't have any functional effect. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/main: use non-prefixed enums for consistencyErik Faye-Lund2018-11-231-33/+33
| | | | | | | | | These enums all have the same values as their non-prefixed versions, and there's several aliases for some of them. So let's switch to the non-prefixed versions for simplicity. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/main: correct year for EXT_occlusion_query_booleanErik Faye-Lund2018-11-231-1/+1
| | | | | | | | | | | According to the extension spec, this was initially released in 2011, so let's set this to the correct value. The value of 2001 could be a copy-paste mistake, as ARB_occlusion_query which this is based on was released then. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/main: correct requirement for EXT_occlusion_query_booleanErik Faye-Lund2018-11-231-1/+1
| | | | | | | | | | | | | | | EXT_occlusion_query_boolean require support for GL_ANY_SAMPLES_PASSED, which ARB_occlusion_query doesn't supply. We need ARB_occlusion_query2 for this instead. This is still not 100% accurate, as we also require support for the GL_SAMPLES_PASSED_CONSERVATIVE target, which isn't guaranteed by either ARB_occlusion_query nor ARB_occlusion_query2. But it should be trivial to implement for any driver supporting ARB_occlusion_query2, as it can simply be implemented as GL_ANY_SAMPLES_PASSED. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: Remove unneeded bitfield widths from the VAO.Mathias Fröhlich2018-11-211-2/+2
| | | | | | | | | | | | With the current VAO layout we do not need to make these fields a bitfield. We get a tight struct layout with this change for VAO attributes. v2: Change unsigned char -> GLubyte. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Factor out struct gl_vertex_format.Mathias Fröhlich2018-11-2124-202/+224
| | | | | | | | | | | | | | | | Factor out struct gl_vertex_format from array attributes. The data type is supposed to describe the type of a vertex element. At this current stage the data type is only used with the VAO, but actually is useful in various other places. Due to the bitfields being used, special care needs to be taken for the glGet code paths. v2: Change unsigned char -> GLubyte. Use struct assignment for struct gl_vertex_format. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* tnl: Use gl_array_attribute::_ElementSize.Mathias Fröhlich2018-11-211-9/+2
| | | | | | | | | Instead of open coding the size computation, use the already available gl_array_attribute::_ElementSize value. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* nouveau: Use gl_array_attribute::_ElementSize.Mathias Fröhlich2018-11-211-1/+1
| | | | | | | | | Instead of open coding the size computation, use the already available gl_array_attribute::_ElementSize value. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Unify glEdgeFlagPointer data type.Mathias Fröhlich2018-11-211-1/+1
| | | | | | | | | | | Use GL_UNSIGNED_BYTE as initialization data type for the edge flag vertex attribute array. The same datatype is used in the glEdgeFlagPointer function when setting the array pointer. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Work with bitmasks when en/dis-abling VAO arrays.Mathias Fröhlich2018-11-214-29/+45
| | | | | | | | | | | For enabling or disabling VAO arrays it is now possible to change a set of arrays with a single call without the need to iterate the attributes. Make use of this technique in the vao module. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Remove gl_array_attributes::Enabled.Mathias Fröhlich2018-11-214-24/+4
| | | | | | | | | Now that all users go via the VAO Enabled bitfield, get rid of the Enabled boolean. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Use gl_vertex_array_object::Enabled for glGet.Mathias Fröhlich2018-11-212-9/+36
| | | | | | | | | | | Instead of using gl_array_attributes::Enabled use the much more compact representation stored in gl_vertex_array_object::Enabled using the corresponding bits. Keep the glGet changes in a seperate patch at least for review. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Use the gl_vertex_array_object::Enabled bitfield.Mathias Fröhlich2018-11-215-43/+39
| | | | | | | | | | Instead of using gl_array_attributes::Enabled use the much more compact representation stored in gl_vertex_array_object::Enabled using the corresponding bits. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Rename gl_vertex_array_object::_Enabled -> Enabled.Mathias Fröhlich2018-11-2111-36/+36
| | | | | | | | | Mark the up to now derived bitfield value now as primary value by removing the underscore. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* st/mesa: pin driver threads to a fixed CCX when glthread is enabledMarek Olšák2018-11-201-0/+11
| | | | | | | | radeonsi has 3 driver threads (glthread, gallium, winsys), other drivers may have 2 (glthread, gallium), so it makes sense to pin them to a random CCX and keep that irrespective of the app thread. Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: regularly re-pin driver threads to the CCX where the app thread isMarek Olšák2018-11-202-0/+34
| | | | | | | | | This is used when glthread is disabled. Mesa pretty much chases the app thread on the CPU. The performance is the same as pinning the app thread. Reviewed-by: Dave Airlie <[email protected]>
* mesa/glthread: enable immediate modeMarek Olšák2018-11-201-4/+10
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* mesa/glthread: pass the function name to _mesa_glthread_restore_dispatchMarek Olšák2018-11-203-4/+7
| | | | | | If you insert printf there, you'll know why glthread was disabled. Reviewed-by: Timothy Arceri <[email protected]>
* i965: Do NIR shader cloning in the caller.Kenneth Graunke2018-11-206-6/+7
| | | | | | | | | | | | This moves nir_shader_clone() to the driver-specific compile function, rather than the shared src/intel/compiler code. This allows i965 to do key-specific passes before calling brw_compile_*. Vulkan should not need this cloning as it doesn't compile multiple variants. We do need to continue cloning in the compute shader code because we lower various things in NIR based on the SIMD width. Reviewed-by: Alejandro Piñeiro <[email protected]>
* i965: Use a 'nir' temporary rather than poking at brw_programKenneth Graunke2018-11-206-22/+25
| | | | | | It's shorter and will also be useful when I adjust cloning soon. Reviewed-by: Alejandro Piñeiro <[email protected]>
* meson: Add tests to suitesDylan Baker2018-11-202-4/+7
| | | | | | | | | | | | | | | | Meson test has a concepts of suites, which allow tests to be grouped together. This allows for a subtest of tests to be run only (say only the tests for nir). A test can be added to more than one suite, but for the most part I've only added a test to a single suite, though I've added a compiler group that includes nir, glsl, and glcpp tests. To use this you'll need to invoke meson test directly, instead of ninja test (which always runs all targets). it can be invoked as: `meson test -C builddir --suite $suitename` (meson test has addition options that are pretty useful). Tested-By: Gert Wollny <[email protected]> Acked-by: Eric Engestrom <[email protected]>
* i965/batch: avoid reverting batch buffer if saved state is an emptyAndrii Simiklit2018-11-205-2/+13
| | | | | | | | | | | | | | | | | | | | | There's no point reverting to the last saved point if that save point is the empty batch, we will just repeat ourselves. v2: Merge with new commits, changes was minimized, added the 'fixes' tag v3: Added in to patch series v4: Fixed the regression which was introduced by this patch Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108630 Reported-by: Mark Janes <[email protected]> The solution provided by: Jordan Justen <[email protected]> CC: Chris Wilson <[email protected]> Fixes: 3faf56ffbdeb "intel: Add an interface for saving/restoring the batchbuffer state." Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107626 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108630 (fixed in v4) Signed-off-by: Andrii Simiklit <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965:use FRAMEBUFFER_UNSUPPORTED instead of FRAMEBUFFER_INCOMPLETE_DIMENSIONSGert Wollny2018-11-191-1/+1
| | | | | | | | | | | | | | FRAMEBUFFER_INCOMPLETE_DIMENSIONS is not supported for GLES 3.0 and later and not defined for Desktop OpenGL. Instead use FRAMEBUFFER_UNSUPPORTED like it was done before. Thanks to Iago Toral and Andrey Simiklit for pointing out the problem and the details. Fixes: ebcde3454552adc6d3fea8af2207aafaba857796 i965: be more specific about FBO completeness errors Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* i965: Add support for and expose EXT_texture_sRGB_R8Gert Wollny2018-11-192-0/+2
| | | | | | | | | | | | | | Emulate MESA_FORMAT_R_SRGB8 by using L8_UNORM_SRGB. This is possible because component swizzling is handled based on the mesa format and, hence, the a r001 swizzling can be used to correct the components. Enables and makes pass (tested on Kabylake) dEQP-GLES31.functional.srgb_texture_decode.skip_decode.sr8.* dEQP-GLES31.functional.texture.filtering.cube_array.formats.sr8* Signed-off-by: Gert Wollny <[email protected]> Acked-by: Eric Engestrom <[email protected]>
* i965: Force zero swizzles for unused components in GL_RED and GL_RGGert Wollny2018-11-191-0/+4
| | | | | | | This makes it possible to use a hardware luminance format as RED format. Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* i965: be more specific about FBO completeness errorsGert Wollny2018-11-191-19/+23
| | | | | | | | | | | The driver was returning GL_FRAMEBUFFER_UNSUPPORTED for all cases of an incomplete fbo, be a bit more specific about this following the description of glCheckFramebufferStatus. This helps to keeps dEQP happy when adding EXT_texture_sRGB_R8 support. Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* i915: Delete swizzling detection logic.Kenneth Graunke2018-11-174-31/+0
| | | | | | | This is all leftover from the i965 split. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* i965: Fix calculation of layers array length for isl_viewDanylo Piliaiev2018-11-151-15/+18
| | | | | | | | | | | | | | | | | | | | | | | Handle all cases in calculation of layers count for isl_view taking into account texture view and image unit. st_convert_image was taken as a reference. When u->Layered is true the whole level is taken with respect to image view. In other case only one layer is taken. v3: (Józef Kucia and Ilia Mirkin) - Rewrote patch by taking st_convert_image as a reference - Removed now unused get_image_num_layers function - Changed commit message v4: (Jason Ekstrand) - Added assert Fixes: 5a8c8903 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107856 Signed-off-by: Danylo Piliaiev <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965: avoid 'unused variable' warningsAndrii Simiklit2018-11-142-3/+3
| | | | | | | | | | | | | | 1. brw_pipe_control.c:311:34: warning: unused variable ‘devinfo’ 2. brw_program_binary.c:209:19: warning: unused variable ‘gen_size’ 3. brw_program_binary.c:216:19: warning: unused variable ‘nir_size’ v2: Changes for unreproducible issues were removed Signed-off-by: Andrii Simiklit <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* mesa: Reference count shaders that are used by transform feedback objectsGert Wollny2018-11-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Transform feedback objects may hold a pointer to a shader program, and at least in Gallium, this must be a valid pointer until ctx->Driver.EndTransformFeedback in glEndTransformFeedback has been called - which is conform with the spec that any program that is part of a current rendering state should only be flagged for deletion by glDeleteProgram. This was not handled properly for the transform feedback objects so that a call sequence glUseProgram(x) glBeginTransformFreedback(...) glPauseTransformFeedback(...) glDeleteProgram(x) glEndTransformFeedback(...) would result in a use after free bug. With this patch the transform feedback object also updates the reference count to the used program thereby keeping the program valid as long as the transform feedback objects links to it. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108713 Fixes: 654587696b4234d09a6b471b70e9629cf2887c27 mesa: add end_transform_feedback() helper Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* mesa: mark GL_SR8_EXT non-renderable on GLESMarek Olšák2018-11-121-0/+1
| | | | | | Fixes: dEQP-GLES3.functional.fbo.completeness.renderable.texture.color0.sr8_ext Reviewed-by: Ilia Mirkin <[email protected]>
* st/mesa: disable L3 thread pinningMarek Olšák2018-11-121-9/+0
| | | | | | | This implementation can have massive drawbacks. Cc: 18.3 <[email protected]> Reviewed-by: Edmondo Tommasina <[email protected]>
* i965: add support for sampling from AYUVLionel Landwerlin2018-11-122-0/+9
| | | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* st/mesa: make use of nir_link_constant_varyings()Timothy Arceri2018-11-101-0/+3
| | | | | | | | | | | | | | | | | | Shader-db results radeonsi (VEGA): Totals from affected shaders: SGPRS: 161464 -> 161368 (-0.06 %) VGPRS: 86904 -> 86292 (-0.70 %) Spilled SGPRs: 296 -> 314 (6.08 %) Spilled VGPRs: 0 -> 0 (0.00 %) Private memory VGPRs: 0 -> 0 (0.00 %) Scratch size: 0 -> 0 (0.00 %) dwords per thread Code Size: 3618596 -> 3573852 (-1.24 %) bytes LDS: 0 -> 0 (0.00 %) blocks Max Waves: 26189 -> 26276 (0.33 %) Wait states: 0 -> 0 (0.00 %) Reviewed-by: Eric Anholt <[email protected]>
* gallium: add PIPE_CONTEXT_LOSE_CONTEXT_ON_RESETMarek Olšák2018-11-091-0/+3
| | | | Tested-by: Dieter Nützel <[email protected]>
* Revert "mesa: expose NV_conditional_render on GLES"Erik Faye-Lund2018-11-091-1/+1
| | | | This reverts commit 5213be9fab72548c799b30e320dd1b257534f096.
* Revert "mesa/main: fixup make check after NV_conditional_render for gles"Erik Faye-Lund2018-11-091-4/+0
| | | | This reverts commit cccd7a253f9ed14ea748a222f58b0e5c895eb939.
* mesa/main: fixup make check after NV_conditional_render for glesErik Faye-Lund2018-11-091-0/+4
| | | | | | | | | It seems I missed some details when exposing NV_conditional_render on GLES; this fixes up "make check". Fixes: 5213be9fab7 ("mesa: expose NV_conditional_render on GLES") Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-and-Tested-by: Eric Engestrom <[email protected]>
* mesa: expose NV_conditional_render on GLESErik Faye-Lund2018-11-091-1/+1
| | | | | | | | The extension spec has been updated to include GLES 2 support, so let's enable it there. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* i965: Lift restriction in external textures for EGLImage supportAditya Swarup2018-11-083-15/+0
| | | | | | | | | | | | | | | | Fixes Skqp's unitTest_EGLImageTest test. For Intel platforms, we support external textures only for EGLImages created with EGL_EXT_image_dma_buf_import. This restriction seems to be Intel specific and not present for other platforms. While running SKQP test - unitTest_EGLImageTest, GL_INVALID is sent to the test because of this restriction. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105301 Signed-off-by: Aditya Swarup <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965/batch/debug: Allow log be dumped before assertSergii Romantsov2018-11-051-1/+1
| | | | | | | | | Message that may show the culprit of assert now will be dumped before that for debug purposes. Signed-off-by: Sergii Romantsov <[email protected]> Reviewed-by: Lionel G Landwerlin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: Don't record garbage streamout information in the non-SSO case.Kenneth Graunke2018-11-033-31/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the non-SSO case, where multiple shader stages are linked together, we were recording garbage pipe_stream_output_info structures for all but the last enabled geometry-processing stage. Specifically, we were using the gl_transform_feedback_info from shader_program->last_vert_prog (the stage whose outputs will be recorded)...but were pairing it with the output varying mappings from the current shader stage. For example, a program with a VS and GS, the VS's pipe_shader_state would have a pipe_stream_output_info based on the GS transform feedback info, but the VS output mapping. This generally worked out okay because only the pipe_stream_output_info for the last stage really matters - the others can be ignored. However, we'd like to avoid confusing the pipe driver. In particular, my new driver translates the stream out information to hardware packets at bind_{vs,tes,gs}_state() time...and was hitting asserts about garbage varyings that didn't exist. This patch changes st/mesa to record a blank pipe_stream_output_info with num_outputs = 0 for all stages prior to last_vert_prog. The last one is captured as normal. (In the fully-SSO case, nothing should change - each program contains a single shader stage, so last_vert_prog *is* the current shader.) Tested with llvmpipe (piglit's gpu profile), and freedreno (a3xx, gpu profile with -t transform.feedback). Fixes several hundred CTS tests on my new driver. Reviewed-by: Timothy Arceri <[email protected]>
* st/nir: Drop unused parameter from st_nir_assign_uniform_locations().Kenneth Graunke2018-11-031-2/+1
| | | | | | ARB programs won't have one of these, and we don't use it anyway. Reviewed-by: Rob Clark <[email protected]>
* st/mesa: Pull nir_lower_wpos_ytransform work into a helper function.Kenneth Graunke2018-11-032-29/+40
| | | | | | This will let me use it in the ARB program code as well. Reviewed-by: Rob Clark <[email protected]>
* i965/icl: Disable prefetching of sampler state entriesTopi Pohjolainen2018-11-021-3/+12
| | | | | | | | | | | | | | | | | | | In the same spirit as commit a5889d70f2074201ceaeac4f96a9a0c0b1f68a31 "i965/icl: Disable binding table prefetching". Fixes some 110+ intermittent piglit failures with tex-miplevel-selection variants. WA_1606682166: Incorrect TDL's SSP address shift in SARB for 16:6 & 18:8 modes. Disable the Sampler state prefetch functionality in the SARB by programming 0xB000[30] to '1'. This is to be done at boot time and the feature must remain disabled permanently. Anuj: Set SamplerCount = 0 for vs, gs, hs, ds and wm units as well. Signed-off-by: Topi Pohjolainen <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Cc: Mark Janes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa/st: Add support for EXT_texture_sRGB_R8Gert Wollny2018-11-022-0/+12
| | | | | | | | | | | | | | | | | | | | | | This only adds support on the Gallium core level, for the drivers it is likely that additional changes are needed to support the new texture format and thereby enabling the extension. Enables on softpipe and makes pass: dEQP-GLES31.functional.srgb_texture_decode.skip_decode.sr8.* v2: - add include for getting GL_SR8_EXT v4: - since the extension is not required don't bother providing a fallback (Ilia Mirkin) - split patch (2/2) to separate Gallium and mesa/st parts (Roland Scheidegger) - trim commit message to only contain the history of the patch relevant to this part v5: - don't include GLES headers (required enum has been added to glheader.h) (Ilia Mirkin) Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa/core: Add definitions and translations for EXT_texture_sRGB_R8Gert Wollny2018-11-0210-3/+28
| | | | | | | | | | | | | | | | | | | | | | v2: - fix format definition line - disable for desktop GL - don't add GL_R8_EXT to glext.h since it is already in GLES2/gl2ext.h in glext.h and include this header where needed (all Emil) v3: - swrast: Fill the function table for sRGB_R8 The size of the function table is checked at compile time and must correspond to the number of mesa texture formats. dri/swrast being gles-2.0 doesn't support the extension though v4: - correct format layout comment (Ilia Mirkin) - correct logic for accepting GL_RED only textures (in part Ilia Mirkin) EXT_texture_sRGB_R8 requires OpenGL ES 3.0 which includes ARB_texture_rg/EXT_texture_rg, so one only must check for the first when SR8_EXT is really requested. v5: - add define for GL_ES8_XT to glheader.h and don't include GLES headers (Ilia Mirkin) Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa/glsl: add support for EXT_shader_implicit_conversionsErik Faye-Lund2018-11-021-0/+1
| | | | | | | | | | | EXT_shader_implicit_conversions adds support for implicit conversions for GLES 3.1 and above. This is essentially a subset of ARB_gpu_shader5, and augments OES_gpu_shader5. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: Remove needless indirection in some draw functions.Mathias Fröhlich2018-11-022-126/+44
| | | | | Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* Revert "i965/batch: avoid reverting batch buffer if saved state is an empty"Mark Janes2018-11-015-14/+3
| | | | | | This reverts commit a9031bf9b55602d93cccef6c926e2179c23205b4. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108630