summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* linker: Calculate the sampler to texture target mapping during linkingIan Romanick2012-01-115-8/+8
| | | | | | | | | Track the calculated data in gl_shader_program instead of the individual assembly shaders. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Validate sampler settings using uniform storageIan Romanick2012-01-113-62/+48
| | | | | | | | | | | | | Rather than looking at the settings in individual assembly programs, look at the settings in the top-level uniform values. The old code was flawed because examining each shader stage in isolation could allow inconsitent usage across stages (e.g., bind unit 0 to a sampler2D in the vertex shader and sampler1DShadow in the fragment shader). Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Track fixed-function fragment shader as a shaderIan Romanick2012-01-113-0/+41
| | | | | | | | | | | | Previously the fixed-function fragment shader was tracked as a gl_program. This means that it shows up in the driver as a Mesa IR program instead of as a GLSL IR program. If a driver doesn't generate Mesa IR from the GLSL IR, that program is empty. If the program is empty there is either no rendering or a GPU hang. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Acked-by: Kenneth Graunke <[email protected]>
* mesa: Use static buffer for uniform nameIan Romanick2012-01-111-1/+6
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Use uniform interfaces in fixed-function fragment shader codeIan Romanick2012-01-111-5/+24
| | | | | | | | | | | Poking directly at the backing resources works only by luck. Core Mesa code should only know about the gl_uniform_storage structure. Soon other code that looks at samplers will use the gl_uniform_storage structures instead of the data in the gl_program. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Acked-by: Kenneth Graunke <[email protected]>
* mesa: add _mesa_HashNumEntries() functionBrian Paul2012-01-112-0/+23
| | | | | Useful when debugging to find the number of texture objects, shader programs, etc.
* mesa: Fix transform feedback of unsubscripted gl_ClipDistance array.Paul Berry2012-01-111-0/+2
| | | | | | | | | | | | | | | | | | | | | On drivers that set gl_shader_compiler_options::LowerClipDistance (for example i965), we need to handle transform feedback of gl_ClipDistance specially, to account for the fact that the hardware represents it as an array of vec4's rather than an array of floats. The previous way this was accounted for (translating the request for gl_ClipDistance[n] to a request for a component of gl_ClipDistanceMESA[n/4]) doesn't work when performing transform feedback on the whole unsubscripted array, because we need to keep track of the size of the gl_ClipDistance array prior to the lowering pass. So I replaced it with a boolean is_clip_distance_mesa, which switches on the special logic that is needed to handle the lowered version of gl_ClipDistance. Fixes Piglit tests "EXT_transform_feedback/builtin-varyings gl_ClipDistance[{1,2,3,5,6,7}]-no-subscript". Reviewed-by: Eric Anholt <[email protected]>
* mesa/clear: fix crashes with illegal clear tests.Dave Airlie2012-01-111-4/+11
| | | | | | | | | Mesa shouldn't call into the drivers if there are no renderbuffers bound to the attachments for the buffers to be cleared. Fixes a number of the clearbuffer-* tests on softpipe. Signed-off-by: Dave Airlie <[email protected]>
* mesa: fix cubemap depth completeness testDave Airlie2012-01-111-3/+5
| | | | | | | | This fixes the test to allow cube/depth combinations on GL3 or EXT_gpu_shader4. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: fix > vs. >> typo in EXPAND_3_8() macroBrian Paul2012-01-101-1/+1
| | | | Found by Eirik Byrkjeflot Anonsen.
* mesa: use STATIC_ASSERT in a few more placesBrian Paul2012-01-104-4/+4
|
* mesa: move _mesa_clear_accum_buffer() inside FEATURE_accum testBrian Paul2012-01-101-13/+11
| | | | | | | Fixes _mesa_clear_accum_buffer() being multiply defined if FEATURE_accum is false. Tested-by: Chih-Wei Huang <[email protected]>
* mesa: add missing color buffer datatype check for glBlitFramebuffer()Brian Paul2012-01-101-0/+44
| | | | Reviewed-By: Jose Fonseca <[email protected]>
* mesa: Bump version to 8.0 (devel)Kenneth Graunke2012-01-091-3/+3
| | | | | | | Also update the release notes to mention that Mesa 8.0 implements OpenGL 3.0. Signed-off-by: Kenneth Graunke <[email protected]>
* mesa: fix error message in _mesa_BlitFramebufferEXT()Brian Paul2012-01-091-1/+1
|
* mesa: check depth, stencil formats (not depths) in glBlitFramebufferBrian Paul2012-01-091-6/+4
| | | | | | | | | | | | We were only comparing the number of depth and stencil bits but the extension spec actually says the formats must match: The error INVALID_OPERATION is generated if BlitFramebufferEXT is called and <mask> includes DEPTH_BUFFER_BIT or STENCIL_BUFFER_BIT and the source and destination depth or stencil buffer formats do not match. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: add missing error check for linear blit of integer colorsBrian Paul2012-01-091-0/+13
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: add _mesa_unpack_ubyte_rgba_row() functionBrian Paul2012-01-092-0/+502
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: rename _mesa_unpack_int_rgba_row() to _mesa_unpack_uint_rgba_row()Brian Paul2012-01-093-5/+5
| | | | | | Since it returns uint values, not int. Reviewed-by: Eric Anholt <[email protected]>
* mesa: rework ctx->Driver.CopyTexSubImage() parametersBrian Paul2012-01-072-31/+57
| | | | | | | | | | | 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]>
* mesa: remove unused _mesa_unpack_uint_rgba_row() prototypeBrian Paul2012-01-071-5/+0
|
* mesa: add some 'f' suffixes to silence MSVC warningsBrian Paul2012-01-071-4/+4
|
* mesa: add/update comments in _mesa_copy_buffer_subdata()Brian Paul2012-01-071-1/+4
|
* mesa: remove gl_framebuffer:_DepthBuffer, _StencilBuffer fieldsBrian Paul2012-01-062-12/+0
| | | | | | | | These were used by swrast to make a combined depth+stencil buffer look like separate depth and stencil buffers. But that's no longer needed after rewriting the depth/stencil code in swrast. Reviewed-by: Eric Anholt <[email protected]>
* mesa: Fix packing of stencil bits to MESA_FORMAT_Z32_FLOAT_X24S8.Eric Anholt2012-01-061-1/+1
| | | | | | | | | We were converting our ubyte stencil value to a float. Just write it as a uint, which overwrites the X24 part of X24S8 with 0 but shouldn't matter. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Remove 'texelBytes' declarations that are only used in assertions.Vinson Lee2012-01-051-68/+34
| | | | | | | | This patch silences these GCC warnings. warning: unused variable 'texelBytes' Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Avoid segfault when getting an unbound transform feedback buffer name.Paul Berry2012-01-051-1/+1
| | | | | | | | | | | | | | | | | | | | Previously we were using gl_transform_feedback_object::Buffers[i]->Name to service an indexed get request for GL_TRANSFORM_FEEDBACK_BUFFER_BINDING. However, if no buffer has been bound, gl_transform_feedback_object::Buffers[i] is NULL, so this was causing a segfault. This patch switches to using gl_transform_feedback_object::BufferNames[i], which is equal to gl_transform_feedback_object::Buffers[i]->Name if gl_transform_feedback_object::Buffers[i] is not NULL, and 0 if it is NULL. Fixes piglit test "EXT_transform_feedback/get-buffer-state indexed_binding". Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add gl_transform_feedback_info::ComponentOffset.Paul Berry2012-01-051-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using transform feedback, there are three circumstances in which it is useful for Mesa to instruct a driver to stream out just a portion of a varying slot (rather than the whole vec4): (a) When a varying is smaller than a vec4, Mesa needs to instruct the driver to stream out just the first one, two, or three components of the varying slot. (b) In the future, when we implement varying packing, some varyings will be offset within the vec4, so Mesa will have to instruct the driver to stream out an arbitrary contiguous subset of the components of the varying slot (e.g. .yzw or .yz). (c) On drivers that set gl_shader_compiler_options::LowerClipDistance, if the client requests that an element of gl_ClipDistance be streamed out using transform feedback, Mesa will have to instruct the driver to stream out a single component of one of the gl_ClipDistance varying slots. Previous to this patch, only (a) was possible, since gl_transform_feedback_info specified only the number of components of the varying slot to stream out. This patch adds gl_transform_feedback_info::ComponentOffset, which indicates which components should be streamed out. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Remove the dead Varyings list in the program.Eric Anholt2012-01-052-6/+0
| | | | Reviewed-by: Paul Berry <[email protected]>
* mesa: Fix glGetTransformFeedbackVarying().Eric Anholt2012-01-052-27/+31
| | | | | | | | | | The current implementation was totally broken -- it was looking in an unpopulated structure for varyings, and trying to do so using the current list of varying names, not the list used at link time. v2: Fix leaking of memory into the program per re-link. Reviewed-by: Paul Berry <[email protected]>
* mesa: only map src/dest regions in _mesa_copy_buffer_subdata()Brian Paul2012-01-051-6/+7
| | | | | | | We were wastefully mapping the whole source/dest buffers before. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Yuanhan Liu <[email protected]>
* mesa: print more info in buffer_object_subdata_range_good() error messageBrian Paul2012-01-051-1/+4
|
* mesa: Add missing GL_RG_INTEGER casesIan Romanick2012-01-041-0/+39
| | | | | | | | Adds two missing '|| srcFormat == GL_RG_INTEGER' in assertions and a bunch of missing pixel converions cases. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Additional error checks for transform feedback.Paul Berry2012-01-041-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | From the EXT_transform_feedback spec: The error INVALID_OPERATION is also generated by BeginTransformFeedbackEXT if no binding points would be used, either because no program object is active or because the active program object has specified no varying variables to record. ... The error INVALID_VALUE is generated by BindBufferRangeEXT or BindBufferOffsetEXT if <offset> is not word-aligned. Fixes Piglit tests: - EXT_transform_feedback/api-errors no_prog_active - EXT_transform_feedback/api-errors interleaved_no_varyings - EXT_transform_feedback/api-errors separate_no_varyings - EXT_transform_feedback/api-errors bind_offset_offset_1 - EXT_transform_feedback/api-errors bind_offset_offset_2 - EXT_transform_feedback/api-errors bind_offset_offset_3 - EXT_transform_feedback/api-errors bind_offset_offset_5 Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Check that all buffers are bound in BeginTransformFeedback.Paul Berry2012-01-042-0/+17
| | | | | | | | | | | | | | | | | | | | | | | From the EXT_transform_feedback spec: The error INVALID_OPERATION is generated by BeginTransformFeedbackEXT if any transform feedback buffer object binding point used in transform feedback mode does not have a buffer object bound. This required adding a new NumBuffers field to the gl_transform_feedback_info struct, to keep track of how many transform feedback buffers are required by the current program. Fixes Piglit tests: - EXT_transform_feedback/api-errors interleaved_unbound - EXT_transform_feedback/api-errors separate_unbound_0_1 - EXT_transform_feedback/api-errors separate_unbound_0_2 - EXT_transform_feedback/api-errors separate_unbound_1_2 Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Fix typos in transform feedback error messages.Paul Berry2012-01-042-2/+2
| | | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove unused _mesa_init_teximage_fields() target parameterBrian Paul2012-01-045-13/+12
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Yuanhan Liu <[email protected]>
* ff_fragment_shader: Don't generate swizzles for scalar combiner inputsIan Romanick2012-01-031-6/+10
| | | | | | | | | | | There are a couple scenarios where the source could be zero and the operand could be either SRC_ALPHA or ONE_MINUS_SRC_ALPHA. For example, if the source was ZERO. This would result in something like (0).w, and a later call to ir_validate would get angry. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42517
* mesa: remove the dstX/Y/Zoffset params to _mesa_texstore() functionsBrian Paul2012-01-025-303/+109
| | | | | | | | The were always zero. When doing a sub-texture replacement we account for the dstX/Y/Zoffsets when we map the texture image. So no need to pass them into the texstore code anymore. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: simplify Driver.GetCompressedTexImage() parametersBrian Paul2011-12-303-14/+10
| | | | | Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: simplify Driver.CompressedTex[Sub]Image function parametersBrian Paul2011-12-304-154/+86
| | | | | | | | As with previous commits, the target, level and texObj info can be obtained through the texImage pointer. Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: simplify Driver.TexImage() parametersBrian Paul2011-12-305-62/+49
| | | | | | | | As with TexSubImage(), the target, level and texObj values can be obtained through the texImage pointer. Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: simplify Driver.TexSubImage() parametersBrian Paul2011-12-305-59/+47
| | | | | | | | 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]>
* mesa: Use __builtin_ffsll on Mac OS X.Vinson Lee2011-12-281-1/+1
| | | | | | | | | Fixes this GCC warning. arrayobj.c: In function '_mesa_update_array_object_max_element': arrayobj.c:310: warning: implicit declaration of function 'ffsll' Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Re-add main/bitset.h to fix classic nouveau build failure.José Fonseca2011-12-281-0/+160
| | | | | | | | bitset.h is still used by classic nouveau -- see `git grep '\<BITSET_'` -- and the state stored is too big to fit in 64bit integers (it requires approximately 87 bits), so there is no obvious alternative here. This effecively reverts commit 196800d79829a420073f762fac90090a7b416d2d.
* mesa: Remove now unused main/bitset.h.Mathias Fröhlich2011-12-281-160/+0
| | | | Signed-off-by: Mathias Froehlich <[email protected]>
* mesa: Remove remaining FEATURE_ARB_vertex_buffer_object guards.Mathias Fröhlich2011-12-286-21/+0
| | | | | | | | | Since commit 82b9661894315362f857192439bdcbc9db090387 and 34eae1c72a9b3a8eb0634cda52fca0208cd2f40d vbo support is mandatory for all drivers. So, remove the remaining FEATURE_ARB_vertex_buffer_object guards. Signed-off-by: Mathias Froehlich <[email protected]>
* mesa: Convert RENDERINPUTS* macros to GLbitfield64.Mathias Fröhlich2011-12-281-0/+6
| | | | | Signed-off-by: Mathias Froehlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: fpclassify is available on HaikuAlexander von Gluck2011-12-271-1/+1
| | | | | Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* mesa: fix signed/unsigned comparison warningsBrian Paul2011-12-261-2/+2
|