aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_cb_drawpixels.c
Commit message (Collapse)AuthorAgeFilesLines
* gallium: add start_slot parameter to set_vertex_buffersMarek Olšák2012-10-311-3/+5
| | | | | | | | | | | | | | | | | | | | | 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 <[email protected]>
* mesa/st: Don't use 4bits for GL_UNSIGNED_BYTE_3_3_2(_REV)José Fonseca2012-10-251-0/+2
| | | | | | | | | | | | 4bits and 3bits quantitization values differ significantly for values other than 0 and 1. Fixes piglit draw-pixels for softpipe/llvmpipe. NOTE: Probably a candidate for stable branches. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: Fix assertions.José Fonseca2012-10-121-2/+2
| | | | Can't access ptDraw before it is written.
* gallium: unify transfer functionsMarek Olšák2012-10-111-33/+27
| | | | | | | | | | | | | | "get_transfer + transfer_map" becomes "transfer_map". "transfer_unmap + transfer_destroy" becomes "transfer_unmap". transfer_map must create and return the transfer object and transfer_unmap must destroy it. transfer_map is successful if the returned buffer pointer is not NULL. If transfer_map fails, the pointer to the transfer object remains unchanged (i.e. doesn't have to be NULL). Acked-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_drawpix define.Oliver McFadden2012-09-151-4/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* Don't cast the return value of malloc/reallocMatt Turner2012-09-051-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch has been generated by the following Coccinelle semantic patch: // Don't cast the return value of malloc/realloc. // // Casting the return value of malloc/realloc only stands to hide // errors. @@ type T; expression E1, E2; @@ - (T) ( _mesa_align_calloc(E1, E2) | _mesa_align_malloc(E1, E2) | calloc(E1, E2) | malloc(E1) | realloc(E1, E2) )
* st/mesa: don't clamp fragment color with integer colorbufferMarek Olšák2012-08-151-2/+4
|
* gallium: consolidate CSO sampler and sampler_view functionsBrian Paul2012-08-031-8/+8
| | | | | | | | | | | | | Merge the vertex/fragment versions of the cso_set/save/restore_samplers() functions. Now we pass the shader stage (PIPE_SHADER_x) to the function to indicate vertex/fragment/geometry samplers. For example: cso_single_sampler(cso, PIPE_SHADER_FRAGMENT, unit, sampler); This results in quite a bit of code reduction, fewer CSO functions and support for geometry shaders. Reviewed-by: Marek Olšák <[email protected]>
* mesa: add glformats integer type/format detection routinesJordan Justen2012-07-211-1/+2
| | | | | | | | | | | | _mesa_is_integer_format is moved to formats.c and renamed as _mesa_is_enum_format_integer. _mesa_is_format_unsigned, _mesa_is_type_integer, _mesa_is_type_unsigned, and _mesa_is_enum_format_or_type_integer are added. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa,st/mesa: implement GL_RGB565 from ARB_ES2_compatibilityMarek Olšák2012-07-131-0/+2
| | | | | | | | | | This was not implemented, because the spec was changed just recently. Everything has been in place already. Gallium has PIPE_FORMAT_B5G6R5_UNORM, while Mesa has MESA_FORMAT_RGB565. Reviewed-by: Kenneth Graunke <[email protected]>
* gallium: add util_format_stencil_only helper functionMarek Olšák2012-07-121-21/+2
| | | | | | used for stencil sampler views. Reviewed-by: Alex Deucher <[email protected]>
* st/mesa: clamp glDrawPixels size to max texture sizeBrian Paul2012-06-191-0/+31
|
* st/mesa: move st_validate_state() call earlier in st_DrawPixels()Brian Paul2012-06-191-5/+5
|
* st/mesa: fix glDrawPixels(GL_DEPTH_COMPONENT) color outputBrian Paul2012-06-141-2/+11
| | | | | | | | | When drawing a depth image the fragment shader also needs to emit the current raster color. The new piglit drawpix-z test exercises this. NOTE: This is a candiate for the 8.0 branch.
* st/mesa: no-op glCopyPixels if source region is out of boundsBrian Paul2012-04-231-1/+9
| | | | | | | | | If the source region for a glCopyPixels is completely outside the source buffer bounds, no-op the copy. Fixes a failed assertion. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: write vertices directly into the buffer in glDrawPixelsMarek Olšák2012-04-181-17/+15
|
* st/mesa: use u_upload_mgr to upload vertices for glDrawPixelsMarek Olšák2012-04-181-8/+9
|
* st/mesa: stop using MAX_WIDTH in st_cb_drawpixels.cBrian Paul2012-02-241-26/+29
| | | | Reviewed-by: José Fonseca <[email protected]>
* st/mesa: use _mesa_pack_ubyte_stencil_row() in draw_stencil_pixels()Brian Paul2012-02-151-42/+2
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: remove st_renderbuffer::formatBrian Paul2012-02-151-6/+7
| | | | | | We only used it in a few places that can implemented differently. Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: do vertex and fragment color clamping in shadersMarek Olšák2012-01-251-1/+4
| | | | | | | | | | | | | | For ARB_color_buffer_float. Most hardware can't do it and st/mesa is the perfect place for a fallback. The exceptions are: - r500 (vertex clamp only) - nv50 (both) - nvc0 (both) - softpipe (both) We also have to take into account that r300 can do CLAMPED vertex colors only, while r600 can do UNCLAMPED vertex colors only. The difference can be expressed with the two new CAPs.
* Squash-merge branch 'gallium-clip-state'Marek Olšák2012-01-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gallium/auxiliary/tgsi/tgsi_strings.c src/mesa/state_tracker/st_atom_clip.c commit d919791f2742e913173d6b335128e7d4c63c0840 Author: Christoph Bumiller <[email protected]> Date: Fri Jan 6 17:59:22 2012 +0100 d3d1x: adapt to new clip state commit cfec82bca3fefcdefafca3f4555285ec1d1ae421 Author: Christoph Bumiller <[email protected]> Date: Fri Jan 6 14:16:51 2012 +0100 gallium/docs: update for clip state changes commit c02bfeb81ad9f62041a2285ea6373bbbd602912a Author: Christoph Bumiller <[email protected]> Date: Fri Jan 6 14:21:43 2012 +0100 tgsi: add TGSI_PROPERTY_PROHIBIT_UCPS commit d4e0a785a6a23ad2f6819fd72e236acb9750028d Author: Brian Paul <[email protected]> Date: Thu Jan 5 08:30:00 2012 -0700 tgsi: consolidate TGSI string arrays in new tgsi_strings.h There was some duplication between the tgsi_dump.c and tgsi_text.c files. Also use some static assertions to help catch errors when adding new TGSI values. v2: put strings in tgsi_strings.c file instead of the .h file. Reviewed-by: Dave Airlie <[email protected]> commit c28584ce0d8c62bd92c8f140729d344f88a0b3cd Author: Christoph Bumiller <[email protected]> Date: Fri Jan 6 12:48:09 2012 +0100 gallium: extend user_clip_plane_enable to apply to clip distances commit f1d5016c07f786229ed057effbe55fbfd160b019 Author: Marek Olšák <[email protected]> Date: Fri Jan 6 02:39:09 2012 +0100 nvfx: adapt to new clip state commit 6f6fa1c26bd19f797c1996731708e3569c9bfe24 Author: Marek Olšák <[email protected]> Date: Fri Jan 6 01:41:39 2012 +0100 st/mesa: fix DrawPixels with GL_DEPTH_CLAMP commit c86ad730aa1c017788ae88a55f54071bf222be12 Author: Christoph Bumiller <[email protected]> Date: Tue Jan 3 23:51:30 2012 +0100 nv50: adapt to new clip state commit 3a8ae6ac243bae5970729dc4057fe02d992543dc Author: Christoph Bumiller <[email protected]> Date: Tue Jan 3 23:32:36 2012 +0100 nvc0: adapt to new clip state commit 6243a8246997f8d2fcc69ab741a2c2dea080ff11 Author: Marek Olšák <[email protected]> Date: Thu Dec 29 01:32:51 2011 +0100 draw: initalize pt.user.planes in draw_init This fixes a crash in glean/fpexceptions. commit e3056524b19b56d473f4faff84ffa0eb41497408 Author: Marek Olšák <[email protected]> Date: Mon Dec 26 06:26:55 2011 +0100 svga: adapt to new clip state commit c5bfa8b37d6d489271df457229081d6bbb51b4b7 Author: Marek Olšák <[email protected]> Date: Sun Dec 25 14:11:51 2011 +0100 r600g: adapt to new clip state commit f11890905362f62627c4a28a8255b76eb7de7df2 Author: Marek Olšák <[email protected]> Date: Sun Dec 25 14:10:26 2011 +0100 r300g: adapt to new clip state commit e37465327c79a01112f15f6278d9accc5bf3103f Author: Marek Olšák <[email protected]> Date: Sun Dec 25 12:39:16 2011 +0100 draw: adapt to new clip state This adds a regression in the LLVM clipping path. Can anybody see anything wrong with the code? It works for every other case, just glean/fpexceptions crashes when doing the "Infinite clip plane test". commit b474d2b18c72d965eefae4e427c269cba5ce6ba2 Author: Marek Olšák <[email protected]> Date: Sun Dec 25 13:14:59 2011 +0100 u_blitter: don't save/set/restore clip state commit 9dd240ea91f523a677af45e8d0adb9e661e28602 Author: Marek Olšák <[email protected]> Date: Sun Dec 25 13:11:56 2011 +0100 gallium: don't cso_save/set/restore clip state The enable bits are in the rasterizer state. commit a4f7031179f5f4ad524b34b394214b984ac950f6 Author: Marek Olšák <[email protected]> Date: Sun Dec 25 12:58:55 2011 +0100 gallium: default depth_clip to 1 depth_clip = !depth_clamp commit fe21147a00ab90e549d63fe12ee4625c9c2ffcc3 Author: Marek Olšák <[email protected]> Date: Mon Dec 26 06:14:19 2011 +0100 trace,util: update state logging to new clip state Also dump the other missing flags. commit 2a3b96e84ac872dcc5bc1de049fe76bb58d64b23 Author: Marek Olšák <[email protected]> Date: Sun Dec 25 10:43:43 2011 +0100 st/mesa: adapt to new clip state commit b7b656a42fca19d7c85267f42649a206a85a2c72 Author: Marek Olšák <[email protected]> Date: Sat Dec 17 15:45:19 2011 +0100 gallium: move state enable bits from clip_state to rasterizer_state
* mesa: remove the dstX/Y/Zoffset params to _mesa_texstore() functionsBrian Paul2012-01-021-1/+0
| | | | | | | | The were always zero. When doing a sub-texture replacement we account for the dstX/Y/Zoffsets when we map the texture image. So no need to pass them into the texstore code anymore. Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: implement EXT_transform_feedback and ARB_transform_feedback2Marek Olšák2011-12-151-0/+3
|
* st/mesa: stop using _DepthBuffer, _StencilBuffer fieldsBrian Paul2011-12-131-11/+5
| | | | | | | | We never want to use the depth/stencil buffer wrappers so always just use the attachment renderbuffers. This is a step toward removing the _DepthBuffer, _StencilBuffer fields. Reviewed-by: Eric Anholt <[email protected]>
* st/mesa: quick fix of CopyPixels with GL_DEPTH_STENCILMarek Olšák2011-11-221-0/+7
| | | | | | | | This fixes: - depthstencil-default_fb-copypixels - fbo-depthstencil-GL_DEPTH24_STENCIL8-copypixels Reviewed-by: Brian Paul <[email protected]>
* st/mesa: remove dependencies on code in st_cb_readpixels.cBrian Paul2011-11-151-3/+18
| | | | | | st_cb_readpixels.c is going away next. Acked-by: Eric Anholt <[email protected]>
* st/mesa: fix memory leaksMorgan Armand2011-11-071-2/+2
| | | | Signed-off-by: Brian Paul <[email protected]>
* st/mesa: fix indentationMorgan Armand2011-11-071-3/+3
| | | | Signed-off-by: Brian Paul <[email protected]>
* st/mesa: set geometry shader to NULL when doing internal drawingMarek Olšák2011-11-041-0/+4
| | | | | | | The code expects the geometry shader to be NULL. We don't have geometry shaders now, but it's good to be prepared. v2: check for support in the cso context
* gallium: rename ZS stencil type to UINT (v2)Dave Airlie2011-10-111-20/+20
| | | | | | | | | | these are never USCALED, always UINT in reality. taken from some work by Christoph Bumiller v2: fixup formatting of table + tabs Signed-off-by: Dave Airlie <[email protected]>
* mesa: get rid of imageOffsets arrays in texstore codeBrian Paul2011-10-051-3/+1
| | | | | | | | | | | These were used to find the start of a 3D image slice (or 2D array texture slice) given a base address. Instead, use a simple array of address of image slices instead. This is a step toward getting rid of the gl_texture_image::ImageOffsets field. Reviewed-by: Eric Anholt <[email protected]>
* Merge branch 'glsl-to-tgsi'Bryan Cain2011-08-041-0/+44
|\ | | | | | | | | | | Conflicts: src/mesa/state_tracker/st_atom_pixeltransfer.c src/mesa/state_tracker/st_program.c
| * st/mesa: replace duplicated create_color_map_texture() function with shared ↵Bryan Cain2011-08-041-22/+1
| | | | | | | | function
| * st/mesa, glsl_to_tgsi: support glDrawPixels/glCopyPixels with a GLSL ↵Bryan Cain2011-08-011-0/+65
| | | | | | | | | | | | | | fragment shader active Since this was previously implemented using Mesa IR and _mesa_combine_programs, this commit adds a new code path that works with glsl_to_tgsi.
* | st/mesa: choose a matching depth internal format for DrawPixelsMarek Olšák2011-07-121-2/+27
| | | | | | | | | | | | | | This makes it easier to hit the fast path and get a float format when we ask for it. Reviewed-by: Brian Paul <[email protected]>
* | st/mesa: get rid of unnecessary 'goto' in DrawPixelsMarek Olšák2011-07-111-10/+6
| | | | | | | | Reviewed-by: Brian Paul <[email protected]>
* | st/mesa: derive a stencil sampler format from the actual texture formatMarek Olšák2011-07-111-44/+26
| | | | | | | | Reviewed-by: Brian Paul <[email protected]>
* | st/mesa: implement read/draw/copypixels for Z32F and Z32F_S8X24Marek Olšák2011-07-101-9/+55
| |
* | st/mesa: Use correct internal targetEmil Velikov2011-06-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | Commit 1a339b6c(st/mesa: prefer native texture formats when possible) introduced two new arguments to the st_choose_format() functions. This patch fixes the order and passes the correct internal_target rather than GL_NONE NOTE: This is a candidate for the 7.11 branch Signed-off-by: Emil Velikov <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* | st/mesa: prefer native texture formats when possible.Stéphane Marchesin2011-06-221-4/+6
|/ | | | | | If possible, we want to match the hardware format to what the app uses. By doing so, we avoid the need for pixel conversions and therefore greatly speed up texture uploads.
* st/mesa: don't use resource_copy_region for CopyPixels with conditional renderMarek Olšák2011-05-301-1/+2
| | | | | | | | | | | | The conditional rendering should be able to kill CopyPixels. I assume the render condition has no effect on resource_copy_region. This fixes piglit: - NV_conditional_render/copypixels NOTE: This is a candidate for the 7.10 branch. Reviewed-by: Brian Paul <[email protected]>
* st/mesa: simplify some st_context(ctx)->pipe codeBrian Paul2011-05-251-2/+2
|
* st/mesa: fix incorrect texture level/face/slice accessesBrian Paul2011-05-251-9/+15
| | | | | | | | | | If we use FBOs to access mipmap levels with glRead/Draw/CopyPixels() we need to be sure to access the correct mipmap level/face/slice. Before, we were just passing zero in quite a few places. This fixes the new piglit fbo-mipmap-copypix test. NOTE: This is a candidate for the 7.10 branch.
* st/mesa: set correct baseInternalFormat for _mesa_texstore in DrawPixelsMarek Olšák2011-05-141-3/+4
| | | | | | | | | GL_RGBA was always used for baseInternalFormat regardless of the chosen texture internal format. https://bugs.freedesktop.org/show_bug.cgi?id=37154 Reviewed-by: Brian Paul <[email protected]>
* st/mesa: remove set-but-unused variablesMarek Olšák2011-05-011-2/+0
|
* st/mesa: support EXT_packed_floatMarek Olšák2011-04-291-0/+4
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/mesa: support EXT_texture_shared_exponentMarek Olšák2011-04-291-0/+4
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/mesa: choose an appropriate texture format for DrawPixelsMarek Olšák2011-03-291-3/+49
|
* gallium: implement clamping controls (ARB_color_buffer_float)Luca Barbieri2011-03-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BTW this changes the gallium interface. Some rather cosmetic changes by Marek. Squashed commit of the following: commit 513b37d484f0318311e84bb86ed4c93cdff71f13 Author: Luca Barbieri <[email protected]> Date: Thu Aug 26 18:17:54 2010 +0200 mesa/st: respect fragment clamping in st_DrawPixels commit 546a31e42cad459d7a7a10ebf77fc5ffcf89e9b8 Author: Luca Barbieri <[email protected]> Date: Thu Aug 26 18:17:28 2010 +0200 mesa/st: support fragment and vertex color clamping commit c406514a1fbee6891da4cf9ac3eebe4e4407ec13 Author: Luca Barbieri <[email protected]> Date: Tue Aug 24 21:56:37 2010 +0200 mesa/st: expose ARB_color_buffer_float if unclamping is supported commit d0c5ea11b6f75f3da2f4ca989115f150ebc7cf8d Author: Luca Barbieri <[email protected]> Date: Thu Aug 26 17:53:41 2010 +0200 mesa/st: use unclamped colors This assumes that Gallium is to be interpreted as given drivers the responsibility to clamp these colors if necessary. commit aef5c3c6be6edd076e955e37c80905bc447f8a82 Author: Luca Barbieri <[email protected]> Date: Thu Aug 26 18:12:34 2010 +0200 mesa, mesa/st: handle read color clamping properly We set IMAGE_CLAMP_BIT in the caller based on _ClampReadColor, where the operation mandates it. (see the removed XXX comment. -Marek) TODO: did I get the set of operations mandating it right? commit 76bdfcfe3ff4145a1818e6cb6e227b730a5f12d8 Author: Luca Barbieri <[email protected]> Date: Thu Aug 26 18:18:25 2010 +0200 gallium: add color clamping to the interface