summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
Commit message (Collapse)AuthorAgeFilesLines
* mesa: convert _NEW_RASTERIZER_DISCARD to a driver flagMarek Olšák2013-04-243-3/+5
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* st/mesa: add a simple path to BufferData if it only discards buffer contentsMarek Olšák2013-04-241-0/+14
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/mesa: depth-stencil-alpha state also depends on _NEW_BUFFERSMarek Olšák2013-04-241-1/+1
| | | | | | | | | because the code looks at the visual if there is a depth or stencil buffer before enabling depth or stencil, respectively. NOTE: This is a candidate for the stable branches. Reviewed-by: Brian Paul <[email protected]>
* gallium: Replace gl_rasterization_rules with lower_left_origin and ↵José Fonseca2013-04-234-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | half_pixel_center. Squashed commit of the following: commit 04c5fa2cbb8e89d6f2fa5a75af1cca03b1f6b852 Author: José Fonseca <[email protected]> Date: Tue Apr 23 17:37:18 2013 +0100 gallium: s/lower_left_origin/bottom_edge_rule/ commit 4dff4f64fa83b9737def136fffd161d55e4f1722 Author: José Fonseca <[email protected]> Date: Tue Apr 23 17:35:04 2013 +0100 gallium: Move diagram to docs. commit 442a63012c8c3c3797f45e03f2ca20ad5f399832 Author: James Benton <[email protected]> Date: Fri May 11 17:50:55 2012 +0100 gallium: Replace gl_rasterization_rules with lower_left_origin and half_pixel_center. This change is necessary to achieve correct results when using OpenGL FBOs. Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: minor indentation fixesBrian Paul2013-04-221-2/+2
|
* gallium: handle drirc disable_glsl_line_continuations optionVadim Girlin2013-04-191-0/+3
| | | | | | | | NOTE: This is a candidate for the 9.1 branch Signed-off-by: Vadim Girlin <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* st/mesa: optionally apply texture swizzle to border color v2Christoph Bumiller2013-04-184-4/+30
| | | | | | | | | | | | This is the only sane solution for nv50 and nvc0 (really, trust me), but since on other hardware the border colour is tightly coupled with texture state they'd have to undo the swizzle, so I've added a cap. The dependency of update_sampler on the texture updates was introduced to avoid doing the apply_depthmode to the swizzle twice. v2: Moved swizzling helper to u_format.c, extended the CAP to provide more accurate information.
* mesa: remove #include "mfeatures.h" from numerous source filesBrian Paul2013-04-172-2/+0
| | | | | | None of the remaining FEATURE_x symbols in mfeatures.h are used anymore. Reviewed-by: Jordan Justen <[email protected]>
* st/mesa: clean up formatting in st_cb_msaa.cBrian Paul2013-04-171-12/+18
| | | | Insert blank lines, wrap lines, remove trailing whitespace, etc.
* gallium: Disambiguate TGSI_OPCODE_IF.José Fonseca2013-04-172-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TGSI_OPCODE_IF condition had two possible interpretations: - src.x != 0.0f - Mesa statetracker when PIPE_SHADER_CAP_INTEGERS was false either for vertex and fragment shaders - gallivm/llvmpipe - postprocess - vl state tracker - vega state tracker - most old drivers - old internal state trackers - many graw examples - src.x != 0U - Mesa statetracker when PIPE_SHADER_CAP_INTEGERS was true for both vertex and fragment shaders - tgsi_exec/softpipe - r600 - radeonsi - nv50 And drivers that use draw module also were a mess (because Mesa would emit float IFs, but draw module supports native integers so it would interpret IF arg as integers...) This sort of works if the source argument is limited to float +0.0f or +1.0f, integer 0, but would fail if source is float -0.0f, or integer in the float NaN range. It could also fail if source is integer 1, and hardware flushes denormalized numbers to zero. But with this change there are now two opcodes, IF and UIF, with clear meaning. Drivers that do not support native integers do not need to worry about UIF. However, for backwards compatibility with old state trackers and examples, it is advisable that native integer capable drivers also support the float IF opcode. I tried to implement this for r600 and radeonsi based on the surrounding code. I couldn't do this for nouveau, so I just shunted IF/UIF together, which matches the current behavior. Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Marek Olšák <[email protected]> v2: - Incorporate Roland's feedback. - Fix r600_shader.c merge conflict. - Fix typo in radeon, spotted by Michel Dänzer. - Incorporte Christoph Bumiller's patch to handle TGSI_OPCODE_IF(float) properly in nv50/ir.
* st/mesa: add support for ARB_texture_multisample (v3)Dave Airlie2013-04-1112-20/+96
| | | | | | | | | | | | | | | | This adds support to the mesa state tracker for ARB_texture_multisample. hardware doesn't seem to use a different texture instructions, so I don't think we need to create one for TGSI at this time. Thanks to Marek for fixes to sample number picking. v2: idr pointed out a bug in how we picked the max sample counts, use new internal format chooser interface to pick proper answers. v3: use st_choose_format directly, it was okay, fix anding of masks. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* st/mesa: add support for get sample positionDave Airlie2013-04-113-0/+95
| | | | | | | This just calls into the gallium interface. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* st/mesa: fix UBO offsets.Dave Airlie2013-04-111-0/+1
| | | | | | | | Reported and tested by degasus on #radeon. Note: This is a candidate for the 9.1 branch Signed-off-by: Dave Airlie <[email protected]>
* st/mesa: remove #if FEATURE_GL/ES testsBrian Paul2013-04-091-7/+0
| | | | Reviewed-by: Jordan Justen <[email protected]>
* st/mesa: remove #include mfeatures.hBrian Paul2013-04-0924-24/+0
| | | | | | None of these were needed. Reviewed-by: Jordan Justen <[email protected]>
* st/mesa: fix levels in initial texture creationDave Airlie2013-04-081-1/+1
| | | | | | | | | | | calim pointed out we were getting mipmap levels for array multisamples, this didn't make sense. So then I noticed this function takes last_level so we are passing in a too high value here. I think this should fix the case he was seeing. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* st/mesa: don't expose ARB_color_buffer_float without driver support in GL coreMarek Olšák2013-04-061-0/+11
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: don't set _ClampFragmentColor to TRUE if it has no effectMarek Olšák2013-04-064-10/+5
| | | | | | | | This should reduce shader recompilations with drivers that emulate fragment color clamping, because we want the clamping to be enabled only if there is a signed normalized or floating-point colorbuffer. Reviewed-by: Brian Paul <[email protected]>
* st/mesa: rewrite comment in st_manager.cBrian Paul2013-04-031-3/+2
|
* st/mesa: fix bitmap,drawpix,drawtex for PIPE_CAP_TGSI_TEXCOORDChristoph Bumiller2013-04-033-2/+8
| | | | | | | NOTE: Changed the semantic index for the drawtex coordinate to be the texture unit index instead of always 0. Not sure if this is correct but since the value seems to depend on the unit it would make sense to use different varying slots.
* st/mesa: add ir_lod case in GLSL->TGSI code to silence warningBrian Paul2013-03-291-0/+3
|
* st/mesa: remove leftover printfs from ReadPixelsMarek Olšák2013-03-281-3/+0
| | | | Oops, I thought I had removed all debugging code.
* glsl_to_tgsi: avoid creating arrays if driver doesn't support themChristian König2013-03-261-1/+3
| | | | | | Avoid creating arrays if we replace indirect addressing anyway. Signed-off-by: Christian König <[email protected]>
* glsl_to_tgsi: make simplify_cmp work with arraysChristian König2013-03-261-1/+1
| | | | | | | | | Even when we have arrays it is possible for simplify_cmp to work on temps, just not on arrays. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=62696 Signed-off-by: Christian König <[email protected]>
* st/mesa: fix crash with blit-based GetTexImageMarek Olšák2013-03-261-1/+1
| | | | | | https://bugs.freedesktop.org/show_bug.cgi?id=62573 Tested-by: Andreas Boll <[email protected]>
* cso: add constant buffer save/restore feature for postprocessingMarek Olšák2013-03-261-3/+5
| | | | | Postprocessing is an internal meta op and should restore the states it changes.
* mesa: allow internalformat_query with multisample texture targetsChris Forbes2013-03-242-4/+6
| | | | | | | | | | | | | | | | Now that we support ARB_texture_multisample, there are multiple targets accepted for this query, and they may have target-dependent limits, so pass the target to the driverfunc. For example, the sampling hardware may not be able to do general texelFetch() for some format/sample count combination, but the driver may still be able to implement a reasonable resolve operation, so it can be supported for renderbuffers. V2: - Don't break Gallium compile. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* gallium,st/mesa: don't use blit-based transfers with software rasterizersMarek Olšák2013-03-234-0/+15
| | | | | | | | | The blit-based paths for TexImage, GetTexImage, and ReadPixels aren't very fast with software rasterizer. Now Gallium drivers have the ability to turn them off. Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
* st/mesa: implement blit-based ReadPixelsMarek Olšák2013-03-233-13/+189
| | | | | | | | | | | | | | | Initial version contributed by: Martin Andersson <[email protected]> This is only used if the memcpy path cannot be used and if no transfer ops are needed. It's pretty similar to our TexImage and GetTexImage implementations. The motivation behind this is to be able to use ReadPixels every frame and still have at least 20 fps (or 60 fps with a powerful GPU and CPU) instead of 0.5 fps. Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
* mesa: add helper func for checking combined depthstencil buffers from st/mesaMarek Olšák2013-03-233-44/+6
| | | | | Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
* gallium: add TGSI_SEMANTIC_TEXCOORD,PCOORD v3Christoph Bumiller2013-03-203-11/+39
| | | | | | | | | | | | | | | This makes it possible to identify gl_TexCoord and gl_PointCoord for drivers where sprite coordinate replacement is restricted. The new PIPE_CAP_TGSI_TEXCOORD decides whether these varyings should be hidden behind the GENERIC semantic or not. With this patch only nvc0 and nv30 will request that they be used. v2: introduce a CAP so other drivers don't have to bother with the new semantic v3: adapt to introduction gl_varying_slot enum
* glsl_to_tgsi: remove indirect addressing limitationsChristian König2013-03-191-33/+3
| | | | | | They shouldn't be necessary any more. Signed-off-by: Christian König <[email protected]>
* glsl_to_tgsi: allocate arrays separately v2Christian König2013-03-191-31/+58
| | | | | | | | | Instead of allocating everything as temporaries, use the new array allocation functions. v2: fix bug in simplify_cmp, declare arrays on demand Signed-off-by: Christian König <[email protected]>
* glsl_to_tgsi: use get_temp for all allocationsChristian König2013-03-191-13/+10
| | | | Signed-off-by: Christian König <[email protected]>
* Replace gl_frag_attrib enum with gl_varying_slot.Paul Berry2013-03-158-56/+56
| | | | | | | | | | | | This patch makes the following search-and-replace changes: gl_frag_attrib -> gl_varying_slot FRAG_ATTRIB_* -> VARYING_SLOT_* FRAG_BIT_* -> VARYING_BIT_* Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Tested-by: Brian Paul <[email protected]>
* Replace gl_geom_result enum with gl_varying_slot.Paul Berry2013-03-153-21/+21
| | | | | | | | | | | This patch makes the following search-and-replace changes: gl_geom_result -> gl_varying_slot GEOM_RESULT_* -> VARYING_SLOT_* Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Tested-by: Brian Paul <[email protected]>
* Replace gl_geom_attrib enum with gl_varying_slot.Paul Berry2013-03-152-14/+14
| | | | | | | | | | | | This patch makes the following search-and-replace changes: gl_geom_attrib -> gl_varying_slot GEOM_ATTRIB_* -> VARYING_SLOT_* GEOM_BIT_* -> VARYING_BIT_* Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Tested-by: Brian Paul <[email protected]>
* Replace gl_vert_result enum with gl_varying_slot.Paul Berry2013-03-158-49/+49
| | | | | | | | | | | This patch makes the following search-and-replace changes: gl_vert_result -> gl_varying_slot VERT_RESULT_* -> VARYING_SLOT_* Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Tested-by: Brian Paul <[email protected]>
* st/mesa: add PIPE_FORMAT_R16G16B16A16_UNORM renderbuffer supportBrian Paul2013-03-121-0/+3
| | | | | | To allow rendering in 16-bit/channel RGBA buffers. Reviewed-by: José Fonseca <[email protected]>
* mesa: Replace MESA_VERSION with PACKAGE_VERSION.Matt Turner2013-03-121-1/+1
| | | | | | One fewer place to have to update. Reviewed-by: Eric Anholt <[email protected]>
* st/mesa: translate ir offset parameters for non-TXF opcodes.Roland Scheidegger2013-03-051-2/+18
| | | | | | | Otherwise the state tracker will crash if the texture instructions have offsets. Reviewed-by: Brian Paul <[email protected]>
* st/mesa: add switch case for ir_txf_ms to silence warningBrian Paul2013-03-021-0/+3
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* st/mesa: convert ir_triop_lrp to TGSI_OPCODE_LRPBrian Paul2013-03-011-1/+4
| | | | | | | AFAICT, all gallium drivers implement TGSI_OPCODE_LRP. Tested with softpipe, llvmpipe, svga drivers. Reviewed-by: Matt Turner <[email protected]>
* glsl: Convert mix() to use a new ir_triop_lrp opcode.Kenneth Graunke2013-02-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Many GPUs have an instruction to do linear interpolation which is more efficient than simply performing the algebra necessary (two multiplies, an add, and a subtract). Pattern matching or peepholing this is more desirable, but can be tricky. By using an opcode, we can at least make shaders which use the mix() built-in get the more efficient behavior. Currently, all consumers lower ir_triop_lrp. Subsequent patches will actually generate different code. v2 [mattst88]: - Add LRP_TO_ARITH flag to ir_to_mesa.cpp. Will be removed in a subsequent patch and ir_triop_lrp translated directly. v3 [mattst88]: - Move changes from the next patch to opt_algebraic.cpp to accept 3-src operations. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* st/mesa: remove some conditionals in update_raster_state()Brian Paul2013-02-261-15/+8
| | | | | | Just use simple assignments. Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: fix debug_printf() format string warningBrian Paul2013-02-231-1/+1
| | | | Use %td for ptrdiff_t (aka GLsizeiptrARB).
* st/mesa: fix polygon offset state translation logicBrian Paul2013-02-221-7/+3
| | | | | | | | The old logic was kind of twisted, but seemed to work in practice. Note: This is a candidate for the stable branches. Reviewed-by: José Fonseca <[email protected]>
* st/mesa: check for dummy programs in destroy_program_variants()Brian Paul2013-02-221-1/+1
| | | | | | | | | | | | | When we destroy an ARB vp/fp whose ID was gen'd but not otherwise used we get a pointer to the dummy/placeholder program. We can't destroy that one so just skip it. This only failed during context tear-down because glDeleteProgramsARB() was already aware of dummy programs. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38086 Note: This is a candidate for the stable branches. Tested-by: Andreas Boll <[email protected]>
* st/mesa: fix trimming of GL_QUAD_STRIPBrian Paul2013-02-221-1/+1
| | | | | | | | | | | | | | We sometimes convert GL_QUAD_STRIP prims into GL_TRIANGLE_STRIP, but that changes the results of the u_trim_pipe_prim() call. We need to pass the original primitive type to the trim function. Note that OpenGL's GL_x prim type values match Gallium's PIPE_PRIM_x values. Fixes a failure in the new piglit degenerate-prims test. Note: This is a candidate for the stable branches. Reviewed-by: José Fonseca <[email protected]>
* st/mesa: implement glBitmap unpacking from a PBO, for the cache pathBrian Paul2013-02-191-2/+11
| | | | | | | | | We weren't mapping the PBO when using the bitmap cache (but we had the PBO code for the non-cache path.) Fixes http://bugs.freedesktop.org/show_bug.cgi?id=61026 Note: This is a candidate for the stable branches.