summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* mesa: fix GLES 3.1 version calculationRob Clark2018-06-211-1/+2
| | | | | | | | | | | | | | | All of ARB_gpu_shader5 is most certainly not required for GLES 3.1 (most of it is in OES_gpu_shader5 on top of GLES 3.1). Some of what is required from ARB_gpu_shader5 is provided by ARB_texture_gather, so check for that. The remaining subset of ARB_gpu_shader5 doesn't have individual extensions to check for, but I guess it is unlikely that some driver has all of these extensions but not, say, integer bitfield manipulation. Signed-off-by: Rob Clark <[email protected]> Acked-by: Ilia Mirkin <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* freedreno/a5xx: MSAARob Clark2018-06-2114-42/+89
| | | | Signed-off-by: Rob Clark <[email protected]>
* freedreno: update generated headersRob Clark2018-06-218-41/+53
| | | | Signed-off-by: Rob Clark <[email protected]>
* freedreno/ir3: txf_ms supportRob Clark2018-06-213-7/+51
| | | | Signed-off-by: Rob Clark <[email protected]>
* freedreno/a5xx: fix gpu hangs with large compute shadersRob Clark2018-06-211-3/+11
| | | | | | | Similar to the combined limit for VS+FS, there is an upper limit for shader size to run from internel memory. Signed-off-by: Rob Clark <[email protected]>
* freedreno/ir3: fix base_vertexRob Clark2018-06-211-0/+1
| | | | | Fixes: c366f422f0a nir: Offset vertex_id by first_vertex instead of base_vertex Signed-off-by: Rob Clark <[email protected]>
* i965: Link uniforms of SPIR-V programs using the NIR linkerEduardo Lima Mitev2018-06-211-0/+6
| | | | | | | | | v2: nir_link_uniforms renamed to gl_nir_link_uniforms Signed-off-by: Eduardo Lima <[email protected]> Signed-off-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* i965: Setup glsl uniforms by index rather than name matchingNeil Roberts2018-06-211-13/+37
| | | | | | | | | | | | | | | Previously when setting up a uniform it would try to walk the uniform storage slots and find one that matches the name of the given variable. However, each variable already has a location which is an index into the UniformStorage array so we can just directly jump to the right slot. Some of the variables take up more than one slot so we still need to calculate how many it uses. The main reason to do this is to support ARB_gl_spirv because in that case the uniforms don’t have names so the previous approach won’t work. Reviewed-by: Timothy Arceri <[email protected]>
* i965: account for NIR uniforms without nameEduardo Lima Mitev2018-06-212-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | Right now, the BRW linker code assumes nir_variable::name is always non-NULL, but thanks to ARB_gl_spirv we will soon be linking SPIR-V programs, and those explicitly require matching uniforms by location. The name is just a debug hint. Instead of checking for the name this patch makes it check for var->num_state_slots on the assumption that everything that had an internal name also had some state slots. This seems likely because the two code paths that are taken when the name begins with "gl_" already have an assert that var->state_slots is not NULL. v2: simplified, most of it moved to glsl/nir/spirv (Neil Roberts) v3: check for num_state_slots instead of the name. This is needed because we do actually have nameless builtins with SPIR-V such as PatchVerticesIn and we want them to hit the _mesa_add_state_reference code path (Neil Roberts) Signed-off-by: Eduardo Lima <[email protected]> Signed-off-by: Neil Roberts <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* i965: Update TexturesUsed after linking the shadersNeil Roberts2018-06-211-1/+3
| | | | | | | | | Otherwise if the shader is SPIR-V then SamplerUsed won’t have been initialised yet so it will end up thinking no textures are used. This was causing a crash later on if nothing causes it to regenerate TexturesUsed before the next render. Reviewed-by: Timothy Arceri <[email protected]>
* i965: Build SPIR-V programs' resource list using NIREduardo Lima Mitev2018-06-211-1/+7
| | | | | | v2: tweak after nir_linker.h being renamed to gl_nir_linker.h Reviewed-by: Timothy Arceri <[email protected]>
* nir/linker: Add nir_build_program_resource_list()Eduardo Lima Mitev2018-06-214-0/+72
| | | | | | | | | | | | | | | | | | This function is equivalent to the linker.cpp build_program_resource_list() but will extract the resources from NIR shaders instead. For now, only uniforms and program inputs are implemented. v2: move from compiler/nir to compiler/glsl (Timothy Arceri) v3: remove support for inputs, that is still WIP (spotted by Timothy Arceri) Signed-off-by: Eduardo Lima <[email protected]> Signed-off-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* compiler/link: move add_program_resource to linker_utilAlejandro Piñeiro2018-06-215-56/+91
| | | | | | | | | | So it could be used by the GLSL and NIR linker. v2: (Timothy Arceri) * Moved from compiler to compiler/glsl * Method renamed to link_util_add_program_resource Reviewed-by: Timothy Arceri <[email protected]>
* nir/linker: Set the uniform initial valuesNeil Roberts2018-06-215-0/+298
| | | | | | | | This is based on link_uniform_initializers.cpp. v2: move from compiler/nir to compiler/glsl (Timothy Arceri) Reviewed-by: Timothy Arceri <[email protected]>
* nir/linker: Add gl_nir_link_uniforms()Eduardo Lima Mitev2018-06-214-0/+506
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function will be the entry point for linking the uniforms from the nir_shader objects associated with the gl_linked_shaders of a program. This patch includes initial support for linking uniforms from NIR shaders. It is tailored for the ARB_gl_spirv needs, and it is far from complete, but it should handle most cases of uniforms, array uniforms, structs, samplers and images. There are some FIXMEs related to specific features that will be implemented in following patches, like atomic counters, UBOs and SSBOs. Also, note that ARB_gl_spirv makes mandatory explicit location for normal uniforms, so this code only handles uniforms with explicit location. But there are cases, like uniform atomic counters, that doesn't have a location from the OpenGL point of view (they have a binding), but that Mesa assign internally a location. That will be handled on following patches. A nir_linker.h file is also added. More NIR-linking related API will be added in subsequent patches and those will include stuff from Mesa, so reusing nir.h didn't seem a good idea. v2: move from compiler/nir to compiler/glsl (Timothy Arceri) v3: sets var->driver.location if the uniform was found from a previous stage (Neil Roberts). Signed-off-by: Eduardo Lima <[email protected]> Signed-off-by: Neil Roberts <[email protected] Signed-off-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* compiler/link: add linker_util.h, move linker_error/warning to itAlejandro Piñeiro2018-06-216-14/+48
| | | | | | | | | | | | Linker utilities common to the GLSL IR and NIR linker (the latter to be used for ARB_gl_spirv). We need to move it to a new header as the NIR linker doesn't need to know about ir_variable, and others, included at linker.h. v2: move from src/compiler to src/compiler/glsl (Timothy Arceri) Reviewed-by: Timothy Arceri <[email protected]>
* spirv: Set nir_variable->explicit_bindingNeil Roberts2018-06-212-0/+3
| | | | | | | | | When SpvDecorationBinding is encountered in the SPIR-V source it now sets explicit_binding on the nir_variable. This will be used to determine whether to initialise sampler and image uniforms with the binding value. Reviewed-by: Timothy Arceri <[email protected]>
* spirv: Get rid of vtn_variable_mode_image/samplerNeil Roberts2018-06-215-39/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vtn_variable_mode_image and _sampler are instead replaced with vtn_variable_mode_uniform which encompasses both of them. In the few places where it was neccessary to distinguish between the two, the GLSL type of the pointer is used instead. The main reason to do this is that on OpenGL it is permitted to put images and samplers into structs and declare a uniform with them. That means that variables can now have a mix of uniform, sampler and image modes so picking a single one of those modes for a variable no longer makes sense. This fixes OpLoad on a sampler within a struct which was previously using the variable mode to determine whether it was a sampler or not. The type of the variable is a struct so it was not being considered to be uniform mode even though the member being loaded should be sampler mode. The previous code appeared to be using var->interface_type as a place to store the type of the variable without the enclosing array for images and samplers. I guess this worked because opaque types can not appear in interfaces so the interface_type is sort of unused. This patch removes the overloading of var->interface_type and any places that needed the type without the array can now just deduce it from var->type. v2: squash in this patch the changes to anv/nir (Timothy) Signed-off-by: Eduardo Lima <[email protected]> Signed-off-by: Neil Roberts <[email protected] Signed-off-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* spirv: translate default-block uniformsNicolai Hähnle2018-06-212-10/+16
| | | | | | | | | | | | | | | | | | They are supported by SPIR-V for ARB_gl_spirv. v2 (changes on top of Nicolai's original patch): * Handle UniformConstant storage class for uniforms other than samplers and images. (Eduardo Lima) * Handle location decoration also for samplers and images. (Eduardo Lima) * Rebase update (spirv_to_nir options added, logging changes, and others) (Alejandro Piñeiro) Signed-off-by: Nicolai Hähnle <[email protected]> Signed-off-by: Eduardo Lima <[email protected]> Signed-off-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* nir/types: Add a utility wrapper to glsl_type::sampler_index()Eduardo Lima Mitev2018-06-212-0/+8
| | | | | | I think it is more accurate to call it a sampler target (?). Reviewed-by: Timothy Arceri <[email protected]>
* nir/types: Add a glsl_get_component_slots() utilityEduardo Lima Mitev2018-06-212-0/+7
| | | | | | It is basically a wrapper around glsl_type::component_slots(). Reviewed-by: Timothy Arceri <[email protected]>
* nir/lower_samplers: Limit assert to GLSL shader programsEduardo Lima Mitev2018-06-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | Vulkan has the concept of separate image and sampler objects in the SPIR-V code whereas GL conflates them into one. nir_lower_samplers contains an assert to verify that sampler operand is not being set on the nir instruction. However when the code comes from spirv_to_nir the sampler operand is always set. GL_arb_gl_spirv explicitly states that OpTypeSampler is not supported so it retains the GL behaviour of not being able to seperate them. Therefore the sampler will always be the same as the texture. This GL version of the lowering code ignores instr->sampler and sets instr->sampler_index to the same value as instr->texture_index. Some other places in the code (such as in nir_print) assume that once the instruction is lowered then both instr->texture and instr->sampler will be NULL, so to keep this behaviour we now set instr->sampler to NULL after ignoring it to fill in instr->sampler_index. Signed-off-by: Eduardo Lima <[email protected]> Signed-off-by: Neil Roberts <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* nir: Add explicit_binding to nir_variableNeil Roberts2018-06-212-0/+6
| | | | | | | This is copied from the corresponding value in ir_variable. The intention is to eventually use it in a pure-NIR linker. Reviewed-by: Timothy Arceri <[email protected]>
* mesa/main: add NULL name check when searching for a resource nameAlejandro Piñeiro2018-06-211-0/+5
| | | | | | | | | Since ARB_gl_spirv name reflection can be missing. piglit shader_runner does several resource checking, so this commit is useful to get even the more simple piglit tests running without crashing on SPIR-V mode. Reviewed-by: Timothy Arceri <[email protected]>
* i965: use gl_shader_program_data::spirvAlejandro Piñeiro2018-06-211-1/+1
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* mesa/main: Add a 'spirv' flag to gl_shader_program_dataEduardo Lima Mitev2018-06-212-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will be used by the linker code to differentiate between programs made out of SPIR-V or GLSL shaders. This was rejected in the past, assuming that it was equivalent to check for "shProg->_LinkedShaders[stage]->spirv_data != NULL". But: * At some points of the linking process it would be needed to check if _LinkerShaders[stage] is present, so the full check would be: "shProg->_LinkedShaders[stage] != NULL && shProg->_LinkedShaders[stage]->spirv_data != NULL" * Sometimes you would like to do some specific to SPIR-V independently of the stage, or for any stage. For example, "link all the uniforms, for all stages". In that case checking for the flag would be equivalent to iterate all the _LinkedShaders and check if there is any spirv_data available. The former makes readibility really worse. Both could be solved by adding two helpers. But adding a flag seems really more simple and readable. v2: added justification for the flag on the commit message (Alejandro) Signed-off-by: Eduardo Lima <[email protected]> Signed-off-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* docs/release-calendar: restore the missing 18.1 columnEmil Velikov2018-06-211-0/+1
| | | | | | | | | Earlier commit removed the column, instead of adjusting the height. Cc: Dylan Baker <[email protected]> Fixes: 0d4f338a116 ("docs: Update release-notes and calendar") Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* configure: use compliant grep regex checksEmil Velikov2018-06-211-2/+2
| | | | | | | | | | | | | The current `grep "foo\|bar"' trips on some grep implementations, like the FreeBSD one. Instead use `egrep "foo|bar"' as suggested by Stefan. Cc: Stefan Esser <[email protected]> Reported-by: Stefan Esser <[email protected]> Bugzilla: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=228673 Fixes: 1914c814a6c ("configure: error out if building OMX w/o supported platform") Fixes: 63e11ac2b5c ("configure: error out if building VA w/o supported platform") Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl/tests/glcpp: reinstate "error out if no tests found"Emil Velikov2018-06-211-0/+9
| | | | | | | | | | | | | | | With the recent rework of converting the shell script to a python one the check for actual tests was dropped. Bring that back, since it was explicitly added considering we had a ~2 year period, during which the tests were not run. v2: use raise Exception() over print() & return false (Dylan) Fixes: db8cd8e36771 ("glcpp/tests: Convert shell scripts to a python script") Cc: Dylan Baker <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* glsl/glcpp/tests: reinstate srcdir/abs_builddir blurbEmil Velikov2018-06-211-0/+13
| | | | | | | | | | | Bring back the "detection" of the said variables, to allow standalone execution. Fixes: db8cd8e36771 ("glcpp/tests: Convert shell scripts to a python script") Cc: Dylan Baker <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* glsl: fold glcpp-test-cr-lf.sh into glcpp-test.shEmil Velikov2018-06-213-5/+1
| | | | | | | | | | | As of recently both of these have been reworked so they invoke a python script. At the same time the latter can be executed with the combined arguments of both scripts. AKA we no longer need to have them separate. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* st/dri: constify dri_fill_st_visual's screenEmil Velikov2018-06-212-2/+4
| | | | | | | As the function says - only the visual is changed. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: remove struct gl_extensions::ATI_separate_stencilEmil Velikov2018-06-217-15/+2
| | | | | | | | | | | | Virtually every driver that supports ATI_separate_stencil also supports EXT_stencil_two_side. Use the latter boolean for both extension. With that in mind we can drop the explicit true from the drivers and the nasty comment in compute_version(). Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* travis: add libXrandr and its randrproto dependencyEric Engestrom2018-06-211-0/+10
| | | | | Fixes: 3f960c1338713d317ce6 "vulkan: EXT_acquire_xlib_display requires libXrandr headers to build" Signed-off-by: Eric Engestrom <[email protected]>
* swr: bump minimum supported LLVM version to 5.0Juan A. Suarez Romero2018-06-215-17/+16
| | | | | | | | | | | | | | | | RADV now requires LLVM 5.0 or greater, and thus we can't build dist tarball because swr requires LLVM 4.0. Let's bump required LLVM to 5.0 in swr too. Fixes: f9eb1ef870 ("amd: remove support for LLVM 4.0") Cc: Tim Rowley <[email protected]> Cc: Emil Velikov <[email protected]> Cc: Dylan Baker <[email protected]> Cc: Eric Engestrom <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Acked-by: Bruce Cherniak <[email protected]>
* radeonsi: add a debug flag to zero vram allocationsGrazvydas Ignotas2018-06-215-0/+7
| | | | | | | | | | This allows to avoid having to see garbage in Dying Light loading screen at least, which probably expects Windows/NV behavior of all allocations being zeroed by default. Analogous to radv flag with the same name. Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: use shifts for sign extensionGrazvydas Ignotas2018-06-211-2/+2
| | | | | | | | | Avoids a branch and reduces code size a tiny bit: text data bss dec hex filename 10804563 398653 2070368 13273584 ca89f0 /tmp/radeonsi_dri.so.old 10804499 398653 2070368 13273520 ca89b0 /tmp/radeonsi_dri.so Reviewed-by: Marek Olšák <[email protected]>
* radv: set EVENT_WRITE_EOP.INT_SEL = wait for write confirmationSamuel Pitoiset2018-06-211-3/+9
| | | | | | | | Ported from RadeonSI. Not sure why this is needed but AMDVLK does something similar. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: use EOP_DATA_SEL_* instead of magic numbersSamuel Pitoiset2018-06-213-6/+12
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* r600: fix copy/paste bug for sampleMaskIn workaroundRoland Scheidegger2018-06-211-1/+1
| | | | | | | | | | | The sampleMaskIn workaround (b936f4d1ca0d2ab1e828ff6a6e617f12469687fa) tries to figure out if the shader is running at per-sample frequency, but there's a typo bug so it will only recognize per-sample linar inputs, not per-sample perspective ones. Spotted by Eric Engestrom <[email protected]> Fixes: b936f4d1ca0d2ab1e828a "r600: partly fix sampleMaskIn value"
* v3d: Fix min vs mag determination when not doing mip filtering.Eric Anholt2018-06-201-2/+10
| | | | | Fixes all 128 failing tests in dEQP-GLES3.functional.texture.filtering.*.combinations
* vulkan: EXT_acquire_xlib_display requires libXrandr headers to buildKeith Packard2018-06-208-5/+13
| | | | | | | | | | | | | | | | | When VK_USE_PLATFORM_XLIB_XRANDR_EXT is defined, vulkan.h includes X11/extensions/Xrandr.h for the RROutput typedef which is used in the vkGetRandROutputDisplayEXT interface. Make sure we have the required header by checking during the build, and also set CFLAGS to point at the right directory. We don't need to link against the library as we don't use any functions from there, so don't add the _LIBS value in the autotools build. Signed-off-by: Keith Packard <[email protected]> Fixes: dbac8e25f851ed44c51f "radv: Add EXT_acquire_xlib_display to radv driver [v2]" Reviewed-by: Eric Engestrom <[email protected]>
* v3d: Implement ALPHA_TO_COVERAGE.Eric Anholt2018-06-202-2/+15
| | | | | | There's a convenient "FTOC" instruction for generating the coverage now, unlike vc4. This fixes dEQP-GLES3.functional.multisample.fbo_4_samples.proportionality_alpha_to_coverage
* v3d: Track write reference to the separate stencil buffer.Eric Anholt2018-06-201-1/+16
| | | | | | | | | | | | | Otherwise, a blit from separate stencil may fail to flush the job that initialized it, or new drawing could fail to flush a blit reading from stencil. Fixes: dEQP-GLES3.functional.fbo.blit.depth_stencil.depth32f_stencil8_basic dEQP-GLES3.functional.fbo.blit.depth_stencil.depth32f_stencil8_scale dEQP-GLES3.functional.fbo.blit.depth_stencil.depth32f_stencil8_stencil_only dEQP-GLES3.functional.fbo.msaa.2_samples.depth32f_stencil8 dEQP-GLES3.functional.fbo.msaa.4_samples.depth32f_stencil8
* v3d: Add missing reference to the separate stencil buffer.Eric Anholt2018-06-201-11/+13
| | | | Noticed while debugging a missing flush of rendering in the z32f_s8 case.
* v3d: Fix return value from fence_finish.Eric Anholt2018-06-201-1/+1
| | | | | | | We needed to convert from a -errno to a boolean success value. Fixes: GTF-GLES3.gtf.GL3Tests.sync.sync_functionality_clientwaitsync_flush GTF-GLES3.gtf.GL3Tests.sync.sync_functionality_clientwaitsync_signaled
* mesa/st: only do scalar lowerings if driver benefitsChristian Gmeiner2018-06-201-9/+30
| | | | | | | | | As not every (upcoming) backend compiler is happy with nir_lower_xxx_to_scalar lowerings do them only if the backend is scalar (and not vec4) based. Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* gallium: add scalar isa shader capChristian Gmeiner2018-06-2015-1/+32
| | | | | | | | | | | | | | | | v1 -> v2: - nv30 is _NOT_ scalar as suggested by Ilia Mirkin. - Change from a screen cap to a shader cap as suggested by Eric Anholt. - radeonsi is scalar as suggested by Marek Olšák. - Change missing ones to be scalar. v2 -> v3: - r600 prefers vec4 as suggested by Marek Olšák. Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* radv: Add VK_EXT_display_surface_counter to radv driverKeith Packard2018-06-202-0/+13
| | | | | | | | This extension is required to support EXT_display_control as it offers a way to query whether the vblank counter is supported. Signed-off-by: Keith Packard <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Add VK_EXT_display_surface_counter to anv driver [v2]Keith Packard2018-06-202-0/+13
| | | | | | | | | | | | | This extension is required to support EXT_display_control as it offers a way to query whether the vblank counter is supported. v2: Add extension to list in alphabetical order Suggested-by: Jason Ekstrand <[email protected]> Signed-off-by: Keith Packard <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>