aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Add a new ir_txs (textureSize) opcode to ir_texture.Kenneth Graunke2011-08-233-1/+7
| | | | | | | | One unique aspect of TXS is that it doesn't have a coordinate. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* mesa: call _mesa_set_vp_override in glDrawTex*Chia-I Wu2011-08-231-0/+4
| | | | | | | The driver may install its own vertex shader. _mesa_set_vp_override must be called so that core mesa can generate correct fragment program.. Reviewed-by: Brian Paul <[email protected]>
* intel: Abort when DRI2 separate stencil handshake failsChad Versace2011-08-221-0/+7
| | | | | | | | | | When intel_context requires separate stencil but the DRI2 separate stencil handshake fails, then abort and emit an error instructing the user to upgrade the DDX to 2.16.0. CC: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* glsl_to_tgsi: Fix a few more struct vs. class warnings.Kenneth Graunke2011-08-211-5/+5
| | | | Signed-off-by: Kenneth Graunke <[email protected]>
* glsl_to_tgsi: emit a MAD(b, -a, b) for !a && bBryan Cain2011-08-201-0/+52
| | | | This is a port of commit ff2cfb8989cd to glsl_to_tgsi.
* glsl_to_tgsi: fix typoBryan Cain2011-08-201-1/+1
|
* glsl_to_tgsi: implement ir_binop_all_equal using DP4 w/SGEBryan Cain2011-08-201-1/+19
| | | | | This is a port of commit ba01df11c4d0 to glsl_to_tgsi with integer support added.
* glsl_to_tgsi: implement ir_binop_any_nequal using DP4 w/saturate or DP4 w/SLTBryan Cain2011-08-201-2/+23
| | | | | | | | Implement the any() part of the operation the same way regular ir_unop_any is implemented. This is a port of commit e7bf096e8b04 to glsl_to_tgsi, with added integer support.
* glsl_to_tgsi: implement ir_unop_any using DP4 w/saturate or DP4 w/SLTBryan Cain2011-08-201-4/+28
| | | | | This is a port of commit 92ca560d68e8 to glsl_to_tgsi, with integer support added.
* glsl_to_tgsi: make glsl_to_tgsi_visitor::emit_dp return the instructionBryan Cain2011-08-201-7/+7
|
* glsl_to_tgsi: implement ir_binop_logic_or using an add w/saturate or add w/SLTBryan Cain2011-08-201-4/+27
| | | | | | | | | | | | | | | | | | | | | Logical-or is implemented using addition (followed by clamping to [0,1]) on values of 0.0 and 1.0. Replacing the logical-or operators with addition gives a + b which has a result on the range [0, 2]. Previously a SNE instruction was used to clamp the resulting logic value to [0,1]. In a fragment shader, using a saturate on the add has the same effect. Adding the saturate to the add is free, so (at least) one instruction is saved. In a vertex shader, using an SLT on the negation of the add result has the same effect. Many older shader architectures do not support the SNE instruction. It must be emulated using two SLT instructions and an ADD. On these architectures, the single SLT saves two instructions. Note that SNE is still used when integers are used for boolean values, since there is no such thing as an integer saturate, and older shader architectures without SNE don't support integers. This is a port of commit 41f8ffe5e07c to glsl_to_tgsi with integer support added.
* glsl_to_tgsi: implement ir_unop_logic_not using 1-xBryan Cain2011-08-201-1/+11
| | | | | | | Since our logic values are 0.0 (false) and 1.0 (true), 1.0 - x accurately implements logical not. This is a port of commit 6ad08989d7c1 to glsl_to_tgsi.
* android: build glslChia-I Wu2011-08-211-0/+32
| | | | | | | This builds the static library libmesa_glsl and executable glsl_compiler from glsl. glsl_compiler is only installed for engineering build. Reviewed-by: Chad Versace <[email protected]>
* android: build core mesaChia-I Wu2011-08-212-0/+214
| | | | | | This builds the static library libmesa_st_mesa from core mesa. Acked-by: Chad Versace <[email protected]>
* mesa: android has no log2f nor ffsChia-I Wu2011-08-211-1/+7
| | | | | | Define log2f(v) to be logf(v) / M_LN2 and ffs to __builtin_ffs. Reviewed-by: Chad Versace <[email protected]>
* mesa: fix !FEATURE_GL buildChia-I Wu2011-08-211-18/+18
| | | | | | | Move vbo_exec_FlushVertices_internal out of FEATURE_beginend. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965/gen7: Use align1 mode to set URB_WRITE_HWORD channel enables.Kenneth Graunke2011-08-201-0/+3
| | | | | | | Makes the new vertex shader backend work on Ivybridge. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965/fs: Don't double-convert integer/boolean uniforms.Kenneth Graunke2011-08-191-16/+20
| | | | | | | | | | | | | When ctx->Const.NativeIntegers is set, Core Mesa loads integer/boolean uniforms directly, rather than loading the floating point equivalent. So, when that's set, we don't need to perform any conversions. Unfortunately, we can't properly support native integers with the old vertex shader backend, so this patch leaves them disabled for now. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa, glsl_to_tgsi: Add new gl_context::NativeIntegers flag.Kenneth Graunke2011-08-193-27/+37
| | | | | | | | | | | | | | | | | | | Previously, native integer support was based on whether the driver advertised GLSL 1.30 or not. However, drivers that natively support integers may wish to do so for older GLSL versions as well. Adding this new opt-in flag allows them to do so. Currently disabled by default on all drivers, which was the existing behavior (no drivers currently implement GLSL 1.30). Fixes piglit tests on i965 with INTEL_GLSL_VERSION=130 set: - spec/glsl-1.10/fs-uniform-int-110.shader_test - spec/glsl-1.30/fs-uniform-int-130.shader_test (it was doubly converting the data) Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* ir_to_mesa: Remove incorrect usage of the 'struct' keyword on classes.Kenneth Graunke2011-08-191-2/+2
| | | | Signed-off-by: Kenneth Graunke <[email protected]>
* i965/fs: Change incorrect use of 'struct fs_reg' to simply 'fs_reg'.Kenneth Graunke2011-08-191-1/+1
| | | | | | It's actually a class. Signed-off-by: Kenneth Graunke <[email protected]>
* i965/vs: Implement proper register allocation instead of 1:1 mapping.Eric Anholt2011-08-192-1/+155
| | | | | | Fixes vs-atan-* and several others. This is not the real solution we eventually want, which will pack floats, vec2s, and vec3s into vec4 registers, but this code should provide the framework for that.
* i965/vs: Add simple dead code elimination.Eric Anholt2011-08-193-0/+38
| | | | | This is copied right from the fragment shader. It is needed for real register allocation to work correctly.
* i965/vs: Copy the live intervals calculation over from the FS.Eric Anholt2011-08-194-0/+139
| | | | | | This is a rather pessimistic calculation, since it doesn't distinguish individual channels of a vec4, or elements of an array, but should be a minimum start for register allocation.
* i965/vs: Remove stale comment about compressed instructions.Eric Anholt2011-08-191-1/+0
| | | | | This was copy'n'paste from the fragment shader, and didn't make sense here.
* mesa: handle array textures in GenerateMipmap(), FramebufferTexture1/2D()Brian Paul2011-08-191-3/+21
| | | | | | | | | This was an unfinished to-do item before. With this patch and the two preceeding patches, piglit's fbo-generatemipmap-array test runs and passes instead of generating a GL error and dying on an assertion. Reviewed-by: Ian Romanick <[email protected]>
* meta: use fallback mipmap generation for 1D/2D texture arraysBrian Paul2011-08-191-2/+5
| | | | | | | We could do 1D/2D arrays with textured quad rendering, but it'll take some work (as with 3D textures). Reviewed-by: Ian Romanick <[email protected]>
* mesa: set Q=1 for OPCODE_TEX executionBrian Paul2011-08-191-0/+8
| | | | | | | | | | | Q should not be significant for OPCODE_TEX, but it winds up getting passed to the compute_lambda() function. Make sure it's 1.0 to prevent garbage values, which is effectively what we get when the swizzle is coord.xyzz (which is what GLSL gives us). Part of the fix for piglit's fbo-generatemipmap-array test. Reviewed-by: Ian Romanick <[email protected]>
* mesa: restructure error checking in _mesa_FramebufferTexture1D/2DEXT()Brian Paul2011-08-191-11/+45
| | | | | | In anticipation of adding more texture targets. Reviewed-by: Ian Romanick <[email protected]>
* mesa: Declare _mesa_meta_begin()/end() as publicChad Versace2011-08-192-142/+147
| | | | | | | | | | | Declare _mesa_meta_begin()/end() in meta.h so that drivers can write custom meta-ops (such as HiZ resolves for i965). This necessitates moving the the META_* macros into meta.h. To prevent naming collisions, this commit renames each macro to be MESA_META_*. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* mesa: fix incorrect error code in _mesa_FramebufferTexture1D/3DEXT()Brian Paul2011-08-181-2/+2
| | | | | The spec says GL_INVALID_OPERATION is generated when texture!=0 and textarget is not a legal value. We had this right for the 2D function.
* glapi: update .gitignore for generated ES dispatch headersPaul Berry2011-08-181-0/+4
| | | | | | | | | | | Commit 6eff33dc (glapi: generate ES dispatch headers from core mesa) replaced the autogenerated files src/mapi/es1api/main/{dispatch,remap_helper}.h with new autogenerated files src/mesa/main/api_exec_es{1,2}_{dispatch,remap_helper}.h. This patch updates the .gitignore files to properly ignore the new autogenerated files, and stop ignoring the old autogenerated files. Reviewed-by: Chia-I Wu <[email protected]>
* i965/fs: Fix 32-bit integer multiplication.Eric Anholt2011-08-172-1/+22
| | | | | | | | | The MUL opcode does a 16bit * 32bit multiply, and we need to do the MACH to get the top 16bit * 32bit added in. Fixes fs-op-mult-int-*, fs-op-mult-ivec* Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: fix incorrect loop over instruction src regsBrian Paul2011-08-171-1/+1
| | | | The array of src regs is of size 3, not 4.
* xmlpool.h: fix a typoLauri Kasanen2011-08-171-1/+1
|
* xmlconfig: Make the error message more informativeLauri Kasanen2011-08-171-1/+1
|
* mesa: Bump instruction execution limit to 65536Ian Romanick2011-08-161-1/+1
| | | | | | | | | | | Shader Model 3.0[1] requires that shaders be able to execute at least 65536 instructions. Bump Mesa maxExec to that limit. This allows several vertex shaders in the OpenGL ES 2.0 conformance test suite to run to completion. 1: http://en.wikipedia.org/wiki/High_Level_Shader_Language Reviewed-by: Eric Anholt <[email protected]>
* mesa: Add partial constant propagation pass for Mesa IRIan Romanick2011-08-165-0/+458
| | | | | | | | | | | | This cleans up some code generated by the IR-to-Mesa pass for i915. In particular, some shaders involving arrays of constant matrices result in really bad code. v2: Silence several warnings from merging the gl_constant_value work. Fix DP[23] folding. Add support for a bunch more opcodes that appear in piglit runs on i915. Reviewed-by: Eric Anholt <[email protected]>
* ir_to_mesa: Emit a MAD(b, -a, b) for !a && bIan Romanick2011-08-161-0/+52
| | | | | | | | !a && b occurs frequently when nexted if-statements have been flattened. It should also be possible use a MAD for (a && b) || c, though that would require a MAD_SAT. Reviewed-by: Eric Anholt <[email protected]>
* ir_to_mesa: Implement ir_binop_all_equal using DP4 w/SGEIan Romanick2011-08-161-1/+12
| | | | | | | | | | | | | | | | | | | The operation ir_binop_all_equal is !(a.x != b.x || a.y != b.y || a.z != b.z || a.w != b.w). Logical-or is implemented using addition (followed by clampling to [0,1]) on values of 0.0 and 1.0. Replacing the logical-or operators with addition gives !bool((int(a.x != b.x) + int(a.y == b.y) + int(a.z == b.z) + int(a.w == b.w)). This can be implemented using a dot-product with a vector of all 1.0. After the dot-product, the value will be an integer on the range [0,4]. Previously a SEQ instruction was used to clamp the resulting logic value to [0,1] and invert the result. Using an SGE instruction on the negation of the dot-product result has the same effect. Many older shader architectures do not support the SEQ instruction. It must be emulated using two SGE instructions and a MUL. On these architectures, the single SGE saves two instructions. Reviewed-by: Eric Anholt <[email protected]>
* ir_to_mesa: Implement ir_binop_any_nequal using DP4 w/saturate or DP4 w/SLTIan Romanick2011-08-161-2/+20
| | | | | | | | | The operation ir_binop_any_nequal is (a.x != b.x) || (a.y != b.y) || (a.z != b.z) || (a.w != b.w), and that is the same as any(bvec4(a.x != b.x, a.y != b.y, a.z != b.z, a.w != b.w)). Implement the any() part the same way the regular ir_unop_any is implemented. Reviewed-by: Eric Anholt <[email protected]>
* ir_to_mesa: Implement ir_unop_any using DP4 w/saturate or DP4 w/SLTIan Romanick2011-08-161-4/+23
| | | | | | | | | | | | | | | | | | | | | | This is just like the ir_binop_logic_or case. The operation ir_unop_any is (a.x || a.y || a.z || a.w). Logical-or is implemented using addition (followed by clampling to [0,1]) on values of 0.0 and 1.0. Replacing the logical-or operators with addition gives (a.x + a.y + a.z + a.w). This can be implemented using a dot-product with a vector of all 1.0. Previously a SNE instruction was used to clamp the resulting logic value to [0,1]. In a fragment shader, using a saturate on the dot-product has the same effect. Adding the saturate to the dot-product is free, so (at least) one instruction is saved. In a vertex shader, using an SLT on the negation of the dot-product result has the same effect. Many older shader architectures do not support the SNE instruction. It must be emulated using two SLT instructions and an ADD. On these architectures, the single SLT saves two instructions. Reviewed-by: Eric Anholt <[email protected]>
* ir_to_mesa: Make ir_to_mesa_visitor::emit_dp return the instructionIan Romanick2011-08-161-7/+7
| | | | Reviewed-by: Eric Anholt <[email protected]>
* ir_to_mesa: Implement ir_binop_logic_or using an add w/saturate or add w/SLTIan Romanick2011-08-161-4/+21
| | | | | | | | | | | | | | | | | | | Logical-or is implemented using addition (followed by clampling to [0,1]) on values of 0.0 and 1.0. Replacing the logical-or operators with addition gives a + b which has a result on the range [0, 2]. Previously a SNE instruction was used to clamp the resulting logic value to [0,1]. In a fragment shader, using a saturate on the add has the same effect. Adding the saturate to the add is free, so (at least) one instruction is saved. In a vertex shader, using an SLT on the negation of the add result has the same effect. Many older shader architectures do not support the SNE instruction. It must be emulated using two SLT instructions and an ADD. On these architectures, the single SLT saves two instructions. Reviewed-by: Eric Anholt <[email protected]>
* ir_to_mesa: Implement ir_unop_logic_not using 1-xIan Romanick2011-08-161-1/+7
| | | | | | | Since our logic values are 0.0 (false) and 1.0 (true), 1.0 - x accurately implements logical not. Reviewed-by: Eric Anholt <[email protected]>
* mesa: Add Android to list of platforms that define fpclassify()Chad Versace2011-08-161-1/+1
| | | | | | This is a fix for the Android build. Signed-off-by: Chad Versace <[email protected]>
* mesa: Fix Android build by #ifdef'ing out locale supportChad Versace2011-08-161-1/+2
| | | | | | | Bionic does not support locales. This commit #ifdef's out the locale usage in _mesa_strtof(). Signed-off-by: Chad Versace <[email protected]>
* mesa: Remove use of fpu_control.hChad Versace2011-08-162-14/+0
| | | | | | | | | | | Remove the inclusion of fpu_control.h from compiler.h. Since Bionic lacks fpu_control.h, this fixes the Android build. Also remove the sole use of the fpu_control bits, which was in debug.c. Those were brianp's debug bits, and he approved of their removal. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* i965/vs: Fix multiplies to actually do 32-bit multiplies.Eric Anholt2011-08-162-1/+22
| | | | Fixes vs-op-mult-int-int and friends.
* i965/vs: Add support for conversion of FIXED_HW_REG src_reg to/from dst_reg.Eric Anholt2011-08-161-0/+2
| | | | This was quietly occurring in some emit code I produced, and failed.