aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_cb_bitmap.c
Commit message (Collapse)AuthorAgeFilesLines
* st/mesa: move utility functions, macros into new st_util.h fileBrian Paul2019-03-111-0/+1
| | | | | | | | | | | | | | To de-clutter st_context.h. Clean up remaining function prototypes in st_context.h. The st_vp_uses_current_values() helper is only used in st_context.c so move it there. The st_get_active_states() function is only used in st_context.c so remove its prototype in st_context.h Reviewed-by: Neha Bhende <[email protected]>
* st/mesa: Combine the DrawPixels and Bitmap passthrough VS programs.Kenneth Graunke2018-12-211-21/+6
| | | | | | They're now identical, so we can just compile it once. Reviewed-by: Marek Olšák <[email protected]>
* gallium: split depth_clip into depth_clip_near & depth_clip_farMarek Olšák2018-09-061-1/+2
| | | | for AMD_depth_clamp_separate.
* gallium: add storage_sample_count parameter into is_format_supportedMarek Olšák2018-07-311-3/+3
| | | | Tested-by: Dieter Nützel <[email protected]>
* gallium: remove aux_vertex_buffer_slot codeMarek Olšák2018-05-121-4/+1
| | | | | | The slot index is always 0, and is pretty unlikely to change in the future. Reviewed-by: Brian Paul <[email protected]>
* mesa: include mtypes.h lessMarek Olšák2018-04-121-0/+1
| | | | | | | | | | - remove mtypes.h from most header files - add main/menums.h for often used definitions - remove main/core.h v2: fix radv build Reviewed-by: Brian Paul <[email protected]>
* gallium: Mute arrays for several meta like callbacks.Mathias Fröhlich2018-02-091-2/+2
| | | | | | | | | | | | | Set the _DrawArray pointer to NULL when calling into the Drivers Bitmap/CopyPixels/DrawAtlasBitmaps/DrawPixels/DrawTex hooks. This fixes an assert that gets uncovered when the following patch gets applied. v2: Mute from within the state tracker instead of generic mesa. v3: Avoid evaluating _DrawArrays from within st_validate_state. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: don't store non-fragment sampler states and views in st_contextMarek Olšák2018-02-081-4/+4
| | | | | | | | those are unused. st_context: 10120 -> 3704 bytes Reviewed-by: Timothy Arceri <[email protected]>
* mesa/st: fix unused variable warningsTimothy Arceri2017-07-261-2/+3
| | | | | Reviewed-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: don't keep framebuffer state in st_contextMarek Olšák2017-06-071-6/+6
| | | | | Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium: decrease the size of pipe_vertex_buffer - 24 -> 16 bytesMarek Olšák2017-05-101-2/+2
|
* st/mesa: simplify update_constants functionsMarek Olšák2017-05-081-1/+1
| | | | | Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: put the bitmap_cache structure inside st_contextMarek Olšák2017-04-201-41/+13
| | | | | | | | This is nicer on caches, and the next commit will need to access the structure from a different place. Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st_cb_bitmap: check NULL return from u_upload_allocJulien Isorce2017-03-281-0/+6
| | | | | | Signed-off-by: Julien Isorce <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: use the common uploader (v2)Marek Olšák2017-02-141-2/+2
| | | | | | | | v2: use const_uploader Reviewed-by: Nicolai Hähnle <[email protected]> Tested-by: Edmondo Tommasina <[email protected]> (v1) Tested-by: Charmaine Lee <[email protected]>
* st/mesa/r200/i915/i965: eliminate gl_fragment_programTimothy Arceri2016-10-261-2/+1
| | | | | | | | | | Here we move OriginUpperLeft and PixelCenterInteger into gl_program all other fields have been replace by shader_info. V2: Don't use anonymous union/structs to hold vertex/fragment fields suggested by Ian. Reviewed-by: Jason Ekstrand <[email protected]>
* st/mesa: move all sampler view code into new st_sampler_view.[ch] filesBrian Paul2016-10-061-0/+1
| | | | | | | | | | | | | Previously, the sampler view code was scattered across several different files. Note, the previous REALLOC(), FREE() for st_texture_object::sampler_views are replaced by realloc(), free() to avoid conflicting macros in Mesa vs. Gallium. Reviewed-by: Edward O'Callaghan <[email protected]> Acked-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: use the new subroutine index upload API.Dave Airlie2016-08-231-1/+1
| | | | | | | This plugs the new API into the gallium state tracker. Signed-off-by: Dave Airlie <[email protected]> Acked-by: Andres Gomez <[email protected]>
* st/mesa: remove excessive shader state dirtyingMarek Olšák2016-07-301-1/+2
| | | | | | | | | This just needs to be done by st_validate_state. v2: add "shaders_may_be_dirty" flags for not skipping st_validate_state on _NEW_PROGRAM to detect real shader changes Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: completely rewrite state atomsMarek Olšák2016-07-301-5/+5
| | | | | | | | | | | | | | | | | | | | The goal is to do this in st_validate_state: while (dirty) atoms[u_bit_scan(&dirty)]->update(st); That implies that atoms can't specify which flags they consume. There is exactly one ST_NEW_* flag for each atom. (58 flags in total) There are macros that combine multiple flags into one for easier use. All _NEW_* flags are translated into ST_NEW_* flags in st_invalidate_state. st/mesa doesn't keep the _NEW_* flags after that. torcs is 2% faster between the previous patch and the end of this series. v2: - add st_atom_list.h to Makefile.sources Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: invalidate readpixels cacheNicolai Hähnle2016-06-211-0/+3
| | | | | | | Whenever a draw happens or some other function call might change the result of future glReadPixels calls, we must invalidate the cache. Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: fix sampler view leak in st_DrawAtlasBitmaps()Brian Paul2016-04-141-0/+6
| | | | | | | | | | | | I neglected to free the sampler view which was created earlier in the function. So for each glCallLists() command that used the bitmap atlas to draw text, we'd leak a sampler view object. Also, check for st_create_texture_sampler_view() failure and record GL_OUT_OF_MEMORY. Cc: "11.1 11.2" <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* st/mesa: new st_DrawAtlasBitmaps() function for drawing bitmap textBrian Paul2016-02-171-3/+140
| | | | | | | | | | | | This basically saves the current pipeline state, sets up state for rendering, constructs a set of textured quads, renders, then restores the previous pipeline state. It shouldn't be hard to implement a similar function for non-gallium drives. With some code refactoring, the vertex definition code could probably be shared. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: use new CSO_BITS_ALL_SHADERSBrian Paul2016-02-161-6/+3
| | | | Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: simplify st->ctx, ctx->st usage in a various placesBrian Paul2016-02-161-6/+5
|
* st/mesa: use new cso_save/restore_state() functionsBrian Paul2016-02-161-24/+13
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: use new cso_set_viewport_dims() helperBrian Paul2016-02-161-13/+3
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: consolidate quad drawing codeBrian Paul2016-02-161-63/+3
| | | | | | | The glClear, glBitmap and glDrawPixels code now use a new st_draw_quad() helper function. Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: overhaul vertex setup for clearing, glDrawPixels, glBitmapBrian Paul2016-02-161-46/+54
| | | | | | | | | | | | Define a new st_util_vertex structure which is a bit smaller (9 floats versus the previous 12 floats per vertex). Clean up the glClear, glDrawPixels and glBitmap code that sets up the vertex data and does the drawing so it's all very similar. This can lead to more consolidation. v2: add assertion that vertex buffer slot == 0 to catch possible future change in cso_get_aux_vertex_buffer_slot() behavior. Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: add a second pipeline for computeSamuel Pitoiset2016-02-131-1/+1
| | | | | | | | | | | | | Compute needs a new and different validation path. Changes from v2: - make use of unreachable() instead of assert() when the pipeline is invalid - move the st_pipeline enumeration to st_context.h instead of st_api.h Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: fix bitmap texture target code and simplify tex sampler stateBrian Paul2016-02-091-16/+16
| | | | | | | | | | | | | | | Bitmaps may be drawn with a PIPE_TEXTURE_2D or PIPE_TEXTURE_RECT resource as determined at context creation by checking if PIPE_CAP_NPOT_TEXTURES is supported. But many places in the bitmap code were hard-coded to use PIPE_TEXTURE_2D. Use st->internal_target instead. I think an older NV chip is the only case where a gallium driver does not support NPOT textures. Bitmap drawing was probably broken for that GPU. Also, we only need one sampler state with texcoord normalization set up according to st->internal_target. Reviewed-by: Roland Scheidegger <[email protected]>
* st/mesa: don't allocate bitmap drawing state until neededBrian Paul2016-02-091-68/+77
| | | | | | | | | Most apps don't use glBitmap so don't allocate the bitmap cache or gallium state objects/shaders/etc until the first call to st_Bitmap(). v2: simplify a conditional, per Gustaw Smolarczyk. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: move the setup_bitmap_vertex_data() code into draw_bitmap_quad()Brian Paul2016-02-091-90/+78
| | | | | | Now all the code to setup the vertex data and draw it is in one place. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: refactor some bitmap drawing codeBrian Paul2016-02-091-33/+57
| | | | | | | Move setup/restoration of rendering state into helper functions. This makes the draw_bitmap_quad() function much more concise. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: minor formatting fixes in st_cb_bitmap.cBrian Paul2016-02-081-3/+1
|
* st/mesa: replace bitmap size checks with assertionBrian Paul2016-01-061-2/+2
| | | | The _mesa_Bitmap() caller already checks for zero-sized bitmaps.
* st/mesa: be more careful about state validation in st_Bitmap()Brian Paul2016-01-061-1/+8
| | | | | | | | | | | If the only dirty state is mesa's _NEW_PROGRAM_CONSTANTS flag, we can skip state validation before drawing a bitmap since that state doesn't effect bitmap rendering. This further increases the performance of the ipers demo on llvmpipe to about what it was before commit 36c93a6fae27561. Reviewed-by: José Fonseca <[email protected]>
* st/mesa: protect debug printf() with a conditional instead of commentBrian Paul2016-01-061-5/+5
|
* st/mesa: fix comment indentation in st_flush_bitmap_cache()Brian Paul2016-01-061-2/+2
|
* u_upload_mgr: pass alignment to u_upload_alloc manuallyMarek Olšák2016-01-021-1/+1
| | | | | | | | | | 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]>
* st/mesa: fix GLSL uniform updates for glBitmap & glDrawPixels (v2)Marek Olšák2016-01-021-1/+5
| | | | | | | | | | Spotted by luck. The GLSL uniform storage is only associated once in LinkShader and can't be reallocated afterwards, because that would break the association. v2: don't remove st_upload_constants calls, clarify why they're needed Cc: 11.0 11.1 <[email protected]>
* st/mesa: decouple shaders from contexts if they are shareableMarek Olšák2015-10-201-1/+1
| | | | Reviewed-by: Ilia Mirkin <[email protected]>
* st/mesa: implement glBitmap shader transformation using tgsi_transform_shaderMarek Olšák2015-10-091-145/+0
| | | | | | Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
* st/mesa: properly handle u_upload_alloc failureIlia Mirkin2015-09-061-1/+1
| | | | | | | | vbuf is never null. We want to make sure that a resource was allocated for the vbuf, which is *vbuf. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* u_upload_mgr: remove the return value from u_upload_allocMarek Olšák2015-09-031-2/+3
| | | | | | The return buffer or the returned pointer can be used instead. Reviewed-by: Brian Paul <[email protected]>
* cso: only allow saving and restoring fragment sampler statesMarek Olšák2015-07-221-2/+2
|
* cso: only allow saving and restoring fragment sampler viewsMarek Olšák2015-07-221-2/+2
| | | | Not needed for other shader stages.
* gallium: disable tessellation shaders for meta opsMarek Olšák2015-05-161-1/+7
| | | | | Reviewed-by: Roland Scheidegger <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* gallium: remove unused pipe_viewport_state::translate[3] and scale[3]Marek Olšák2014-11-161-2/+0
| | | | Almost all drivers ignore them.
* gallium/util: add a window_space option to the passthrough vertex shaderMarek Olšák2014-11-161-1/+2
| | | | Tested-by: Nick Sarnie <[email protected]>