summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-12-19i915g: Add unsupported caps.Stéphane Marchesin1-0/+4
2011-12-19i915g: Turn an assert into a debug message, print more debug info for ↵Stéphane Marchesin2-4/+9
missing depth swz. Also fix indentation a bit.
2011-12-19i915g: Make the pipe_sampler_state struct non const and get rid of useless ↵Stéphane Marchesin2-2/+2
memcpy.
2011-12-19i915g: Implement KILP.Stéphane Marchesin1-3/+12
2011-12-19i915g: Add two unsupported caps.Stéphane Marchesin1-0/+2
2011-12-19i915g: Put the templates at the beggining of the structures.Stéphane Marchesin2-5/+5
Seriously. This fixes fragment-and-vertex-texturing in piglit and probably a boatload of other stuff.
2011-12-19i965: Advertise our vertex shader texture units.Kenneth Graunke1-1/+1
Previously, we advertised 0 VS texture units. Now that we have proper support for using the sampling engine in the VS, we can advertise 16, which is conveniently the number required for OpenGL 3.0. v2: Enable on Gen4. I hacked up my tests to not use flat ivec varyings and they pass. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19i965/vs: Implement EXT_texture_swizzle support for VS texturing.Kenneth Graunke2-1/+52
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19i965/vs: Add texture related data to brw_vs_prog_key.Kenneth Graunke2-0/+11
Now that this is all factored out, it's trivial to do. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19i965/fs: Only set brw_wm_prog_key data for samplers used by the WM.Kenneth Graunke1-1/+3
This should avoid state-dependent FS recompiles when samplers that are only used by the VS change. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19i965/fs: Factor out texturing related data from brw_wm_prog_key.Kenneth Graunke7-115/+168
The idea is to reuse this for the VS and (in the future) GS as well. v2: Include yuvtex data since we're not dropping GL_MESA_ycbycr. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> [v1] Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19i965/vs: Add support for texel offsets.Kenneth Graunke3-2/+23
The visit() half computes the values to put in the header based on the IR and simply stuffs that in the vec4_instruction; the emit() half uses this to set up the message header. This works out well since emit() can use brw_reg directly and access individual DWords without kludgery. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19i965/fs: Factor out texture offset bitfield computation.Kenneth Graunke3-18/+26
We'll want to reuse this for the VS, and it's complex enough that I'd rather not cut and paste it. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19i965/vs: Implement vec4_visitor::visit(ir_texture *).Kenneth Graunke1-7/+120
This translates the GLSL compiler's IR into vec4_instruction IR, generating code to load coordinates, LOD info, shadow comparitors, and so on into the appropriate message registers. It turns out that the SIMD4x2 parameters are identical on Gen 5-7, and the Gen4 code is similar enough that, unlike in the FS, it's easy enough to support all generations in a single function. v2: Load zeros for missing coordinates (fixing vs-texelFetch-sampler1D and 2D on G45), and fix G45 message length for shadow comparisons. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-19i965/vs: Implement vec4_visitor::generate_tex().Kenneth Graunke2-0/+110
This is the part that takes the vec4_instruction IR and turns it into actual Gen ISA. v2: Add Gen4 messages, don't retype m0 to UW. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19i965: Add missing SIMD4x2 sample_l_c message #defines.Kenneth Graunke1-0/+1
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19i965: Don't minify depth when setting up cube map miptrees on Gen4.Kenneth Graunke1-1/+2
Prior to Ironlake, cube maps were stored as 3D textures. In recent refactoring, we removed a separate "layers" parameter in favor of using depth. Unfortunately, depth was getting minified, which is only correct for actual 3D textures. Fixes piglit tests: - bugs/crash-cubemap-order - fbo/fbo-cubemap - texturing/cubemap Also changes texturing/cubemap npot from abort to fail. This hasn't seen a full test run since Piglit on Mesa master hangs GM45 a lot. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-19glx: Remove GLX_USE_APPLEGL cruft in extension string handlingIan Romanick1-36/+2
All of the extensions require that both libGL and either the server or the direct rendering driver (or both) enable the extension before it's advertised. It seems safe to assume that none of the other components on OS X will enable these extensions, so all the #ifdef blocks here just clutter the code. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net> Cc: Jeremy Huddleston <jeremyhu@apple.com>
2011-12-19glx: GLX 1.4 does not require GLX_INTEL_swap_eventIan Romanick1-1/+1
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-19glx: Remove some extensions that are not, and never will be, supportedIan Romanick2-20/+0
There are a few unsupported extensions (e.g., the ATI and NV float extensions) that are still in the list. There is some small chance that these may be supported some day. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-19glx: Explicitly reject servers that only support GLX 1.0Ian Romanick1-4/+6
__glXInitialize calls AllocAndFetchScreenConfigs. AllocAndFetchScreenConfigs unconditionally sends a glXQuerySeverString request to the server. This request is only supported with GLX 1.1 or later, so we were already implicitly incompatible with GLX 1.0 servers. How many more similar bugs lurk in the code that nobody has noticed in years? Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-19glx: Initialize share_xid in CreateContextIan Romanick1-0/+1
Previously the share_xid was only set in the glXImportContextEXT path, and it was left set to None in all of the other create-context paths. Fixes the piglit test glx-query-context-info-ext. NOTE: This is a candidate for the 7.11 branch. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-19glx: Make parameter types for __glXSendError match protocol typesIan Romanick2-4/+6
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net> Cc: Jeremy Huddleston <jeremyhu@apple.com>
2011-12-19glx: Make __glXSendError available in non-Apple buildsIan Romanick4-1/+2
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net> Cc: Jeremy Huddleston <jeremyhu@apple.com>
2011-12-19glx: Send DestroyContext protocol at the correct timesIan Romanick6-26/+31
Send the DestroyContext protocol immediately when glXDestroyContext is called, and never call it when glXFreeContextEXT is called. In both cases, either destroy the client-side structures or, if the context is current, set xid to None so that the client-side structures will be destroyed later. I believe this restores the behavior of the original SGI code. See src/glx/x11 around commit 5df82c8. The spec doesn't say anything about glXDestroyContext not really destroying imported contexts (it acts like glXFreeContextEXT instead), but that's what the original code did. Note that glXFreeContextEXT on a non-imported context does not destroy it either. Fixes the piglit test glx-free-context. NOTE: This is a candidate for the 7.11 branch. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-19glx: Don't segfault if glXGetContextIDEXT is pased a NULL contextIan Romanick1-1/+1
Fixes the piglit test glx-get-context-id. NOTE: This is a candidate for the 7.11 branch. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-19glx: Fix handling of property list received from the server in ↵Ian Romanick1-13/+32
glXImportContextEXT The primary problem was that the number of reply bytes read is clamped to sizeof(propList), but the loop that processes the properties tries to examine all of the properties sent by the server. If the server sends 47,000 properties, we only read 3 but process all 47,000. NOTE: This is a candidate for the 7.11 branch. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-19glx: Don't segfault if xcb_glx_is_direct_reply returns NULLIan Romanick1-1/+1
NOTE: This is a candidate for the 7.11 branch. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-19glx: Don't create a shared context if the other context isn't the same kindIan Romanick3-0/+21
Each of the DRI, DRI2, and DRISW backends contain code like the following in their create-context routine: if (shareList) { pcp_shared = (struct dri2_context *) shareList; shared = pcp_shared->driContext; } This assumes that the glx_context *shareList is actually the correct derived type. However, if shareList was created as an indirect-rendering context, it will not be the expected type. As a result, shared will contain garbage. This garbage will be passed to the driver, and the driver will probably segfault. This can be observed with the following GLX code: ctx0 = glXCreateContext(dpy, visinfo, NULL, False); ctx1 = glXCreateContext(dpy, visinfo, ctx0, True); Create-context is the only case where this occurs. All other cases where a context is passed to the backend, it is the 'this' pointer (i.e., we got to the backend by call something from ctx->vtable). To work around this, check that the shareList->vtable->destroy method is the same as the destroy method of the expected type. We could also check that shareList->vtable matches the vtable or by adding a "tag" to glx_context to identify the derived type. NOTE: This is a candidate for the 7.11 branch. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-19i965: Add support for GL_ARB_depth_buffer_float under 3.0 override.Eric Anholt4-1/+20
This is not exposed generally yet because some of the swrast paths hit in piglit (drawpixels, copypixels, blit) aren't yet converted to MapRenderbuffer. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-19i965: Add separate stencil/HiZ setup for MESA_FORMAT_Z32_FLOAT_X24S8.Eric Anholt3-15/+20
This is a little more unusual than the separate MESA_FORMAT_S8_Z24 support, because in addition to storing the real stencil data in a MESA_FORMAT_S8 miptree, we also make the Z miptree be MESA_FORMAT_Z32_FLOAT instead of the requested format. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-19i965: Use the miptree format for texture surface format choice.Eric Anholt2-2/+2
With separate stencil GL_DEPTH32F_STENCIL8, the miptree will have a really different format (MESA_FORMAT_Z32_FLOAT) from the teximage (MESA_FORMAT_Z32_FLOAT_X24S8). Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-19i965: Add support for mapping Z32_FLOAT_X24S8 fake packed depth/stencil.Eric Anholt1-5/+17
The format handling here is tricky, because we're not actually generating a Z32_FLOAT_X24S8 miptree, so we're guessing the format that GL wants based on seeing Z32_FLOAT with a separate stencil. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-19intel: Stop creating the wrapped depth irb.Eric Anholt2-111/+8
All the operations were just trying to get at irb->wrapped_depth->mt, which is the same as irb->mt now. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-19i965: Properly demote the depth mt format for fake packed depth/stencil.Eric Anholt4-3/+19
gen7 only supports the non-packed formats, even if you associate a real separate stencil buffer -- otherwise it's as if the depth test always fails. This requires a little bit of care in the match_texture_image case, since the miptree format no longer matches the texture image format. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-19intel: Reuse intel_miptree_match_image().Eric Anholt1-9/+6
This little bit of logic was duplicated, which isn't much, but I was going to need to duplicate a bit of additional logic in the next commit. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-19intel: Stop creating the wrapped stencil irb.Eric Anholt5-78/+67
There were only two places it was really used at this point, which was in the batchbuffer emit of the separate stencil packets for gen6/7. Just write in the ->stencil_mt reference in those two places and ditch all this flailing around with allocation and refcounts. v2: Fix separate stencil on gen7. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-19tgsi: update documents with some info on texture lookupDave Airlie1-0/+11
this mentions which channels are used for slice and depth comparison values. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-19softpipe: fix shadow1d tests.Dave Airlie1-1/+13
This fixes the piglit glsl-1.10 shadow1D related tests. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-19softpipe: fix shadow 2d texture array samplingDave Airlie2-6/+22
The 4th texcoord is used in this case for the comparison. This fixes piglit glsl-fs-shadow2DArray* on softpipe. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-19gallium/draw: fix two side handlingDave Airlie1-18/+9
The code didn't handle the case where front wasn't specified in the vertex shader outputs, but back was. In that case we were doing a copy from back to non-existant front, this code checks we have existant front/backs and only does the copy when they both exist. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-19osmesa: fix RGB565 renderingAlex Galakhov1-0/+4
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-19vdpau: Add background surface supportMaarten Lankhorst1-1/+10
Sets rgba layer as zeroth layer if a custom background_surface is specified. Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com> Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-12-19vdpau: Add support for mixer attributesMaarten Lankhorst3-15/+147
It's harmless to add support for attributes we don't support, since they require a feature enabled for them to affect something. As long as they aren't enabled, nothing happens. This enables support for custom colorspaces and background colors. Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com> Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-12-19vdpau: Add support for parametersMaarten Lankhorst3-6/+126
Currently only validating, since nothing else can be done with it yet Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com> v2: removed check_video_surface Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-12-19softpipe: fix depth sampling for linear vs nearest.Dave Airlie1-7/+16
This sample compare was always doing linear, and this makes the glsl-fs-shadow1DArray test render like the Intel driver. fix wrong 0->j from initial patch Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-19softpipe: fix texture sampling from 1D texture arrayDave Airlie1-0/+13
This is the first part of a fix to piglit glsl-fs-shadow1DArray also fix the passing of unused r[2] in the normal 1D case. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-18mesa: make _mesa_set_tex_image() static since it's not called anywhere elseBrian Paul2-13/+7
2011-12-18nvc0: add NVC0_RESOURCE_FLAG_VIDEOChristoph Bumiller2-0/+30
2011-12-18glsl_to_tgsi: make sure copied instructions don't lose texture target. (v2)Dave Airlie1-2/+6
The piglit draw-pixel-with-texture was asserting in the glsl->tgsi code, due to 0 texture target, this makes sure the texture target is copied over correctly when we copy instructions around. v2: drive-by fix bitmap on the way past. This avoids the assertion, have to contemplate fixing things as per the spec later. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Brian Paul <brianp@vmware.com>