summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* st/mesa: Add a GLSL IR to TGSI translator.Bryan Cain2011-08-018-183/+4767
| | | | | | | | | | It is still a work in progress at this point, but it produces working and reasonably well-optimized code. Originally based on ir_to_mesa and st_mesa_to_tgsi, but does not directly use Mesa IR instructions in TGSI generation, instead generating TGSI from the intermediate class glsl_to_tgsi_instruction. It also has new optimization passes to replace _mesa_optimize_program.
* st/mesa: fix indentation, whitespaceBrian Paul2011-06-141-69/+74
|
* st/mesa: replace st->ctx with ctxBrian Paul2011-06-147-69/+80
|
* st/mesa: fix comments, whitespaceBrian Paul2011-06-141-3/+4
|
* st/mesa: improved is_interleaved_arrays() checkingBrian Paul2011-06-141-31/+19
| | | | | | | | | | | | | | Check that the difference in array pointers/offsets from the 0th array are less than the stride, for both VBOs and user-space arrays. Previously, we were only doing this for the later. This tightens up the interleaved array test and fixes a problem with the llvmpipe driver where we were creating way too many vertex fetch variants only because the pipe_vertex_element::src_offset values were changing frequently. This change results in a 5x speed-up for one of the viewperf tests. Also, clean up the function to make it easier to understand.
* r600c: add tiling support for evergreen+Alex Deucher2011-06-141-45/+95
| | | | Signed-off-by: Alex Deucher <[email protected]>
* mesa: Switch generate_mipmaps_compressed() to using TexImage2D to upload.Eric Anholt2011-06-144-69/+52
| | | | | | | | | | | | | The code was playing fast and loose with rowstrides, which meant that if a driver chose anything different for its alignment requirements, the generated mipmaps came out garbage. Unlike the uncompressed case, we can't generate mipmaps directly into image->Data, so by using TexImage2D we cut out most of the weird logic that existed to generate in-place into ->Data. The up/downside is that the driver recovery code for the fact that _mesa_generate_mipmaps whacked ->Data has to be turned off for compressed now. Fixes 6 piglit tests about compressed mipmap gen.
* mesa: Remove uncompressed code from generate_mipmaps_compressed().Eric Anholt2011-06-141-100/+77
|
* mesa: Remove compressed code from generate_mipmaps_uncompressed().Eric Anholt2011-06-141-114/+4
|
* mesa: Split _mesa_generate_mipmap along compressed/uncompressed lines.Eric Anholt2011-06-141-26/+225
| | | | | | | | | | The path taken is wildly different based on this (do we generate from a temporary image, or from level-1's data), and we appear to have stride bugs in the compressed case that are tough to disentangle. This just duplicates the code for the moment, the followon commit will do the actual changes. Only real code change here is handling maxLevel in one common place.
* intel: Fix miptree height alignment for compressed NPOT textures.Eric Anholt2011-06-141-4/+2
| | | | | | This is effectively just "round up when dividing by 4" compared to the previous code. Fixes the broken stripe at the top of fbo-generatemipmap-formats GL_EXT_texture_compression_rgtc.
* intel: Drop dead preinitialization of align_w, align_h.Eric Anholt2011-06-141-1/+1
|
* intel: Drop the cpp argument to intel_miptree_create().Eric Anholt2011-06-145-22/+5
|
* intel: Calculate compress_byte in intel_miptree_create.Eric Anholt2011-06-145-26/+18
| | | | One less argument and thing to get wrong.
* intel: Use the gl_format to get the base_format for miptree create.Eric Anholt2011-06-145-5/+1
| | | | One less argument to this insanely long function call.
* intel: Drop the internal_format field of the mipmap tree.Eric Anholt2011-06-145-15/+4
| | | | This has been replaced with the gl_format now.
* intel: Make the intel_miptree_match_image format check more specific.Eric Anholt2011-06-142-12/+3
| | | | | | | | We don't care just about the internalFormat/cpp/compressed, but about the specific format chosen. We have no support for format translations as part of texture validation, and furthermore it has restrictions in the GL specification. However, we should be making consistent decisions for this check anyway.
* i915: Drop dead argument to translate_texture_format().Eric Anholt2011-06-142-6/+3
|
* intel: Add block alignment for RGTC textures.Eric Anholt2011-06-144-32/+18
| | | | | We were using the default 4x2 alignment instead of the 4x4 required for RGTC textures.
* intel: Add the MESA_FORMAT as a field of the miptree.Eric Anholt2011-06-145-4/+14
| | | | | We only had internal_format before, which is way more irritating to work with.
* intel: Fix 2x2 and 1x1 compressed teximages from _mesa_generate_mipmap()Eric Anholt2011-06-141-5/+12
| | | | | | | | | | Generally image uploads to a the region occur at TexImage time, but that's not the case for fallback _mesa_generate_mipmap(), and in this path we were forgetting to align the width when dividing height. We were just leaving out parts of the compressed block at 2x2 and 1x1 levels. Fixes gen-compressed-teximage.
* meta: Fix glCopyTexImage(GL_LUMINANCE) from non-GL_LUMINANCE source.Eric Anholt2011-06-131-0/+14
| | | | | | | glReadPixels() was performing RGB -> L conversion differently from the glTexImage() style conversion appropriate for glCopyTexImage(). Fixes gles2conform copy_texture.
* intel: Fix mipmap and format handling of blit glCopyPixels().Eric Anholt2011-06-131-45/+53
| | | | Fixes fbo-mipmap-copypix.
* intel: Do the drawable x/y offset in intel_renderbuffer_map() for spans.Eric Anholt2011-06-131-64/+27
| | | | | | | | | | | We were mapping the renderbuffer once, then walking over all the buffers to map just the texture ones using the other texture mapping function that handled the x/y offset to the image in the region. But then we would go and overwrite *those* mappings with the original mappings for depth/stencil, which was wrong. Instead, just walk over the attachments once and map the attachments. Wasn't that easy?
* intel: Use rb->Data and rb->RowStride to handle spans Y flipping.Eric Anholt2011-06-131-7/+4
| | | | | | | | This is already pointing at 0 or Height - 1 and with an appropriate pitch, so no need to recompute those values per customization of the spans code. Cuts 3 out of 21kb of the compiled size. Reviewed-by: Chad Versace <[email protected]>
* intel: Clean up intel_render_texture with a rename and a helper function.Eric Anholt2011-06-131-10/+6
| | | | | | | | | | The "newImage" isn't particularly new -- it might be the same texture that was attached to the same attachment point before. This function also gets called when just rebinding back to an FBO with a texture attachment. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* intel: Move the draw_x/draw_y to the renderbuffer where it belongs.Eric Anholt2011-06-1312-80/+97
| | | | | | | | | | | | | | | | It was originally located in the region because the tracking of depth/color buffers was on the regions, and getting back to the irb would have been tricky. Now, we're keying off of the renderbuffer in more places, which means we can move these fields where they belong. This could fix potential rendering failure with a single texture having multiple images attached to different renderbuffers across shareCtx (as far as I can tell, this was the only failure we could cause, since anything else should trigger intel_render_texture in between, for example a BindFramebuffer). Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* dri: include swrast.h, not s_texrender.hBrian Paul2011-06-132-2/+2
|
* mesa: move texrender.c to swrastBrian Paul2011-06-138-44/+35
| | | | | | | This stuff is really for software rendering, it's not core Mesa. A small step toward pushing the FetchTexel() stuff down into swrast. Reviewed-by: Eric Anholt <[email protected]>
* vbo: minor simplification in print_draw_arrays() debug functionBrian Paul2011-06-131-4/+4
|
* mesa: move invariant code out of loop in get_tex_rgba()Brian Paul2011-06-131-14/+14
|
* st/mesa: rebind vertex arrays if _NEW_BUFFER_OBJECT is dirtyMarek Olšák2011-06-131-1/+2
| | | | | | This fixes piglit/vbo-bufferdata. It's a regression in 7.11. Reviewed-by: Brian Paul <[email protected]>
* i965: Add support for GL_FIXED vertex attributes.Eric Anholt2011-06-104-1/+41
| | | | | | | | | This sadly requires work in the VS to rescale them, because the hardware doesn't support this format natively. Fixes arb_es2_compatibility-fixed-type and gtf/fixed_data_type. Reviewed-by: Ian Romanick <[email protected]>
* Fix format not a string literal error with -Werror=format-securityEugeni Dodonov2011-06-101-1/+1
| | | | | | | A trivial fix for error: format not a string literal and no format arguments with compiling with -Werror=format-security flags. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/brw: Fix emit_depthbuffer() when packed depth/stencil texture is attachedChad Versace2011-06-101-11/+5
| | | | | | | | | | | | | If either depth or stencil buffer has packed depth/stencil format, then do not use separate stencil. Before this commit, emit_depthbuffer() incorrectly assumed that the texture's stencil renderbuffer wrapper was a *separate* stencil buffer, because the depth and stencil renderbuffer wrappers are distinct for depth/stencil textures (that is, depth_irb != stencil_irb). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38134 Signed-off-by: Chad Versace <[email protected]>
* i965/gen6: Add support for gl_PointCoord.Eric Anholt2011-06-091-0/+3
| | | | | | | | | This is just like PointSprite overrides, but it's always on for that attribute. Fixes glsl-fs-pointcoord, gtf/point_sprites. Acked-by: Kenneth Graunke <[email protected]>
* i965/gen6: Fix point sprite texture coordinate overrides.Eric Anholt2011-06-091-7/+7
| | | | | | | | We were assuming that the input attribute n to the FS was FRAG_ATTRIB_TEXn, which happened to be true often enough for our testcases. Acked-by: Kenneth Graunke <[email protected]>
* i965/gen6: Refactor SF setup a bit to handle overrides in one place.Eric Anholt2011-06-091-19/+24
| | | | Acked-by: Kenneth Graunke <[email protected]>
* mesa: get rid of homegrown logbase2 implementation in driversRoland Scheidegger2011-06-092-28/+2
| | | | | Some of the logbase2 functions did just the same as _mesa_logbase2, though they were taking signed numbers (but it shouldn't matter for them).
* mesa: fix gcc version check for _mesa_bitcountRoland Scheidegger2011-06-091-3/+3
| | | | The version check was bogus, and only inside a non-gcc block anyway.
* mesa: use __builtin_clz for logbase2 when availableRoland Scheidegger2011-06-092-20/+24
| | | | | Also rename to _mesa_logbase2 and move to imports.h to keep the ugly ifdef GNUC stuff outside other files (also to allow reuse).
* i965/gen7: Call gen7_create_constant_surface instead of brw_[...].Kenneth Graunke2011-06-083-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes 17 piglit tests: - glsl-vs-arrays-3 - glsl-vs-texturematrix-2 - glsl-vs-uniform-array-2 - arl - nv-arl - nv-init-zero-addr - vp-address-01 - vp-arl-constant-array - vp-arl-constant-array-huge - vp-arl-constant-array-huge-offset - vp-arl-constant-array-huge-offset-neg - vp-arl-constant-array-huge-relative-offset - vp-arl-constant-array-huge-varying - vp-arl-env-array - vp-arl-local-array - vp-arl-neg-array - vp-arl-neg-array-2 Fixes 4 glean tests: - glsl1-constant array of vec4 with variable indexing, vertex shader - glsl1-constant array with variable indexing, vertex shader - glsl1-constant array with variable indexing, vertex shader (2) - vp1-ARL test Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965/gen7: Enable SIMD16 fragment shader dispatch.Kenneth Graunke2011-06-081-2/+6
| | | | | Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965/gen7: Don't emit 3DSTATE_GS_SVB_INDEX on Ivybridge.Kenneth Graunke2011-06-081-7/+9
| | | | | | | | | | According to vol2a.07, it only applies from Cantiga to Sandybridge. I found this in my ringbuffers while investigating various GPU hangs. While it may not have been the cause, it seemed wise to remove it. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965/gen7: Program stencil buffers on Ivybridge.Kenneth Graunke2011-06-081-19/+42
| | | | | | | | Thanks to Chad's hard work implementing separate stencil and HiZ support, this is entirely straightforward. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965/gen7: Add a prepare_depthbuffer function.Kenneth Graunke2011-06-081-0/+15
| | | | | | | We need to call add_validated_bo to do proper aperture space accounting. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965/gen7: gen7_emit_depthbuffer needs the _NEW_DEPTH dirty bit.Kenneth Graunke2011-06-081-1/+2
| | | | | | | For ctx->Depth.Mask. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965/gen7: Remove stencil renderbuffer from gen7_depth_format.Kenneth Graunke2011-06-081-3/+0
| | | | | | | | Since Gen7 doesn't support packed depth/stencil, the stencil buffer can't possibly be relevant for determining the depth format. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* st/mesa: more helpful debug message in destroy_program_variants_cb()Brian Paul2011-06-081-2/+2
|
* intel: Request DRI2 buffers for separate stencil and hizChad Versace2011-06-083-14/+444
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When it is sensible to do so, 1) intelCreateBuffer() now attaches separate depth and stencil buffers to the framebuffer it creates. 2) intel_update_renderbuffers() requests for the framebuffer a separate stencil buffer (DRI2BufferStencil). The criteria for "sensible" is: - The GLX config has nonzero depth and stencil bits. - The hardware supports separate stencil. - The X driver supports separate stencil, or its support has not yet been determined. If the hardware supports hiz too, then intel_update_renderbuffers() also requests DRI2BufferHiz. If after requesting DRI2BufferStencil we determine that X driver did not actually support separate stencil, we clean up the mistake and never ask for DRI2BufferStencil again. CC: Ian Romanick <[email protected]> CC: Kristian Høgsberg <[email protected]> Acked-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Chad Versace <[email protected]>