aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga/svga_context.h
Commit message (Collapse)AuthorAgeFilesLines
* util: move os_time.[ch] to src/utilNicolai Hähnle2017-11-091-1/+1
| | | | Reviewed-by: Marek Olšák <[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: re-validate sampler view at draw time if neededCharmaine Lee2017-06-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch validates those sampler views with backing copy of texture whose original copy has been updated since the view is last validated. This is done here at draw time because the texture binding might not have modified, hence validation is not triggered at state update time, and yet the texture might have been updated in another context, so we need to re-validate the sampler view in order to update the backing copy of the updated texture. This fixes a rendering flickering issue with Photoshop running in Linux VM with HWversion 11. The problem is Photoshop renders to texture A in context X, and then bind texture A to context Y. The first time when texture A is bound to context Y, cso calls pipe->set_sampler_views(). Validation of sampler views is done, rendering is fine. But when texture A is rendered to again in context X, and rebound in context Y, cso skips pipe->set_sampler_views() because texture A is already bound in context Y. SVGA driver is not given a chance to re-validate the texture binding, the backing copy of the texture is not updated, and hence causes black image. Tested with Photoshop, MTT glretrace, piglit. Fixes VMware bug 1769103. Reviewed-by: Jose Fonseca <[email protected]>
* svga: add new num-failed-allocations HUD queryBrian Paul2017-06-161-0/+1
| | | | | | | This counter is incremented if we fail to allocate memory for vertex/index/const buffers, textures, etc. Reviewed-by: Neha Bhende <[email protected]>
* svga: Support accelerated conditional blittingThomas Hellstrom2017-06-161-0/+3
| | | | | | | | | | | | | | | | | | The blitter has functions to save and restore the conditional rendering state, but we currently don't save the needed info. Since also the copy_region_vgpu10 path supports conditional blitting, we instead use the same function as the clearing routines and move that function to svga_pipe_query.c Note that we still haven't implemented conditional blitting with the software fallbacks. Fixes piglit nv_conditional_render::copyteximage Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* gallium: remove pipe_index_buffer and set_index_bufferMarek Olšák2017-05-101-1/+0
| | | | | | | | | | | | | | pipe_draw_info::indexed is replaced with index_size. index_size == 0 means non-indexed. Instead of pipe_index_buffer::offset, pipe_draw_info::start is used. For indexed indirect draws, pipe_draw_info::start is added to the indirect start. This is the only case when "start" affects indirect draws. pipe_draw_info::index is a union. Use either index::resource or index::user depending on the value of pipe_draw_info::has_user_indices. v2: fixes for nine, svga
* svga: Move rendertarget view related fields to hw_clear stateCharmaine Lee2017-04-261-4/+5
| | | | | | | | This patch moves the rendertarget view related fields from svga_hw_draw_state to svga_hw_clear_state where all the hw framebuffer related state resides. Reviewed-by: Brian Paul <[email protected]>
* svga: add the has_backed_views flagCharmaine Lee2017-04-071-0/+1
| | | | | | | | | The new has_backed_views flag specifies if any of the render target views or depth stencil view is a backing surface view. The flag is used in svga_propagate_rendertargets() so it can return early if there is no surface to propagate. Reviewed-by: Brian Paul <[email protected]>
* svga: disable rasterization if rasterizer_discard is set or FS undefinedCharmaine Lee2017-04-071-0/+6
| | | | | | | | | | | | | | | | | | | With this patch, rasterization will be disabled if the rasterizer_discard flag is set or the fragment shader is undefined due to missing position output from the vertex/geometry shader. Tested with piglit test glsl-1.50-geometry-primitive-id-restart. Also tested with full MTT glretrace and piglit. v2: As suggested by Roland, to properly disable rasterization, besides setting FS to NULL, we will also need to disable depth and stencil test. v3: As suggested by Brian, set SVGA_NEW_DEPTH_STENCIL_ALPHA dirty bit in svga_bind_rasterizer_state() if the rasterizer_discard flag is changed. Reviewed-by: Brian Paul <[email protected]>
* svga: s/unsigned/pipe_prim_type/Brian Paul2017-03-021-1/+1
| | | | | | And add some default switch cases to silence compiler warnings. Reviewed-by: Charmaine Lee <[email protected]>
* svga: whitespace fixes in svga_context.hBrian Paul2017-03-021-10/+9
| | | | Trivial.
* svga: move svga_mark_surfaces_dirty() prototype to svga_surface.hBrian Paul2016-11-031-10/+0
| | | | Trivial.
* svga: Add render_condition boolean flag in struct svga_contextNeha Bhende2016-11-031-0/+2
| | | | | | | | | | | | | | set render_condition flag when driver performs conditional rendering. Blit using DXPredCopyRegion command gets affected by conditional rendering so We should check this flag while performing blit operation Tested with piglit tests. v2: As per Charmaine's comment, setting render_condition flag if svga_query is valid. Tested with pigit tests. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: Implement the pipe clear_render_target functionality v2Thomas Hellstrom2016-11-031-1/+6
| | | | | | | | | | | v2: Accounted for the fact that svga_try_clear_render_target also honors conditional rendering. Testing done: Excercised all functions in a separate feature branch. Forced emission of conditional rendering commands when necessary. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* svga: remove disable_shader debug variableBrian Paul2016-09-211-2/+0
| | | | | | Never used, AFAIK. Reviewed-by: Charmaine Lee <[email protected]>
* svga: use upload buffer for upload texture.Charmaine Lee2016-09-171-0/+1
| | | | | | | | | | | | | With this patch, when running with vgpu10, instead of mapping directly to the guest backed memory for texture update, we'll use the texture upload buffer and use the transfer from buffer command to update the host side texture memory. This optimization yields about 20% performance improvement with Lightsmark2008 and about 40% with Tropics. Tested with Lightsmark2008, Tropics, Heaven, MTT piglit, glretrace, conform. Reviewed-by: Brian Paul <[email protected]>
* svga: split the num-resources-mapped hud to textures & buffersCharmaine Lee2016-09-171-2/+4
| | | | | | | | Replace the num-resources-mapped hud with num-textures-mapped and num-buffers-mapped, so we can differentiate the map counts for these two different resources. Reviewed-by: Brian Paul <[email protected]>
* svga: change svga hud defines to enumsCharmaine Lee2016-09-171-22/+25
| | | | | | This will make it easier to add new hud types. Reviewed-by: Brian Paul <[email protected]>
* svga: reduce unmapping/remapping of the default constant bufferBrian Paul2016-09-171-0/+7
| | | | | | | | | | | | | | | Previously, every time we put shader constants into the default constant buffer we called u_upload_alloc(), which mapped the buffer, and u_upload_unmap(). We had to unmap the buffer before calling svga_buffer_handle() to get the winsys handle for the buffer. But we really only need to do that the first time we reference the const buffer. Now we try to keep the upload manager's buffer mapped until we fill it or flush the command buffer. v2: add additional comment on the buffer unmapping code in svga_context_flush(), per Charmaine. Reviewed-by: Charmaine Lee <[email protected]>
* svga: avoid emitting redundant SetShaderResource commandCharmaine Lee2016-08-261-1/+4
| | | | | | Tested with Lightsmark2008, Heaven, MTT piglit, glretrace, viewperf, conform. Reviewed-by: Brian Paul <[email protected]>
* svga: add a cleanup function to clean up sampler stateCharmaine Lee2016-08-261-0/+1
| | | | | | | This patch adds a cleanup function to clean up sampler state at context destruction time. Reviewed-by: Brian Paul <[email protected]>
* svga: define svga_clear() in svga_init_clear_functions()Neha Bhende2016-08-261-9/+0
| | | | | | | Put all the clearing related functions in svga_init_clear_functions() Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: add svga_init_clear_functions()Neha Bhende2016-08-261-0/+1
| | | | | | | | | define svga_init_clear_functions() and svga_clear_texture as svga->pipe.clear_texture. This is part of ARB_clear_texture extension Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: add guest statistic gathering interfaceCharmaine Lee2016-08-261-0/+5
| | | | | | | | | | | | With this patch, guest statistic gathering interface is added to svga winsys interface that can be used to gather svga driver statistic. The winsys module can then share the statistic info with the VMX host via the mksstats interface. The statistic enums used in the svga driver are defined in svga_stats_count and svga_stats_time in svga_winsys.h Reviewed-by: Brian Paul <[email protected]>
* svga: don't call os_get_time() when not needed by Gallium HUDBrian Paul2016-08-161-0/+15
| | | | | | | The calls to os_get_time() were showing up higher than expected in profiles. Reviewed-by: Charmaine Lee <[email protected]>
* svga: additional comments for svga_hw_draw_state membersBrian Paul2016-08-161-4/+11
| | | | | | And re-order a few fields. Signed-off-by: Brian Paul <[email protected]>
* svga: avoid emitting redundant DXSetRenderTargets commandCharmaine Lee2016-07-051-0/+4
| | | | | | | Tested with Lightsmark2008, MTT piglit, glretrace, conform. Reviewed-by: Sinclair Yeh <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* svga: fix vertex buffer references in the hw stateCharmaine Lee2016-06-231-2/+2
| | | | | | | | | | | | | | This patch fixes three issues with vertex buffer references: (1) Instead of copy the vertex buffer resource handles to the hw state in the context structure, use pipe_resource_reference to properly reference the vertex buffer resources in the context. (2) Make sure to unbind those unused vertex buffer resources. (3) Force to rebind the vertex buffer resources at the first draw of each command buffer to make sure the vertex buffer resources are paged in. Reviewed-by: Brian Paul <[email protected]>
* svga: fix index buffer reference in the hw stateCharmaine Lee2016-06-231-1/+1
| | | | | | | | Instead of copy the index buffer resource handle to the hw state in the context structure, use pipe_resource_reference to properly reference the index buffer resource in the context. Reviewed-by: Brian Paul <[email protected]>
* svga: eliminiate unnecessary constant buffer updatesCharmaine Lee2016-04-251-0/+3
| | | | | | | | | | | | | | | | | | Currently if the texture binding is changed, emit_fs_consts() is triggered to update texture scaling factor for rectangle texture or texture buffer size in the constant buffer. But the update is only relevant if the texture binding includes a rectangle texture or a texture buffer. To eliminate the unnecessary constant buffer updates due to other texture binding changes, a new flag SVGA_NEW_TEXTURE_CONSTS will be used to trigger fragment shader constant buffer update when a rectangle texture or a texture buffer is bound. With this patch, the number of constant buffer updates in Lightsmark2008 reduces from hundreds per frame to about 28 per frame. Reviewed-by: Brian Paul <[email protected]>
* svga: separate HUD counters for state objectsBrian Paul2016-04-251-1/+9
| | | | | | | | | | Count depth/stencil, blend, sampler, etc. state objects separately but just report the sum for the HUD. This change lets us use gdb to see the breakdown of state objects in more detail. Also, count sampler views too. Reviewed-by: Charmaine Lee <[email protected]>
* 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 <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]>
* 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 <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* 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 <[email protected]>
* svga: avoid emitting redundant SetVertexBuffers() commandsBrian Paul2016-01-051-0/+5
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: avoid emitting redundant SetIndexBuffer commandsBrian Paul2015-12-111-0/+4
| | | | | Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* 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 <[email protected]>, Reviewed-by: José Fonseca <[email protected]>
* 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 <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* 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 <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]> Acked-by: Christian König <[email protected]> Acked-by: Alex Deucher <[email protected]>
* 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 <[email protected]> Acked-by: Marek Olšák <[email protected]>
* 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 <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* 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 <[email protected]>