aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: remove const from glDebugMessageCallbackARB() function parameterBrian Paul2013-06-262-3/+3
| | | | | | | The new 20130624 version of glext.h removed the const qualifier on the 'userParam' parameter. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: Remove the Initialized field from framebuffers.Eric Anholt2013-06-251-2/+0
| | | | | | | | | | This existed to tell the core not to call GetBufferSize, except that even if you didn't set it nothing happened because nobody had a GetBufferSize. v2: Remove two more instances of setting the field (from Brian) Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Remove Driver.GetBufferSize and its callers.Eric Anholt2013-06-253-123/+0
| | | | | | | | Only the GDI driver set it to non-NULL any more, and that driver has a Viewport hook that should keep it limping along as well as it ever has. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Fix gl_shader_program::UniformLocationBaseScale assert.Vinson Lee2013-06-251-1/+1
| | | | | | | | | | | | commit 26d86d26f9f972b19c7040bdb1b1daf48537ef3e added gl_shader_program::UniformLocationBaseScale. According to the code comments in that commit, UniformLocationBaseScale "must be >=1". UniformLocationBaseScale is of type unsigned. Coverity reported a "Macro compares unsigned to 0" defect as well. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Move the common _mesa_glsl_compile_shader() code to glsl/.Eric Anholt2013-06-211-1/+2
| | | | | | | | | | | This code had no relation to ir_to_mesa.cpp, since it was also used by intel and state_tracker, and most of it was duplicated with the standalone compiler (which has periodically drifted from the Mesa copy). v2: Split from the ir_to_mesa to shaderapi.c changes. Acked-by: Paul Berry <[email protected]> (v1) Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Move shader compiler API code to shaderapi.cEric Anholt2013-06-211-4/+38
| | | | | | | | | | | There was nothing ir_to_mesa-specific about this code, but it's not exactly part of the compiler's core turning-source-into-IR job either. v2: Split from the ir_to_mesa to glsl/ commit, avoid renaming the sh variable. Acked-by: Paul Berry <[email protected]> (v1) Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Use shared code for converting shader targets to short strings.Eric Anholt2013-06-212-22/+4
| | | | | | | | We were duplicating this code all over the place, and they all would need updating for the next set of shader targets. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Remove ir_print_visitor.h includes and usageEric Anholt2013-06-211-1/+0
| | | | | | | | | | | | | We have ir->print() to do the old declaration of a visitor and having the IR accept the visitor (yuck!). And now you can call _mesa_print_ir() safely anywhere that you know what an ir_instruction is. A couple of missing printf("\n")s are added in error paths -- when an expression is handed to the visitor, it doesn't print '\n' (since it might be a step in printing a whole expression tree). Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* mesa: wrap comments, code to 78 columns in multisample.cBrian Paul2013-06-191-6/+11
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* mesa: remove unused BITSET64 macrosBrian Paul2013-06-191-61/+0
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* mesa: Hide weirdness of 1D_ARRAY textures from Driver.CopyTexSubImage().Eric Anholt2013-06-172-6/+42
| | | | | | | | | | | | | | | | | Intel had brokenness here, and I'd like to continue moving Mesa toward hiding 1D_ARRAY's ridiculousness inside of the core, like we did with MapTextureImage. Fixes copyteximage 1D_ARRAY on intel. There's still an impedance mismatch in meta when falling back to read and texsubimage, since texsubimage expects coordinates into 1D_ARRAY as (width, slice, 0) instead of (width, 0, slice). v2: Fix offset of scanline reads from the source. (Thanks Brian!), replace dd.h comment with Paul's text and replace early exit with an assert. Reviewed-by: Brian Paul <[email protected]> (v1) Reviewed-by: Kenneth Graunke <[email protected]> (v1) Reviewed-by: Paul Berry <[email protected]> (v1)
* mesa: Fix ieee fp on AlphaSven Joachim2013-06-171-1/+1
| | | | | | | | | | | Commit 1f82bf12ed inadvertently broke it, checking for __IEEE_FLOAT on all Alpha machines instead of only on VMS as before. NOTE: This is a candidate for the 9.1 branch. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Andreas Boll <[email protected]> Signed-off-by: Sven Joachim <[email protected]>
* mesa: Add infrastructure for ARB_shading_language_420pack.Todd Previte2013-06-142-0/+2
| | | | | | | | v2 [mattst88] - Split infrastructure into separate patch. - Add preprocessor #define. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Fix bug in unclamped float to ubyte conversion.Manfred Ernst2013-06-121-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The IEEE float optimized version of UNCLAMPED_FLOAT_TO_UBYTE in macros.h computed incorrect results for inputs in the range 0x3f7f0000 (=0.99609375) to 0x3f7f7f80 (=0.99803924560546875) inclusive. 0x3f7f7f80 is the IEEE float value that results in 254.5 when multiplied by 255. With rounding mode "round to closest even integer", this is the largest float in the range 0.0-1.0 that is converted to 254 by the generic implementation of UNCLAMPED_FLOAT_TO_UBYTE. The IEEE float optimized version incorrectly defined the cut-off for mapping to 255 as 0x3f7f0000 (=255.0/256.0). The same bug was present in the function float_to_ubyte in u_math.h. Fix: The proposed fix replaces the incorrect cut-off value by 0x3f800000, which is the IEEE float representation of 1.0f. 0x3f7f7f81 (or any value in between) would also work, but 1.0f is probably cleaner. The patch does not regress piglit on llvmpipe and on i965 on sandy bridge. Tested-by Stéphane Marchesin <[email protected]> Reviewed-by Stéphane Marchesin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: fix OES_EGL_image_external being partially allowed in the core profileMarek Olšák2013-06-132-3/+5
| | | | Reviewed-by: Chad Versace <[email protected]>
* glsl: Add gl_shader_program::UniformLocationBaseScaleIan Romanick2013-06-123-3/+21
| | | | | | | | | | | | | | | | This is used by _mesa_uniform_merge_location_offset and _mesa_uniform_split_location_offset to determine how the base and offset are packed. Previously, this value was hard coded as (1U<<16) in those functions via the shift and mask contained therein. The value is still (1U<<16), but it can be changed in the future. The next patch dynamically generates this value. NOTE: This is a candidate for stable release branches. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-and-tested-by: Chad Versace <[email protected]>
* glsl: Add a gl_shader_program parameter to ↵Ian Romanick2013-06-123-4/+6
| | | | | | | | | | | | _mesa_uniform_{merge,split}_location_offset This will be used in the next commit. NOTE: This is a candidate for stable release branches. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-and-tested-by: Chad Versace <[email protected]>
* mesa: add missing texture strings in tex_target_name()Brian Paul2013-06-101-0/+5
| | | | And add a static assert for the future.
* dlist: fix save_SamplerParameteriChris Forbes2013-06-091-1/+1
| | | | | | | | | | This was building the temporary array to pass to save_SamplerParameteriv, and then not passing it. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Vinson Lee <[email protected]> Signed-off-by: Vinson Lee <[email protected]>
* mesa: Prevent possible out-of-bounds read by save_SamplerParameteriv.Vinson Lee2013-06-081-1/+4
| | | | | | | Fixes "Out-of-bounds access" defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Report core FBO incompleteness cases through GL_ARB_debug_output.Eric Anholt2013-06-071-18/+25
| | | | | | | | | | | | | Just like we produce from inside the Intel driver, this can help provide information quickly about FBO incompatibility problems (particularly when using apitrace replay). Currently, in driver-marked incompleteness cases, you'll get both the driver message and the core message on Intel. Until the other drivers are fixed to produce output, I think this is better than not putting in a message for driver-marked incomplete. Reviewed-by: Brian Paul <[email protected]>
* mesa: Expose MAX_FRAGMENT_INPUT_COMPONENTS on ES3 and desktop 3.2.Eric Anholt2013-06-072-0/+10
| | | | | | | | | piglit OpenGL ES 3.0/minmax now passes. This was also one of the subcase failures in OpenGL 3.2/minmax (and still is, because our value is too low for 3.2, but at least we report what it is). Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Expose texture array getters on GLES3.Eric Anholt2013-06-072-2/+10
| | | | | | | | | Part of fixing piglit OpenGL ES 3.0/minmax. v2: s/_gles3/_es3/ in extra name, for consistency (review by Matt). Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> (v1)
* mesa: Fix the return value of TEXTURE_BINDING_2D_ARRAY.Eric Anholt2013-06-071-1/+1
| | | | | | | Noticed by inspection when reviewing the next commit. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Expose texel offset limits in GLES3.Eric Anholt2013-06-072-5/+6
| | | | | | | | | Part of fixing piglit OpenGL ES 3.0/minmax. v2: s/_gles3/_es3/ in extra name, for consistency (review by Matt). Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> (v1)
* glsl: Fix uniform buffer object counting.Eric Anholt2013-06-061-1/+9
| | | | | | | | | | | | | | | | | | | | We were counting uniforms located in UBOs against the default uniform block limit, while not doing any counting against the specific combined limit. Note that I couldn't quite find justification for the way I did this, but I think it's the only sensible thing: The spec talks about components, so each "float" in a std140 block would count as 1 component and a "vec4" would count as 4, though they occupy the same amount of space. Since GPU limits on uniform buffer loads are surely going to be about the size of the blocks, I just counted them that way. Fixes link failures in piglit arb_uniform_buffer_object/maxuniformblocksize when ported to geometry shaders on Paul's GS branch, since in that case the max block size is bigger than the default uniform block component limit. Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove outdated version lines in commentsRico Schüller2013-06-05153-153/+0
| | | | Signed-off-by: Brian Paul <[email protected]>
* mesa: change MAX_PROGRAM_ADDRESS_REGS to 1, clamp to it in state trackerBrian Paul2013-06-041-1/+1
| | | | | | | | | | | | | We've never properly supported more than one address register. There isn't even a field in prog_src_register or prog_dst_register to indicate which address register to use if RelAddr!=0. In the state tracker, clamp MaxAddressRegs against MAX_PROGRAM_ADDRESS_REGS since many gallium drivers do support more. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65226 Reviewed-by: Jose Fonseca <[email protected]>
* mesa: Prevent possible out-of-bounds read by save_SamplerParameterfv.Vinson Lee2013-06-031-1/+4
| | | | | | | Fixes "Out-of-bounds access" defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/texformat: add _mesa_tex_target_is_array functionJordan Justen2013-06-022-0/+16
| | | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: handle missing read buffer in _mesa_get_color_read_format/type()Brian Paul2013-06-021-30/+48
| | | | | | | | | | | | We were crashing when GL_READ_BUFFER == GL_NONE. Check for NULL pointers and reorganize the code. The spec doesn't say which error to generate in this situation, but NVIDIA raises GL_INVALID_OPERATION. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65173 NOTE: This is a candidate for the stable branches. Tested-by: Vedran Rodic <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* mesa: fix hodge podge indentation, update comments in texformat.cBrian Paul2013-06-021-186/+184
|
* mesa: Add missing break statement in _mesa_choose_tex_format.Vinson Lee2013-05-301-0/+1
| | | | | | | | Fixes "Missing break in switch" defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: fix error checking of DXT sRGB formats in _mesa_base_tex_format()Brian Paul2013-05-301-2/+4
| | | | | | | | | | | | | For formats such as GL_COMPRESSED_SRGB_S3TC_DXT1_EXT we need to have both the GL_EXT_texture_sRGB and GL_EXT_texture_compression_s3tc extensions. This patch adds the missing check for the later. Found when checking out https://bugs.freedesktop.org/show_bug.cgi?id=65173 NOTE: This is a candidate for the stable branches. Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: asst. whitespace, formatting fixes in teximage.cBrian Paul2013-05-301-28/+43
|
* mesa: Implement ext_framebuffer_multisample_blit_scaled extensionAnuj Phogat2013-05-303-6/+32
| | | | | | Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Delete the ctx->Array._RestartIndex derived state.Kenneth Graunke2013-05-294-12/+3
| | | | | | | | | | | | It's incorrect and isn't used any longer. v2: Actually flush vertices/flag _NEW_TRANSFORM on RestartIndex change. NOTE: This is a candidate for the 9.1 branch. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Ignore fixed-index primitive restart in ArrayElement().Kenneth Graunke2013-05-291-1/+1
| | | | | | | | | | | | GL_PRIMITIVE_RESTART_FIXED_INDEX is only supposed to apply to glDrawElements*. This code is for legacy drawing paths and display lists, so it shouldn't apply. NOTE: This is a candidate for the 9.1 branch. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Add a helper function for determining the restart index.Kenneth Graunke2013-05-292-0/+26
| | | | | | | | | | | | | | | | | | The derived state approach currently used (_RestartIndex) doesn't work: in the GL_PRIMITIVE_RESTART_FIXED_INDEX case, the restart index depends on the index buffer's data type, and that isn't known until draw time. The existing code also fails to obey the GL 4.3 rules which say that FIXED_INDEX takes precedence over normal primitive restart. This helper function correctly determines the restart index, and will replace the derived state. NOTE: This is a candidate for the 9.1 branch. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: fix GLSL program objects with more than 16 samplers combinedMarek Olšák2013-05-283-26/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | The problem is the sampler units are allocated from the same pool for all shader stages, so if a vertex shader uses 12 samplers (0..11), the fragment shader samplers start at index 12, leaving only 4 sampler units for the fragment shader. The main cause is probably the fact that samplers (texture unit -> sampler unit mapping, etc.) are tracked globally for an entire program object. This commit adapts the GLSL linker and core Mesa such that the sampler units are assigned to sampler uniforms for each shader stage separately (if a sampler uniform is used in all shader stages, it may occupy a different sampler unit in each, and vice versa, an i-th sampler unit may refer to a different sampler uniform in each shader stage), and the sampler-specific variables are moved from gl_shader_program to gl_shader. This doesn't require any driver changes, and it fixes piglit/max-samplers for gallium and classic swrast. It also works with any number of shader stages. v2: - converted tabs to spaces - added an assertion to _mesa_get_sampler_uniform_value Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: declare UniformBufferBindings as an array with a static sizeMarek Olšák2013-05-283-9/+7
| | | | | | | | Some Gallium drivers were crashing, because the array was not large enough. v2: clamp the per-shader maximum in st/mesa, then sum them all up NOTE: This is a candidate for the stable branches.
* mesa: Remove extension checking from ChooseTexFormat.Eric Anholt2013-05-211-651/+533
| | | | | This should already be handled by _mesa_base_tex_format() calls in TexImage*.
* mesa: Add ChooseTexFormat support for the new XBGR formats.Eric Anholt2013-05-211-0/+10
|
* mesa: Make FinishRenderTexture just take the renderbuffer being finished.Eric Anholt2013-05-172-4/+4
| | | | | | | Now that the rb has a reference to the teximage, we didn't need anything else out of the attachment. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Track the TexImage being rendered to in the gl_renderbuffer.Eric Anholt2013-05-175-26/+14
| | | | | | | | | We keep having to pass the attachments around with our gl_renderbuffers because that's the only way to find what the gl_renderbuffer actually refers to. This is a step toward removing that (though drivers still need the Zoffset as well). Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Make gl_renderbuffers backed by EGL images use FinishRenderTexture.Eric Anholt2013-05-172-9/+24
| | | | | | | | | | | | | This is the opportunity that radeon and intel drivers rely on for flushing render targets that may get reused as textures. Before EGL, that only happened for GL_TEXTURE attachments. Fixes piglits: KHR_gl_renderbuffer_image/renderbuffer-texture OES_EGL_image/renderbuffer-texture NOTE: This is a candidate for the 9.1 branch. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Stop clamping stencil reference value at specification timeChris Forbes2013-05-151-9/+0
| | | | | | | | | | | | All drivers now clamp this to the appropriate range for the bound stencil buffer when emitting stencil state. NOTE: This is a candidate for stable branches. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Use accessor for stencil reference values in glGetChris Forbes2013-05-152-2/+6
| | | | | | | | | NOTE: This is a candidate for stable branches. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: add accessor for effective stencil refChris Forbes2013-05-151-0/+14
| | | | | | | | | | | | | | Clamps the stencil reference value to the range representable in the currently-bound draw framebuffer's stencil attachment. V2: Add spec quote. NOTE: This is a candidate for stable branches. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* extensions: add AMD_vertex_shader_layerJordan Justen2013-05-132-1/+3
| | | | | | | | | | This extension will require driver support, so it must be enabled by the driver. http://www.opengl.org/registry/specs/AMD/vertex_shader_layer.txt Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>