summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
Commit message (Collapse)AuthorAgeFilesLines
* gallium: Convert the state_tracker to use CoordsReplaceBits.Mathias Fröhlich2016-06-161-6/+2
| | | | | | | | Switch over to use the CoordsReplaceBits bitmask. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa/glsl: stop using GL shader type internallyTimothy Arceri2016-06-162-18/+18
| | | | | | | | | | | | Instead use the internal gl_shader_stage enum everywhere. This makes things more consistent and gets rid of unnecessary conversions. Ideally it would be nice to remove the Type field from gl_shader altogether but currently it is used to differentiate between gl_shader and gl_shader_program in the ShaderObjects hash table. Reviewed-by: Kenneth Graunke <[email protected]>
* st_glsl_to_tgsi: don't read potentially uninitialized buffer variableNicolai Hähnle2016-06-151-1/+1
| | | | | | | | Found by -fsanitize=undefined. Note that this should be a harmless issue in practice because the inst->op check always dominates anyway. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* st/mesa: inline _mesa_create_context() into its only callerEmil Velikov2016-06-131-2/+6
| | | | | | | | Inline the function into it's only caller. This way it's more obvious how the classic and gallium drivers (st/mesa) use _mesa_initialize_context. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* st/mesa: remove unneeded break from st_api_create_context()Emil Velikov2016-06-131-1/+0
| | | | | | | | We have return on the previous line, thus the break will never be reached. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* st/mesa: use c99 initializer for st_gl_apiEmil Velikov2016-06-131-13/+13
| | | | | Signed-off-by: Emil Velikov <[email protected]> Acked-by: Ian Romanick <[email protected]>
* gallium: remove st_api::get_proc_address hookEmil Velikov2016-06-131-7/+0
| | | | | | | It has been unused for a long time, plus makes the gallium dri modules require an extra glapi symbol relative to their classic counterparts. Signed-off-by: Emil Velikov <[email protected]>
* st/mesa: tweak surface format mapping tableBrian Paul2016-06-101-9/+11
| | | | | | | | | | | 1. Try to choose R8G8B8A8 unorm/srgb formats before others in an effort to try to match component ordering for UINT/SINT/etc. 2. If we can't get a format such as PIPE_FORMAT_A16_UNORM, try PIPE_FORMAT_R16G16B16A16_UNORM before shallower formats. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* st/mesa: use base level size as "guess" when availableNicolai Hähnle2016-06-101-6/+27
| | | | | | | | | | | | | | | | | | | | When an applications specifies mip levels _before_ setting a mipmap texture filter, we will initially guess a single texture level. When the second level image is created, we try to allocate the full texture -- however, we get the base level size guess wrong if that size is odd. This leads to yet another re-allocation of the texture later during st_finalize_texture. Even worse, this re-allocation breaks a (reasonable) assumption made by st_generate_mipmaps, because the re-allocation in the finalization call will again allocate a single-level pipe texture (based on the non-mipmap texture filter!). As a result, mipmap generation fails in interesting ways. All of this can be avoided by just using the fact that we already know the size of the base level. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95529 Cc: 12.0 <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: fix type confusion with reladdrsIlia Mirkin2016-06-091-5/+5
| | | | | | | | | | | The reality is that this doesn't matter, because we manually emit the ARL to the sampler reladdr, and those arguments don't get an extra load later, so it's effectively just a boolean. However having the types be wrong is confusing and could trigger very odd bugs should usage change down the line. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* glsl/types: rename is_dual_slot_double to is_dual_slot_64bit.Dave Airlie2016-06-091-1/+1
| | | | | | | In the future int64 support will have the same requirements. Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* st/glsl_to_tgsi: move to checking 64-bitness instead of doubleDave Airlie2016-06-091-16/+14
| | | | | | | | This uses the new types interfaces to check for 64-bit types, as futureproofing against int64 support. Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* st/glsl_to_tgsi: use enum glsl_base_type instead of unsignedDave Airlie2016-06-091-12/+12
| | | | | | | | This is just some better type safety that I noticed while working on 64-bit integer support. Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* st/mesa: try not to compile compute shader on the first useMarek Olšák2016-06-081-0/+1
| | | | Reviewed-by: Ilia Mirkin <[email protected]>
* st/mesa: directly compute level=0 texture size in st_finalize_textureNicolai Hähnle2016-06-085-53/+48
| | | | | | | | | | | | | | | | | | | | | | | | The width0/height0/depth0 on stObj may not have been set at this point. Observed in a trace that set up levels 2..9 of a 2d texture, and set the base level to 2, with height 1. This made the guess logic always bail. Originally investigated by Ilia Mirkin, this patch gets rid of the somewhat redundant storage of width0/height0/depth0 and makes sure we always compute pipe texture sizes that are compatible with the base level image of the GL texture. Fixes the gl-1.2-texture-base-level piglit test provided by Brian Paul. v2: - try to re-use an existing pipe texture when possible - handle a corner case where the base level is not level 0 and it is of size 1x1x1 v3: - ptHeight = ptWidth in cube map 1x1 case (suggested by Brian) Cc: "12.0" <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: use buffer usage history to set dirty flags for revalidationIlia Mirkin2016-06-071-2/+13
| | | | | | | | | | We were previously unconditionally doing this for arrays and ubo's, and ignoring texture/storage/atomic buffers. Instead use the usage history to determine which atoms need to be revalidated. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Cc: "12.0" <[email protected]>
* st/mesa: revalidate image atoms when a texture is updatedIlia Mirkin2016-06-071-6/+6
| | | | | | | | | | A texture may be redefined with _NEW_TEXTURE, which might have been bound to a shader image slot. We have to revalidate the image atoms to pick up on the new resource. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Cc: "12.0" <[email protected]>
* st/mesa: expose GL_ARB_shader_group_vote when supported by backendIlia Mirkin2016-06-062-4/+11
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* mesa: hook up core bits of GL_ARB_shader_group_voteIlia Mirkin2016-06-061-0/+4
| | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: change SQRT lowering to fix the game RisenMarek Olšák2016-06-061-7/+9
| | | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94627 (against nouveau) Acked-by: Ilia Mirkin <[email protected]>
* st/mesa: fix resource leak in try_pbo_readpixelsNicolai Hähnle2016-06-061-1/+1
| | | | | | | Found by inspection after seeing https://bugs.freedesktop.org/show_bug.cgi?id=96343 Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: check shader image format support before using PBO downloadIlia Mirkin2016-06-061-0/+6
| | | | | | | | | | | ARB_shader_image_load_store only requires a very fixed list of formats to be supported, while textures may be in all kinds of formats, like BGRA which are presently not supported on at least Kepler. Signed-off-by: Ilia Mirkin <[email protected]> Tested-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* glsl: Add glsl LowerCsDerivedVariables optionJordan Justen2016-06-011-0/+1
| | | | | | | | | | v2: * Move lower flag to context constants. (Ken) Cc: "12.0" <[email protected]> Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> (v1) Reviewed-by: Jason Ekstrand <[email protected]>
* st/mesa: implement PBO downloads for ReadPixelsNicolai Hähnle2016-06-013-3/+160
| | | | | | | | | v2: require PIPE_CAP_SAMPLER_VIEW_TARGET; technically only needed for some of the texture targets, but all hardware that has shader images should also have this cap. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: hook up a no-op try_pbo_readpixelsNicolai Hähnle2016-06-011-20/+37
| | | | | | | | For better bisectability given that the order of some of the fallback tests in the blit path are rearranged. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: add layer_offset to PBO fragment shaderNicolai Hähnle2016-06-012-4/+16
| | | | | | | | | This will be used to select a slice of a 3D texture. v2: fix a comment (Marek) Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: create PBO download fragment shadersNicolai Hähnle2016-06-012-7/+79
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: add PBO download enable bit and fragment shadersNicolai Hähnle2016-06-012-0/+17
| | | | | | | | | | For downloads, the fragment shader must know the source texture target, hence we may cache multiple fragment shaders. v2: break long line (Marek) Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: move shareable parts of PBO upload state and draw to st_pbo.cNicolai Hähnle2016-06-013-106/+129
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: move PBO buffer address calculation to st_pbo.cNicolai Hähnle2016-06-013-120/+204
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: move PBO upload fs creation to st_pbo.cNicolai Hähnle2016-06-013-77/+80
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: rename pbo_upload to pboNicolai Hähnle2016-06-013-48/+48
| | | | | | | At the same time, rename members that are upload-specific to say so. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: move PBO vertex and geometry shader creation to st_pbo.cNicolai Hähnle2016-06-013-89/+97
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: begin moving PBO functions into their own fileNicolai Hähnle2016-06-015-61/+128
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium/cso: allow saving the first fragment shader image slotNicolai Hähnle2016-06-011-4/+5
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/glsl_to_tgsi: prevent infinite loopEric Engestrom2016-05-311-2/+3
| | | | | | | | `unsigned j` would never fail `j >= 0`, leading to an infinite loop as `j--` wraps around. Signed-off-by: Eric Engestrom <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* st/mesa: fix setting of point_size_per_vertex in ES contextsIlia Mirkin2016-05-291-2/+18
| | | | | | | | | | | | | GL ES 2.0+ does not have a GL_PROGRAM_POINT_SIZE enable, unlike desktop GL. So we have to go and check the last pre-rasterizer stage to see whether it outputs a point size or not. This fixes a number of dEQP tests that use a geometry or tessellation shader to emit points primitives. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Cc: "11.1 11.2" <[email protected]>
* st/mesa: expose OES_shader_io_blocks when we have enough for ES 3.1Ilia Mirkin2016-05-281-0/+6
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* compiler: Move glsl_to_nir to libglsl.laJason Ekstrand2016-05-261-1/+1
| | | | | | | | Right now libglsl.la depends on libnir.la so putting it in libnir.la adds a dependency on libglsl.la that goes the wrong direction. Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* st/mesa: enable ARB_ES3_1_compatibility when ES 3.1 would be exposedIlia Mirkin2016-05-231-0/+22
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: reenable cullingDave Airlie2016-05-241-1/+1
| | | | | | Now the lowering pass is fixed, reenable ARB_cull_distance. Signed-off-by: Dave Airlie <[email protected]>
* st/mesa: update inst->info along with inst->opIlia Mirkin2016-05-231-0/+1
| | | | | | | | | | | | Otherwise we still have TGSI_OPCODE_CMP's info, which causes a number of later logic to go wrong. This fixes dEQP-GLES2.functional.shaders.functions.control_flow.return_in_if_vertex on nv30. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Implement glGet*(GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED).Kenneth Graunke2016-05-231-0/+2
| | | | | | | | | | | | | | | | | | | | | Technically, this was introduced with GL 4.4. However, I believe it was intended to be retroactive. As far as I know, AMD has never supported primitive restart with patches, while NVidia and Intel do. This necessitated the need for a query which would allow applications to figure out whether this was usable or not. I decided to expose it everywhere ARB_tessellation_shader is exposed. (It's also in both OES and EXT_tessellation_shader.) Enable this for i965 and Gallium drivers which expose the capability. v2: Fix a bug in the state_tracker code (caught by Ilia Mirkin). Bugzilla: https://cvs.khronos.org/bugzilla/show_bug.cgi?id=10364 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa/st: don't leak nameRob Clark2016-05-181-2/+5
| | | | | | Pointed out by coverity. Signed-off-by: Rob Clark <[email protected]>
* st/mesa: remove unused st_context::default_textureBrian Paul2016-05-172-7/+0
| | | | | | | | The code which used this was removed quite a while ago. Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* st/mesa: fix reversed copyimage canonical formatNicolai Hähnle2016-05-171-3/+3
| | | | | | | | | | | The format_desc swizzle describes where in the array each color channel comes from - but the existing code was written as if each entry in the swizzle described the meaning of an array element. Fixes piglit's arb_copy_image-format-swizzle. Cc: "11.1 11.2" <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: add support for NIR as possible driver IRRob Clark2016-05-176-12/+630
| | | | | Signed-off-by: Rob Clark <[email protected]> Acked-by: Eric Anholt <[email protected]>
* mesa/st: move things around a bit in st_create_fp_variant()Rob Clark2016-05-171-12/+8
| | | | | | | Prep work for next patch. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: add nir pass for lowering builtin uniformsRob Clark2016-05-172-0/+276
| | | | | Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* st/mesa: disable cull distance for nowIlia Mirkin2016-05-151-1/+1
| | | | | | | | | The pass that st/mesa relies on to combine clip and cull distances has been reverted, so we can't expose ARB_cull_distance until that is resolved. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>