summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
Commit message (Collapse)AuthorAgeFilesLines
* gallium: rename shader cap MAX_CONSTS to MAX_CONST_BUFFER_SIZEMarek Olšák2014-07-281-4/+4
| | | | | | | | | | This new name isn't so confusing. I also changed the gallivm limit, because it looked wrong. Reviewed-by: Brian Paul <[email protected]> v2: use sizeof(float[4])
* gallium: rename PIPE_CAP_TGSI_VS_LAYER to also have _VIEWPORTIlia Mirkin2014-07-031-1/+1
| | | | | | | | | Now that this cap is used to determine the availability of both, adjust its name to reflect the new reality. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* svga: Don't unnecessarily reemit BindGBShader commands v2Thomas Hellstrom2014-07-033-20/+8
| | | | | | | | | | | | | The Linux winsys can no longer relocate shader code, so avoid reemitting BindGBShader commands. They are costly. v2: Correctly handle errors from SVGA3D_BindGBShader() Reported-by: Michael Banack <[email protected]> Signed-off-by: Thomas Hellstrom <[email protected]> Tested-by: Brian Paul <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jakob Bornecrantz <[email protected]>
* svga: add switch cases for PIPE_SHADER_CAP_DOUBLESBrian Paul2014-07-031-0/+4
| | | | Signed-off-by: Brian Paul <[email protected]>
* gallium: add facilities for indirect drawingChristoph Bumiller2014-07-021-0/+1
| | | | | | v2: Added comments to util_draw_indirect, clarified and fixed map size. Removed unlikely().
* gallium: add a cap for max vertex streamsIlia Mirkin2014-07-011-0/+1
| | | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* gallium: add an index argument to create_queryIlia Mirkin2014-07-011-1/+3
| | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* gallium: create TGSI_PROPERTY to disable viewport and clippingChristoph Bumiller2014-06-021-0/+1
| | | | | | Marek v2: add a cap Signed-off-by: Marek Olšák <[email protected]>
* svga: use svga_shader_too_large() in compile_vs()Brian Paul2014-05-311-8/+36
| | | | | | And rework the dummy shader code to match the fragment shader case. Reviewed-by: José Fonseca <[email protected]>
* svga: use svga_shader_too_large() in compile_fs()Brian Paul2014-05-311-3/+1
| | | | Reviewed-by: José Fonseca <[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]>
* gallium: add a cap for supporting 4-offset TG4 opcodesIlia Mirkin2014-05-071-0/+1
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* svga: add switch case for PIPE_SHADER_CAP_PREFERRED_IR, remove default caseBrian Paul2014-05-071-8/+10
| | | | | | | Remove default switch case so we're warned of missing cases at compile time. Reviewed-by: José Fonseca <[email protected]>
* gallium: add basic support for ARB_sample_shadingIlia Mirkin2014-04-261-0/+1
| | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* gallium/util: use ui[4] instead of ui in union util_colorRoland Scheidegger2014-04-251-1/+1
| | | | | | | | util_color often merely represents a collection of bytes, however it is inconvenient if those bytes can only be accessed as floats/doubles for int formats exceeding 32bits. (Note that since rgba8 formats use one uint, not 4 bytes, hence the byte and short member were left as is.)
* svga: move draw debug code into separate functionBrian Paul2014-04-211-123/+135
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* svga: fix comment for emit_adjusted_vertex_attribs()Brian Paul2014-04-171-3/+3
|
* svga: compute need_swvfetch in svga_create_vertex_elements_state()Brian Paul2014-04-173-13/+9
| | | | | | This saves us doing it at state validation time. Reviewed-by: Matthew McClure <[email protected]>
* svga: add VS code to set attribute W component to 1Brian Paul2014-04-175-46/+100
| | | | | | | | | | | | | | | There's a few 3-component vertex attribute formats that have no equivalent SVGA3D_DECLTYPE_x format. Previously, we had to use the swtnl code to handle them. This patch lets us use hwtnl for more vertex attribute types by fetching 3-component attributes as 4-component attributes and explicitly setting the W component to 1. This lets us handle PIPE_FORMAT_R16G16B16_SNORM/UNORM and PIPE_FORMAT_R8G8B8_UNORM vertex attribs without using the swtnl path. Fixes piglit normal3b3s GL_SHORT test. Reviewed-by: Charmaine Lee <[email protected]>
* svga: implement support for signed byte vertex attributesBrian Paul2014-04-176-14/+151
| | | | | | | | | | | | | | There's no SVGA3D_DECLTYPE that directly corresponds to PIPE_FORMAT_R8G8B8_SNORM. Previously, we used the swtnl fallback path to handle this but that's slow and causes invariance issues. Now we fetch the attribute as SVGA3D_DECLTYPE_UBYTE4N and insert some extra VS instructions to remap the attributes from the range [0,1] to the range[-1,1]. Fixes Sauerbraten sw fallback. Fixes piglit normal3b3s-invariance test. Reviewed-by: Charmaine Lee <[email protected]>
* svga: move translated vertex declaration types into svga_velems_stateBrian Paul2014-04-174-40/+45
| | | | | | | Now only translate the formats once in svga_create_vertex_elements_state(). And rename the array and use the proper SVGA3dDeclType type. Reviewed-by: Charmaine Lee <[email protected]>
* Revert "svga: add work-around for Sauerbraten Z fighting issue"Brian Paul2014-04-173-49/+2
| | | | | | | | | | | | This reverts commit c875d6e57a817bb6a8163a8a98ebd2768ee91848. Conflicts: src/gallium/drivers/svga/svga_context.c This work-around will no longer be needed after the next patch which properly supports signed-byte vertex attributes. Reviewed-by: Charmaine Lee <[email protected]>
* svga: use new inst_token_setp() helper functionBrian Paul2014-04-172-12/+26
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* svga: use new inst_token_predicated() helper functionBrian Paul2014-04-172-13/+25
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* gallium: add a way to query min/max texture gather offsetsIlia Mirkin2014-04-101-0/+2
| | | | | | | | Defaults to providing the same offsets as MIN/MAX_TEXEL_OFFSET. For nvc0, the offset can be -32/31. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* svga: move LIST_INITHEAD(dirty_buffers) earlier in svga_context_create()Brian Paul2014-04-091-2/+2
| | | | | | | | | | | | Fixes a crash in svga_context_flush_buffers() if we use the 'draw' module for AA lines (when the device doesn't support that feature). We need to initialize this list before we setup the swtnl pieces. Found/fixed by Charmaine Lee. Cc: "10.0" <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]> Reviewed-by: Jakob Bornecrantz <[email protected]>
* svga: replace sampler assertion with conditionalBrian Paul2014-04-082-5/+33
| | | | | | | | | | | | | For TEX instructions, the set of samplers and sampler views should be consistent. The XA state tracker sometimes passes an inconsistent set of samplers and sampler views. Rather than assert and die, issue a warning. v2: add debugging code to detect inconsistent state. v3: also check for null sampler in svga_state_tss.c Cc: "10.0" "10.1" <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]>
* gallium: add support for LODQ opcodes.Dave Airlie2014-04-071-0/+1
| | | | | | | | | This opcode provide support for GL_ARB_texture_query_lod, Signed-off-by: Dave Airlie <[email protected]> [imirkin: rebase, docs update] Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* svga: remove no-op checks in sampler, sampler_view functionsBrian Paul2014-04-031-15/+0
| | | | | | | | We are checking for no-ops in the CSO module for both of these items so there's no reason to do it in the driver. Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* mesa/soft/llvmpipe: add fake MSAA supportDave Airlie2014-04-021-0/+1
| | | | | | | | This adds a gallium cap that allows us to fake GL3.0 by not exposing MSAA on sw rendering. It also forces the extra extensions needed for GL3.2. Signed-off-by: Dave Airlie <[email protected]>
* svga: add work-around for Sauerbraten Z fighting issueBrian Paul2014-03-263-2/+49
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* svga: null out query's hwbuf pointer after destroyingBrian Paul2014-03-261-0/+1
| | | | | | Just to be extra safe. Reviewed-by: Jose Fonseca <[email protected]>
* svga: add some debug_printf() calls in the query object codeBrian Paul2014-03-261-2/+6
| | | | | | To help debug failures. Reviewed-by: Jose Fonseca <[email protected]>
* svga: fix a comment (sampler vs. sampler_view)Brian Paul2014-03-261-1/+1
|
* gallium: the other drivers don't support ARB_buffer_storageMarek Olšák2014-02-251-0/+1
| | | | Reviewed-by: Fredrik Höglund <[email protected]>
* gallium: add texture gather support to gallium (v3)Dave Airlie2014-02-251-0/+2
| | | | | | | | | | | | | | | | | | | | | This adds support to gallium for a TG4 instruction, and two CAPs. The first CAP is required for GL_ARB_texture_gather. The second CAP is required to expose GL_ARB_gpu_shader5. However so far we haven't found any hardware that natively exposes the textureGatherOffsets feature from GL, so just lower it for now. If hardware appears for this we can add another CAP to allow TG4 to take 4 offsets. v2: add component selection src and a cap to say hw can do it. (st can use to help control GL_ARB_gpu_shader5/GLSL 4.00). Add docs. v3: rename to SM5, add docs. Reviewed-by: Roland Scheidegger <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* svga/winsys: Propagate surface shared information to the winsysThomas Hellstrom2014-02-142-2/+15
| | | | | | | | | | | | | | | | | The linux winsys needs to know whether a surface is shared. For guest-backed surfaces we need this information to avoid allocating a mob out of the mob cache for shared surfaces, but instead allocate a shared mob, that is never put in the mob cache, from the kernel. Also previously, all surfaces were given the "shareable" attribute when allocated from the kernel. This is too permissive for client-local surfaces. Now that we have the needed info, only set the "shareable" attribute if the client indicates that it needs to share the surface. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Jakob Bornecrantz <[email protected]> Reviewed-by: Brian Paul <[email protected]> Cc: "10.1" <[email protected]>
* svga: update texture code for GBSBrian Paul2014-02-142-64/+326
| | | | | Reviewed-by: Thomas Hellstrom <[email protected]> Cc: "10.1" <[email protected]>
* svga: update buffer code for GBSBrian Paul2014-02-142-42/+224
| | | | | Reviewed-by: Thomas Hellstrom <[email protected]> Cc: "10.1" <[email protected]>
* svga: add new helper functions for GBS buffersBrian Paul2014-02-141-0/+76
| | | | | Reviewed-by: Thomas Hellstrom <[email protected]> Cc: "10.1" <[email protected]>
* svga: remove a couple unneeded assertionsBrian Paul2014-02-142-2/+0
| | | | | Reviewed-by: Thomas Hellstrom <[email protected]> Cc: "10.1" <[email protected]>
* svga: adjust adjustment for point coordinatesBrian Paul2014-02-141-1/+4
| | | | | Reviewed-by: Thomas Hellstrom <[email protected]> Cc: "10.1" <[email protected]>
* svga: track which textures are rendered toBrian Paul2014-02-142-18/+38
| | | | | Reviewed-by: Thomas Hellstrom <[email protected]> Cc: "10.1" <[email protected]>
* svga: add helpers for tracking rendering to texturesBrian Paul2014-02-142-0/+68
| | | | | Reviewed-by: Thomas Hellstrom <[email protected]> Cc: "10.1" <[email protected]>
* svga: update shader code for GBSBrian Paul2014-02-148-20/+142
| | | | | Reviewed-by: Thomas Hellstrom <[email protected]> Cc: "10.1" <[email protected]>
* svga: update constant buffer code for GBSBrian Paul2014-02-145-69/+175
| | | | | Reviewed-by: Thomas Hellstrom <[email protected]> Cc: "10.1" <[email protected]>
* svga: add svga_have_gb_objects/dma() functionsBrian Paul2014-02-141-0/+14
| | | | | Reviewed-by: Thomas Hellstrom <[email protected]> Cc: "10.1" <[email protected]>
* svga: add new GBS commandsBrian Paul2014-02-142-5/+637
| | | | | | | And update some existing commands. Reviewed-by: Thomas Hellstrom <[email protected]> Cc: "10.1" <[email protected]>
* svga: update svga_winsys interface for GBSBrian Paul2014-02-145-13/+140
| | | | | | | | This adds new interface functions for guest-backed surfaces and adds a mobid parameter to the surface_relocation() function. Reviewed-by: Thomas Hellstrom <[email protected]> Cc: "10.1" <[email protected]>
* svga: update dumping code with new GBS commands, etcBrian Paul2014-02-141-44/+268
| | | | | Reviewed-by: Thomas Hellstrom <[email protected]> Cc: "10.1" <[email protected]>