summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga/svga_context.h
Commit message (Collapse)AuthorAgeFilesLines
* svga: add a few more resource updates HUD queryCharmaine Lee2016-03-211-22/+30
| | | | | | | | | | | | This patch adds the following HUD queries: .num-resource-updates -- number of resource update. Commands include UPDATE_SUBRESOURCE, UPDATE_GB_IMAGE. .num-buffer-uploads -- number of buffer uploads. .num-const-buf-updates -- number of set constant buffer. .num-const-updates -- number of set shader constant. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
* svga: add new num-readbacks HUD queryCharmaine Lee2016-03-211-7/+9
| | | | | | | To find out how many image readback command is issued. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
* svga: add new surface-write-flushes HUD queryBrian Paul2016-03-071-7/+9
| | | | | | | To know when we're flushing the command buffer because we need to write to surface in the command buffer. Reviewed-by: Charmaine Lee <charmainel@vmware.com>
* svga: add new flush-time HUD queryBrian Paul2016-03-071-7/+9
| | | | | | To measure the time spent flushing the command buffer. Reviewed-by: Charmaine Lee <charmainel@vmware.com>
* svga: add new command-buffer-size HUD queryBrian Paul2016-03-041-7/+9
| | | | | | To plot a graph of the command buffer size. Reviewed-by: Charmaine Lee <charmainel@vmware.com>
* svga: add num-generate-mipmap HUD queryCharmaine Lee2016-01-141-1/+3
| | | | | | | | The actual increment of the num-generate-mipmap counter will be done in a subsequent patch when hw generate mipmap is supported. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
* svga: change svga_hw_view_state::dirty to booleanBrian Paul2016-01-051-1/+1
| | | | | | Since it's a true/false value. Reviewed-by: Charmaine Lee <charmainel@vmware.com>
* svga: avoid emitting redundant SetVertexBuffers() commandsBrian Paul2016-01-051-0/+5
| | | | Reviewed-by: Charmaine Lee <charmainel@vmware.com>
* u_upload_mgr: pass alignment to u_upload_alloc manuallyMarek Olšák2016-01-021-0/+2
| | | | | | | | | | The fixed alignment of u_upload_mgr will go away. This is the first step. The motivation is that one u_upload_mgr can have multiple users, each allocating from the same buffer, but requiring a different alignment. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
* svga: avoid emitting redundant SetSamplers() commandsBrian Paul2015-12-111-0/+3
| | | | | | | | This greatly reduces the number of SetSamplers() commands for some applications. Reviewed-by: José Fonseca <jfonseca@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com>
* svga: avoid emitting redundant SetIndexBuffer commandsBrian Paul2015-12-111-0/+4
| | | | | Reviewed-by: Charmaine Lee <charmainel@vmware.com> Reviewed-by: José Fonseca <jfonseca@vmware.com>
* svga: use the debug callback to report issues to the state trackerBrian Paul2015-12-071-0/+3
| | | | | | | | | | | | | | | Use the new debug callback hook to report conformance, performance and fallbacks to the state tracker. The state tracker, in turn can report this issues to the user via the GL_ARB_debug_output extension. More issues can be reported in the future; this is just a start. v2: remove conditionals around pipe_debug_message() calls since the check is now done in the macro itself. v3: remove unneeded dummy %s substitutions Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>, Reviewed-by: José Fonseca <jfonseca@vmware.com>
* svga: add num-bytes-uploaded HUD queryBrian Paul2015-11-201-6/+9
| | | | | | | | To graph the number of bytes uploaded to GPU per frame (vertex buffer data, constant buffer data, texture data, etc). Reviewed-by: José Fonseca <jfonseca@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com>
* svga: add new GALLIUM_HUD queriesNeha Bhende2015-10-161-7/+27
| | | | | | | | | | | | | | | | | | Add new GALLIUM_HUD queries for: num-shaders num-resources num-state-objects num-validations map-buffer-time num-surface-views num-resources-mapped num-flushes Most of this patch was originally written by Neha. Additional clean-ups and num-flushes counter added by Brian Paul. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com>
* svga: update driver for version 10 GPU interfaceBrian Paul2015-09-021-66/+184
| | | | | | | | | | | | | | | | | 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 <brianp@vmware.com>
* gallium: add flags parameter to pipe_screen::context_createMarek Olšák2015-08-261-1/+1
| | | | | | | | This allows creating compute-only and debug contexts. Reviewed-by: Brian Paul <brianp@vmware.com> Acked-by: Christian König <christian.koenig@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com>
* gallium: replace INLINE with inlineIlia Mirkin2015-07-211-3/+3
| | | | | | | | | | | | | | | | 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 <imirkin@alum.mit.edu> Acked-by: Marek Olšák <marek.olsak@amd.com>
* util: Move gallium's linked list to utilJason Ekstrand2015-05-081-1/+1
| | | | | | | | | The linked list in gallium is pretty much the kernel list and we would like to have a C-based linked list for all of mesa. Let's not duplicate and just steal the gallium one. Acked-by: Connor Abbott <cwabbott0@gmail.com> Reviewed-by: Rob Clark <robclark@freedesktop.org>
* svga: compute need_swvfetch in svga_create_vertex_elements_state()Brian Paul2014-04-171-0/+1
| | | | | | This saves us doing it at state validation time. Reviewed-by: Matthew McClure <mcclurem@vmware.com>
* svga: add VS code to set attribute W component to 1Brian Paul2014-04-171-0/+1
| | | | | | | | | | | | | | | 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 <charmainel@vmware.com>
* svga: implement support for signed byte vertex attributesBrian Paul2014-04-171-0/+1
| | | | | | | | | | | | | | 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 <charmainel@vmware.com>
* svga: move translated vertex declaration types into svga_velems_stateBrian Paul2014-04-171-2/+1
| | | | | | | 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 <charmainel@vmware.com>
* Revert "svga: add work-around for Sauerbraten Z fighting issue"Brian Paul2014-04-171-5/+0
| | | | | | | | | | | | 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 <charmainel@vmware.com>
* svga: add work-around for Sauerbraten Z fighting issueBrian Paul2014-03-261-0/+5
| | | | Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
* svga: update shader code for GBSBrian Paul2014-02-141-0/+2
| | | | | Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Cc: "10.1" <mesa-stable@lists.freedesktop.org>
* svga: update constant buffer code for GBSBrian Paul2014-02-141-1/+6
| | | | | Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Cc: "10.1" <mesa-stable@lists.freedesktop.org>
* svga: add svga_have_gb_objects/dma() functionsBrian Paul2014-02-141-0/+14
| | | | | Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Cc: "10.1" <mesa-stable@lists.freedesktop.org>
* svga: refactor some shader codeBrian Paul2014-02-031-2/+1
| | | | | | | Put common code in new svga_shader.c file. Considate separate vertex/ fragment shader ID generation. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
* svga: rename shader_result -> variantBrian Paul2014-01-231-6/+9
| | | | | | | To be more consisten with other parts of gallium. Plus, update/add various comments. Reviewed-by: José Fonseca <jfonseca@vmware.com>
* svga: expose HW smooth/stipple/wide linesBrian Paul2013-12-111-0/+1
| | | | | | | Newer virtual HW versions support smooth/stipple/wide lines. Use that instead of 'draw' fallbacks when possible. Reviewed-by: José Fonseca <jfonseca@vmware.com>
* svga: remove user-space vertex/index buffer codeBrian Paul2013-10-241-3/+0
| | | | | | | | The gallium vbuf module, which we've been using for some time now, takes care of uploading user-space vertex/index data into real buffers. The upload code in the svga driver was unused. Reviewed-by: José Fonseca <jfonseca@vmware.com>
* svga: add new memory-used HUD queryBrian Paul2013-04-031-0/+1
| | | | | | | To track the amount of memory used by all pipe_resources (textures and buffers). Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
* svga: add HUD queries for number of draw calls, number of fallbacksBrian Paul2013-04-031-0/+9
| | | | | | | The fallbacks count is the number of drawing calls that use a "draw" module fallback, such as polygon stipple. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
* gallium: add start_slot parameter to set_vertex_buffersMarek Olšák2012-10-311-2/+0
| | | | | | | | | | | | | | | | | | | | | This allows updating only a subrange of buffer bindings. set_vertex_buffers(pipe, start_slot, count, NULL) unbinds buffers in that range. Binding NULL resources unbinds buffers too (both buffer and user_buffer must be NULL). The meta ops are adapted to only save, change, and restore the single slot they use. The cso_context can save and restore only one vertex buffer slot. The clients can query which one it is using cso_get_aux_vertex_buffer_slot. It's currently set to 0. (the Draw module breaks if it's set to non-zero) It should decrease the CPU overhead when using a lot of meta ops, but the drivers must be able to treat each vertex buffer slot as a separate state (only r600g does so at the moment). I can imagine this also being useful for optimizing some OpenGL use cases. Reviewed-by: Brian Paul <brianp@vmware.com>
* svga: implement blitMarek Olšák2012-09-301-0/+2
| | | | Reviewed-by: Brian Paul <brianp@vmware.com>
* svga: remove unused svga_shader::use_sm30 field, add commentsBrian Paul2012-08-081-3/+1
| | | | Reviewed-by: José Fonseca <jfonseca@vmware.com>
* svga: remove the special zero-stride vertex array codeBrian Paul2012-05-251-6/+0
| | | | | This code actually hasn't been needed for some time now. We can just treat a zero-stride vertex array like any other non-zero-stride array.
* svga: Advertise SVGA3D_DEVCAP_MAX_POINT_SIZE.José Fonseca2012-02-281-2/+0
| | | | | | | | | | | Backends usually advertise a SVGA3D_DEVCAP_MAX_POINT_SIZE between 63 and 256, so an hardcoded max point size of 80 is often incorrect. This limitation does not apply for anti-aliased points (as they are done via draw module) but we still advertise the same limit for both, because all others pipe drivers do. Reviewed-by: Brian Paul <brianp@vmware.com>
* svga: Remove unused SVGA_TEX_UNITS constant.José Fonseca2012-02-271-1/+0
|
* svga: pass fragment shader to draw moduleBrian Paul2011-11-031-0/+3
| | | | | | | | | If we use the draw-module for wide point/line/etc drawing we'll need a fragment shader too (like we pass in the vertex shader). This fixes sprite point rendering when forcing the swtnl path. Reviewed-by: José Fonseca <jfonseca@vmware.com>
* svga: implement generic variable index remappingBrian Paul2011-11-031-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | The state tracker may generate shaders that use generic vs outputs / fs inputs like: DCL IN[0], GENERIC[0] DCL IN[1], GENERIC[10] DCL IN[2], GENERIC[11] This patch remaps 0, 10, 11 to small integers like 1, 2, 3 so that we stay inside the SVGA3D limit (8). The remapping is done to both the vertex shader outputs and the fragment shader inputs. The same mapping must be used for a vs/fs pair. Note that 'union svga_compile_key' is now 'struct svga_compile_key' because we needed to add the register remapping table. The change in size isn't really significant though (it's not a search key). Also, add assertions when building up SVGA3D src/dst registers to we don't try to store too large of value for the bitfield size. Reviewed-by: José Fonseca <jfonseca@vmware.com>
* svga: Fix potential buffer overflow in rs draw state.José Fonseca2011-10-311-7/+5
| | | | Reviewed-by: Brian Paul <brianp@vmware.com>
* svga: Flush the hwtnl primitives before writing to buffers.José Fonseca2011-10-311-0/+2
| | | | | | | | | | | | | | | svga keeps a small queue of similar primitive draws in order to coalesce them into a single draw primitive command. But the buffers referred in primitives not yet emitted were being ignored in the considerations to flush or not the context. This fixes piglit vbo-map-remap, vbo-subdata-sync, vbo-subdata-zero, and Seeker. Based on investigation and patch from Brian Paul. Reviewed-By: Brian Paul <brianp@vmware.com>
* svga: implement point sprite suppportBrian Paul2011-09-231-0/+1
| | | | | | Emit the SVGA3D_RS_POINTSPRITEENABLE render state. When sprite_coord_mode=PIPE_SPRITE_COORD_LOWER_LEFT emit extra frag shader code to invert the Y coordinate of the incoming texcoord.
* gallium: move clear paths from rgba to a pointer to a color union (v2)Dave Airlie2011-09-181-1/+1
| | | | | | | | | | | | | | | This moves the gallium interface for clears from using a pointer to 4 floats to a pointer to a union of float/unsigned/int values. Notes: 1. the value is opaque. 2. only when the value is used should it be interpretered according to the surface format it is going to be used with. 3. float clears on integer buffers and vice-versa are undefined. v2: fixed up vega and graw, dropped hunks that shouldn't have been in patch. Signed-off-by: Dave Airlie <airlied@redhat.com>
* svga: Flush when switching between HW to SW TNL, after updating need_swtnl.José Fonseca2011-07-011-3/+0
| | | | | Also, only flush when going from HW TNL to SW TNL, given it is impossible for the buffers resulting from SWTNL to be ever referred by HW TNL path.
* svga: Rebind framebuffer and tss bindings strictly when necessary.José Fonseca2011-04-121-1/+5
| | | | | | | | | | The earlier change to ensure rendertargets and textures are always rebound at every command buffer start had the downside of making successive flushes no longer no-ops, as a command buffer with merely the rebinding commands were being unnecessarily sent to the vGPU. This change only re-emits the bindings when necessary, by keeping track of the need to rebind outside of the dirty state update mechanism.
* svga: Ensure pending drawing commands other surface operations are emitted ↵José Fonseca2011-02-181-0/+2
| | | | | | | | | before DMAs. This behavior was last when moving the transfers to the contexts. This fixes several piglit failures, which were reading the color renderbuffer before the draw operations were emitted.
* svga: flush when transitioning between HW and SW rendering pathsBrian Paul2011-02-161-0/+3
| | | | To avoid mixing HW and SW rendering with the same vertex buffer.
* svga: fix incorrect commentBrian Paul2011-02-161-1/+1
|