aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
...
* mesa: add texobj support for ARB_texture_multisampleChris Forbes2013-03-0210-22/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds the new texture targets, and per-image state for GL_TEXTURE_SAMPLES and GL_TEXTURE_FIXED_SAMPLE_LOCATIONS. V2: - Allow multisample texture targets in glInvalidateTexSubImage too. This was already partly there, but I missed it the first time around since the interaction is defined in a newer extension. Fixed weird indentation. - Allow multisample array textures in glFramebufferTextureLayer. This was overlooked as the tests originally only used 2d multisample textures. V3: - Set min/mag filters sensibly for multisample textures. This can't actually be changed by the user, so it's more sensible to initialize it correctly than to hack around it being bogus later. V4: - Tidy up initial min/mag filter setup. Setup in _mesa_initialize_texture_object was bogus, but benign since finish_texture_init() clobbered everything with correct values. For V4, just do the setup in finish_texture_init(). V5: - Don't break glPopAttrib(GL_TEXTURE_BIT) Signed-off-by: Chris Forbes <[email protected]> [V2] Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glapi: add ARB_texture_multisampleChris Forbes2013-03-025-4/+57
| | | | | | | | | | | | | | | | | | | | Adds new enums, dispatch machinery, and stubs for the 4 new entrypoints. V2: - Drop placeholder - Align enum values - Remove explicit exec=mesa; it *is* the dispatch flavor we want, but it's also the default. I misunderstood how this worked before; after actually reading the generator it makes good sense. V3: - Squash in stubs for new entrypoints, and dispatch_sanity tweaks, so we don't get build breakage between those patches. V4: - Fix various remaining whitespace issues Signed-off-by: Chris Forbes <[email protected]> [1/3 V2] Reviewed-by: Matt Turner <[email protected]> [V3] Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* intel: Use the new "ctx" local variable I just added some more.Eric Anholt2013-03-011-2/+2
| | | | Reviewed-and-tested-by: Ian Romanick <[email protected]>
* i965: Make sRGB-capable framebuffers by default.Eric Anholt2013-03-012-3/+63
| | | | | | | | | | | | | The GLX extension lets you expose visuals that explicitly guarantee you that the GL_FRAMEBUFFER_SRGB_CAPABLE flag will be set, but we can set the flag even while the visual doesn't provide the guarantee. This appears to be consistent with other implementations, as we've seen several apps now that don't require an srgb visual and assume sRGB will work without checking the GL_FRAMEBUFFER_SRGB_CAPABLE flag. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55783 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60633 Reviewed-and-tested-by: Ian Romanick <[email protected]>
* intel: Fix software copying of miptree faces for weird formats.Eric Anholt2013-03-013-61/+77
| | | | | | | | | | | Now that we have W-tiled S8, we can't just region_map and poke at bits -- there has to be some swizzling. Rely on intel_miptree_map to get that job done. This should also get the highest performance path we know of for the mapping (interesting if I get around to finishing movntdqa some day). v2: Fix stale name of the bit in a comment. Reviewed-by: Chad Versace <[email protected]>
* intel: Add a flag for miptree mapping to disable transcoding.Eric Anholt2013-03-012-4/+17
| | | | | | | | I want to reuse intel_miptree_map() to replace some region mapping that's broken for separate stencil, but doing so would result in new demands on ETC transcode that we actually don't want to happen. Reviewed-by: Chad Versace <[email protected]>
* i965: Add WARN_ONCE for depthstencil workarounds we shouldn't be hitting.Eric Anholt2013-03-012-0/+6
| | | | Reviewed-by: Chad Versace <[email protected]>
* intel: Enable __DRI_API_OPENGL_CORE api with dri2 contextsJordan Justen2013-02-281-0/+2
| | | | | | | | | | | | | Without this set, dri_util.c:dri2CreateContextAttribs will reject requests to create a context with __DRI_API_OPENGL_CORE. This prevents a 3.2 core profile context from being created even when MESA_GL_OVERRIDE_VERSION=3.2 is used. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel: update max versions based on MESA_GL_VERSION_OVERRIDEJordan Justen2013-02-281-0/+10
| | | | | | | | | If the override is version is >= 3.1, then update the max_gl_core_version. Otherwise, update max_gl_compat_version. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa version: add _mesa_get_gl_version_overrideJordan Justen2013-02-282-27/+70
| | | | | | | | | This will allow other code to get access to the override version before a context is available. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Put immediate operand as src2Matt Turner2013-02-281-1/+1
| | | | | | | | Immediate operands can only be src2 in 2-source instructions. Fixes piglit failures since 0a1d145e (oops!). Spotted-by: Eric Anholt <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* intel: Remove intel_mipmap_tree::wraps_etcChad Versace2013-02-282-21/+3
| | | | | | | | | | | | | | The field was equivalent to (etc_format != MESA_FORMAT_NONE), and therefore duplicate information. This patch removes field and replaces all references to it with `etc_format != MESA_FORMAT_NONE`. No Piglit ETC test regresses on Intel Sandybridge. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Anuj Phogat <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* ir_to_mesa: Translate ir_triop_lrp to OPCODE_LRP.Matt Turner2013-02-281-2/+5
| | | | | Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vs: Assert that ir_triop_lrp was lowered.Matt Turner2013-02-281-0/+4
| | | | | Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fp: Use the LRP instruction for OPCODE_LRP.Matt Turner2013-02-281-8/+4
| | | | | Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Use the LRP instruction for ir_triop_lrp when possible.Kenneth Graunke2013-02-287-5/+75
| | | | | | | | | | | | | | | | | | | v2 [mattst88]: - Add BRW_OPCODE_LRP to list of CSE-able expressions. - Fix op_var[] array size. - Rename arguments to emit_lrp to (x, y, a) to clear confusion. - Add LRP function to brw_fs.cpp/.h. - Corrected comment about LRP instruction arguments in emit_lrp. v3 [mattst88]: - Duplicate MAD code for LRP instead of using a function pointer. - Check for != GRF instead of == IMM in emit_lrp. - Lower LRP on gen < 6. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> 1
* i965: Add support for emitting the LRP instruction.Kenneth Graunke2013-02-284-0/+4
| | | | | | | | Like MAD, this is another three-source instruction. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* glsl: Convert mix() to use a new ir_triop_lrp opcode.Kenneth Graunke2013-02-283-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | Many GPUs have an instruction to do linear interpolation which is more efficient than simply performing the algebra necessary (two multiplies, an add, and a subtract). Pattern matching or peepholing this is more desirable, but can be tricky. By using an opcode, we can at least make shaders which use the mix() built-in get the more efficient behavior. Currently, all consumers lower ir_triop_lrp. Subsequent patches will actually generate different code. v2 [mattst88]: - Add LRP_TO_ARITH flag to ir_to_mesa.cpp. Will be removed in a subsequent patch and ir_triop_lrp translated directly. v3 [mattst88]: - Move changes from the next patch to opt_algebraic.cpp to accept 3-src operations. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* i965/vs/gen7: Allow MATH instructions to have MRF as a destinationMatt Turner2013-02-281-1/+1
| | | | | | | | | total instructions in shared programs: 346873 -> 346847 (-0.01%) instructions in affected programs: 364 -> 338 (-7.14%) (All affected shaders are from Lightsmark) Reviewed-by: Eric Anholt <[email protected]>
* i965/fs/gen7: Allow MATH instructions to have MRF as a destinationMatt Turner2013-02-281-1/+1
| | | | | | | total instructions in shared programs: 1376297 -> 1375626 (-0.05%) instructions in affected programs: 35977 -> 35306 (-1.87%) Reviewed-by: Eric Anholt <[email protected]>
* i965/gen7: Relax restrictions on fake MRFsMatt Turner2013-02-281-2/+4
| | | | | | | | | | | | | Gen6 has write-only MRF registers, and for ease of implementation we paritition off 16 general purposes registers to act as MRFs on Gen7. Knowing that our Gen7 MRFs are actually GRFs, we can do things we can't do with real MRFs: - read from them; - return values directly to them from a send instruction; and - compute directly to them with math instructions. Reviewed-by: Eric Anholt <[email protected]>
* i965/fs: Remove duplicate scan_inst->mlen checkMatt Turner2013-02-281-5/+0
| | | | | | Is already checked 20 lines below. Reviewed-by: Eric Anholt <[email protected]>
* attrib: push/pop FRAGMENT_PROGRAM_ARB stateJordan Justen2013-02-281-0/+12
| | | | | | | | | | | | | | This requirement was added by ARB_fragment_program When the Steam overlay is enabled, this fixes: * Menu corruption with the Puddle game * The screen going black on Rochard when the Steam overlay is accessed NOTE: This is a candidate for the 9.0 and 9.1 branches. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* texobj: add verbose api trace messages to several routinesJordan Justen2013-02-271-0/+21
| | | | | | | | Motivated by wanting to see if GenTextures was called by an application while debugging another Steam overlay issue. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* st/mesa: remove some conditionals in update_raster_state()Brian Paul2013-02-261-15/+8
| | | | | | Just use simple assignments. Reviewed-by: Marek Olšák <[email protected]>
* i965: Fix the W value of deprecated pointcoords on pre-gen6.Eric Anholt2013-02-251-1/+18
| | | | | | | | | | | | | | When you didn't have a texcoord array bound (or a non-1 current w attrib), we were telling the fragment shader that it could just use "1" instead of doing expensive pre-gen6 math to invert it. If you drew the point with a non-1 W value, then you'd get the right size (since all the vertex computations worked), but we'd mis-interpolate the coordinate across the face. Fixes the mesa pointsprite demo on GM45. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30232 Reviewed-and-tested-by: Ian Romanick <[email protected]> Note: This is a candidate for the stable branches.
* mesa/es: NULL check in EGLImageTargetTexture2DOESTapani Pälli2013-02-251-0/+6
| | | | | | | | | check that pointer passed is valid and return error if not. Note: This is a candidate for the stable branches. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa: add missing case in _mesa_GetTexParameterfv()Tapani Pälli2013-02-251-0/+6
| | | | | | | | | | missing case GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES is required by OES_EGL_image_external extension. Note: This is a candidate for the stable branches. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* st/mesa: fix debug_printf() format string warningBrian Paul2013-02-231-1/+1
| | | | Use %td for ptrdiff_t (aka GLsizeiptrARB).
* st/mesa: fix polygon offset state translation logicBrian Paul2013-02-221-7/+3
| | | | | | | | The old logic was kind of twisted, but seemed to work in practice. Note: This is a candidate for the stable branches. Reviewed-by: José Fonseca <[email protected]>
* st/mesa: check for dummy programs in destroy_program_variants()Brian Paul2013-02-221-1/+1
| | | | | | | | | | | | | When we destroy an ARB vp/fp whose ID was gen'd but not otherwise used we get a pointer to the dummy/placeholder program. We can't destroy that one so just skip it. This only failed during context tear-down because glDeleteProgramsARB() was already aware of dummy programs. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38086 Note: This is a candidate for the stable branches. Tested-by: Andreas Boll <[email protected]>
* st/mesa: fix trimming of GL_QUAD_STRIPBrian Paul2013-02-221-1/+1
| | | | | | | | | | | | | | We sometimes convert GL_QUAD_STRIP prims into GL_TRIANGLE_STRIP, but that changes the results of the u_trim_pipe_prim() call. We need to pass the original primitive type to the trim function. Note that OpenGL's GL_x prim type values match Gallium's PIPE_PRIM_x values. Fixes a failure in the new piglit degenerate-prims test. Note: This is a candidate for the stable branches. Reviewed-by: José Fonseca <[email protected]>
* i965: Enable OpenGL ES 3.0 on Sandy BridgeIan Romanick2013-02-221-1/+1
| | | | | | | | | | Regardless of what we put in the screen structure, all of the extensions that compute_version_es2 checks are present and 3.0 will be exposed anyway. NOTE: This is a candidate for the 9.1 branch. Signed-off-by: Ian Romanick <[email protected]>
* meta: Allocate texture before initializing texture coordinatesAnuj Phogat2013-02-221-9/+8
| | | | | | | | | | | | tex->Sright and tex->Ttop are initialized during texture allocation. This fixes depth buffer blitting failures in khronos conformance tests when run on desktop GL 3.0. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=59495 Note: This is a candidate for stable branches. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa: Fix setup of ctx->Point.PointSprite for GLES2.Eric Anholt2013-02-222-2/+2
| | | | | | | | | | | The recent change for GL core broke the older setup, which broke gl_PointCoord on pre-gen6 (where gl_PointCoord is undefined if point sprites are disabled). Fixes the new piglit GLES-2.0/glsl-fs-pointcoord test. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32429 Note: This is a candidate for the stable branches. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Fix broken math on values loaded from uniform buffers on gen6.Eric Anholt2013-02-221-0/+1
| | | | | | | | | | | | In a debug build this led to assertion failures, but on a non-debug build the hardware would just reference the whole vec8 instead of the same channel 8 times. Fixes the new piglit glsl-1.40/uniform-buffer/fs-exp2. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57121 Note: This is a candidate for the stable branches Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Avoid segfault in gen6_upload_stateCarl Worth2013-02-211-1/+1
| | | | | | | | | | | | | | | This fixes a bug introduced in commit 258453716f001eab1288d99765213 and triggered whenever "rb" is NULL. Fixes at least one cause bug #59445: [SNB/IVB/HSW Bisected]Oglc draw-buffers2(advanced.blending.none) segfault https://bugs.freedesktop.org/show_bug.cgi?id=59445 (Though segfaults are still possible in that test case, but they have been present since before commit 258453716f which is what's being fixed here.) Reviewed-by: Eric Anholt <[email protected]>
* i965: Consign COORD_REPLACE VS hacks to Pre-Gen6.Paul Berry2013-02-203-11/+34
| | | | | | | | | | | | | | | | | | | | | | | | | Pre-Gen6, the SF thread requires exact matching between VS output slots (aka VUE slots) and FS input slots, even when the corresponding VS output slot is unused due to being overwritten by point coordinate replacement (glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE)). As a result, we have a special hack in the VS to ensure when any texture coordinate is subject to point coordinate replacement, it is always allocated space in the VUE, even if it isn't written to by the VS. This hack isn't needed from Gen6 onwards, since SF (Gen7: SBE) swizzling has the ability to insert the point coordinate into gl_TexCoord[] without needing a corresponding unused VUE slot. Note that no modification of SF setup code is required for this patch--get_attr_override() already does the right thing. However, we make a slight comment change to clarify why this works. In addition to eliminating unnecessary VS recompiles and saving precious URB space on Gen6+, this will save us the trouble of having to adjust this hack when we implement geometry shaders. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Don't install glEvalMesh in the beginend dispatch tableIan Romanick2013-02-203-9/+16
| | | | | | | | NOTE: This is a candidate for the 9.1 branch. Signed-off-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59740 Reviewed-by: Eric Anholt <[email protected]>
* gles2: a stub implementation for GL_EXT_discard_framebufferTapani Pälli2013-02-206-1/+64
| | | | | | | | | | | This patch implements a stub for GL_EXT_discard_framebuffer with required checks listed by the extension specification. This extension is required by GLBenchmark 2.5 when compiled with OpenGL ES 2.0 as the rendering backend. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-and-tested-by: Chad Versace <[email protected]>
* i965/fs: Enable CSE on uniform pull constant loads.Eric Anholt2013-02-191-0/+3
| | | | | | | | Improves on a major performance regression for the dolphin wii emulator from its move to using UBOs. Performance in the UBO codepath (as replayed through apitrace) is up 21.1% +/- 2.3% (n=26/29). Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Only do CSE when the dst types match.Eric Anholt2013-02-191-1/+2
| | | | | | | | | | We could potentially do some CSE even when the dst types aren't the same on gen6 where there is no implicit dst type conversion iirc, or in the case of uniform pull constant loads where the dst type doesn't impact what's stored. But it's not worth worrying about. Reviewed-by: Kenneth Graunke <[email protected]> NOTE: This is a candidate for the 9.1 branch.
* i965/fs: Delay setup of uniform loads until after pre-regalloc scheduling.Eric Anholt2013-02-193-27/+66
| | | | | | | | This should fix the register allocation explosion on the GLES 3.0 test on gen6. It also gives us an instruction that will fit our CSE handling. Reviewed-by: Kenneth Graunke <[email protected]> NOTE: This is a candidate for the 9.1 branch.
* i965/fs: Fix copy propagation with smearing.Eric Anholt2013-02-191-1/+2
| | | | | | | | | | We were correctly relaying the smear from MOV's src, but if the MOV didn't do a smear, we don't want to smash the smear value from the instruction being propagated into. Prevents a regression in the upcoming UBO change. Reviewed-by: Kenneth Graunke <[email protected]> NOTE: This is a candidate for the 9.1 branch.
* i965/fs: Add a bit more instruction dumping useful for upcoming work.Eric Anholt2013-02-191-1/+30
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Remove unused userclip flags.Paul Berry2013-02-193-5/+0
| | | | | | | | | | brw_vs_prog_data::userclip hasn't been used since commit f0cecd4 (i965: Move VUE map computation to once at VS compile time). brw_gs_prog_key::userclip_active hasn't been used since commit 9f3d321 (i965: Make the userclip flag for the VUE map come from VS prog data). Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: implement glBitmap unpacking from a PBO, for the cache pathBrian Paul2013-02-191-2/+11
| | | | | | | | | We weren't mapping the PBO when using the bitmap cache (but we had the PBO code for the non-cache path.) Fixes http://bugs.freedesktop.org/show_bug.cgi?id=61026 Note: This is a candidate for the stable branches.
* st/mesa: remove what is left from u_blitMarek Olšák2013-02-186-29/+0
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/mesa: simplify and improve CopyTexSubImageMarek Olšák2013-02-183-260/+99
| | | | | | | | | | | | | | | | | | | | It has become a bit messy. Changes: - finally correct checking for transfer ops depending on the base format - making sure the base internal format and the texture format match (we were ignoring it, but it's important for correctness) - the way-too-strict rule that both src and dst base formats must be the same was dropped; ensuring the simpler and more permissive rule mentioned above is enough - stop using util_blit_pixels; pipe->blit is flexible enough, and now that we have RGBX and red-alpha formats, pipe->blit can be used for more cases Reviewed-by: Brian Paul <[email protected]>
* st/mesa: don't do sRGB conversion in CopyTexSubImageMarek Olšák2013-02-181-2/+2
| | | | | | | | Assuming I understand EXT_texture_sRGB correctly. NOTE: This is a candidate for the stable branches. Reviewed-by: Brian Paul <[email protected]>