summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Fix and speedup gl_array_object::_MaxElement computation.Mathias Fröhlich2012-01-202-139/+28
| | | | | | | | | | Use a bitmask approach to compute gl_array_object::_MaxElement. To make this work correctly depending on the shader type actually used, make use of the newly introduced typed bitmask getters. With this change I gain about 5% draw time on some osgviewer examples. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Introduce enabled bitfield helper functions.Mathias Froehlich2012-01-202-0/+41
| | | | | | | | | | Depending on the installed shader type, different arrays are used from gl_array_object. Provide helper functions that compute the bitmask of these arrays that are finally enabled for a given shader type. The will be used in a followup change. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Use BITFIELD64_RANGE for VERT_BIT_*_ALL.Mathias Fröhlich2012-01-201-5/+5
| | | | | Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Set default access flags based on the run-time APIIan Romanick2012-01-192-14/+33
| | | | | | | | | | | | | | | | | | | The default access flags for OpenGL ES (via GL_OES_map_buffer) and desktop OpenGL are different. The code previously tried to handle this, but the decision was made at compile time. Since the same driver binary can be used for both OpenGL ES and desktop OpenGL, the decision must be made at run-time. This should fix bug #44433. It appears that the test case does various map and unmap operations and inspects the state of the buffer object around each. When it sees that GL_BUFFER_ACCESS does not match its expectations, it fails. NOTE: This is a candidate for release branches. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44433
* mesa: Fix leak of uniform storage records on shader program link/free.Eric Anholt2012-01-181-0/+2
| | | | NOTE: This is a candidate for the 8.0 branch.
* mesa: use GL_MAP_INVALIDATE_RANGE_BIT in glTexImage pathsBrian Paul2012-01-182-3/+9
| | | | | | | | | | | | | Update the dd.h docs to indicate that GL_MAP_INVALIDATE_RANGE_BIT can be used with GL_MAP_WRITE_BIT when mapping renderbuffers and texture images. Pass the flag when mapping texture images for glTexImage, glTexSubImage, etc. It's up to drivers whether to actually make use of the flag. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Ian Romanick <[email protected]>
* mesa: try RGBA_FLOAT16 before RGBA_FLOAT32 when choosing A,L,LA,I formatsBrian Paul2012-01-181-0/+4
| | | | | | | | | To try to use less tex memory and maybe get better performance. Spotted by Roland Scheidegger. NOTE: This is a candidate for the 8.0 and 7.11 branches. Reviewed-by: José Fonseca <[email protected]>
* mesa: fix tex format selection for GL_R32F and other R/G float formatsBrian Paul2012-01-181-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | The i965 driver advertises GL_ARB_texture_float and GL_ARB_texture_rg support but the ctx->TextureFormatSupported[] table entries for MESA_FORMAT_R_FLOAT32 and MESA_FORMAT_RGBA_FLOAT32 are false on gen 4 hardware. So the case for GL_R32F would fail and we'd print an implementation error. This patch adds more Mesa tex format options for GL_R32F and other R/G formats so we fall back to 16-bit formats when 32-bit formats aren't available. Eric made the same fix in commit 6216a5b4 for the non R/G formats. v2: try 16-bit formats before 32-bit formats and try RG formats before RGBA where possible. This should fix https://bugs.freedesktop.org/show_bug.cgi?id=44039 NOTE: This is a candidate for the 8.0 and 7.11 branches. Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: Support GL_VERTEX_ATTRIB_ARRAY_INTEGER in GL 3.0 contexts.Kenneth Graunke2012-01-181-1/+1
| | | | | | | | | According to Table 6.8 (Page 348) in the OpenGL 3.0 specification, glGetVertexAttribiv supports GL_VERTEX_ATTRIB_ARRAY_INTEGER. NOTE: This is a candidate for the 8.0 branch. Signed-off-by: Kenneth Graunke <[email protected]>
* mesa: Add condition in glGetTexImage for zero size texturesAnuj Phogat2012-01-172-1/+14
| | | | | | | | | | | | | | | | | | | | TestMipMaps() function in src/OGLconform/textureNPOT.c calls glTexImage2D() with width = 0. Texture with zero size skips miptree allocation due to a condition in function _mesa_store_teximage3d(). While calling glGetTexImage() it results in assertion failure in intel_map_texture_image() due to null mt pointer. This patch fixes the issue by detecting the zero size texture early in glGetTexImage and glGetCompressedTexImage functions. In such a case function simply returns doing nothing. Verified that below mentioned bug is fixed by this patch. https://bugs.freedesktop.org/show_bug.cgi?id=42334 NOTE: This is a candidate for stable branches Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: update compute_version for GL3Marek Olšák2012-01-151-4/+2
| | | | | | only check ARB_fbo, add shader_texture_lod as a requirement Reviewed-by: Ian Romanick <[email protected]>
* mesa: s/GLushort/GLubyte/ in pack_ubyte_AL44()Brian Paul2012-01-131-1/+1
| | | | | | | | The AL44 format occupies one byte, not two. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]>
* mesa: Throw the required error for glCopyPixels from multisample FBO.Eric Anholt2012-01-121-0/+6
| | | | | | | Fixes piglit EXT_framebuffer_multisample/negative-copypixels. Reviewed-by: Brian Paul <[email protected]> NOTE: This is a candidate for the 8.0 branch.
* mesa: Throw the required error for glCopyTex{Sub,}Image from multisample FBO.Eric Anholt2012-01-121-0/+14
| | | | | | | Fixes piglit EXT_framebuffer_multisample/negative-copyteximage. Reviewed-by: Brian Paul <[email protected]> NOTE: This is a candidate for the 8.0 branch.
* mesa: Throw the required error for glReadPixels() from a multisampled FBO.Eric Anholt2012-01-121-0/+5
| | | | | | | Fixes piglit EXT_framebuffer_multisample-negative-readpixels. Reviewed-by: Brian Paul <[email protected]> NOTE: This is a candidate for the 8.0 branch.
* mesa: Avoid short-circuiting realloc of renderbuffers to new sample count.Eric Anholt2012-01-121-1/+2
| | | | | | | Fixes piglit EXT_framebuffer_multisample/renderbuffer-samples. Reviewed-by: Brian Paul <[email protected]> NOTE: This is a candidate for the 8.0 branch.
* mesa: remove incorrect (float) cast in mipmap do_row()Brian Paul2012-01-121-1/+1
| | | | | | | | | | | The array holds GLuint values so remove the float cast. Note, however, that to compute the average of four GLuints we really want to do (a+b+c+d)/4 but that could overflow. This change doesn't address that for now. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]>
* mesa: fix ir_variable declarationBrian Paul2012-01-121-1/+1
| | | | | | | | ir_variable is a class, not a struct. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]>
* mesa: fix incorrect float vs. int values in a few placesBrian Paul2012-01-121-3/+3
| | | | | | | | | | | In the first case, the newImage[] array contains GLuint values. In the second case, the parameter type is GLuint, but the maxDepth value is never used in this case (GL_FLOAT_32_UNSIGNED_INT_24_8_REV). Pass ~OU just to be safe. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]>
* mesa: use _mesa_is_user_fbo() and _mesa_is_winsys_fbo() functionsBrian Paul2012-01-127-48/+52
| | | | | | Rather than testing the fbo's name against zero. Reviewed-by: José Fonseca <[email protected]>
* mesa: whitespace, 80-column wrapping in buffers.cBrian Paul2012-01-121-2/+6
|
* mesa: remove obsolete comment on _mesa_dest_buffer_exists()Brian Paul2012-01-121-1/+0
|
* mesa/gallium: add FFS_DEFINED to protect ffs() from multiple definitionsBrian Paul2012-01-121-0/+4
| | | | | | | | We include both imports.h and u_math.h in the state tracker. This leads to multiple, conflicting definitions of ffs() with MSVC. Use FFS_DEFINED to skip the ffs() in u_math.h. Reviewed-by: José Fonseca <[email protected]>
* mesa: remove _mesa_ffs(), implement ffs() for non-GNU platformsBrian Paul2012-01-128-28/+21
| | | | | | | | | | | Call ffs() and ffsll() everywhere. Define our own ffs(), ffsll() functions when the platform doesn't have them. v2: remove #ifdef _WIN32, __IBMC__, __IBMCPP_ tests inside ffs() implementation. The #else clause was recursive. Reviewed-by: Kenneth Graunke <[email protected]> Tested-by: Alexander von Gluck <[email protected]>
* vbo: introduce vbo_get_minmax_indices functionYuanhan Liu2012-01-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Introduce vbo_get_minmax_indices() function to handle the min/max index computation for nr_prims(>= 1). The old code just compute the first prim's min/max index; this would results an error rendering if user called functions like glMultiDrawElements(). This patch servers as fixing this issue. As when nr_prims = 1, we can pass 1 to paramter nr_prims, thus I made vbo_get_minmax_index() static. v2: per Roland's suggestion, put the indices address compuation into vbo_get_minmax_index() instead. Also do comination if possible to reduce map/unmap count v3: per Brian's suggestion, use a pointer for start_prim to avoid structure copy per loop. Signed-off-by: Yuanhan Liu <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove const qualifier from fProg to silence warningBrian Paul2012-01-111-1/+1
| | | | The args to _mesa_reference_shader_program() can't be const.
* mesa: include uniforms.h to silence warning, remove unused varBrian Paul2012-01-111-2/+1
|
* mesa: Remove unused opengl version macroJakob Bornecrantz2012-01-111-11/+0
| | | | | Signed-off-by: Jakob Bornecrantz <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* linker: Calculate used samplers and shadow samplers in the linkerIan Romanick2012-01-112-11/+16
| | | | | | | | | | | | It used to be done in ir_to_mesa, and that was kind of a bad place. I didn't change st_glsl_to_tgsi because there is some strange stuff happening in the code that generates glDrawPixels shaders. It looked like this would break horribly if I touched anything. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* 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
|