aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* i965: Set up clip distance VUE slots appropriately for gl_ClipDistance.Paul Berry2011-09-234-27/+32
| | | | | | | | | | | | | | | When gl_ClipDistance is in use, the contents of the gl_ClipDistance array just need to be copied directly into the clip distance VUE slots, so we re-use the code that copies all other generic VUE slots (this has been extracted to its own method). When gl_ClipDistance is not in use, the vertex shader needs to calculate the clip distances based on user-specified clipping planes. This patch also removes the i965-specific enum values BRW_VERT_RESULT_CLIP[01], since we now have generic Mesa enums that serve the same purpose (VERT_RESULT_CLIP_DIST[01]). Reviewed-by: Eric Anholt <[email protected]>
* i965: Don't upload clip planes when gl_ClipDistance is in use.Paul Berry2011-09-234-7/+12
| | | | | | | | When the vertex shader writes to gl_ClipDistance, we do clipping based on clip distances rather than user clip planes, so don't waste push constant space storing user clip planes that won't be used. Reviewed-by: Eric Anholt <[email protected]>
* i965: Enable lower_clip_distance.Paul Berry2011-09-231-0/+1
| | | | | | | | i965 requires gl_ClipDistance to be formatted as an array of 2 vec4's (as opposed to an array of 8 floats), so enable the lowering pass that performs this conversion. Reviewed-by: Eric Anholt <[email protected]>
* mesa: Decode GL_CLIP_DISTANCE[67] properly in _mesa_set_enable().Paul Berry2011-09-231-6/+8
| | | | | | | | | | | | | In order to support 8 clip distances, we need to properly decode when the user sets the GL_CLIP_DISTANCE6 and GL_CLIP_DISTANCE7 enable flags. For clarity, this patch changes the names GL_CLIP_PLANE[0-5] in the switch statement to the equivalent names GL_CLIP_DISTANCE[0-5], since the GL_CLIP_PLANE names are deprecated. Reviewed-by: Eric Anholt <[email protected]> Tested-by: Brian Paul <[email protected]>
* mesa: set up gl_vert_result and gl_frag_attrib values for gl_ClipDistance.Paul Berry2011-09-232-10/+14
| | | | | | | | | | | | This patch assigns enumerated values for gl_ClipDistance in the gl_vert_result and gl_frag_attrib enums, so that driver back-ends can assign gl_ClipDistance to the appropriate hardware registers. It also adjusts the functions _mesa_vert_result_to_frag_attrib() and _mesa_frag_attrib_to_vert_result() (which translate between the two enums) to correctly translate the new enumerated values. Reviewed-by: Eric Anholt <[email protected]> Tested-by: Brian Paul <[email protected]>
* mesa: Add a flag to indicate whether a program uses gl_ClipDistance.Paul Berry2011-09-233-1/+12
| | | | | | | | | | | | | | | | | | GLSL 1.30 requires us to use gl_ClipDistance for clipping if the vertex shader contains a static write to it, and otherwise use user-defined clipping planes. Since the driver needs to behave differently in these two cases, we need a flag to record whether the shader has written to gl_ClipDistance. The new flag is called UsesClipDistance. We initially store it in gl_shader_program (since that is the data structure that is available when we check to see whethe gl_ClipDistance was written to), and we later copy it to a flag with the same name in gl_vertex_program, since that is a more convenient place for the driver to access it (in i965, at least). Reviewed-by: Eric Anholt <[email protected]> Tested-by: Brian Paul <[email protected]>
* glsl: Implement a lowering pass for gl_ClipDistance.Paul Berry2011-09-236-0/+351
| | | | | | | | | | | | | | | | | | | In i965 GEN6+ (and I suspect most other hardware), gl_ClipDistance needs to be laid out as a pair of vec4's (the first containing clip distances 0-3, and the second containing clip distances 4-7). However, it is declared in GLSL as an array of 8 floats. This lowering pass acts at the GLSL level, modifying the declaration of gl_ClipDistance so that it is an array of vec4's rather than an array of floats, and renaming it to gl_ClipDistanceMESA. In addition, it modifies all accesses to the array so that they access the appropiate component of one of the vec4's. Since some hardware may not internally represent gl_ClipDistance as a pair of vec4's, this lowering pass is optional. To enable it, set the LowerClipDistance flag in gl_shader_compiler_options to true. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl hierarchical visitor: Do not overwrite base_ir for parameter lists.Paul Berry2011-09-232-7/+17
| | | | | | | | | | | | | | This patch fixes a bug in ir_hirearchical_visitor: when traversing an exec_list representing the formal or actual parameters of a function, it modified base_ir to point to each parameter in turn, rather than leaving it as a pointer to the enclosing statement. This was a problem, since base_ir is used by visitor classes to locate the statement containing the node being visited (usually so that additional statements can be inserted before or after it). Without this fix, visitors might attempt to insert statements into parameter lists. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add missing includes to meta.hChad Versace2011-09-231-0/+2
| | | | | | Include mtypes.h. Signed-off-by: Chad Versace <[email protected]>
* svga: indentation/formatting fixesBrian Paul2011-09-231-16/+16
|
* svga: remove emit_consts() offset parameterBrian Paul2011-09-231-3/+7
| | | | It was always zero.
* svga: s/int/unsigned/ in svga_state_constants.cBrian Paul2011-09-231-3/+7
| | | | Be consistent with other functions in the file. And add some comments.
* svga: s/unit/shader/ and related clean-upsBrian Paul2011-09-231-19/+23
| | | | 'shader' is more intuitive. Also s/int/unsigned/ and add assertions.
* svga: clean up return values and error codesBrian Paul2011-09-2315-97/+92
| | | | | | Previously we were using a hodge podge of int vs. pipe_enum and 0 vs. PIPE_OK. Some functions that always returned PIPE_OK were made void.
* svga: add format translation for DXT/sRGB formatsBrian Paul2011-09-231-2/+8
| | | | | Without this, apps/tests that tried to use a DXT/sRGB format would die on a failed assertion (st_texture.c:80).
* svga: test register W component in emit_kil()Brian Paul2011-09-231-16/+44
| | | | | | Only the XYZ components are checked to be negative by SVGA3DOP_TEXKILL. GL_ARB_fp requires all four components be checked. Emit a second texkill for W if needed.
* svga: fix depth/shadow compare for non-projected texcoordsBrian Paul2011-09-231-16/+24
| | | | | | | We only need to do the divide by Q step for TXP instructions. This fixes the incorrectly rendered soft shadow test in Lightsmark. Along with the previous texture swizzle commit, this also fixes all the piglit glsl-fs-shadow2d-XX.shader_test failures.
* svga: implement texture swizzlingBrian Paul2011-09-234-9/+128
| | | | | | | This exposes the GL_EXT_texture_swizzle extension and allows the various depth texture modes to be implemented properly. This, plus a follow-on texture/shadow change fixes quite a few piglit GLSL shadow sampler test failures.
* svga: check that we don't exceed input/ouput register limitsBrian Paul2011-09-233-2/+13
|
* svga: implement point sprite suppportBrian Paul2011-09-238-4/+119
| | | | | | Emit the SVGA3D_RS_POINTSPRITEENABLE render state. When sprite_coord_mode=PIPE_SPRITE_COORD_LOWER_LEFT emit extra frag shader code to invert the Y coordinate of the incoming texcoord.
* svga: add translation for float formatsBrian Paul2011-09-231-0/+14
|
* svga: check to avoid writing beyond end of constant bufferBrian Paul2011-09-231-1/+23
| | | | See bug 688394
* svga: Cleanup format capability checking.José Fonseca2011-09-238-192/+683
| | | | | | Accurately describe what operations are supported when a format caps entry is not advertised by the host, and which formats are never supported, instead of making ad-hoc and often incorrect assumptions.
* svga: Don't use the new depth formats for surfaces that will never be ↵José Fonseca2011-09-235-17/+23
| | | | | | | sampled from. Mitigates issues with hosts where support for these new depth formats is flaky.
* svga: Share one texcoord between depth and fogJakob Bornecrantz2011-09-233-13/+86
|
* svga: Only emit Z depth work if it is actually readJakob Bornecrantz2011-09-232-15/+21
|
* svga: Fix vPos usageJakob Bornecrantz2011-09-231-1/+7
|
* svga: Wip for passing depth in a texcoordJakob Bornecrantz2011-09-233-13/+86
| | | | TODO: Can we pass this as the same texcoord as fog?
* svga: Add a comment about depth format selection.José Fonseca2011-09-231-1/+10
|
* svga: Consider the new depth formats in svga_texture_from_handle().José Fonseca2011-09-231-1/+2
|
* svgadump: Dump the new depth format names.José Fonseca2011-09-231-0/+9
|
* svga: Expose the new depth formatsJakob Bornecrantz2011-09-236-25/+65
|
* svga: Coalesce multiple shader constants in a single command.José Fonseca2011-09-233-4/+178
| | | | | | HWv8 feature. Tested with GoogleEarth, Mesa demos.
* svgadump: Update for svga3d_reg.h header changes.José Fonseca2011-09-231-33/+60
|
* svga: updated svga3d_reg.h to latest public versionBrian Paul2011-09-231-49/+144
|
* Allow RBUG to start blockedAlex Corscadden2011-09-231-0/+4
| | | | | | | | | It is sometimes useful to examine the first frame or and early frame of a quickly executing and non-repeating application, this chain introduces a new environment variable that is checked when creating contexts. If GALLIUM_RBUG_START_BLOCKED is set, then each context that is created is started in a blocked state. This allows time to connect rbug before anything is rendered in the context.
* draw/llvm: add additional null pointer checkin ↵Brian Paul2011-09-231-1/+1
| | | | draw_pt_fetch_pipeline_or_emit_llvm()
* intel: fix the wrong code to detect null texture.Yuanhan Liu2011-09-231-1/+1
| | | | | | | | | | | | There is already comments show how to detect a null texture. Fix the code to match the comments. This would fix the oglc divzero(basic.texQOrWEqualsZero) and divzero(basic.texTrivialPrim) test case fail. Signed-off-by: Yuanhan Liu <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: fix the constant interp bitmask for flat modeYuanhan Liu2011-09-232-12/+26
| | | | | | | | | | | | | | | Fix the constant interpolation enable bit mask for flat light mode. FRAG_BIT_COL0 attribute bit might be 0, in which case we need to shift one more bit right. This would fix the oglc specularColor test fail on both Sandybridge and Ivybridge. v2: move the constant interp bitmask setup code into for(; attr < FRAG_ATTRIB_MAX; attr++) loop suggested by Eric. Signed-off-by: Yuanhan Liu <[email protected]> Signed-off-by: Xiang, Haihao <[email protected]>
* i915g: Don't generate useless swizzles before texture accesses.Stéphane Marchesin2011-09-223-10/+62
| | | | That helps reduce the number of texture indirections, which are very limited on i915.
* i915g: Fix whitespace.Stéphane Marchesin2011-09-221-13/+13
|
* st/mesa: remove unnecessary st_texture_match_image() parametersBrian Paul2011-09-223-11/+7
| | | | | We didn't use the face parameter and the level parameter can be found in the gl_texture_image.
* i915g: Fix peephole optimization for MOVs.Stéphane Marchesin2011-09-221-0/+8
|
* i915g: Add unsupported PIPE_CAP_MIN_TEXEL_OFFSET/PIPE_CAP_MAX_TEXEL_OFFSET.Stéphane Marchesin2011-09-221-0/+3
|
* intel: Unindent the blit call in PBO blit uploads.Eric Anholt2011-09-221-17/+12
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Drop gratuitous flush in PBO blit upload.Eric Anholt2011-09-221-3/+0
| | | | | | | | Since the blit gets sequenced after other batchbuffer rendering like normal, there's no need to push things out early. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* intel: Clean up check_pbo_format to ignore internalFormat.Eric Anholt2011-09-221-25/+13
| | | | | | | | | | All that matters here is the format of the texture, not the internalformat (which might mean various different pixel formats). In one case, the pbo upload for MESA_FORMAT_YCBCR would have swapped the channels for MESA_FORMAT_YCBCR_REV. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* intel: Move more of the PBO blit upload logic into that function.Eric Anholt2011-09-221-26/+33
| | | | | | | | | This also improves the debugging output in the failure paths so you get more than just "failed", and don't get spammed with "failed" when you didn't even have a PBO to try. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* intel: Remove stale comment about non-intel gl_buffer_objects.Eric Anholt2011-09-221-8/+1
| | | | | | | | This hasn't been true since dd26899ca39111e0866afed9df94bfb1618dd363 in 2009. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* intel: Remove the pbo zero-copy code.Eric Anholt2011-09-225-247/+0
| | | | | | | | | | | There were notes about the possibility of slowdowns due to zcopy from a PBO due to thrashing around of the region. Slowdowns are even more likely now that textures are generally tiled, which a zcopy wouldn't get. Additionally, there were no checks on the buffer size to ensure that the hardware-required rounding was present, which could result in GPU hangs on large zcopy PBOs. Reviewed-by: Ian Romanick <[email protected]>