summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
Commit message (Collapse)AuthorAgeFilesLines
* st/mesa: honour sized internal formats in st_choose_format (v2)Nicolai Hähnle2016-03-171-21/+6
| | | | | | | | | | | | | | | | | | | | | The bitcasting which is possible with shader images (and texture views?) requires that when the user specifies a sized internal format for a texture, we really allocate that format. To this end: (1) find_exact_format should ignore sized internal formats and (2) some of the entries in the mapping table corresponding to sized internal formats are reordered to use an RGBA format instead of a BGRA one. This fixes arb_shader_image_load_store-bitcast in the (work in progress) ARB_shader_image_load_store implementation for radeonsi. v2: don't change the mapping of GL_RGB10: the change caused a regression because it preferred a format with an alpha channel, and GL_RGB10 is not among the supported formats for shader images Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: set image access flags in st_bind_imagesNicolai Hähnle2016-03-141-0/+15
| | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/glsl_to_tgsi: set FS_EARLY_DEPTH_STENCIL when requiredNicolai Hähnle2016-03-141-0/+3
| | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/glsl_to_tgsi: set memory access type on image intrinsicsNicolai Hähnle2016-03-141-0/+7
| | | | | | | | This is required to preserve the image variable's coherent/restrict/volatile qualifiers in TGSI. Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/glsl_to_tgsi: provide Texture and Format information for image opsNicolai Hähnle2016-03-141-9/+15
| | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: check that the image unit is valid in st_bind_imagesNicolai Hähnle2016-03-111-1/+2
| | | | Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: remove ST_NEW_MESA flag (v2)Marek Olšák2016-03-114-6/+4
| | | | | | | | Only used indirectly when checking dirty.st != 0 v2: also update st_cb_compute.c Reviewed-by: Ilia Mirkin <[email protected]>
* st/mesa: add GL_ARB_shader_atomic_counter_ops supportIlia Mirkin2016-03-102-7/+57
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: shader image atoms must be before framebuffer updateNicolai Hähnle2016-03-091-6/+6
| | | | | | | | | | | | | The reason is that the shader image atoms call st_finalize_texture, which may set ST_NEW_FRAMEBUFFER. This fixes an assertion triggered by a subtest of piglit's arb_shader_image_load_store-invalid. v2: add comment explaining order constraints (suggested by Ilia) Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: conditionally enable GL_NV_vdpau_interopChristian König2016-03-082-0/+8
| | | | | | | Only enable it when we compile the state tracker as well. Signed-off-by: Christian König <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* st/mesa: don't force per-sample interp if only sampleid/pos are usedIlia Mirkin2016-03-052-12/+6
| | | | | | | | | | | The OES extensions clarify this behaviour to differentiate between per-sample invocation and per-sample interpolation. Using sampleid/pos will force per-sample invocation but not per-sample interpolation. See https://www.khronos.org/bugzilla/show_bug.cgi?id=1462 Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: 78-column wrapping in st_extensions.cBrian Paul2016-03-051-68/+107
| | | | Reviewed-by: Eduardo Lima Mitev <[email protected]>
* st/format: Replace QuerySamplesForFormat by new QueryInternalFormat hookEduardo Lima Mitev2016-03-033-8/+40
| | | | | | The previous code for SAMPLES and NUM_SAMPLE_COUNTS is reused as a private function. Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: move dereference after null checkThomas Hindoe Paaboel Andersen2016-03-021-1/+3
| | | | | | | | We should not dereference shader before we have done the null check. Reviewed-by: Erik Faye-Lund <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* program: Remove NV_fragment_program Abs support.Matt Turner2016-03-011-3/+0
| | | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Acked-by: Brian Paul <[email protected]>
* program: Remove condition-code and precision support.Matt Turner2016-03-011-6/+0
| | | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Acked-by: Brian Paul <[email protected]>
* program: Remove OPCODE_KIL_NV.Matt Turner2016-03-011-3/+0
| | | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Acked-by: Brian Paul <[email protected]>
* program: Remove RelAddr2 support.Matt Turner2016-03-011-9/+0
| | | | | | | | Looks like more never-used crap from the first geometry shader attempt. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Acked-by: Brian Paul <[email protected]>
* st/mesa: remove useless break statementBrian Paul2016-02-241-1/+0
| | | | | Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* st/mesa: rename st_readpixels to st_ReadPixelsBrian Paul2016-02-241-2/+2
| | | | | | | To match the convention of other device driver functions. Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* st/mesa: fix frontbuffer glReadPixels regressionsBrian Paul2016-02-241-2/+11
| | | | | | | | | | | | | | | | | | | | | The change "mesa/readpix: Don't clip in _mesa_readpixels()" caused a few piglit regressions. The failing tests use glReadPixels to read from the front color buffer. The problem is we were trying to read from a non-existant front color buffer. The front color buffer is created on demand in st/mesa. Since the missing buffer bounds were effectively 0 x 0 the glReadPixels was totally clipped and returned early. The fix involves creating the real front color buffer when we're about to try reading from it. Tested with llvmpipe and VMware driver on Linux, Windows. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94253 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94254 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94257 Cc: [email protected] Reviewed-by: Roland Scheidegger <[email protected]>
* st/mesa: force depth mode to GL_RED for sized depth/stencil formatsIlia Mirkin2016-02-191-9/+25
| | | | | | | | | | | See commit 9db2098d for the i965 version of this. This fixes depth in a bunch of dEQP EXT_texture_border_clamp tests. And probably other ones as well. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: [email protected]
* st/mesa: fix pbo uploadsIlia Mirkin2016-02-191-10/+18
| | | | | | | | | | | - LOD must be provided in .w for TXF (even for buffer textures) - User buffer must be valid at draw time - Must have a sampler associated with the sampler view This makes PBO uploads work again on nouveau. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: implement a simple cache for glDrawPixelsBrian Paul2016-02-193-0/+97
| | | | | | | | | Instead of discarding the texture we created, keep it around in case the next glDrawPixels draws the same image again. This is intended to help application which draw the same image several times in a row, either within a frame or subsequent frames. Reviewed-by: Charmaine Lee <[email protected]>
* st/mesa: disable depth/stencil/alpha tests in PBO uploadNicolai Hähnle2016-02-181-0/+8
| | | | | | Noticed by Brian Paul. Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: new st_DrawAtlasBitmaps() function for drawing bitmap textBrian Paul2016-02-172-3/+141
| | | | | | | | | | | | This basically saves the current pipeline state, sets up state for rendering, constructs a set of textured quads, renders, then restores the previous pipeline state. It shouldn't be hard to implement a similar function for non-gallium drives. With some code refactoring, the vertex definition code could probably be shared. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: apply DepthMode swizzle to stencil texturing as wellIlia Mirkin2016-02-171-2/+0
| | | | | | | | Gallium doesn't present these as GL_RED-style. A swizzle is necessary to present the proper data in the unused components. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* st/mesa: fix up result_src.type when doing i2u/u2i conversionsIlia Mirkin2016-02-171-0/+1
| | | | | | | | | | | | Even though it's a no-op, it's important to keep track of the type so that we can pick the properly-signed op later on. This fixes dEQP-GLES3.functional.shaders.precision.uint.highp_div_fragment, which ended up using IDIV instead of UDIV. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: [email protected]
* st/mesa: use cso_set_viewport_dims() in try_pbo_upload_common()Brian Paul2016-02-171-12/+1
| | | | | | | Note that this results in a different transformation for the viewport's Z axis (depth range), but that doesn't matter for this case. Reviewed-by: Roland Scheidegger <[email protected]>
* st/mesa: add missing ETC2 entries to format_mapRob Clark2016-02-161-0/+42
| | | | | | | | Noticed by Ilia when I was trying to figure out why some app was failing to use ETC2. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* st/mesa: do not init limits when compute shaders are not supportedSamuel Pitoiset2016-02-161-0/+8
| | | | | | | | | | | | | | | | | When the number of uniform blocks is less than 12, ARB_uniform_buffer_object can't be enabled and the maximum GL version is not even 3.1... This fixes a regression introduced in 7c79c1e (st/mesa: add compute shader state) if the maximum number of uniform blocks allowed for compute shaders is less than 12. This happens on Kepler but this might also affect other Gallium drivers. Signed-off-by: Samuel Pitoiset <[email protected]> Reported-by: Tobias Klausmann <[email protected]> Tested-by: Tobias Klausmann <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Tobias Klausmann <[email protected]>
* st/mesa: use new CSO_BITS_ALL_SHADERSBrian Paul2016-02-164-24/+9
| | | | Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: simplify st->ctx, ctx->st usage in a various placesBrian Paul2016-02-166-18/+17
|
* st/mesa: use _mesa_geometric_width/height() in glDrawPixels codeBrian Paul2016-02-161-10/+9
| | | | Reviewed-by: Ilia Mirkin <[email protected]>
* st/mesa: rename attr variable in st_DrawTex()Brian Paul2016-02-161-10/+10
| | | | | | | Rename to 'tex_attr' to be a bit more clear. Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: use 'cso' instead of 'st->cso_context' in st_DrawTex()Brian Paul2016-02-161-1/+1
| | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: fix whitespace and add comment in st_DrawTex()Brian Paul2016-02-161-3/+3
| | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: used _mesa_num_tex_faces() in st_finalize_texture()Brian Paul2016-02-161-1/+1
| | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: use cso_save/restore_state() in st_cb_texture.cBrian Paul2016-02-161-33/+22
| | | | | | This simplifies the error handling code too. Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: use new cso_save/restore_state() functionsBrian Paul2016-02-164-101/+55
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: use new cso_set_viewport_dims() helperBrian Paul2016-02-163-36/+7
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: use 'cso' local var instead of st->cso_contextBrian Paul2016-02-163-90/+89
| | | | | | Just a little cleaner. Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: consolidate quad drawing codeBrian Paul2016-02-165-238/+136
| | | | | | | The glClear, glBitmap and glDrawPixels code now use a new st_draw_quad() helper function. Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: overhaul vertex setup for clearing, glDrawPixels, glBitmapBrian Paul2016-02-165-161/+193
| | | | | | | | | | | | Define a new st_util_vertex structure which is a bit smaller (9 floats versus the previous 12 floats per vertex). Clean up the glClear, glDrawPixels and glBitmap code that sets up the vertex data and does the drawing so it's all very similar. This can lead to more consolidation. v2: add assertion that vertex buffer slot == 0 to catch possible future change in cso_get_aux_vertex_buffer_slot() behavior. Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: include u_draw.h, not u_draw_quad.h in st_draw.cBrian Paul2016-02-161-1/+1
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: count shader images in MaxCombinedShaderOutputResourcesNicolai Hähnle2016-02-151-0/+1
| | | | Reviewed-by: Ilia Mirkin <[email protected]>
* st/mesa: enable GL image extensions when backend supports themIlia Mirkin2016-02-151-0/+17
| | | | | | | | | | This enables ARB_shader_image_load_store and ARB_shader_image_size when the backend claims support for these. It will also implicitly enable the image component of ARB_shader_texture_image_samples. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: convert GLSL image intrinsics into TGSIIlia Mirkin2016-02-151-4/+210
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: allow st_format.h to be included from C++ filesIlia Mirkin2016-02-151-0/+8
| | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: set pipe_image_view layers correctly for 3D texturesNicolai Hähnle2016-02-151-7/+17
| | | | Reviewed-by: Ilia Mirkin <[email protected]>