summaryrefslogtreecommitdiff
path: root/src/mesa
AgeCommit message (Collapse)AuthorFilesLines
2012-01-13mesa: Bump version number to 8.0-rc1mesa-8.0-rc1Jakob Bornecrantz1-1/+1
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-01-13mesa: Throw the required error for glCopyPixels from multisample FBO.Eric Anholt1-0/+6
Fixes piglit EXT_framebuffer_multisample/negative-copypixels. Reviewed-by: Brian Paul <brianp@vmware.com> NOTE: This is a candidate for the 8.0 branch. (cherry picked from commit 9be6654c1f75bc402c807ec0caccebde032afa59)
2012-01-13mesa: Throw the required error for glCopyTex{Sub,}Image from multisample FBO.Eric Anholt1-0/+14
Fixes piglit EXT_framebuffer_multisample/negative-copyteximage. Reviewed-by: Brian Paul <brianp@vmware.com> NOTE: This is a candidate for the 8.0 branch. (cherry picked from commit 6950a4faf650fe119ee97aa18b006eed099038be)
2012-01-13mesa: Throw the required error for glReadPixels() from a multisampled FBO.Eric Anholt1-0/+5
Fixes piglit EXT_framebuffer_multisample-negative-readpixels. Reviewed-by: Brian Paul <brianp@vmware.com> NOTE: This is a candidate for the 8.0 branch. (cherry picked from commit 86b7c6707f915b07347070901d602917bc25dd0f)
2012-01-13mesa: Avoid short-circuiting realloc of renderbuffers to new sample count.Eric Anholt1-1/+2
Fixes piglit EXT_framebuffer_multisample/renderbuffer-samples. Reviewed-by: Brian Paul <brianp@vmware.com> NOTE: This is a candidate for the 8.0 branch. (cherry picked from commit 0e8d156c3cd70a67c99a82e42e7875f69b6a5b94)
2012-01-13meta: Add GL_RED/GL_RG support to meta CopyTexImage.Eric Anholt1-1/+4
Fixes some _mesa_problem()s in oglconform. Reviewed-by: Brian Paul <brianp@vmware.com> NOTE: This is a candidate for the 8.0 branch. (cherry picked from commit f83756f80f509fc51030853f8aa0fef3309fe886)
2012-01-13i965/gen7: Fix depth buffer rendering to tile offsets.Eric Anholt2-4/+4
Previously, we were saying that everything from the starting tile to region width+height was part of the limits of our depthbuffer, even if the tile was near the bottom of the depthbuffer. This mean that our range was not clipping to buffer buonds if the start tile was anything but the start of the buffer. In bebc91f0f3a1f2d19d36a7f1a4f7c992ace064e9, this was changed to saying that we're just rendering to a region of the size of the renderbuffer. This is great -- we get a range that should actually match what we want. However, the hardware's range checking occurs after the X/Y offset addition, so we were clipping out rendering to small depth mip levels when an X/Y offset was present. Just add tile_x/y to the width in that case -- the WM won't produce negative x/y values pre-offset, so we just need to get the left/bottom sides of the region to cover our buffer. Fixes the following Piglit regressions on gen7: spec/ARB_depth_buffer_float/fbo-clear-formats spec/ARB_depth_texture/fbo-clear-formats spec/EXT_packed_depth_stencil/fbo-clear-formats NOTE: This is a candidate for the 8.0 branch. (cherry picked from commit e6d6a10c5a2962f93d4adcd251b9a47a4e438121)
2012-01-13gen6_hiz: Don't bind GL_DRAW_FRAMEBUFFER on GLESNeil Roberts1-5/+29
When using Mesa with a GLES API, calling _mesa_FramebufferRenderbuffer with GL_DRAW_FRAMEBUFFER will report a 'user error' because get_framebuffer_target validates that this enum from the framebuffer blit extension is only used on GL. To work around it this patch makes it use the GL_FRAMEBUFFER enum instead in that case. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43418 Note: This is a candidate for the 8.0 branch. Signed-off-by: Chad Versace <chad.versace@linux.intel.com> (cherry picked from commit 9462b8447864c754252cd2580c9e1e4d36d5cc63)
2012-01-13mesa: s/GLushort/GLubyte/ in pack_ubyte_AL44()Brian Paul1-1/+1
The AL44 format occupies one byte, not two. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <jfonseca@vmware.com> (cherry picked from commit b0af16abf1153da243b856e55f59ca1945860f47)
2012-01-13osmesa: fix renderbuffer format selectionBrian Paul1-46/+42
The gl_renderbuffer::Format field wasn't always set properly. This didn't matter much in the past but with the recent swrast/renderbuffer mapping changes, core Mesa will be directly touching OSMesa colorbuffers so using the right MESA_FORMAT_x value is important. Unfortunately, there aren't MESA_FORMATs for all the possible OSmesa format/type combinations, such as GL_FLOAT / OSMESA_ARGB. If anyone runs into these we can add new Mesa formats. v2: add warnings for unsupported formats, fix ARGB_REV mix-up. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <jfonseca@vmware.com> (cherry picked from commit 540a8b2cfdedbf5a635f33c720aa795fae74e08b)
2012-01-13osmesa: fix glReadPixels, etcBrian Paul1-1/+57
Needed to implement the Map/UnmapRenderbuffer() driver hooks. This fixes glRead/Draw/CopyPixels, etc. See https://bugs.freedesktop.org/show_bug.cgi?id=44723 Note: This is a candidate for the 8.0 branch. Tested-by: Kevin Hobbs <hobbsk@ohiou.edu> (cherry picked from commit cb254b75d7d971b3f1baab45a82cedf0bd6c36c4)
2012-01-13intel: move declaration before codeBrian Paul1-1/+1
(cherry picked from commit 062a4b601edaaea193397bd5d86fea11ceec04f4)
2012-01-13intel: fix mapping of malloc'd renderbuffersBrian Paul1-0/+15
This fixes accum buffer operations. The accumulation buffer is the only malloc-based renderbuffer for the intel drivers. v2: apply x/y offset to returned pointer NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Eric Anholt <eric@anholt.net> (cherry picked from commit 6dbdc0395698de929e23b4ec1ab399e64ecfd264)
2012-01-13mesa: remove incorrect (float) cast in mipmap do_row()Brian Paul1-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 <jfonseca@vmware.com> (cherry picked from commit 003dd8adf39c964d8c7beb86955a61ceb3706ebc)
2012-01-13swrast: use BITFIELD64_BIT() macro to fix MSVC warningsBrian Paul3-5/+5
NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <jfonseca@vmware.com> (cherry picked from commit 706400f0a7a59bba89eca8e97a1ada45445ee6df)
2012-01-13mesa: fix ir_variable declarationBrian Paul1-1/+1
ir_variable is a class, not a struct. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <jfonseca@vmware.com> (cherry picked from commit decd018b992eb0f7f85338ee39083daca04885b6)
2012-01-13mesa: fix incorrect float vs. int values in a few placesBrian Paul1-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 <jfonseca@vmware.com> (cherry picked from commit a240c998ac649d79f423bb0c445993132cd56f97)
2012-01-13meta: fix incorrect argument order in setup_texture_coords() callBrian Paul1-1/+1
And pass integer width, height values. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <jfonseca@vmware.com> (cherry picked from commit 2f0fa456e31a7030c911a563b62c84d448b09800)
2012-01-13st/mesa: fix struct vs. class compilation warningBrian Paul1-1/+1
glsl_to_tgsi_visitor is earlier defined as a class, not a struct. Fixes MSVC warning. NOTE: This is a candidate for the 8.0 branch. (cherry picked from commit 9f2963b631cb2a2899fcb0eb384895fd33f9821d)
2012-01-11mesa: remove const qualifier from fProg to silence warningBrian Paul1-1/+1
The args to _mesa_reference_shader_program() can't be const. (cherry picked from commit 459a44460e4d31d69d7ff04c1000917ca7870ff3)
2012-01-11mesa: include uniforms.h to silence warning, remove unused varBrian Paul1-2/+1
(cherry picked from commit fe1b38960b44135f6557a1e7a9fb5adc66d0edbb)
2012-01-11Enable is_front_buffer_rendering variable in case of GL_FRONT_AND_BACKAnuj Phogat1-1/+1
glDrawBuffer(GL_FRONT_AND_BACK) results in to segmentation fault if intel->is_front_buffer_rendering is not enabled with GL_FRONT_AND_BACK. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44153 Reported-by: Yi Sun <yi.sun@intel.com> Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-11mesa: Remove unused opengl version macroJakob Bornecrantz1-11/+0
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-11i965: Don't use _mesa_ir_link_shader to do our dirty workIan Romanick1-7/+85
Instead, do the uniform setting and input / output mapping directly in brw_link_shader. Hurray for not generating Mesa IR! However, once the i965 driver stops calling _mesa_ir_link_shader, UsesClipDistance and UsesKill are no longer set. Ideally gen6_upload_vs_push_constants should use the gl_shader_program, but I don't see a way to propagate the information there. The other alternative, since this is the only usage, is to move gl_vertex_program::UsesClipDistance to brw_vertex_program. The compile (and precompile) stages use UsesKill to determine the cache key for the shader. This is then used to determine whether or not to compile the shader. Calculating this data during compilation is too late. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Acked-by: Kenneth Graunke <kenneth@whitecape.org> Acked-by: Eric Anholt <eric@anholt.net>
2012-01-11i965: Don't calculate masks of used FS inputsIan Romanick1-0/+15
This previously enabled some optimizations in the fragment shader (interpolation, etc.) if some input components were always 0.0 or 1.0. However, this data was generated by analyzing Mesa IR. The next patch in this series removes generation of Mesa IR for GLSL paths. When we detect that case, just set the used mask to ~0 and circumvent the optimizations. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11linker: Calculate used samplers and shadow samplers in the linkerIan Romanick3-38/+20
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 <ian.d.romanick@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11linker: Calculate the sampler to texture target mapping during linkingIan Romanick7-16/+14
Track the calculated data in gl_shader_program instead of the individual assembly shaders. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11mesa: Validate sampler settings using uniform storageIan Romanick3-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 <ian.d.romanick@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11mesa: Track fixed-function fragment shader as a shaderIan Romanick7-5/+50
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 <ian.d.romanick@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net> Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11mesa: Use static buffer for uniform nameIan Romanick1-1/+6
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11mesa: Use uniform interfaces in fixed-function fragment shader codeIan Romanick1-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 <ian.d.romanick@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net> Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11i965: Don't reallocate push constant URB space on new VS programs.Kenneth Graunke3-10/+26
The gen7_urb atom depends on CACHE_NEW_VS_PROG and CACHE_NEW_GS_PROG, causing gen7_upload_urb() to be called when switching to a new VS program. In addition to partitioning the URB space between the VS and GS, gen7_upload_urb() also allocated space for VS and PS push constants. Unfortunately, this meant that whenever CACHE_NEW_VS was flagged, we'd reallocate the space for the PS push constants. According to the BSpec, after sending 3DSTATE_PUSH_CONSTANT_ALLOC_PS, we must reprogram 3DSTATE_CONSTANT_PS prior to the next 3DPRIMITIVE. Since our URB allocation for push constants is entirely static, it makes sense to split it out into its own atom that only subscribes to BRW_NEW_CONTEXT. This avoids reallocating the space and trashing constants. Fixes a rendering artifact in Extreme Tuxracer, where instead of a snow trail, you'd get a bright red streak (affectionately known as the "bloody penguin bug"). This also explains why adding VS-related dirty bits to gen7_ps_state made the problem disappear: it made 3DSTATE_CONSTANT_PS be emitted after every 3DSTATE_PUSH_CONSTANT_ALLOC_PS packet. NOTE: This is a candidate for the 7.11 branch. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38868 Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-01-11i965: Fix compiler warning from uninitialized "success" value.Eric Anholt1-1/+1
This shouldn't happen, because the DDX should only load this driver if IS_965. But better to do something defined in that case.
2012-01-11i965/gen7: Fix segfault in transform feedback to DYNAMIC_DRAW buffers.Eric Anholt1-2/+3
Fixes piglit EXT_transform_feedback/buffer-usage.
2012-01-11i965/vs: Try to emit more components of constant vectors at once.Eric Anholt1-2/+27
We were naively emitting each component at a time, even if we were emitting the same value to multiple channels. Improves on a codegen regression from the old VS to the new VS on some unigine shaders (because we emit constant vecs/matrices as immediates instead of loading them as push constants, so we had over 4x the instructions for using them). shader-db results: Total instructions: 58594 -> 58540 11/870 programs affected (1.3%) 765 -> 711 instructions in affected programs (7.1% reduction)
2012-01-11mesa: add _mesa_HashNumEntries() functionBrian Paul2-0/+23
Useful when debugging to find the number of texture objects, shader programs, etc.
2012-01-11xlib: stop calling XShmQueryVersion()Brian Paul1-8/+8
It caused an X protocol error in some (rare) situations. This is a follow-on to the previous commits which fixes a bug reported by Wayne E. Robertz. NOTE: This is a candidate for the 7.11 branch. Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-01-11xlib: call register_with_display() in Fake_glXChooseFBConfig()Brian Paul1-0/+3
as we do in Fake_glXChooseVisual(). This registers the MesaGLX extension on the display so we can clean up buffers, etc. when the display connection is closed. Fixes a bug reported by Wayne E. Robertz. NOTE: This is a candidate for the 7.11 branch. Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-01-11st/mesa: rename translate_texture_target, and make translate_opcode static.Dave Airlie3-8/+5
As suggested by Brian. Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11glsl_to_tgsi: add support for shadow cube map sampling.Dave Airlie2-2/+4
This along with the TGSI support lets the piglit sampler-cube-shadow test pass on softpipe. Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11mesa: Fix transform feedback of unsubscripted gl_ClipDistance array.Paul Berry1-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 <eric@anholt.net>
2012-01-11st_extensions: fixup GLSL 1.30 related enables (v3)Dave Airlie2-9/+33
This just fixes up the enables for native integers and EXT_texture_integer support in st/mesa. It also set the MaxClipPlanes to 8. We should consider exposing caps for MCP vs MCD, but since core mesa doesn't care yet maybe we can wait for now. v2: use 32-bit formats as per Marek's mail. v3: add calim's fix for INT_DIV_TO_MUL_RCP disabling. Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11st_glsl_to_tgsi: use ISSG and fixup IABSDave Airlie1-4/+4
It doesn't look like the GLSL compiler will produce sign op for an unsigned anyways (seems insane anyways). Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11mesa/clear: fix crashes with illegal clear tests.Dave Airlie1-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 <airlied@redhat.com>
2012-01-11mesa: fix cubemap depth completeness testDave Airlie1-3/+5
This fixes the test to allow cube/depth combinations on GL3 or EXT_gpu_shader4. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-10i965: Claim to support 4 multisamples on gen6+.Eric Anholt1-0/+8
We're not quite ready to actually support it in the implementation, but at least this allows GL 3.0 API-reliant applications to hopefully run successfully, though they won't get multisampling. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-10i965: Increase the number of array texture levels to the hardware limit.Eric Anholt1-5/+6
The EXT_texture_array required only 64, but GL 3.0 required 256. Since we're already exposing values that can get us way beyond our ability to map the single object directly, go ahead and expose all the way to hardware limits. Tested with new piglit EXT_texture_array/maxlayers on gen7. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-10i965: Fix compiler warnings from hiz changes.Eric Anholt2-4/+0
2012-01-10i965/gen7: Fix batch length for 3DSTATE_HIER_DEPTH_BUFFERChad Versace1-2/+2
Change from 5 to 3. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-10i965/gen7: Enable HiZChad Versace5-13/+76
This patch modifies all batches needed for HiZ. The batch length for 3DSTATE_HIER_DEPTH_BUFFER is also corrected from 4 to 3. Performance +6.7% on Citybench. num-frames: 400 resolution: 1918x1031 avg-hiz-off: 127.90 fps avg-hiz-on: 136.50 fps kernel: git://people.freedesktop.org/~anholt/linux.git branch=gen7-reset-sol sha=23360e4 Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>