summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/common
Commit message (Collapse)AuthorAgeFilesLines
* meta: remove call to _meta_in_progress(), fix multisample enable/disableBrian Paul2012-08-301-2/+31
| | | | | | | | | | | | | | | | | | | This partially reverts d638da23d2ec2e9c52655b1ea138249e7f8bcccb. With gallium the meta code is not always built so the call to _meta_in_progress() was unresolved. Simply special-case the GL_MULTISAMPLE case in the meta code. There might be other special cases in the future given all the differences between legacy GL, core GL, GLES, etc. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=54234 and https://bugs.freedesktop.org/show_bug.cgi?id=54239 v2 (Paul Berry <[email protected]>): keep _meta_in_progress function, since it's needed by the i965 driver, but don't call it from core mesa. Signed-off-by: Brian Paul <[email protected]>
* meta: add parenthesis to silence compiler warningsBrian Paul2012-08-301-2/+2
| | | | Reviewed-by: Paul Berry <[email protected]>
* meta: Don't use deprecated keyword in 1.30 shaderIan Romanick2012-08-291-1/+1
| | | | Signed-off-by: Ian Romanick <[email protected]>
* mesa: Only FRONT_AND_BACK is allowed for PolygonMode in core contextIan Romanick2012-08-291-2/+8
| | | | | | | | | | | | | Page 407 (page 423 of the PDF) of the OpenGL 3.0 spec says (in the list of deprecated functionality): "Separate polygon draw mode - PolygonMode face values of FRONT and BACK; polygons are always drawn in the same mode, no matter which face is being rasterized." Also modify meta to not use FRONT or BACK in a core context. Signed-off-by: Ian Romanick <[email protected]>
* meta: Don't stray outside the confines of the API specified in the contextPaul Berry2012-08-291-42/+58
| | | | | Signed-off-by: Paul Berry <[email protected]> Signed-off-by: Ian Romanick <[email protected]>
* meta: Add GLSL variant of _mesa_meta_GenerateMipmap() functionAnuj Phogat2012-08-291-58/+220
| | | | | | | | | | | | | | | | This reduces the overhead of using the fixed function internally in the driver. V2: Use setup_glsl_generate_mipmap() and setup_ff_generate_mipmap() functions to avoid code duplication. Use glsl version when ARB_{vertex, fragmet}_shader are present. Remove redundant code. V3: Remove redundant border related code leaving the assertion. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* meta: Don't modify GL_GENERATE_MIPMAP state when it doesn't existIan Romanick2012-08-231-2/+6
| | | | | | | | | | | | | | | | | | This is a bit of a hack. _mesa_meta_GenerateMipmap shouldn't even be used in contexts where GL_GENERATE_MIPMAP doesn't exist (i.e., core profile and ES2) because it uses fixed-function, and fixed-function doesn't exist there either! A GLSL-based _mesa_meta_GenerateMipmap should be available soon. When that is available, this patch will be irrelevant and should be reverted. v2: Change (ctx->API != API_OPENGLES2 && ctx->API != API_OPENGL_CORE) to (ctx->API == API_OPENGL || ctx->API == API_OPENGLES) based on review comment from Brian Paul. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* meta: remove unused variableBrian Paul2012-08-161-1/+1
|
* meta: allow CopyTexSubImage on integer formatsJordan Justen2012-08-141-6/+10
| | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* meta: texture rectangle textures may not have mipmapsPauli Nieminen2012-08-121-2/+4
| | | | | | | | | | | | | Avoid INVALID_OPERATION error if decompressing rectangle texture. Setting mipmap level limits for those textures is error that must not be hit by meta code to mislead user. [v3/Kayden]: Resolve conflicts due to Eric picking a subset of Pauli's original changes. Signed-off-by: Pauli Nieminen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Use sampler object for mipmap generationPauli Nieminen2012-08-121-25/+27
| | | | | | | | | | | Sampler objects are perfect for meta operations.Sampler object is separate state object that shadows the sampling state in texture object. With sampler object mipmap can maintain same sampling state for all subsequent generation requests. Signed-off-by: Pauli Nieminen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Use sampler object in framebuffer blitPauli Nieminen2012-08-011-17/+14
| | | | | | | | | | | | | | | | | Framebuffer blit needs to setup texture sampling with no reference to the user's texturing state, and a sampler object lets us avoid a bunch of changes to the user's state setup. We don't bother caching the sampler object since we're changing parameters in it based on the filtering option to glBlitFramebuffer(). Fixes piglit GL_ARB_sampler_objects/framebufferblit and rendering in l4d2 (our setting of srgb decode wasn't being respected due to the user's sampler object being active). Signed-off-by: Pauli Nieminen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* meta: Add sampler object to texture decompressionPauli Nieminen2012-08-011-20/+24
| | | | | | | | | | | Sampler objects can be used to shadow texture object state without modifying original application state. Decompression path feels a bit like path where caching shouldn't happen. But as everything else is cached already I decided to cache sampler state too. Signed-off-by: Pauli Nieminen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* meta: add support for using API_OPENGL_COREJordan Justen2012-07-301-1/+1
| | | | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* meta: fix glDrawPixels fallback test, stencil drawingBrian Paul2012-07-271-2/+2
| | | | | | | | | | | | | | | | | | Remove the check for pixel transfer ops. If any RGB/depth scale/bias is in effect, it'll be applied in the glTexImage step. If drawing stencil pixels we need to disable pixel transfer so that alpha scale/bias are not applied to the stencil data. These issues were spotted by Roland. Fixes Blender performance issues reported in http://bugs.freedesktop.org/show_bug.cgi?id=47375 NOTE: This is a candidate for the 8.0 branch. Tested-by: Barto <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: move some format helper functions to glformats.cBrian Paul2012-07-241-0/+1
|
* msaa: Make meta-ops save and restore state of GL_MULTISAMPLE.Paul Berry2012-07-022-1/+17
| | | | | | | | | | | | | | | | | | | | | | The meta-ops _mesa_meta_Clear() and _mesa_meta_glsl_Clear() need to ignore the state of GL_SAMPLE_ALPHA_TO_COVERAGE, GL_SAMPLE_ALPHA_TO_ONE, GL_SAMPLE_COVERAGE, GL_SAMPLE_COVERAGE_VALUE, and GL_SAMPLE_COVERAGE_INVERT when clearing multisampled buffers. The easiest way to accomplish this is to disable GL_MULTISAMPLE during the clear meta-ops. Note: this patch also causes GL_MULTISAMPLE to be disabled during _mesa_meta_GenerateMipmap() and _mesa_meta_GetTexImage() (since those two meta-ops use MESA_META_ALL). Arguably this isn't strictly necessary, since those meta-ops use their own non-MSAA fbo's, but it shouldn't do any harm. Fixes Piglit tests "EXT_framebuffer_multisample/clear {2,4} {color,stencil}" on i965. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* meta: Don't alter fragment color clamp in DrawPixels().Kenneth Graunke2012-07-021-1/+0
| | | | | | | | | | | | | | | | DrawPixels uses the MESA_META_CLAMP_FRAGMENT_COLOR flag to save/restore the fragment color clamp mode. This is unnecessary since it never alters it. It's also harmful: when the clamp mode is GL_FIXED_ONLY, setting this flag causes _mesa_meta_begin to force it to GL_FALSE, breaking clamping on SNORM formats. DrawPixels should use the user-specified clamp mode and not change it. Fixes Piglit's spec/ARB_color_buffer_float/GL_RGBA8_SNORM-drawpixels test on i965/Sandybridge (with SNORM render targets re-enabled). Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* meta: Cleanup the resources we allocate.Antoine Labour2012-06-121-6/+66
| | | | | | | | | | | When we have multiple shared contexts, and one of them is long-running, this will lead to never freeing those resources since they are shared. Instead, free them right away on context destruction since we know the other context isn't using them. Reviewed-by: Ian Romanick <[email protected]> NOTE: This is a candidate for the 8.0 branch.
* mesa: consolidate internal glCompressedTexSubImage1/2/3D codeBrian Paul2012-06-061-3/+1
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: consolidate internal glCompressedTexImage1/2/3D codeBrian Paul2012-06-061-3/+1
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: consolidate internal glCopyTexSubImage1/2/3D codeBrian Paul2012-06-063-71/+15
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: consolidate internal glTexSubImage1/2/3D codeBrian Paul2012-06-062-19/+6
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: consolidate internal glTexImage1/2/3D codeBrian Paul2012-06-061-3/+1
| | | | | | | The functions for handling 1D, 2D and 3D texture images were nearly identical. This folds them all together. Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Fix GL_RENDERBUFFER binding in decompress_texture_image().Kenneth Graunke2012-06-051-0/+4
| | | | | | | | | | | | | This isn't saved/restored by _mesa_meta_begin, so we need to do it manually (like we do for the read/draw framebuffers). Additionally, we neglected to re-bind before the glRenderbufferStorage call. +13 oglconforms. NOTE: This is a candidate for stable release branches. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: don't compile integer clear shaders for unsupported APIsOliver McFadden2012-05-301-1/+1
| | | | | | | | | | | | | | Discovered while running the Khronos conformance test suite and receiving "implementation error: meta program compile failed." This bug was recently introduced by the i965 clear patch set and would only be detected while using the ES2 API and only on gen6+ hardware. Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: remove ctx->Driver.ClearColor() hookBrian Paul2012-03-121-1/+0
| | | | | | | The driver Clear() function should just grab the clear color out of the context. Reviewed-by: Dave Airlie <[email protected]>
* mesa: remove ctx->Driver.ClearDepth(), ClearStencil() driver hooksBrian Paul2012-03-121-2/+0
| | | | | | | Not used by any drivers. Drivers can easily access the values from the Mesa context at glClear() time. Reviewed-by: Dave Airlie <[email protected]>
* meta: Fix compilation without FEATURE_EXT_transform_feedbackBenjamin Franzke2012-03-051-0/+6
| | | | | | | | | That is when building with --disable-opengl. Fix for commit cb045880b113b0042d8dfb7e4cdf76e6cc76c1d1. CC: Paul Berry <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* meta: Fix compilation without FEATURE_feedbackBenjamin Franzke2012-03-051-0/+6
| | | | | | | | | That is when building with --disable-opengl. Fix for commit c5f4024a793f1209b1693aed9a46be9374ba4741. CC: Chad Versace <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* meta: Avoid FBO resizing/reallocating in decompress_texture_imageAnuj Phogat2012-02-151-1/+1
| | | | | | | | | | Reallocate/resize decompress FBO only if texture image width/height is greater than existing decompress FBO width/height. This is a candidate for stable branches. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* meta: Add pixel store/pack operations in decompress_texture_imageAnuj Phogat2012-02-131-5/+3
| | | | | | | | | | | | | | | | | | | | This patch adds the pixel store operations in decompress_texture_image(). decompress_texture_image() is used in glGetTexImage() for compressed textures with unsigned, normalized values. It also fixes the failures in intel oglconform pxstore-gettex due to following sub test cases: - Test all mipmaps with byte swapping enabled - Test all small mipmaps with all allowable alignment values - Test subimage packing for all mipmap levels Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40864 Note: This is a candidate for stable branches Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* meta: replace abort() with _mesa_problem()Brian Paul2012-02-101-1/+2
| | | | Reviewed-by: José Fonseca <[email protected]>
* meta: Detect currently-unsupported integer CopyTexSubImage and complain.Eric Anholt2012-01-241-0/+5
| | | | | | | | | | | | | | | | This code is unprepared for handling integer (particularly, the baseFormat of the TexFormat comes out as GL_RGBA, not GL_RGBA_INTEGER, so the direct call of Driver.ReadPixels crashes due to the int vs non-int error checking not having happened). I'm frankly tempted to convert this code to MapRenderbuffer/MapTexImage rather than doing it as meta ops, now that we have that support. Improves the remaining crash in Intel oglconform for int-textures to just a rendering failure. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Brian Paul <[email protected]>
* mesa: remove ctx->Driver.Map/UnmapTexture() hooksBrian Paul2012-01-241-2/+0
| | | | No longer used anywhere.
* meta: Fallback for glBlitFramebuffer from a multisample surfaceIan Romanick2012-01-231-1/+6
| | | | | | | | NOTE: This is a candidate for the 8.0 branch. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44818
* meta: Add GL_RED/GL_RG support to meta CopyTexImage.Eric Anholt2012-01-121-1/+4
| | | | | | | Fixes some _mesa_problem()s in oglconform. Reviewed-by: Brian Paul <[email protected]> NOTE: This is a candidate for the 8.0 branch.
* meta: fix incorrect argument order in setup_texture_coords() callBrian Paul2012-01-121-1/+1
| | | | | | | | And pass integer width, height values. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]>
* mesa: rework ctx->Driver.CopyTexSubImage() parametersBrian Paul2012-01-072-18/+29
| | | | | | | | | | | Replace target, level parameters with gl_texture_image. Add gl_renderbuffer parameter to indicate source buffer for the copy. This removes some redundant code in the drivers to find the source renderbuffer and the destination texture image (which we already had in _mesa_CopyTexSubImage). Signed-off-by: Brian Paul <[email protected]>
* meta: add some 'f' suffixes to silence MSVC warningsBrian Paul2012-01-071-2/+2
|
* mesa: simplify Driver.TexSubImage() parametersBrian Paul2011-12-301-9/+9
| | | | | | | | There's no need to pass the target, level and texObj parameters since they can be easily obtained from the texImage pointer. Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* meta: Disable GL_TEXTURE_EXTERNAL_OES in meta_begin()Chad Versace2011-12-271-0/+2
| | | | | | | | If the meta flag MESA_META_TEXTURE is present, then disable the texture target GL_TEXTURE_EXTERNAL_OES. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* mesa: Pause transform feedback during meta ops.Paul Berry2011-12-231-0/+13
| | | | | | | | | Fixes piglit tests "EXT_transform_feedback/generatemipmap buffer" and "EXT_transform_feedback/generatemipmap prims_written" on i965 Gen6. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Save and restore GL_RASTERIZER_DISCARD state during meta ops.Paul Berry2011-12-231-0/+7
| | | | | | | | | | | | | | | During meta-operations (such as _mesa_meta_GenerateMipmap()), we need to be able to draw even if GL_RASTERIZER_DISCARD is enabled. This patch causes _mesa_meta_begin() to save the state of GL_RASTERIZER_DISCARD and disable it (so that drawing can be done during the meta-op), and causes _mesa_meta_end() to restore it. Fixes piglit test "EXT_transform_feedback/generatemipmap discard" on i965 Gen6. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add a function to query whether a meta-op is in progress.Paul Berry2011-12-202-0/+13
| | | | | | | This is needed by i965 to ensure that transform feedback counters are not incremented during meta-ops. Reviewed-by: Kenneth Graunke <[email protected]>
* meta: use _mesa_prepare_mipmap_level() in the mipmap generation codeBrian Paul2011-12-161-35/+12
| | | | | | | See previous commit for more information. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa/drivers: use new swrast renderbuffer functionsBrian Paul2011-12-081-3/+4
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: rewrite accum buffer supportBrian Paul2011-12-081-1/+2
| | | | | | | | | | | | | Implemented in terms of renderbuffer mapping/unmapping and format packing/unpacking functions. The swrast and state tracker code for implementing accumulation are unused and will be removed in the next commit. v2: don't use memcpy() in _mesa_clear_accum_buffer() v3: don't allocate MAX_WIDTH arrays, be more careful with mapping flags Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove the ctx->Driver.IsTextureResident() hookBrian Paul2011-12-081-1/+0
| | | | | | | No driver implemented this and we always returned "True" for residence queries. Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove TextureMemCpy driver hookBrian Paul2011-12-081-1/+0
| | | | There's probably no reason to use a special version of memcpy() anymore.