aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga/svga_shader.h
Commit message (Collapse)AuthorAgeFilesLines
* svga: add svga shader type in the shader variantCharmaine Lee2019-03-081-3/+4
| | | | | | | | With this patch, the svga shader type will be saved in the shader variant, and there is no need to pass in the shader type to the define/destroy variant functions. Reviewed-by: Brian Paul <[email protected]>
* svga: change svga_destroy_shader_variant() to return voidBrian Paul2018-10-091-1/+1
| | | | | | | | | | | | | svga_destroy_shader_variant() itself flushes and retries the command if there's a failure. So no need for the callers to do it. Other callers of the function were already ignoring the return value. This also fixes a corner-case double-free reported by Coverity (and reported by Dave Airlie). Tested with various OpenGL apps. Reviewed-by: Charmaine Lee <[email protected]>
* svga: encode sample count in resource declarationsBrian Paul2018-09-051-0/+1
| | | | | | No regressions before the corresponding host-side change. Reviewed-by: Neha Bhende <[email protected]>
* svga: fix vgpu9 sprite coordinate bugBrian Paul2018-08-291-2/+1
| | | | | | | | | | | | | Setting GL_POINT_SPRITE_COORD_ORIGIN to GL_LOWER_LEFT did not work for vgpu9. We can use the rasterizer sprite_coord_enable bitfield as-is. We need to index into it using the TGSI semantic index, not the register index. This fixes the Piglit fbo-gl_pointcoord and glsl-fs-pointcoord tests. Testing done: Piglit, Mesa sprite demos Reviewed-by: Charmaine Lee <[email protected]>
* svga: fix shadow comparison failuresBrian Paul2017-12-261-0/+5
| | | | | | | | | | | | | | In some cases, We do shadow comparison cases in the fragment shader instead of with texture sampler state. But when we do so, we must disable the shadow comparison test in the sampler state. As it was, we were doing the comparison twice, which resulted in nonsense. Also, we had the texcoord and texel value swapped in the comparison instruction. Fixes about 38 Piglit tex-miplevel-selection tests. Reviewed-by: Neha Bhende <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: implement MSAA alpha_to_one featureBrian Paul2017-07-251-0/+1
| | | | | | | | | | | | | The device doesn't directly support this feature so we implement it with additional shader code which sets the color output(s) w component to 1.0 (or max_int or max_uint). Fixes 16 Piglit ext_framebuffer_multisample/*alpha-to-one* tests. v2: only support unorm/float buffers, not int/uint, per Roland. Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: fix unnormalized->normalized texture coordinate conversionNeha Bhende2017-07-221-0/+1
| | | | | | | | | | | | | Sometimes, converting unnormalized coordinates to normalized coordinates requires an epsilon value to produce the right texels with nearest filtering. Adding 0.0001 to the coordinates when the min/mag filter is nearest fixes the issue. Fixes piglit test fbo-blit-scaled-linear Tested with mtt-piglit, mtt-glretrace Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: s/unsigned/enum pipe_shader_type/Brian Paul2016-08-291-2/+3
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* svga: remove unused svga_compile_key::texture_msaa fieldBrian Paul2016-04-021-1/+0
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* svga: use shader sampler view declarationsBrian Paul2016-03-211-2/+1
| | | | | | | | | | | | | | Previously, we looked at the bound textures (via the pipe_sampler_views) to determine texture dimensions (1D/2D/3D/etc) and datatype (float vs. int). But this could fail in out of memory conditions. If we failed to allocate a texture and didn't create a pipe_sampler_view, we'd default to using 0 (PIPE_BUFFER) as the texture type. This led to device errors because of inconsistent shader code. This change relies on all TGSI shaders having an SVIEW declaration for each SAMP declaration. The previous patch series does that. Reviewed-by: Charmaine Lee <[email protected]>
* svga: detect constant color writes in fragment shadersBrian Paul2015-10-221-0/+3
| | | | | | | | | | | | | | | | | | Examine the fragment shader to try to detect TGSI shaders which use "MOV OUT[0], CONST[i]" to write a constant value for the fragment color. In this case, all fragments will have the same color (unless blending is enabled). This is a common case for OpenGL code such as: glColor(), glBegin(), glVertex(), ..., glEnd() when lighting/fog/etc are disabled. In this case, the Mesa/gallium state tracker actually generates a simple "MOV OUT[0], CONST[i]" fragment shader. This will be used by the next commit to avoid provoking vertex conversion (creating/rewriting an index buffer) when drawing flat-shaded primitives. Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* svga: use new svga_new_shader_variant() functionBrian Paul2015-10-161-0/+3
| | | | | | To simplify upcoming new HUD shader count implementation. Reviewed-by: Charmaine Lee <[email protected]>
* svga: update driver for version 10 GPU interfaceBrian Paul2015-09-021-1/+277
| | | | | | | | | | | | | | | | | This is a squash commit of roughly two years of development work. Authors include: Brian Paul Charmaine Lee Thomas Hellstrom Jakob Bornecrantz Sinclair Yeh Mingcheng Chen Kai Ninomiya MengLin Wu The driver supports OpenGL 3.3. Signed-off-by: Brian Paul <[email protected]>
* gallium: replace INLINE with inlineIlia Mirkin2015-07-211-1/+1
| | | | | | | | | | | | | | | | Generated by running: git grep -l INLINE src/gallium/ | xargs sed -i 's/\bINLINE\b/inline/g' git grep -l INLINE src/mesa/state_tracker/ | xargs sed -i 's/\bINLINE\b/inline/g' git checkout src/gallium/state_trackers/clover/Doxyfile and manual edits to src/gallium/include/pipe/p_compiler.h src/gallium/README.portability to remove mentions of the inline define. Signed-off-by: Ilia Mirkin <[email protected]> Acked-by: Marek Olšák <[email protected]>
* svga: added svga_shader_too_large() helperBrian Paul2014-05-311-0/+21
| | | | | | | To check if a shader bytcode exceeds the device limit. There's no limit when using GBS. Reviewed-by: José Fonseca <[email protected]>
* svga: refactor some shader codeBrian Paul2014-02-031-0/+44
Put common code in new svga_shader.c file. Considate separate vertex/ fragment shader ID generation. Reviewed-by: Jose Fonseca <[email protected]>