aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/common/meta.c
Commit message (Collapse)AuthorAgeFilesLines
* meta: Fix saving the results of the current occlusion queryNeil Roberts2015-02-161-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | When restoring the current state in _mesa_meta_end it was previously trying to copy the on-going sample count of the current occlusion query into the new query after restarting it so that the driver will continue adding to the previous value. This wouldn't work for two reasons. Firstly, the query might not be ready yet so the Result member will usually be zero. Secondly the saved query is stored as a pointer to the query object, not a copy of the struct, so it is actually restarting the exact same object. Copying the result value is just copying between identical addresses with no effect. The call to _mesa_BeginQuery will have always reset it back to zero. This patch fixes it by making it actually wait for the query object to be ready before grabbing the previous result. The downside of doing this is that it could introduce a stall but I think this situation is unlikely so it might not matter too much. A better solution might be to introduce a real suspend/resume mechanism to the driver interface. This could be implemented in the i965 driver by saving the depth count multiple times like it does in the i945 driver. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88248 Reviewed-by: Carl Worth <[email protected]> Cc: "10.5" <[email protected]>
* DD: Refactor BlitFramebuffer.Laura Ekstrand2015-02-021-1/+2
| | | | | | | | | In preparation for glBlitNamedFramebuffer, the DD table function BlitFramebuffer needs to accept two arbitrary framebuffer objects rather than assuming ctx->ReadBuffer and ctx->DrawBuffer. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* meta: Don't write depth when decompressing tex-imagesTopi Pohjolainen2015-01-301-1/+1
| | | | | | Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* meta/blit: Write depth only when asked forTopi Pohjolainen2015-01-301-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implementing an idea from Ken, on i965 the shader program for 2D blits becomes significantly simpler. Before: pln(8) g6<1>F g4<0,1,0>F g2<8,8,1>F { align1 1Q compacted }; pln(8) g7<1>F g4.4<0,1,0>F g2<8,8,1>F { align1 1Q compacted }; send(8) g2<1>UW g6<8,8,1>F sampler (1, 0, 0, 1) mlen 2 rlen 4 { align1 1Q }; mov(8) g123<1>F g2<8,8,1>F { align1 1Q compacted }; mov(8) g124<1>F g3<8,8,1>F { align1 1Q compacted }; mov(8) g125<1>F g4<8,8,1>F { align1 1Q compacted }; mov(8) g126<1>F g5<8,8,1>F { align1 1Q compacted }; mov(8) g127<1>F g2<8,8,1>F { align1 1Q compacted }; nop ; sendc(8) null g123<8,8,1>F render RT write SIMD8 LastRT Surface = 0 mlen 5 rlen 0 { align1 1Q EOT }; After: pln(8) g6<1>F g4<0,1,0>F g2<8,8,1>F { align1 1Q compacted }; pln(8) g7<1>F g4.4<0,1,0>F g2<8,8,1>F { align1 1Q compacted }; send(8) g124<1>UW g6<8,8,1>F sampler (1, 0, 0, 1) mlen 2 rlen 4 { align1 1Q }; sendc(8) null g124<8,8,1>F render RT write SIMD8 LastRT Surface = 0 mlen 4 rlen 0 { align1 1Q EOT }; v2 (Matt): Removed unintended white-space change Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* meta/blit: Add plumbing for shaders without depthTopi Pohjolainen2015-01-301-1/+2
| | | | | | | | | Currently all blit programs are unconditionally compiled with gl_FragDepth. Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* meta: Put _mesa_meta_in_progress in the header fileIan Romanick2015-01-141-10/+0
| | | | | | | | | | | | | | | ...so that it can be inlined in the two places that call it. On Bay Trail-D using Fedora 20 compile flags (-m64 -O2 -mtune=generic for 64-bit and -m32 -march=i686 -mtune=atom for 32-bit), affects Gl32Batch7: 32-bit: No difference proven at 95.0% confidence (n=120) 64-bit: Difference at 95.0% confidence 1.24042% +/- 0.382277% (n=40) Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* main: Renamed _mesa_get_teximage to _mesa_GetTexImage_sw.Laura Ekstrand2015-01-081-1/+1
| | | | | | | | This reflects the new naming convention for software fallbacks. To avoid confusion with ARB_DIRECT_STATE_ACCESS backend functions, software fallbacks now have the form _mesa_[Driver function name]_sw. Reviewed-by: Anuj Phogat <[email protected]>
* meta: init var to silence uninitialized variable warningBrian Paul2015-01-051-1/+1
|
* meta: Only use _mesa_ClipControl if the extension is supportedIan Romanick2014-10-241-4/+7
| | | | | | | | | Fixes many piglit failures on IVB since 85edaa8. Signed-off-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85425 Reviewed-by: Jason Ekstrand <[email protected]> Cc: Mathias Fröhlich <[email protected]>
* mesa: Handle clip control in meta operations.Mathias Fröhlich2014-10-241-0/+6
| | | | | | | | | | | Restore clip control to the default state if MESA_META_VIEWPORT or MESA_META_DEPTH_TEST is requested. v3: Handle clip control state with MESA_META_TRANSFORM. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Froehlich <[email protected]>
* meta: s/INLINE/inline/Brian Paul2014-09-041-1/+1
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Make MESA_META_DRAW_BUFFERS restore properlyKristian Høgsberg2014-09-021-34/+4
| | | | | | | | | | | | | | | | | | | | A meta begin/end pair with MESA_META_DRAW_BUFFERS will change visible GL state. We recreate the draw buffer enums from the buffer bitfield, which changes GL_BACK to GL_BACK_LEFT (and GL_FRONT to GL_FRONT_LEFT). This commit modifes the save/restore logic to instead copy the buffer enums from the gl_framebuffer and then set them on restore using _mesa_drawbuffers(). It's not clear how this breaks the benchmark in 82796, but fixing meta to not leak the state change fixes the regression. No piglit regressions. Reviewed-by: Kenneth Graunke <[email protected]> Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=82796 Signed-off-by: Kristian Høgsberg <[email protected]> Cc: [email protected]
* i965,meta: Stop unlocking the texture to try and prevent deadlocks.Kenneth Graunke2014-08-201-18/+0
| | | | | | | | | | Unlocking the texture is not safe: another thread could come in and grab it. Now that we use a recursive mutex, this should work. This also fixes texture lock deadlocks in the new meta fast clear path. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Tested-by: Chris Forbes <[email protected]>
* meta: Use instanced rendering for layered clears.Kenneth Graunke2014-08-151-16/+5
| | | | | | | | | Layered rendering is part of OpenGL 3.2; GL_ARB_draw_instanced is part of OpenGL 3.1. As such, all drivers supporting layered rendering already support gl_InstanceID. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* meta: Export _mesa_meta_drawbuffers_from_bitfield()Kristian Høgsberg2014-08-151-3/+3
| | | | | | | We'll use this in the i965 fast clear implementation. Signed-off-by: Kristian Høgsberg <[email protected]> Reviewed-by: Connor Abbott <[email protected]>
* mesa/meta: Support decompressing floating-point formatsNeil Roberts2014-08-121-31/+66
| | | | | | | | | | | | | Previously the Meta implementation of glGetTexImage would fall back to _mesa_get_teximage if the texturing is not using an unsigned normalised format. However in order to support the half-float formats of BPTC textures we can make it render to a floating-point renderbuffer instead. This patch makes decompression_state have two FBOs, one for the GL_RGBA format and one for GL_RGBA32F. If a floating-point texture is encountered it will try setting up a floating-point FBO. It will now also check the status of the FBO and fall back to _mesa_get_teximage if the FBO is not complete. Reviewed-by: Ian Romanick <[email protected]>
* mesa/meta: Make _mesa_meta_bind_fbo_image also take a framebuffer targetJason Ekstrand2014-08-111-16/+22
| | | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Neil Roberts <[email protected]>
* meta: Fix datatype computation in get_temp_image_type()Anuj Phogat2014-08-041-5/+4
| | | | | | | | | | | | | | Changes in the patch will cause datatype to be computed correctly for 8 and 16 bit integer formats. For example: GL_RG8I, GL_RG16I etc. Fixes many failures in gles3 Khronos CTS test: copy_tex_image_conversions_required copy_tex_image_conversions_forbidden Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* meta: Move the call to _mesa_get_format_datatype() out of switchAnuj Phogat2014-08-041-7/+3
| | | | | Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* meta: Use _mesa_get_format_bits() to get the GL_RED_BITSAnuj Phogat2014-08-041-2/+3
| | | | | | | | | | | | | We currently get red bits from ctx->DrawBuffer->Visual.redBits by making a false assumption that the texture we're writing to (in glCopyTexImage2D()) is used as a DrawBuffer. Fixes many failures in gles3 Khronos CTS test: copy_tex_image_conversions_required Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* meta: Initialize the variable in declaration statementAnuj Phogat2014-08-041-3/+1
| | | | | | | Saves one line of code :) Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* util: Move ralloc to a new src/util directory.Kenneth Graunke2014-08-041-1/+1
| | | | | | | | | | | | | | | | | | For a long time, we've wanted a place to put utility code which isn't directly tied to Mesa or Gallium internals. This patch creates a new src/util directory for exactly that purpose, and builds the contents as libmesautil.la. ralloc seemed like a good first candidate. These days, it's directly used by mesa/main, i965, i915, and r300g, so keeping it in src/glsl didn't make much sense. Signed-off-by: Kenneth Graunke <[email protected]> v2 (Jason Ekstrand): More realloc uses and some scons fixes Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* meta: Add a meta implementation of GL_ARB_clear_textureNeil Roberts2014-07-231-0/+189
| | | | | | | | | | | | | | | | | | | | Adds an implementation of the ClearTexSubImage driver entry point that tries to set up an FBO to render to the texture and then calls glClearBuffer with a scissor to perform the actual clear. If an FBO can't be created for the texture then it will fall back to using _mesa_store_ClearTexSubImage. When used in combination with _mesa_store_ClearTexSubImage this should provide an implementation that works for all DRI-based drivers. However as this has only been tested with the i965 driver it is currently only enabled there. v2: Only enable the extension for the i965 driver instead of all DRI drivers. Remove an unnecessary goto. Don't require GL_ARB_framebuffer_object. Add some more comments. v3: Use glClearBuffer* to avoid having to modify glClearColor and friends. Handle sRGB textures. Explicitly disable dithering. Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
* meta: Add a state flag for the GL_DITHERNeil Roberts2014-07-231-0/+8
| | | | | | | | | The Meta implementation of glClearTexSubImage is going to want to ensure that dithering is disabled so that it can get a consistent color across the whole texture when clearing. This adds a state flag to easily save it and set it to the default value when performing meta operations. Reviewed-by: Topi Pohjolainen <[email protected]>
* meta: Call glObjectLabel before linking.Kenneth Graunke2014-07-091-1/+1
| | | | | | | | | | | i965 precompiles shaders at link time, and prints a disassembly if INTEL_DEBUG=vs,gs,fs, including the shader name. However, blit shaders were showing up as "unnamed" since we hadn't set a name prior to linking. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: Make unreachable macro take a string argument.Matt Turner2014-07-011-2/+1
| | | | | | To aid in debugging. Reviewed-by: Ian Romanick <[email protected]>
* meta: Use AMD_vertex_shader_layer instead of a GS for layered clears.Kenneth Graunke2014-06-301-37/+16
| | | | | | | | | | | | | | | | | | | | | | | On i965, enabling and disabling the GS is not free: you have to do a full pipeline stall, reconfigure the URB and push constant space, and emit a bunch of state. Most clears aren't layered, so the GS isn't needed in the common case. But we turned it on universally. Using AMD_vertex_shader_layer allows us to skip setting up the GS altogether, while achieving the same effect. According to Ilia, current nVidia GPUs can't do AMD_vertex_shader_layer. However, since nouveau is Gallium-based, they're unlikely to ever care about this path. Intel and AMD GPUs both support the extension. Since i965 is the only driver using this path which does layered rendering, we may as well target it at that. v2: Improve commit message. No code changes. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* meta: Respect the driver's maximum number of draw buffersIan Romanick2014-06-181-2/+2
| | | | | | | | | | | | | | | Commit c1c1cf5f9 added infrastructure for saving and restoring draw buffer state. However, it universially used MAX_DRAW_BUFFERS, but many drivers support far fewer than that at limit. For example, the radeon and i915 drivers only support 1. Using MAX_DRAW_BUFFERS causes meta to generate GL errors. Signed-off-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80115 Reviewed-by: Kenneth Graunke <[email protected]> Tested-by: Kenneth Graunke <[email protected]> [on Broadwell] Tested-by: [email protected] Cc: "10.2" <[email protected]>
* mesa: Mark default case unreachable to silence warning.Matt Turner2014-06-171-0/+1
| | | | | | | | Warned about 'coord' being undefined in the default case, which is unreachable. Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* meta: Label the meta GLSL clear program.Kenneth Graunke2014-06-101-0/+1
| | | | | | | | | Giving the meta clear program a meaningful name makes it easier to find in output such as INTEL_DEBUG=fs or INTEL_DEBUG=shader_time. We already did so for integer programs, but neglected to label the primary program. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* meta: Use gl_FragColor to output color values to all the draw buffersAnuj Phogat2014-05-211-11/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _mesa_meta_setup_blit_shader() currently generates a fragment shader which, irrespective of the number of draw buffers, writes the color to only one 'out' variable. Current shader rely on an undefined behavior and possibly works by chance. From OpenGL 4.0 spec, page 256: "If a fragment shader writes to gl_FragColor, DrawBuffers specifies a set of draw buffers into which the single fragment color defined by gl_FragColor is written. If a fragment shader writes to gl_FragData, or a user-defined varying out variable, DrawBuffers specifies a set of draw buffers into which each of the multiple output colors defined by these variables are separately written. If a fragment shader writes to none of gl_FragColor, gl_FragData, nor any user defined varying out variables, the values of the fragment colors following shader execution are undefined, and may differ for each fragment color." OpenGL 4.4 spec, page 463, added an additional line in this section: "If some, but not all user-defined output variables are written, the values of fragment colors corresponding to unwritten variables are similarly undefined." V2: Write color output to gl_FragColor instead of writing to multiple 'out' variables. This'll avoid recompiling the shader every time draw buffers count is updated. Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Refactor _mesa_meta_setup_blit_shader() to avoid duplicate shader codeAnuj Phogat2014-05-211-53/+48
| | | | | | | Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Avoid _swrast_BlitFramebuffer in the meta CopyTexSubImage code.Kenneth Graunke2014-05-191-6/+6
| | | | | | | | | | | | | | | This is a replacement for bd44ac8b5ca08016bb064b37edaec95eccfdbcd5 that should actually work. Fixes Piglit's copyteximage-border on swrast, as well as one of es3conform's packed_pixels_pixelstore test. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78546 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77705 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chris Forbes <[email protected]> Cc: "10.2" <[email protected]>
* meta: Split _swrast_BlitFramebuffer out of the meta blit path.Kenneth Graunke2014-05-191-5/+5
| | | | | | | | | | | | | | | | | | Separating the software fallbacks from the rest of the meta path (which is usually hardware accelerated) gives callers better control over their blitting options. For example, i965 might want to try meta blit, hardware blits, then swrast as a last resort. Splitting it makes that possible. This updates all callers to maintain the existing behavior (even in the few cases where it isn't desirable behavior - later patches can change that). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chris Forbes <[email protected]> Cc: "10.2" <[email protected]>
* meta: Merge compiling and linking of blit programTopi Pohjolainen2014-05-121-16/+29
| | | | | | Cc: "10.2" <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Only clear the requested color buffers.Kenneth Graunke2014-05-061-2/+49
| | | | | | | | | | | | | | | | | | | | | This path is used to implement both glClear and glClearBuffer; the latter is only supposed to clear particular buffers. Core Mesa provides us that information in the buffers bitmask; we must only clear buffers mentioned there. To accomplish this, we save/restore the color draw buffers state, and use glDrawBuffers to restrict drawing to the relevant buffers. Fixes Piglit's spec/!OpenGL 3.0/clearbuffer-mixed-formats and spec/ARB_framebuffer_object/fbo-drawbuffers-none glClearBuffer tests for drivers using meta clears (such as Broadwell). Cc: "10.2" <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77852 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77856 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* meta: Add infrastructure for saving/restoring the DrawBuffers state.Kenneth Graunke2014-05-061-0/+39
| | | | | | | | | | Sometimes we need to configure what draw buffers we render to, without creating a new FBO. This path will make that possible. Cc: "10.2" <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* meta: Add a new MESA_META_DRAW_BUFFERS bit.Kenneth Graunke2014-05-061-2/+3
| | | | | | | | | | | This will be used for saving/restoring the glDrawBuffers state. For now, make sure that existing users of MESA_META_ALL don't get the new bit, since they probably won't want it. Cc: "10.2" <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* meta: Unify the GLSL and fixed-function clear paths.Kenneth Graunke2014-05-061-102/+51
| | | | | | | | | | | | | The majority of _mesa_meta_Clear and _mesa_meta_glsl_Clear was the same; adding a boolean for whether to use GLSL allows us to share most of it without polluting either path too much. Tested for regressions by hacking i965 to always use the non-GLSL path. Cc: "10.2" <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa/sso: Enable GL_ARB_separate_shader_objects by defaultIan Romanick2014-05-021-6/+4
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* meta: Fix saving the program pipeline stateIan Romanick2014-05-021-33/+53
| | | | | | | | | | | | | | | | | | This code was broken in some odd ways before. Too much state was being saved, it was being restored in the wrong order, and in the wrong way. The biggest problem was that the pipeline object was restored before restoring the programs attached to the default pipeline. Fixes a regression in the glean texgen test. v3: Fairly significant re-write. I think it's much cleaner now, and it avoids a bug with some meta ops that use shaders (reported by Chia-I). v4: Check Pipeline.Current against NULL instead of Pipeline.Default. Suggested by Chia-I. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Chia-I Wu <[email protected]>
* mesa: Replace use of _ReallyEnabled as a boolean with use of _Current.Eric Anholt2014-04-301-1/+1
| | | | | | | | | | | | | I'm probably not the only person that has tried to kill _ReallyEnabled. This does the mechanical part of the work, and cleans _ReallyEnabled from i965. I think that using _Current makes texture management clearer: You can't have multiple targets in use in the same texture image unit at the same time, because there's just that one pointer. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Drop _EnabledUnits.Eric Anholt2014-04-301-1/+1
| | | | | | | | | | | The field wasn't really valid, since we've got more than 32 units now. It turns out it was mostly just used for checking != 0, or checking for fixed function coordinates, though. v2: Fix mis-conversion in xm_line.c (caught by Ken). Reviewed-by: Matt Turner <[email protected]> (v1) Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Clip src/dest rects in BlitFramebuffer, using the scissorChris Forbes2014-04-171-0/+7
| | | | | | | | | | | | | | | | | Fixes piglit's fbo-blit-stretch test on drivers which use the meta path. (i965: should fix Broadwell, but also fixes Sandybridge/Ivybridge/Haswell since this test falls off the blorp path now due to format conversion) V2: Use scissor instead of just mangling the rects, to avoid texcoord rounding problems. (Thanks Marek) V3: Rebase on Eric's CTSI meta changes; re-add _mesa_update_state in the CTSI path so that _mesa_clip_blit sees the correct bounds. Signed-off-by: Chris Forbes <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77414 Reviewed-by: Anuj Phogat <[email protected]> Tested-by: Anuj Phogat <[email protected]>
* meta: Add an accelerated glCopyTexSubImage using glBlitFramebuffer.Eric Anholt2014-04-151-9/+86
| | | | | | | | | | | | | | | You'll note from the previous commits that there's something of a loop here: You call CTSI, which calls BlitFB, then if things go wrong that falls back to CTSI. As a result, meta CTSI reaches over into blitfb to tell it "no, don't try that fallback". v2: Drop the _mesa_update_state(), which was only necessary due to use of _mesa_clip_blit() in _mesa_meta_BlitFramebuffer() in another patch series. v3: Drop an _EXT suffix I copy-and-pasted. Reviewed-by: Ian Romanick <[email protected]> (v2) Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Add support for CUBE_MAP_ARRAY to generatemipmap.Eric Anholt2014-04-151-0/+4
| | | | | | | | | | I added support to bind_fbo_image in the process of building meta CopyTexSubImage, and found that it broke generatemipmap because previously we would just throw a GL error there and then end up with an incomplete FBO and fallback. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Infer bind_fbo_image parameters from an incoming image.Eric Anholt2014-04-151-2/+8
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Move bind_fbo_image() code back to meta.c, to reuse it elsewhere.Eric Anholt2014-04-151-0/+30
| | | | | | | | | I need to do the same code again for CopyTexSubImage(). v2: Drop incorrect, not-terribly-useful comment (review by Ken) Reviewed-by: Ian Romanick <[email protected]> (v1) Reviewed-by: Kenneth Graunke <[email protected]>
* mesa/sso: Add gl_pipeline_object parameter to _mesa_use_shader_programGregory Hainaut2014-03-251-3/+6
| | | | | | | | | | | | | Extend use_shader_program to support a different target. Allow to reuse the function to update the pipeline state. Note I bypass the flush when target isn't current. Maybe it would be better to create a new UseProgramStages driver function This was originally included in another patch, but it was split out by Ian Romanick. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* meta/sso: Update meta to save and restore SSO state.Gregory Hainaut2014-03-251-0/+18
| | | | | | | | | | | | | | | save and restore _Shader/Pipeline binding point. Rational we don't want any conflict when the program will be unattached. V2: formatting improvement V3 (idr): * Build fix. The original patch added calls to _mesa_use_shader_program with 4 parameters, but the fourth parameter isn't added to that function until a much later patch. Just drop that parameter for now. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>