summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* readpix: allow implementation format/typeJordan Justen2013-01-201-1/+6
| | | | | | | | | For GLES2/3 allow reading of pixels with format/type based on: * GL_IMPLEMENTATION_COLOR_READ_FORMAT * GL_IMPLEMENTATION_COLOR_READ_TYPE Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Jordan Justen <[email protected]>
* extensions: enable EXT_color_buffer_float for ES3Jordan Justen2013-01-203-9/+20
| | | | | | | | | [mattst88] v2: Enable only for ES3 per spec. [mattst88] v3: Use _mesa_is_gles3 since EXT_color_buffer_float is ES3-only. Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Jordan Justen <[email protected]>
* extensions: Add ES3-only extension supportMatt Turner2013-01-201-5/+15
| | | | Reviewed-by: Ian Romanick <[email protected]>
* readpix: check FBO completeness before trying to access the read-bufferJordan Justen2013-01-201-9/+9
| | | | | Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Jordan Justen <[email protected]>
* readpix: add error checking for GLES3Jordan Justen2013-01-201-0/+56
| | | | | Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Jordan Justen <[email protected]>
* copyteximage: update error checking for GLES3Jordan Justen2013-01-201-1/+36
| | | | | | | Changes based on GTF/gles3 conformance test suite. Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Jordan Justen <[email protected]>
* copyteximage: check that sRGB usage is valid for GLES3 / GLJordan Justen2013-01-201-0/+39
| | | | | Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Jordan Justen <[email protected]>
* intel: Enable GL_OES_depth_texture_cube_mapIan Romanick2013-01-201-0/+1
| | | | | | | | | | For now I'm just enabling this on the same subset of hardware that has OpenGL 3.0 enabled. This same functionality is part of OpenGL 3.0, and there is no matching desktop extension. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa/es3: Allow unsized depth and depth-stencil formats in ES3Ian Romanick2013-01-201-2/+5
| | | | | | | | | They're part of GL_OES_depth_texture_cube_map, and we'll always enable that extension in ES3 contexts. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa/es2: Allow depth component cube maps in ES2 if the extension is enabledIan Romanick2013-01-201-1/+2
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add extension bit tracking for GL_OES_depth_texture_cube_mapIan Romanick2013-01-202-0/+2
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Array uniform name length includes length of [0]Ian Romanick2013-01-181-0/+10
| | | | | | | | | | | | | This is required by OpenGL ES 3.0 and desktop OpenGL 4.2. Previous version were ambiguous. This also matches the behavior of NVIDIA's closed-source driver (version 304.64). Fixed gles3conformance test uniform_buffer_object_getactiveuniformsiv and uniform_buffer_object_structure_and_array_element_names (on my in-progress branch that fixes a bunch of other stuff...YMMV). Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Array uniform names are supposed to have [0] appendedIan Romanick2013-01-181-0/+31
| | | | | | | | | | | | | | | | This is required by OpenGL ES 3.0 and desktop OpenGL 4.2. Previous version were ambiguous. This also matches the behavior of NVIDIA's closed-source driver (version 304.64). Fixed gles3conformance test uniform_buffer_object_getactiveuniform. Several piglit tests expect glGetActiveUniform to *not* include the [0] on the end. These tests were already failing on NVIDIA, and this change regresses them on Mesa. Patches have been sent to the piglit mailing list to fix the tests. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Refactor getting a uniform's name to a helper functionIan Romanick2013-01-183-3/+16
| | | | | | | | We currently have a bug in this code, and I don't want to fix it in two places. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Remove unused field gl_uniform_buffer_variable::BufferIan Romanick2013-01-181-1/+0
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Skip updating texgen when not doing fixed function.Eric Anholt2013-01-181-31/+39
| | | | | | | | | Between the previous commit and this one, improves GLBenchmark 2.1 offscreen performance by 0.48% +/- 0.24% (n=22, throttling outliers removed). Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Don't bother updating ff texture state if we have a fragment shader.Eric Anholt2013-01-181-1/+2
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Drop a comment about ff vertex shading and texturing.Eric Anholt2013-01-181-5/+0
| | | | | | | It's never going to have texture fetches. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix out of bounds writes when uncompressing non-block-aligned ETC1.Eric Anholt2013-01-181-2/+2
| | | | | | Fixes a crash in GLB2.1 offscreen on the glthread branch. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Add support for GL_ARB_texture_buffer_object_rgb32.Eric Anholt2013-01-181-0/+1
| | | | | | Tested with piglit ARB_texture_buffer_object/formats. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Add support for MESA_FORMAT_RGB_FLOAT32 surfaces.Eric Anholt2013-01-181-1/+1
| | | | | | | | | This is for GL_ARB_texture_buffer_object_rgb32 support, but it also causes the format to get used for float32 rgb textures as well on Ironlake and later. Since that came with some surprises, separate the change from the enable commit. Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Make intel_region's pitch be bytes instead of pixels.Eric Anholt2013-01-1821-77/+67
| | | | | | | | | | | | We almost never want a stride in pixels -- if you're doing anything with a stride, you're specifying an offset or incrementing a pointer, and in both cases you had to multiply by cpp to get the bytes value you wanted. But worse, on the way to creating a region from a new tiled BO, we divided by cpp to get pitch in pixels, and for an RGB32 buffer (an upcoming change) the pitch wouldn't divide exactly, and we'd end up with a wrong stride in our region. Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Make intel_blit.c take pitches in bytes.Eric Anholt2013-01-188-19/+15
| | | | | | As we gain support for NPOT cpp, a pitch may not divide by cpp cleanly. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Only mark textures as mipmap incomplete on MAX_LEVEL issues.Kenneth Graunke2013-01-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the OpenGL 3.2 Core Profile specification, section 3.8.12: "For one-, two-, and three-dimensional and one-and two-dimensional array textures, a texture is mipmap complete if all of the following conditions hold true: - [...] - levelbase <= levelmax [...] Using the preceding definitions, a texture is complete unless any of the following conditions hold true: - [...] - The minification filter requires a mipmap (is neither NEAREST nor LINEAR), and the texture is not mipmap complete." (This text also appears in all GL >= 3.2 specs and the ES 3.0 spec.) From this, we see that levelbase <= levelmax should only affect mipmap completeness, not base-level completeness. Prior versions of GL did not have the notion of mipmap completeness, simply calling the texture incomplete in this case. But I don't think we really care. Fixes es3conform's sgis_texture_lod_basic_completeness test. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965/vs: Store texturing results into a vec4 temporary.Kenneth Graunke2013-01-181-6/+7
| | | | | | | | | | | | | | | | The sampler appears to ignore writemasks (even when correcting the WRITEMASK_XYZW in brw_vec4_emit.cpp to the proper writemask) and just always writes all four values. To cope with this, just texture into a temporary, then MOV out into a register that has the proper number of components. NOTE: This is a candidate for stable branches. Fixes es3conform's shadow_execution_vert.test. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965/vs: Set LOD to 0 for ordinary texture() calls.Kenneth Graunke2013-01-181-2/+5
| | | | | | | | | Previously it was left undefined, causing us to select a random LOD. NOTE: This is a candidate for stable branches. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965/vs: Create a 'lod_type' temporary for ir->lod_info.lod->type.Kenneth Graunke2013-01-181-5/+8
| | | | | | | | | | This is purely a refactor. However, in a moment, we'll want to set lod_type to float for ir_tex, where ir->lod_info.lod is NULL. NOTE: This is a candidate for stable branches (for the next patch). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: Lower textureGrad() with samplerCubeShadow on pre-Haswell.Kenneth Graunke2013-01-181-6/+9
| | | | | | | | | | | | | | | | | Fixes regressions since commit 899017fc54c40c969b5239b33f3a17b311878b0d Author: Kenneth Graunke <[email protected]> Date: Fri Jan 4 07:53:09 2013 -0800 i965: Use Haswell's sample_d_c for textureGrad with shadow samplers. That patch assumed that all instances were lowered. However, we weren't lowering textureGrad() with samplerCubeShadow because I couldn't figure out the LOD calculations. It turns out they're easy: you just have to use 1 for the depth. This causes it to pass oglconform's four tests. Signed-off-by: Kenneth Graunke <[email protected]> Tested-by: Anuj Phogat <[email protected]> Tested-by: Ian Romanick <[email protected]>
* mesa/es3: Don't check dimensions in _mesa_es3_error_check_format_and_typeIan Romanick2013-01-173-12/+3
| | | | | | | | | | Filtering of DEPTH_COMPONENT and DEPTH_STENCIL for TEXTURE_3D is already done in texture_error_check because these combinations aren't allowed on desktop GL either. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa: Don't allow DEPTH_STENCIL for 3D texturesIan Romanick2013-01-171-1/+2
| | | | | | | | Just like DEPTH_COMPONENT. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* swrast: fix assorted bugs in software blit codeBrian Paul2013-01-171-10/+20
| | | | | | | | | | | | | | | | | 1. The loop over dest buffers in blit_linear() needed a null pointer check. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=59499 2. The code to grab the drawRb's format needs to be inside the drawing loop. 3. An equality test was using = instead of == thus messing up a renderbuffer attachment texture pointer. This lead to memory corruption and a crash at exit. Finally, fix a capitalization error NumDrawBuffers -> numDrawBuffers and change type to unsigned to fix signed/unsigned comparison warnings. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* st/mesa: a couple fixes for st_BlitFramebuffer()Brian Paul2013-01-161-30/+52
| | | | | | | | | | | | 1. Loop over multiple destination color buffers. If we set glDrawBuffers(GL_FRONT_AND_BACK) we need to loop over multiple color buffers, blitting to each. 2. Add checks for null src/dst surface pointers. This fixes a crash in the piglit fbo-missing-attachment-blit test. See bug http://bugs.freedesktop.org/show_bug.cgi?id=59450 Reviewed-by: Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: simplify some src/dst surface setup in BlitFramebufferBrian Paul2013-01-161-4/+4
| | | | | | Use the renderbuffer attachment pointers that we grabbed earlier. Reviewed-by: Reviewed-by: Marek Olšák <[email protected]>
* meta: add 'f' suffix to floats to silence some MSVC warningsBrian Paul2013-01-161-1/+1
|
* mesa: add missing ASSERT_OUTSIDE_BEGIN_END() in _mesa_GetInternalformativ()Brian Paul2013-01-161-0/+3
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa: add new formatquery.c file to SConscript file to fix buildBrian Paul2013-01-161-0/+1
|
* intel: Enable GL_ARB_internalformat_queryIan Romanick2013-01-152-0/+24
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: Add driver method to determine the possible sample countsIan Romanick2013-01-153-4/+44
| | | | | | | | | | | | | | Use this method in _mesa_GetInternalformativ for both GL_SAMPLES and GL_NUM_SAMPLE_COUNTS. v2: internalFormat may not be color renderable by the driver, so zero can be returned as a sample count. Require that drivers supporting the extension provide a QuerySamplesForFormat function. The later was suggested by Eric Anholt. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: Add dispatch and extension XML for GL_ARB_internalformat_queryIan Romanick2013-01-151-2/+4
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: Add extension tracking bit for GL_ARB_internalformat_queryIan Romanick2013-01-152-0/+2
| | | | | | | | | | | | Though, I'm tempted to always expose this extension when GL_ARB_framebuffer_object is exposed. In that case, it would share the same enable bit. v2: Correctly sort extension names. Suggested by Eric Anholt. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: Add skeleton implementation of glGetInternalformativIan Romanick2013-01-153-0/+160
| | | | | | | | | | This is for the GL_ARB_internalformat_query extension and GLES 3.0. v2: Generate GL_INVALID_OPERATION if the extension is not supported. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* meta: Move loop variable declaration outside for loop.Vinson Lee2013-01-151-1/+2
| | | | | | Fixes build with MSVC. Signed-off-by: Vinson Lee <[email protected]>
* mesa: move declarations before code to fix MSVC buildBrian Paul2013-01-151-4/+8
|
* mesa: Round float param in glTexparameterf() to nearest integerAnuj Phogat2013-01-151-9/+4
| | | | | | | | | | | | | | | | | | OpenGL 4.2 specification suggests rounding the float data to nearest integer when the type of internal state is integer. Out of range floats should be clamped to {INT_MIN, INT_MAX}. This is not specified anywhere in gl/gles spec but below test expects this behavior. This patch makes gles3 conformance sgis_texture_lod_basic_getter.test pass. A GL spec bug will be raised to include clamping of out of range floats. V2: Round float to nearest integer for all cases where _mesa_Texparameterf() converts float param to int. Use the same block of float to int conversion code for GL_TEXTURE_SWIZZLE_{R,G,B,A}_EXT cases as well. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Add support to allow blitting to multiple color draw buffersAnuj Phogat2013-01-151-261/+300
| | | | | | | | | | | | | | | | | | | | | This patch fixes a blitting case when drawAttachment->Texture == readAttachment->Texture. It was causing an assertion failure in intel_miptree_attach_map() with gles3 conformance test case: framebuffer_blit_functionality_minifying_blit Number of changes in this file look scary. But most of them are caused by introducing a big for loop to support rendering to multiple color draw buffers. V2: Fixed a case when number of draw buffer attachments are zero. V3: Put a for loop in blit_nearest() and blit_linear() functions in to support blitting to multiple color draw buffers. V4: Remove variable declaration in for loop to avoid MSVC compilation issues. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Add error checking in _mesa_BlitFramebuffer() for MRTsAnuj Phogat2013-01-151-47/+62
| | | | | | | | | | | | | | | | | | This patch adds required error checking in _mesa_BlitFramebuffer() when blitting to multiple color render targets. It also fixes a case when blitting to a framebuffer with renderbuffer/texture attached to GL_COLOR_ATTACHMENT{i} (where i!=0). Earlier it skips color blitting if nothing is found attached to GL_COLOR_ATTACHMENT0. V2: Fixed a case when number of draw buffer attachments are zero. V3: Do compatible_color_datatypes() and compatible_resolve_formats() check for all the draw renderbuffers in fbobject.c. Fix debug code at bottom of _mesa_BlitFramebuffer() to handle MRTs. Combine error checking code for linear blits with other color blit error checking. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix GL error generation in _mesa_GetFramebufferAttachmentParameteriv()Anuj Phogat2013-01-151-1/+28
| | | | | | | | | | | | | | This allows query on default framebuffer in glGetFramebufferAttachmentParameteriv() for gles3. Fixes unexpected GL errors in gles3 conformance test case: framebuffer_blit_functionality_multisampled_to_singlesampled_blit V2: Use _mesa_is_gles3() check to restrict allowed attachment types to specific APIs. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* intel: Support blitting to multiple color draw buffersAnuj Phogat2013-01-152-34/+63
| | | | | | | | | | | | | | | This patch enables blitting to multiple color attachments of a framebuffer. It also fixes a case when blitting to a framebuffer with renderbuffer/texture attached to non-zero attachment point i.e. GL_COLOR_ATTACHMENT{1, 2, ...}. Earlier we were incorrectly blitting to GL_COLOR_ATTACHMENT0 by default. V2: Use intel_copy_texsubimage() for blitting only if all the color attachments can blit using it. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* meta: Add functionality to do _mesa_meta_BlitFrameBuffer() using glslAnuj Phogat2013-01-151-93/+344
| | | | | | | | | | | | | | | | | | | | | | | | This patch rewrites _mesa_meta_BlitFrameBuffer() function to add support for blitting with GLSL/GLSL ES shaders. These changes were required to support glBlitFrameBuffer() in gles3. This patch, along with other patches in this series, make 16 failing framebuffer_blit test cases in gles3 conformance pass. V2: Properly handle flipped blits for source and destination renderbuffer / textures. Add support for GL_TEXTURE_RECTANGLE in _mesa_meta_BlitFrameBuffer. Create a temp depth texture to support depth buffer blitting. V3: Remove unsupported / redundant shader code. Add an assertion to make sure that we don't use rectangle texture in ES. Put API guard on glTexEnvi(). V4: For gles3: Don't use ReadPixels or CopyTexImage2D to blit depth buffer. gles3 spec says for CopyTexImage2D that "color buffer components can be dropped during the conversion to internalformat, but new components cannot be added." So, use the internal format of read renderbuffer to create texture for color buffer blitting. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix GL error generation in glBlitFramebuffer()Anuj Phogat2013-01-151-15/+49
| | | | | | | | | | | | | | | | V2: If mask has GL_STENCIL_BUFFER_BIT set, the depth formats for readRenderBuffer and drawRenderBuffer must match unless one of the two buffers doesn't have depth, in which case it's not blitted, so the format check should be ignored. Same comment goes for stencil formats in depth renderbuffers if mask has GL_DEPTH_BUFFER_BIT set. v3 (Kayden): Refactor code to be a bit more readable. Signed-off-by: Anuj Phogat <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>