summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* vulkan/overlay: fix timestamp query emission with no pipeline statsLionel Landwerlin2019-05-211-4/+0
| | | | | | | | | | | | | | | | | | | | The if (!pipe && timestamp) logic was broken. It should have been : if (!pipe && !timestamp) Let just drop this condition as the following code does the right thing for all cases. An error was appearing with the following variables : VK_INSTANCE_LAYERS=VK_LAYER_MESA_overlay VK_LAYER_MESA_OVERLAY_CONFIG=gpu_timing Signed-off-by: Lionel Landwerlin <[email protected]> Fixes: ea7a6fa98055ad ("vulkan/overlay: add pipeline statistic & timestamps support") Reviewed-by: Tapani Pälli <[email protected]>
* glsl: do not use deprecated bison-keywordErik Faye-Lund2019-05-213-3/+3
| | | | | | | | | | %error-verbose has been deprecated since Bison 3.0, which was released in 2013. In Bison 3.3.1 which was recently released, this has started causing warnings. Let's update the code to do this in the modern way intead, to avoid cluttering the output needlessly. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* glsl: handle 8 and 16 bit ints in glsl_base_type_is_integerKarol Herbst2019-05-211-1/+5
| | | | | | | Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* nir/test: add split vars tests (v2)Dave Airlie2019-05-211-1/+419
| | | | | | | | | | | | | | | | | | | | | | | | | This just adds some split var splitting tests, it verifies by counting derefs and local vars. a basic load from inputs, store to array, same as before but with a shader temp struct { float } [4] don't split test a basic load from inputs, with some out of band loads. a load/store of only half the array two level array, load from inputs store to all levels a basic load from inputs with an indirect store to array. two level array, indirect store to lvl 0 two level array, indirect store to lvl 1 load from inputs, store to array twice load from input, store to array, load from array, store to another array. load and from input and copy deref to array create wildcard derefs, and do a copy v2: use array_imm helpers, move derefs out of loops, rename toplevel/secondlevel, use ints, fix lvl1 don't split test, rename globabls to shader_temp, add comment, check the derefs type Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* anv: Don't re-use entry_point pointer from spirv_to_nirCaio Marcelo de Oliveira Filho2019-05-201-2/+2
| | | | | | | | | | | | | | | When running with NIR_TEST_CLONE=1, the pointer will not be valid, as the whole shader is going to be recreated every pass. Prefer using is_entrypoint (to query when looping) and nir_shader_get_entrypoint() instead. Fixes the Vulkan Piglit tests - vulkan/glsl450/frexp-double - vulkan/glsl450/isinf-double - vulkan/shaders/fs-multiple-large-local-array Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108957 Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Fix clone of nir_variable state slotsCaio Marcelo de Oliveira Filho2019-05-201-3/+5
| | | | | | | | | | | | When num_state_slots is 0, don't create the array. This was triggering the following assert when running vkcube with NIR_TEST_CLONE=1 vkcube: ../src/compiler/nir/nir_split_per_member_structs.c:66: split_variable: Assertion `var->state_slots == NULL' failed. Fixes: 9fbd390dd4b "nir: Add support for cloning shaders" Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: unreference current winsys buffers when unbinding winsys buffersCharmaine Lee2019-05-201-0/+4
| | | | | | | This fixes surface leak when no winsys buffers are bound. Cc: [email protected] Reviewed-by: Brian Paul <[email protected]>
* st/mesa: purge framebuffers with current context after unbinding winsys buffersCharmaine Lee2019-05-201-3/+10
| | | | | | | | | | | | | With commit c89e8470e58, framebuffers are purged after unbinding context, but this change also introduces a heap corruption when running Rhino application on VMware svga device. Instead of purging the framebuffers after the context is unbound, this patch first ubinds the winsys buffers, then purges the framebuffers with the current context, and then finally unbinds the context. This fixes heap corruption. Cc: [email protected] Reviewed-by: Brian Paul <[email protected]>
* spirv: Generate proper NULL pointer valuesCaio Marcelo de Oliveira Filho2019-05-201-4/+12
| | | | | | | | | | | | | Use the storage class address format information to pick the right constant values for a NULL pointer. v2: Don't add a deref_cast to the values. (Jason) v3: Update to use vtn_storage_class_to_mode() and vtn_mode_to_address_format() explicitly. (Jason) Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* spirv: Reuse helpers in vtn_handle_type()Caio Marcelo de Oliveira Filho2019-05-202-33/+6
| | | | | | | | | | | | | And change vtn_storage_class_to_mode() to accept NULL as interface_type. In this case, if we have a SpvStorageClassUniform, we assume it is uses an ubo_addr_format, like the code being replaced by the helper. That assumption is a problem, but no different than the previous code. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* spirv: Add vtn_variable_mode_imageCaio Marcelo de Oliveira Filho2019-05-202-0/+11
| | | | | | | | | | | | | Corresponding to SpvStorageClassImage. We see pointers for that storage class in tests, but don't use the storage class any further. Adding this so that we can call vtn_mode_to_address_format() for all supported pointers. v2: Fail when trying to create a SpvStorageClassImage variable. (Jason) Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* spirv: Add vtn_mode_to_address_format()Caio Marcelo de Oliveira Filho2019-05-202-20/+57
| | | | | | | | | | Handles all the modes and we can use it in combination with nir_address_format_to_glsl_type() to replace the vtn_ptr_type_for_mode() helper. Since the new helper is more generic, moved the assertions from the old one to the call sites. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* spirv: Add vtn_mode_uses_ssa_offset()Caio Marcelo de Oliveira Filho2019-05-202-8/+15
| | | | | | | | | | | | Just the mode is needed to decide whether SSA offsets are needed, so make a function that takes that and reuse it for vtn_pointer_uses_ssa_offset(). This will be used for constant null pointers, that won't have a vtn_pointer handy. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* spirv: Add and use vtn_type_without_array() helperCaio Marcelo de Oliveira Filho2019-05-203-8/+15
| | | | | | | | v2: Renamed from vtn_interface_type. (Jason) Accept any type not only pointers. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* spirv: Change vtn_null_constant() to use vtn_typeCaio Marcelo de Oliveira Filho2019-05-201-32/+26
| | | | | | | | | | | This is a preparation to handle OpConstantNull for pointers, we'll use the vtn_type to get to the address format and then the appropriate representation of NULL pointer. v2: Move rest of body to use vtn_type. (Jason) Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* spirv: Export vtn_storage_class_to_mode()Caio Marcelo de Oliveira Filho2019-05-202-1/+6
| | | | | | | So we can reuse in spirv_to_nir.c. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* nir: Add nir_address_format_null_value()Caio Marcelo de Oliveira Filho2019-05-202-0/+22
| | | | | | | | Returns the nir_const_value * with the representation of the NULL pointer for each address format. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* spirv, radv, anv: Replace ptr_type with addr_formatCaio Marcelo de Oliveira Filho2019-05-205-36/+46
| | | | | | | | | Instead of setting the glsl types of the pointers for each resource, set the nir_address_format, from which we can derive the glsl_type, and in the future the bit pattern representing a NULL pointer. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* nir: Add nir_address_format_32bit_offsetCaio Marcelo de Oliveira Filho2019-05-202-0/+9
| | | | | | | | | This is a simple 32-bit address which is not a global address. Gives us a format that don't use 0 as its null pointer value. We will need this in anv to represent nir_var_mem_shared addresses. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* nir: Add nir_address_format_logicalCaio Marcelo de Oliveira Filho2019-05-202-0/+14
| | | | | | | | | | | An address format representing a purely logical addressing model. In this model, all deref chains must be complete from the dereference operation to the variable. Cast derefs are not allowed. These addresses will be 32-bit scalars but the format is immaterial because you can always chase the chain. E.g. push constants in anv. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* freedreno/a6xx: WFI in program stateobj tooRob Clark2019-05-201-0/+2
| | | | | | | | | | | This "fixes" hangs seen w/ various android games. I think a similar issue to with constant state, we need to avoid CP_LOAD_STATE until previous draw completes. It isn't entirely clear why blob doesn't need to do this, but it might have a different way to accomplish the same thing. Signed-off-by: Rob Clark <[email protected]>
* freedreno/a6xx: make sure binning pass constlen is large enoughRob Clark2019-05-201-0/+13
| | | | | | | | Since we use same constant state for both binning pass program state and draw pass state, and it is possible for binning pass shader to use fewer consts, we need to make sure we program a large enough constlen. Signed-off-by: Rob Clark <[email protected]>
* freedreno/a6xx: limit IBO state to draw passRob Clark2019-05-201-1/+1
| | | | | | | Currently we are only supporting images in FS (and CS) so limit this stateobj to draw pass. Signed-off-by: Rob Clark <[email protected]>
* freedreno/a6xx: don't evaluate FS tex state in binning passRob Clark2019-05-202-6/+14
| | | | | | It is unneeded since FS doesn't run in binning pass. Signed-off-by: Rob Clark <[email protected]>
* radv: decompress FMASK before performing a MSAA decompress using FMASKSamuel Pitoiset2019-05-201-2/+13
| | | | | | | This fixes some CTS failures related to VK_EXT_sample_locations. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* nir/validate: fix crash if entry is null.Dave Airlie2019-05-201-1/+1
| | | | | | | | we validate assert entry just before this, but since that doesn't stop execution, we need to check entry before the next validation assert. Reviewed-by: Jason Ekstrand <[email protected]>
* lima/gpir: switch to use nir_lower_viewport_transformQiang Yu2019-05-204-101/+11
| | | | | | Reviewed-by: Vasily Khoruzhick <[email protected]> Reviewed-by: Erico Nunes <[email protected]> Signed-off-by: Qiang Yu <[email protected]>
* lima/gpir: support vector ssa loadQiang Yu2019-05-202-5/+46
| | | | | | | | | Some vector sysval can't be lowered to scaler, so need to break it to scaler in nir to gpir convertion. Reviewed-by: Vasily Khoruzhick <[email protected]> Reviewed-by: Erico Nunes <[email protected]> Signed-off-by: Qiang Yu <[email protected]>
* lima/gpir: add helper function for emit load nodeQiang Yu2019-05-201-20/+19
| | | | | | Reviewed-by: Vasily Khoruzhick <[email protected]> Reviewed-by: Erico Nunes <[email protected]> Signed-off-by: Qiang Yu <[email protected]>
* util: add missing include to build_id.hTimothy Arceri2019-05-201-0/+2
| | | | | | Required to use uint8_t Reviewed-by: Tapani Pälli <[email protected]>
* panfrost/midgard: Split up midgard_compile.c (RA)Alyssa Rosenzweig2019-05-1911-928/+1149
| | | | | | | | | | | | This commit moves the register allocator out of midgard_compile.c and into its own midgard_ra.c file. In doing so, a number of dependencies are identified and moved into their own files in turn. midgard_compile.c is still fairly monolithic, but this should help. Code churn, but no functional changes should be introduced by this commit. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Improve fixed-function blendingAlyssa Rosenzweig2019-05-192-978/+34
| | | | | | | | This fixes a few miscellaneous issues with the fixed-function blending programming, though it is far from complete. For cases known to be buggy, we force a fallback to blend shaders. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Wire up nir_lower_blendAlyssa Rosenzweig2019-05-191-14/+33
| | | | | | | | This implements blend shaders via nir_lower_blend, by creating dummy fragment shaders simply passing through the source color and using the new lowering pass to inject blendability. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Route new blending intrinsicsAlyssa Rosenzweig2019-05-191-106/+117
| | | | | | | To prepare for the new nir_lower_blend pass, we wire up the intrinsics for tilebuffer reads and constant colour loading. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/nir: Add nir_lower_blend passAlyssa Rosenzweig2019-05-194-1/+305
| | | | | | | | | | | | | | | | | | | | | | | | | | | This new lowering pass implements the OpenGL ES blend pipeline in shaders, applicable to hardware lacking full-featured blending hardware (including Midgard/Bifrost and vc4). This pass is run on a fragment shader, rewriting the store to a blended version, loading in the framebuffer destination color and constant color via intrinsics as necessary. This pass is sufficient for OpenGL ES 2.0 and is verified to pass dEQP's blend tests. MIN/MAX modes are included and tested as well. That said, at present it has the following limitations: - MRT is not supported (ES3). - sRGB support is missing (ES3). - Extended blending is not yet ported from GLSL IR lowering (ES3.2) - Dual-source blending is not supported. (N/A) - Logic ops are not supported. (N/A) v2: Fix code conventions (per Ian Romanick's feedback). Implement color masks. This pass should be in common nir/ space, but due to non-technical reasons, for now it's in Panfrost space. In the future, depending if other drivers need some of the functionality, we can move this back to src/compiler/nir space. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Fix Bifrost-specific paddingAlyssa Rosenzweig2019-05-191-7/+1
| | | | | Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Ryan Houdek <[email protected]>
* panfrost: Cleanup panfrost_job commentsAlyssa Rosenzweig2019-05-191-6/+3
| | | | | Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Ryan Houdek <[email protected]>
* panfrost/decode: Decode blend constantAlyssa Rosenzweig2019-05-192-2/+31
| | | | | | | | | | | | | This adds a forgotten decode line on Midgard and adds the field of a blend constant on Bifrost. The Bifrost encoding is fairly weird; whereas Midgard is just a regular 32-bit float, Bifrost uses a fancy fixed-point-esque encoding. The decode logic here is experimentally correct. The encode logic is a sort of "guesstimate", assuming that the high byte is just int(f / 255.0) and then solving algebraicly for the low byte. This might be slightly off in some cases. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Ryan Houdek <[email protected]>
* panfrost: Hoist blend constant into Midgard-specific structAlyssa Rosenzweig2019-05-196-16/+21
| | | | | | | | | This eliminates one major source of #ifdef parity between Midgard and Bifrost, better representing how the struct acts on Midgard and allowing proper decodes on Bifrost. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Ryan Houdek <[email protected]>
* panfrost/decode: Disassemble Bifrost shadersAlyssa Rosenzweig2019-05-192-8/+10
| | | | | | | | | We already have the Bifrost disassembler in-tree, so now that panwrap is able to dump Bifrost command streams, hook up the disassembler to pandecode. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Ryan Houdek <[email protected]>
* vulkan/wsi: Set X11 minImageCount to 3.Bas Nieuwenhuizen2019-05-191-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | For IMMEDIATE and FIFO, most games work in a pipelined manner where the can produce frames at a rate of 1/MAX(CPU duration, GPU duration), but the render latency is CPU duration + GPU duration. This means that with scanout from pageflipping we need 3 frames to run full speed: 1) CPU rendering work 2) GPU rendering work 3) scanout Once we have a nonblocking acquire that returns a semaphore we can merge 1 and 3. Hence the ideal implementation needs only 2 images, but games cannot tellwe currently do not have an ideal implementation and that hence they need to allocate 3 images. So let us do it for them. This is a tradeoff as it uses more memory than needed for non-fullscreen and non-performance intensive applications. Since this is pretty much a TODO that can use the context I added this as a comment. Acked-by: Jason Ekstrand <[email protected]> Acked-by: Samuel Pitoiset <[email protected]>
* meson: expose glapi through osmesaEric Engestrom2019-05-182-3/+4
| | | | | | | | | | | Suggested-by: Pierre Guillou <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109659 Fixes: f121a669c7d94d2ff672 "meson: build gallium based osmesa" Fixes: cbbd5bb889a2c271a504 "meson: build classic osmesa" Cc: Brian Paul <[email protected]> Cc: Dylan Baker <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Tested-by: Chuck Atkins <[email protected]>
* egl: Allow EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY in ES and GLKenneth Graunke2019-05-171-2/+10
| | | | | | | | | | | | | | | | | | | | | | | EGL annoyingly defines a few variants of this token: EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT - 0x3138 EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR - 0x31BD EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY - 0x31BD The EGL_EXT_create_context_robustness extension specifies that the EXT token is only valid for ES contexts, not GL. The EGL_KHR_create_context extension defines the KHR version, and says it is only allowed for GL contexts, and specifically calls out that it's an error for ES contexts. But EGL 1.5 includes the new suffixless token, which has the same value as the KHR version, and specifically calls out that it's now valid to use with both GL and ES contexts. So we should allow this. Fixes KHR-NoContext.es32.robustness.no_reset_notification and KHR-NoContext.es32.robustness.lose_context_on_reset on iris, which apparently is exposing EGL 1.5. Reviewed-by: Tapani Pälli <[email protected]>
* anv: Only consider minSampleShading when sampleShadingEnable is setJason Ekstrand2019-05-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | From the Vulkan 1.1.107 spec: Sample shading is enabled for a graphics pipeline: - If the interface of the fragment shader entry point of the graphics pipeline includes an input variable decorated with SampleId or SamplePosition. In this case minSampleShadingFactor takes the value 1.0. - Else if the sampleShadingEnable member of the VkPipelineMultisampleStateCreateInfo structure specified when creating the graphics pipeline is set to VK_TRUE. In this case minSampleShadingFactor takes the value of VkPipelineMultisampleStateCreateInfo::minSampleShading. Otherwise, sample shading is considered disabled. In other words, if sampleShadingEnable is set to VK_FALSE, we should ignore minSampleShading. Cc: [email protected] Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Stop forcing bindless for imagesJason Ekstrand2019-05-171-4/+5
| | | | | | | | | This was an unintended artifact of my testing of bindless images. We should be choosing bindless or not dynamically. Fixes: c0d9926df7d "anv: Use bindless handles for images" Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* draw: fix memory leak introduced 7720ce32aNeha Bhende2019-05-171-1/+3
| | | | | | | | | | | | | We need to free memory allocation PrimitiveOffsets in draw_gs_destroy(). This fixes memory leak found while running piglit on windows. Fixes: 7720ce32a ("draw: add support to tgsi paths for geometry streams. (v2)") Tested with piglit Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* anv: Emulate texture swizzle in the shader when neededJason Ekstrand2019-05-174-2/+133
| | | | | | | | | | | | | Now that we have the descriptor buffer mechanism, emulated texture swizzle can be implemented in a very non-invasive way. Previous attempts all tried to extend the push constant based image param mechanism which was gross. This could, in theory, be done much faster with a magic back-end instruction which does indirect MOVs but Vulkan on IVB is already so slow this isn't going to matter much. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104355 Cc: "19.1" <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* panfrost/midgard: TypofixAlyssa Rosenzweig2019-05-171-1/+1
| | | | | Reported-by: Ryan Houdek <[email protected]> Signed-off-by: Alyssa Rosenzweig <[email protected]>
* gitlab-ci: build-test the tools as wellEric Engestrom2019-05-171-0/+2
| | | | | | | Suggested-by: Rob Clark <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* radv: add a workaround for Monster Hunter World and LLVM 7&8Samuel Pitoiset2019-05-175-3/+16
| | | | | | | | | | | | | | The load/store optimizer pass doesn't handle WaW hazards correctly and this is the root cause of the reflection issue with Monster Hunter World. AFAIK, it's the only game that are affected by this issue. This is fixed with LLVM r361008, but we need a workaround for older LLVM versions unfortunately. Cc: "19.0" "19.1" <[email protected]> Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>