summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: move _mesa_base_format_has_channel() into image.cBrian Paul2011-11-285-87/+92
| | | | | | This is where other format-related functions live. Reviewed-by: Eric Anholt <[email protected]>
* mesa: combine GL_TEXTURE_INTENSITY/LUMINANCE_SIZE queriesBrian Paul2011-11-281-17/+8
| | | | | | | Use the _mesa_base_format_has_channel() helper as we do for the other texture format component queries. Reviewed-by: Eric Anholt <[email protected]>
* mesa: use _mesa_base_format_has_channel() in fbobject.c queriesBrian Paul2011-11-283-45/+28
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: fix indexing error in unpack_Z32_FLOAT_X24S8()Brian Paul2011-11-281-1/+1
| | | | | | | The source array elements are 8-bytes (float + uint) so we need to multiply the src index by 2 to get the right array stride. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa/format: add mesa MESA_FORMAT_ARGB2101010_UINT support.Dave Airlie2011-11-288-0/+110
| | | | | | | | | | | | | | This format is used in the ARB_texture_rgb10_a2ui spec. It adds core mesa support, texformat + texstore support, format_unpack and fbobject.c (all patches from list merged + fixed up). also fixes some whitespace issues. Parts were: Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* image/pack: fix missing GL_BGR(A)_INTEGER support.Dave Airlie2011-11-282-0/+4
| | | | | | | These codepaths were missing the cases for BGR_INTEGER/BGRA_INTEGER. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* image: fix legal types for packed integer formats.Dave Airlie2011-11-271-2/+4
| | | | | | | | | After reading ARB_texture_rgb10_a2ui it appears the packed formats for integer types are only specified via this extension, and not via the original ones. So condition the checks on this. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* pack: fix indentation (trivial)Dave Airlie2011-11-271-1/+1
| | | | | | just saw this while looking for other problems. Signed-off-by: Dave Airlie <[email protected]>
* glapi: add ARB_texture_rgb10_a2ui support.Dave Airlie2011-11-271-1165/+1168
| | | | | | | | This just adds one enum. regenerate enums.c. Signed-off-by: Dave Airlie <[email protected]>
* mesa: add MESA_FORMAT_RGBX8888 and MESA_FORMAT_RGBX8888_REVChia-I Wu2011-11-274-6/+69
| | | | | | | | | | | | | MESA_FORMAT_RGBX8888_REV is one of the opaque pixel formats used on Android. Thanks to texture-from-pixmap, drivers may actually see texture images with this format on Android. MESA_FORMAT_RGBX8888 is added only for completeness. Reviewed-by: Brian Paul <[email protected]> [olv: Move the new formats after MESA_FORMAT_ARGB8888_REV in gl_format. I accidentally moved them to the wrong place when preparing the patch.]
* mesa: fix incorrect error message in format_unpack.cBrian Paul2011-11-231-1/+2
|
* mesa: update comment for clear_teximage_fields()Brian Paul2011-11-221-9/+2
|
* mesa: re-implement unpacking of DEPTH_COMPONENT32FMarek Olšák2011-11-231-0/+9
| | | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43122 Reviewed-by: Eric Anholt <[email protected]> Tested-by: Kai Wasserbäch <[email protected]>
* mesa: Fix unpack for MESA_FORMAT_INTENSITY_FLOAT16.Eric Anholt2011-11-221-1/+1
| | | | | | Fixes failures in i965 on fbo-blending-formats when the format is enabled. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Fall back to float16 if float32 isn't supported in ChooseTexFormat.Eric Anholt2011-11-221-0/+11
| | | | | | | Until GL 3.0, there isn't any requirement on the actual sizes of channels chosen. By falling back to 16 here, we can correctly support ARB_texture_float on original i965 hardware, which can't correctly filter 32-bit floats.
* mesa: Add fallback from RGB_FLOAT16 to RGBA_FLOAT16 before RGBA_FLOAT32.Eric Anholt2011-11-221-0/+1
| | | | | | | Not all i965 hardware can do RGB float16, and this will at least save half the memory and have expected behavior in terms of precision. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Make formats.c "datatype" values match glGetTexLevelParameter return.Eric Anholt2011-11-223-9/+14
| | | | | | | | | | | | | | | | | The formats.c code's "datatype" value is "what does this value mean", i.e. unorm or snorm or float, and is the return value from the GL_TEXTURE_RED_TYPE class of queries. The depth formats were marked as GL_UNSIGNED_INT, which is what we use for integer, and not what we should be returning from the glGetTexLevelParameter. In texstore, we were inappropriately using it as an argument to _mesa_unpack_depth_span() that was expecting a value like GL_UNSIGNED_INT or GL_UNSIGNED_SHORT. Just hardcode _mesa_unpack_depth_span()'s arguments for now, though it looks like the consumers of that interface would be happier with using MESA_FORMAT. Reviewed-by: Brian Paul <[email protected]>
* mesa: Don't report types for 0-sized components of textures.Eric Anholt2011-11-221-50/+69
| | | | | | | | | | | | | | | | | | | | The GL_TEXTURE_WHATEVER_SIZE entrypoints were checking if the specified base type of the texture allowed that channel to be present before reporting the size of the channel, so that GL_RGB didn't end up with an alpha size if the hardware driver had to store it that way. The GL_TEXTURE_WHATEVER_TYPE entrypoints weren't checking it, so you would end up with strange responses from the GL involving 0-bit floating-point alpha components in GL_RGB32F, even though it says GL_NONE as expected for other 0-sized channels. Make _TYPE check _BaseFormat the same as _SIZE, which results in fixing most of the GL_RGB* testcases of gl-3.0-required-sized-formats pass on i965. v2: Add a default case with a warning (suggestion by Brian Paul) Reviewed-by: Brian Paul <[email protected]> (v1)
* mesa: rename the AMD_conservative_depth extension flag to ARBMarek Olšák2011-11-222-3/+3
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: set the gl_FragDepth layout in the GLSL linkerMarek Olšák2011-11-191-0/+3
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: handle MapRenderbuffer() failures in glReadPixelsBrian Paul2011-11-191-0/+45
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: make slow_read_rgba_pixels() a void functionBrian Paul2011-11-191-3/+1
| | | | | | The boolean return value was ignored by the caller. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: define, use _mesa_is_cube_face() in several placesBrian Paul2011-11-194-20/+18
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* Revert "read_rgba_pixels: Don't force clamping if the renderbuffer is ↵Michel Dänzer2011-11-171-2/+1
| | | | | | | | normalized." This reverts commit b11c16752a18ef8dfb96d9f0ead6ecb62bde6773. Breaks at least luminance destination formats.
* read_rgba_pixels: Don't force clamping if the renderbuffer is normalized.Michel Dänzer2011-11-171-1/+2
| | | | | Signed-off-by: Michel Dänzer <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: initialize stencilMap, Stride if stencilRb==depthRbBrian Paul2011-11-161-0/+4
|
* mesa: Only update sampler uniforms that are used by the shader stageIan Romanick2011-11-161-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously a vertex shader that used no samplers would get updated (by calling the driver's ProgramStringNotify) when a sampler in the fragment shader was updated. This was discovered while investigating some spurious code generation for shaders in Cogs. The behavior in Cogs is especially pessimal because it ping-pongs sampler uniform settings: glUniform1i(sampler1, 0); glUniform1i(sampler2, 1); draw(); glUniform1i(sampler1, 1); glUniform1i(sampler2, 0); draw(); glUniform1i(sampler1, 0); glUniform1i(sampler2, 1); draw(); // etc. ProgramStringNotify is still too big of a hammer. Applications like Cogs will still defeat the shader cache. A lighter-weight mechanism that can work with the shader cache is needed. However, this patch at least restores the previous behavior. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: don't map depth+stencil buffer twice in glReadPixels()Brian Paul2011-11-161-3/+11
| | | | | | | | | | | In slow_read_depth_stencil_pixels_separate() we might have separate depth and stencil buffers or a combined buffer. In the later case, don't map the buffer twice. This function is used when the depth scale/bias pixel transfer values are not the defaults. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=42963 Reviewed-by: José Fonseca <[email protected]>
* mesa: do not skip att and spot calculation for infinite lightYuanhan Liu2011-11-161-63/+50
| | | | | | | | | | | | | | | | | | glspec doesn't say that we should skip the attenuation and spot calculation for infinite light(Ppli.w == 0). Instead, it gives a same formula to do the light calculation for both finite light and infinite light(see page 62 of glspec 2.1.pdf) Also from the formula (2.4) at page 62 of glspec 2.1.pdf, we can skip attenuation calculation if Ppli.w == 0. This would fix all the intel oglc l_sed fail subcases and introduces no intel oglc regressions. v2: fix an wrong intendation(comments from Brian). Signed-off-by: Yuanhan Liu <[email protected]> Acked-by: Brian Paul <[email protected]>
* mesa: make sure all lighting tables are updated before the computationYuanhan Liu2011-11-161-0/+3
| | | | | | | | | Make sure all lighting tables are updated before using the table to calculate something, say using _SpotExpTable to calculate _VP_inf_spot_attenuation. Signed-off-by: Yuanhan Liu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Fix a couple of missed conversion to arrays in format_unpack.Eric Anholt2011-11-151-11/+11
| | | | | | | | | | Fixes regression in piglit: ARB_color_buffer_float/GL_RGBA16F-getteximage ARB_color_buffer_float/GL_RGBA16F-readpixels ARB_color_buffer_float/GL_RGBA32F-getteximage ARB_color_buffer_float/GL_RGBA32F-readpixels Reviewed-by: Brian Paul <[email protected]>
* mesa: Include R/RG integer textures in _mesa_is_integer_format.Eric Anholt2011-11-151-0/+12
| | | | | | | | Fixes some spurious GL errors in the upcoming gl-3.0-required-sized-formats piglit test. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: convert unpack functions to operate on an array of valuesBrian Paul2011-11-151-630/+900
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: new BYTE/SHORT_TO_FLOATZ() macrosBrian Paul2011-11-153-42/+17
| | | | | | | Rather than redefining the BYTE/SHORT_TO_FLOAT macros, just define new ones with different names. These macros preserve zero when converting. Reviewed-by: Eric Anholt <[email protected]>
* mesa: move CEILING() macro into macros.hBrian Paul2011-11-153-7/+5
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove unused macros in macros.hBrian Paul2011-11-151-26/+0
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: consolidate cases in _mesa_components_in_format()Brian Paul2011-11-151-28/+12
| | | | | | and _mesa_sizeof_packed_type() Reviewed-by: Eric Anholt <[email protected]>
* mesa: move swrast ReadPixels code into core MesaBrian Paul2011-11-152-0/+493
| | | | | | | | The swrast ReadPixels code has no dependencies on swrast since moving to Map/UnmapRenderbuffer(). We'll be able to remove s_readpix.c and remove the state tracker's glReadPixels code next. Acked-by: Eric Anholt <[email protected]>
* mesa: remove support for software alpha buffersBrian Paul2011-11-152-376/+0
| | | | | | | | This was only used by the xlib driver to add an alpha channel to the front/window color buffer. This was no longer going to work well with the move to direct mapping of renderbuffers. Reviewed-by: Eric Anholt <[email protected]>
* mesa: replace GLstencil with GLubyteBrian Paul2011-11-155-33/+12
|
* linker: Count the number of uniform components used by a shader during linkingIan Romanick2011-11-141-0/+7
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* linker: Count the number of samplers used by a shader during linkingIan Romanick2011-11-141-0/+3
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Fix glFramebufferTexture*() for depth and stencil attachmentsChad Versace2011-11-111-3/+55
| | | | | | | | | | | | | | | | | | | | | | | This patch solves three bugs. 1. When a texture was attached to the GL_DEPTH_STENCIL_ATTACHMENT point, Mesa attached the texture only to the depth attachment point gl_framebuffer::Attachment[BUFFER_DEPTH] and failed to attach it to the stencil attachment point gl_framebuffer::Attachment[BUFFER_STENCIL] 2. When a texture was attached to the GL_DEPTH_ATTACHMENT point and then later attached to the GL_STENCIL_ATTACHMENT point, Mesa created two separate renderbuffer wrappers. This caused a GL error in glGetFramebufferAttachmentParameteriv(). 3. Same as 2, but with depth and stencil juxtaposed. Fixes Piglit test ARB_framebuffer_object/same-attachment-glFramebufferTexture2D-GL_DEPTH_STENCIL Note: This is a candidate for the stable branches. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* mesa: Make gl_VertexID be a system value like gl_InstanceID.Eric Anholt2011-11-111-0/+1
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa: replace api_noop.[ch] with vbo_noop.[ch]Brian Paul2011-11-112-1150/+0
| | | | | | None of the code in api_noop.c was used anymore. The new vbo_noop.c functions are true no-ops. They'll be used to no-op glBegin/End functions when we run out of VBO memory.
* mesa: remove ancient, unused gl_free_control_points prototoypeBrian Paul2011-11-111-4/+0
|
* mesa: silence uninitialized var warningBrian Paul2011-11-101-1/+1
|
* mesa: Add support for unpacking 32-bit integer formats to int spans.Eric Anholt2011-11-092-0/+128
| | | | | | | | | This is the inverse operation to _mesa_pack_rgba_span_int. The 16-bit code isn't done because of lack of testing and not being sure how sign extension/clamping should be handled between, say, 16-bit int and 32-bit int or uint. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Assign transform feedback varying slots in linker.Paul Berry2011-11-091-0/+13
| | | | | | | | | | | | | | | | | | | | This patch modifies the GLSL linker to assign additional slots for varying variables used by transform feedback, and record the varying slots used by transform feedback for use by the driver back-end. This required modifying assign_varying_locations() so that it assigns a varying location if either (a) the varying is used by the next stage of the GL pipeline, or (b) the varying is required by transform feedback. In order to avoid duplicating the code to assign a single varying location, I moved it into its own function, assign_varying_location(). In addition, to support transform feedback in the case where there is no fragment shader, it is now possible to call assign_varying_locations() with a consumer of NULL. Reviewed-by: Marek Olšák <[email protected]> Tested-by: Marek Olšák <[email protected]>
* mesa,glsl,mapi: Put extern "C" { ... } where appropriate.José Fonseca2011-11-0910-11/+75
| | | | | Probably a several places missing, but enough to cover all headers (in)directly included by uniform_query.cpp, and fix the MSVC build.