summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* gallivm: change coordinate handling throughout functionsRoland Scheidegger2013-08-153-133/+133
| | | | | | | | | | | | | | | | Instead of passing s,t,r coordinates pass a coord array - the reason is that I need to pass more coords (in particular for shadow "coord", future will also need another one for cube map arrays) so just pass them as an array. Also, to simplify things, use fixed location for the shadow reference value I want to get rid of the silly "where is the right coord value" game. Keep old-style however for aos sampling (which is not going to need shadow coord, though for cube map arrays it still would need fixing). (Next patch will pass those through using the new arrangement directly from sampler interface.) v2: fix up soa split path (unreachable currently but still...) Reviewed-by: Zack Rusin <[email protected]>
* gallivm: fix border color with normalized texture formatsRoland Scheidegger2013-08-151-13/+53
| | | | | | | | | | | | | We need to put border color into texture format color space which essentially means clamping for non-float, normalized formats (not entirely sure if we're also meant to quantize the float but it's probably ok not to do it thankfully). For OpenGL we could do this easily outside generated code due to the 1:1 sampler/texture correspondence but not for d3d10 which is terrible (as we recalculate a constant over and over again per shader invocation). Fortunately border color should be rare enough that we don't care THAT much. Reviewed-by: Zack Rusin <[email protected]>
* llvmpipe: fix pipeline statistics with a null psZack Rusin2013-08-148-8/+43
| | | | | | | | | | If the fragment shader is null then pixel shader invocations have to be equal to zero. And if we're running a null ps then clipper invocations and primitives should be equal to zero but only if both stancil and depth testing are disabled. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* draw: make sure that the stages setup outputsZack Rusin2013-08-145-30/+62
| | | | | | | | | | | | Calling the prepare outputs cleans up the slot assignments for outputs, unfortunately aapoint and aaline didn't have code to reset their slots after the initial setup, this was messing up our slot assignments. The unfilled stage was just missing the initial assignment of the face slot. This fixes all of the reported piglit failures. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* glsl: Fix incorrect pattern matching in ir_set_program_inoutsPaul Berry2013-08-141-2/+2
| | | | | | | | | | | | | | | | | | | | In commit 8fc41df (glsl: Modify ir_set_program_inouts to handle geometry shaders), when attempting to pattern match the "foo" part of expressions such as: foo[i][j] foo[i] I incorrectly called as_dereference_variable() on the subexpression foo[i] instead of foo. As a result, the pattern never matched, so ir_set_program_inouts would fall back on marking the entire variable as used, rather than just the portion indexed by the array. This didn't result in incorrect behaviour, but it could have resulted in inefficiency by causing the back-end to allocate resources for unused parts of an input or output array. Reviewed-by: Kenneth Graunke <[email protected]>
* vl: Add support for max level query v2Rico Schüller2013-08-1412-4/+99
| | | | | | | | | This patch adds the level query support to the video decoders and uses some more reasonable defaults. v2: (ck) add commit message Reviewed-by: Christian König <[email protected]>
* glsl: Emit better warnings for things that look like default precision ↵Ian Romanick2013-08-131-13/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | statements Previously we would emit a warning for empty declarations like float; We would also emit the same warning for things like highp float; However, this second case is most likely the application trying to set the default precision. This makes the compiler generate a stronger warning with some suggestion of a fix. It really seems like this should be an error. I'll bet that 100% of the time someone writes 'highp float;' the actually meant 'precision highp float;'. Alas, both AMD and NVIDIA accept this syntax, and the spec doesn't explicitly forbid it. This makes piglit's precision-05.vert generate the following warnings: 0:12(11): warning: empty declaration with precision qualifier, to set the default precision, use `precision lowp float;' 0:13(12): warning: empty declaration with precision qualifier, to set the default precision, use `precision mediump int;' v2: Add { } around a one-line if body and fix a comment. Suggested by Ken. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "9.2" <[email protected]>
* glsl/ast: Don't perform GS input array checks on non-inputs.Paul Berry2013-08-131-1/+1
| | | | | | | | Previously, we were accidentally calling handle_geometry_shader_input_decl() on non-input interface block declarations, resulting in bogus error checking. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl/ast: Fix assertion failure when GS input declared as non-array.Paul Berry2013-08-131-4/+12
| | | | | | | | | | | | Previously, if a geometry shader input was declared as a non-array, we would flag the proper compiler error, but then before we got a chance to report it to the client, handle_geometry_shader_input_decl() would assertion fail. With this patch, handle_geometry_shader_input_decl() ignores non-arrays. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl/ast: Check that geometry shader interface block inputs are arrays.Paul Berry2013-08-131-0/+13
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965/gen7+: Fix build error introduced by renaming upload_3dstate_so_decl_list.Paul Berry2013-08-131-1/+1
| | | | | | Commit 9f9ccf707c54156b4559a4b1206022c2ca2d45cd renamed upload_3dstate_so_decl_list to gen7_upload_3dstate_so_decl_list but forgot to update the caller.
* radeon/llvm: Add missing "%s" format string to fprintf.Jon Severinsson2013-08-131-1/+1
| | | | | | | | This fixes a compilation warning with -Wformat-security. CC: "9.2" <[email protected]> Reviewed-by: Tom Stellard <[email protected]>
* i965: Move arrays brw_multisample_positions* to new headerChad Versace2013-08-132-46/+73
| | | | | | | | Move the arrays to the new header brw_multisample_state.h, which will be shared with Broadwell code. Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* i965: Refactor names of sample_positions_8/4x arraysChad Versace2013-08-131-7/+7
| | | | | | | | | | | Place each array in the brw namespace by renaming it: sample_positions_4x -> brw_multisample_positions_4x sample_positions_8x -> brw_multisample_positions_8x This prepares for moving the arrays to a header shared by gen6 and gen8. Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* i965/gen7+: Mark upload_3dstate_so_decl_list as non-static (v2)Kenneth Graunke2013-08-132-3/+7
| | | | | | | | We will reuse this for Broadwell. v2: Prefix function name with 'gen7'. (chadv) Reviewed-by: Chad Versace <[email protected]>
* i965: Mark a few brw_draw_upload.c functions as non-staticKenneth Graunke2013-08-132-7/+14
| | | | | | We will reuse these for Broadwell. Reviewed-by: Chad Versace <[email protected]>
* glsl: Require function return type arrays be explicitly sizedIan Romanick2013-08-131-0/+12
| | | | | | | | Fixes piglit array-function-return-unsized.vert. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "9.2" <[email protected]>
* glsl: Move and refine test for unsized arrays in GLSL ESIan Romanick2013-08-131-6/+27
| | | | | | | | | | | | | | | | | | | | | | | | GLSL ES does not allow unsized arrays, and GLSL ES 1.00 does not allow array initializers. However, GLSL ES 3.00 allows array initializers, and the initializer can explicitly size the array. The specification even includes some examples of this: float x[] = float[2] (1.0, 2.0); // declares an array of size 2 float y[] = float[] (1.0, 2.0, 3.0); // declares an array of size 3 float a[5]; float b[] = a; Move the unsized array check to after the initializer has been processed. If the array is still unsized, generate the error. This should have no effect in GLSL ES 1.00 because, as previously mentioned, array initializers are not allowed. Fixes piglit "glsl-es-3.00 compiler array-sized-by-initializer.vert". Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "9.1 9.2" <[email protected]>
* glx: Generate GLXBadDrawable when drawable is zeroIan Romanick2013-08-131-2/+12
| | | | | | | | Fixes piglit glx-query-drawable-GLXBadDrawable. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]> Cc: "9.2" <[email protected]>
* mesa: Use _mesa_detach_renderbuffer when deleting a textureIan Romanick2013-08-132-20/+48
| | | | | | | | | | | | | | | | | | | | The functional change is that now invalidate_framebuffer is called if the texture is actually detached from one of the currently bound FBOs. Previously this was only done for renderbuffers. The remaining changes make the texture delete path look more similar to the renderbuffer delete path. This includes adding relevant spec quotations to justify the behavior. Fixes piglit fbo-incomplete "delete texture of bound FBO" test. v2: Move 'fb->Attachment[i].Texture == att' check from previous patch to this patch... where it was intended to be in the first place. Noticed by Chad. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]> Cc: "9.2" <[email protected]>
* mesa: Make detach_renderbuffer available outside fbobject.cIan Romanick2013-08-132-9/+38
| | | | | | | | | | | | | | Also add a return value indicating whether any work was done. This will be used by the next patch. v2: Move 'fb->Attachment[i].Texture == att' check to the next patch... where it was intended to be in the first place. Noticed by Chad. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]> Cc: "9.2" <[email protected]>
* meta: Don't call _mesa_Ortho with width or height of 0Ian Romanick2013-08-131-3/+8
| | | | | | | | | | Fixes failures in oglconform fbo mipmap.manual.color, mipmap.manual.colorAndDepth, mipmap.automatic, and mipmap.manualIterateTexTargets subtests. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]> Cc: "9.2" <[email protected]>
* r600g/sb: use MULADD workaround on R7xx for MULADD_IEEEVadim Girlin2013-08-141-1/+2
| | | | | | | | | | | | Looks like the same issue that was seen with MULADD in trans slot on R7xx also affects MULADD_IEEE (maybe all OP3 instructions and MULADD is just a most frequently used?). So the workaround is to not allow affected instructions to be placed into the trans slot. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=67927 Signed-off-by: Vadim Girlin <[email protected]> Cc: "9.2" <[email protected]>
* gallivm: implement new float comparison instructions returning integer masksRoland Scheidegger2013-08-131-2/+79
| | | | | | | | | FSEQ/FSGE/FSLT/FSNE work just the same as SEQ/SGE/SLT/SNE except skip the select. And just for consistency use the same appropriate ordered/unordered comparisons for the old opcodes as well. Reviewed-by: Zack Rusin <[email protected]>
* tgsi: implement new float comparison instructions returning integer masksRoland Scheidegger2013-08-134-4/+102
| | | | | | | | Also while here add a bunch of other forgotten (integer) instructions to tgsi_util_get_inst_usage_mask() (which isn't used for much except optimizing away unused input components), though it may still be incomplete. Reviewed-by: Zack Rusin <[email protected]>
* gallium: add new float comparison instructions returning integer masksRoland Scheidegger2013-08-132-17/+82
| | | | | | | | | | | | Newer graphic languages don't want messy float mask results but instead true "boolean" mask results for float comparisons. Otherwise just need to convert the floats back to integers. Need to keep the old opcodes however due to both legacy (gl and d3d9) needing them and because older hw can't really deal with integers. These new FSEQ/FSGE/FSLT/FSNE opcodes are part of integer API and hence must be supported if a driver claims to support glsl 1.30 (or PIPE_SHADER_CAP_INTEGERS). Reviewed-by: Zack Rusin <[email protected]>
* ilo: enable dumping of WM PCBChia-I Wu2013-08-131-1/+5
| | | | It was disabled because it wasn't supported.
* ilo: no binding table change when constants are pushedChia-I Wu2013-08-131-21/+17
| | | | | When constants can be pushed, and nothing else requires new SURFACE_STATEs, there is no need to emit BINDING_TABLE_STATE.
* ilo: support push constant model in shadersChia-I Wu2013-08-136-12/+143
| | | | | Source constants from URB constant data when the constant data can fit in the PCB.
* ilo: support copying constant buffer 0 to PCBChia-I Wu2013-08-135-19/+105
| | | | | Add ILO_KERNEL_PCB_CBUF0_SIZE so that a kernel can specify how many bytes of constant buffer 0 need to be copied to PCB.
* ilo: make constant buffer 0 upload optionalChia-I Wu2013-08-133-29/+35
| | | | | Add ILO_KERNEL_SKIP_CBUF0_UPLOAD so that we can skip constant buffer 0 upload when the kernel does not need it.
* Revert "ilo: initialize constant buffer SURFACE_STATE early"Chia-I Wu2013-08-134-32/+27
| | | | | | This reverts commit a9b800aa81cffdcaef2490ff49986099feae2663. With push constant support, the constructed SURFACE_STATE is unused and wasted. The change only slows things down.
* gbm: Link to libwayland-drm if Wayland EGL platform is enabledArmin K2013-08-123-5/+6
| | | | | | | | We were relying on libEGL to pull in libwayland-client symbols, but with commit 2c2e64edaba0f6aeb181ca5b51eb8dea8e9b39f9 cleaned up the symbol leak. https://bugs.freedesktop.org/show_bug.cgi?id=67962
* gallivm: fix exec_mask interaction with geometry shader after end of mainRoland Scheidegger2013-08-122-16/+14
| | | | | | | | | | | | | | | | Because we must maintain an exec_mask even if there's currently nothing on the mask stack, we can still have an exec_mask at the end of the program. Effectively, this mask should be set back to default when returning from main. Without relying on END/RET opcode (I think it's valid to have neither) it is actually difficult to do this, as there doesn't seem any reasonable place to do it, so instead let's just say the exec_mask is invalid outside main (which it really is effectively). The problem is that geometry shader called end_primitive outside the shader (in the epilogue), and as a result used a bogus mask, leading to bugs if we had to set the (somewhat misnamed) ret_in_main bit anywhere. So just avoid the mask combining function when called from outside the shader. Reviewed-by: Zack Rusin <[email protected]>
* draw: simplify prim mask constructionRoland Scheidegger2013-08-121-22/+10
| | | | | | | | | The code was quite weird, the second comparison was in fact a complete no-op and we can also do the comparison with the vector directly instead of scalar, which should not also be faster but it is way more obvious how that mask is actually going to look like. Reviewed-by: Zack Rusin <[email protected]>
* gallivm: simplify geometry shader mask handling a bitRoland Scheidegger2013-08-121-36/+28
| | | | | | | | | | | | Instead of reducing masks to 0/1 simply use the mask directly as -1. Also use some signed comparison instead of unsigned (as far as I understand these values have to be (very) small and signed means llvm doesn't have to apply additional logic to do the unsigned comparisons the cpu can't do). Saves a couple of instructions in some test geometry shader here. v2: that was a bit to much optimization, don't skip combining the masks... Reviewed-by: Zack Rusin <[email protected]>
* draw: (trivial) dump tgsi for geometry shaders with GALLIVM_DEBUG_TGSIRoland Scheidegger2013-08-121-0/+5
| | | | | | And dump the variant key too (same as vs does). Just so I can stop wondering why I see the tgsi dump for fs and vs but not gs...
* gallivm: (trivial) fix typo in argument declaration of lp_build_size_query_soaRoland Scheidegger2013-08-121-1/+1
| | | | Was meant to match the name used elsewhere, spotted by Anthony.
* i965/fs: Add dump_instruction() support for ARF destinations.Kenneth Graunke2013-08-121-0/+6
| | | | | | | | | | CMP instructions use BRW_ARF_NULL as a destination. Prior to this patch, dump_instruction() decoded the destination as "???". Now it decodes BRW_ARF_NULL as "(null)" and other ARFs numerically. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965/fs: Remove extraneous newline in dump_instruction() for CMP.Kenneth Graunke2013-08-121-1/+1
| | | | | | | | | | | | This resulted in printouts like: 246: cmp.cmod.f0.0 ???, vgrf152, 0.000000f, (null), With this patch, CMP is properly printed on one line. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965/fs: Optimize IF/MOV/ELSE/MOV/ENDIF to SEL when possible.Kenneth Graunke2013-08-122-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many GLSL shaders contain code of the form: x = condition ? foo : bar The compiler emits an ir_if tree for this, since each subexpression might be a complex tree that could have side-effects and short-circuit logic operations. However, the common case is to simply pick one of two constants or variable's values---which is exactly what SEL is for. Replacing IF/ELSE with SEL also simplifies the control flow graph, making optimization passes which work on basic blocks more effective. The shader-db statistics: total instructions in shared programs: 1655247 -> 1503234 (-9.18%) instructions in affected programs: 949188 -> 797175 (-16.02%) 2,970 shaders were helped, none hurt. Gained 181 SIMD16 programs. This helps Valve's Source Engine games (max -41.33%), The Cave (max -33.33%), Serious Sam 3 (max -18.64%), Yo Frankie! (max -30.19%), Zen Bound (max -22.22%), GStreamer (max -6.12%), and GLBenchmark 2.7 (max -1.94%). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965/fs: Consider predicated SEL instructions as whole variable writes.Kenneth Graunke2013-08-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | The instruction (+f0.0) SEL dst, src0, src1 will write either src0 or src1 to dst, depending on the predicate. Unlike most predicated instructions, it always writes to dst. fs_inst::is_partial_write() is supposed to return true if the whole register is guaranteed to be written. The !inst->predicated check makes sense for most instructions, which might not write the whole register, but SEL is a special case. This caused live interval analysis to ignore the destination of predicated SEL instructions when computing "def" information. Requires the previous commit to avoid regressions. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965/fs: Explicitly disallow CSE on predicated instructions.Kenneth Graunke2013-08-121-1/+3
| | | | | | | | | | | | | The existing inst->is_partial_write() already disallows predicated instructions, so this has no functional change. However, it's worth doing explicitly since the CSE pass does not consider the flag register. This means it could blindly factor out operations that use the same sources, but which have different condition codes set. This prevents a regression in the next commit. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965/fs: Log a performance warning if skipping 16-wide due to pulls.Kenneth Graunke2013-08-121-7/+11
| | | | | | | | | | | | | | Usually, the driver creates both 8-wide and 16-wide variants of every fragment shader. When 16-wide compilation fails, it logs a performance warning explaining why only an 8-wide program exists. However, when there are pull parameters, the driver won't even bother trying the 16-wide compile (since it would fail). In this case, it failed to emit a performance warning, leaving no explanation for the missing 16-wide program. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* ilo: initialize constant buffer SURFACE_STATE earlyChia-I Wu2013-08-124-27/+32
| | | | | | Fix ilo_gpe_init_view_surface_for_buffer to allow buffer to be NULL, and add ilo_gpe_set_view_surface_bo to set it later. This allows us to set up SURFACE_STATE early for constant buffers backed by user buffers.
* ilo: 3DSTATE_INDEX_BUFFER may be wrongly skippedChia-I Wu2013-08-101-1/+5
| | | | | | | | | | In finalize_index_buffer(), when the current index buffer was destroyed due to u_upload_data(), it may happen that the new index buffer is at the same address as the old one. Comparing the pointers to the two buffers could fail to work, and 3DSTATE_INDEX_BUFFER would be incorrectly skipped. Holding a reference to the current index buffer before calling u_upload_data() should fix the problem.
* i965: add missing BRW_NEW_INTERPOLATION_MAP to state dumpChris Forbes2013-08-101-0/+1
| | | | | | | Makes this flag appear in the output for INTEL_DEBUG=state Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Add a new debug mode for the VUE mapChris Forbes2013-08-103-0/+29
| | | | | | | | | | INTEL_DEBUG=vue now emits a listing of each slot in the VUE map, and the corresponding interpolation mode. V2: Fix whitespace issues. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Don't allow const on out or inout function parametersIan Romanick2013-08-091-0/+15
| | | | | | | | | Fixes piglit tests const-inout-parameter.frag and const-out-parameter.frag. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Cc: "9.2" <[email protected]>
* gallivm: set non-existing values really to zero in size queries for d3d10Roland Scheidegger2013-08-094-22/+22
| | | | | | | | | | | My previous attempt at doing so double-failed miserably (minification of zero still gives one, and even if it would not the value was never written anyway). While here also rename the confusingly named int_vec bld as we have int vecs of different sizes, and rename need_nr_mips (as this also changes out-of-bounds behavior) to is_sviewinfo too. Reviewed-by: Zack Rusin <[email protected]>