summaryrefslogtreecommitdiffstats
path: root/src/mesa/program
Commit message (Collapse)AuthorAgeFilesLines
* mesa: use GLbitfield64 when copying program inputsBrian Paul2013-01-251-2/+2
| | | | | | Note: This is a candidate for the 9.0 branch. Reviewed-by: José Fonseca <[email protected]>
* mesa: add some casts to silence MSVC warningsBrian Paul2013-01-251-14/+14
| | | | Reviewed-by: José Fonseca <[email protected]>
* glsl: Extend ir_expression_operation for ARB_shading_language_packingMatt Turner2013-01-251-0/+4
| | | | | | | | | For each function {pack,unpack}{Snorm,Unorm}4x8, add a corresponding opcode to enum ir_expression_operation. Validate the new opcodes in ir_validate.cpp. Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Modify uniform_field_visitor::visit_field to take a row_major parameterIan Romanick2013-01-251-2/+6
| | | | | | | | | | Not used yet, but the UBO layout visitor will use this. v2: Remove a spruious hunk. This is moved to the patch "glsl: Remove ir_variable::uniform_block". Suggested by Carl Worth. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Add ir_variable::is_in_uniform_block predicateIan Romanick2013-01-251-1/+1
| | | | | | | | | The way a variable is tested for this property is about to change, and this makes the code easier to modify. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Carl Worth <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Add GLSL_TYPE_INTERFACEIan Romanick2013-01-251-0/+2
| | | | | | | | | | | | | | | | | | | | | Interfaces are structurally identical to structures from the compiler's point of view. They have some additional restrictions, and generally GPUs use different instructions to access them. Using a different base type should make this a bit easier. This commit also adds the glsl_type::interface_packing fields. For GLSL_TYPE_INTERFACE types, this will track the specified packing mode. It is analogous to gl_uniform_buffer::_Packing. v2: Add serveral missing GLSL_TYPE_INTERFACE cases in switch-statements. v3: Add information about glsl_type::interface_packing. Move row_major checking in glsl_type::record_key_compare from this patch to the previous patch. Both suggested by Paul Berry. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Replace most default cases in switches on GLSL typeIan Romanick2013-01-251-4/+10
| | | | | | | | | | | | | | | This makes it easier to find switch-statements that need to be updated after a new GLSL_TYPE_* is added because the compiler will generate a warning. Switch-statements that only had a small number of cases (e.g., everything in ir_constant_expression.cpp) were not modified. I may regret that decision when we eventually add support for doubles. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Carl Worth <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Extend ir_expression_operation for GLSL 3.00 pack/unpack functions (v2)Chad Versace2013-01-241-1/+11
| | | | | | | | | | | | | | | | | For each function {pack,unpack}{Snorm,Unorm,Half}2x16, add a corresponding opcode to enum ir_expression_operation. Validate the new opcodes in ir_validate.cpp. Also, add opcodes for scalarized variants of the Half2x16 functions. (The code generator for the i965 fragment shader requires that all vector operations be scalarized. A lowering pass, to be added later, will scalarize the Half2x16 functions). v2: Fix assertion message in ir_to_mesa [for idr]. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Matt Tuner <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* glsl: Eliminate ambiguity between function ins/outs and shader ins/outsPaul Berry2013-01-241-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces the three ir_variable_mode enums: - ir_var_in - ir_var_out - ir_var_inout with the following five: - ir_var_shader_in - ir_var_shader_out - ir_var_function_in - ir_var_function_out - ir_var_function_inout This eliminates a frustrating ambiguity: it used to be impossible to tell whether an ir_var_{in,out} variable was a shader in/out or a function in/out without seeing where the variable was declared in the IR. This complicated some optimization and lowering passes, and would have become a problem for implementing varying structs. In the lisp-style serialization of GLSL IR to strings performed by ir_print_visitor.cpp and ir_reader.cpp, I've retained the names "in", "out", and "inout" for function parameters, to avoid introducing code churn to the src/glsl/builtins/ir/ directory. Note: a couple of comments in the code seemed to indicate that we were planning for a possible future in which geometry shaders could have shader-scope inout variables. Our GLSL grammar rejects shader-scope inout variables, and I've been unable to find any evidence in the GLSL standards documents (or extensions) that this will ever be allowed, so I've eliminated these comments. Reviewed-by: Carl Worth <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glcpp: Accept pointer to GL context rather than just the API versionCarl Worth2013-01-111-1/+1
| | | | | | | | | As the preprocessor becomes more sophisticated and gains more optional behavior, it's easiest to just pass the GL context pointer to it so that it can examine any fields there that it needs to (such as API version, or the state of any driconf options, etc.). Reviewed-by: Kenneth Graunke <[email protected]>
* Clean up .gitignore filesMatt Turner2013-01-101-1/+0
|
* mesa/program: Fix both Classic and Gallium buildQuentin Glidic2013-01-101-1/+1
| | | | | | | | | Follow-up for 907844107252260c646aca361191ef7f121f3d23 and 3a5ad21cd3f026579eeacc25b39513711556c7ee Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57044 Tested-by: Fabio Pedretti <[email protected]> Tested-by: Brad King <[email protected]>
* program/hash_table.c: rename to program/prog_hash_table.cJordan Justen2012-12-071-0/+0
| | | | | | | | Removes a collision of the object file name for main/hash_table and program/hash_table. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* android: Fix build of libmesa_programChad Versace2012-12-051-0/+3
| | | | | | | | | | | | | | | | | Commit 4097308 fixed the build in a questionable way. It worked at the time, but, as Ian pointed out, the fix would likely fail at a future commit due to the indeterminism of parallel builds. And that's exactly what happened; the fix no longer works. `mm -j4` on Fedora 17 fails for me. The problem is that there is no rule for program_parse.tab.h. To fix that, this patch adds a rule that makes program_parse.tab.c depend on program_parse.tab.h. Technically, the c file does not depend on the h file. However, because the two files are generated together by a single invocation of Bison, any rule that forces execution of Bison is sufficient. Signed-off-by: Chad Versace <[email protected]>
* android: fix bison warning of conflicting outputs to fileAdrian Marius Negreanu2012-12-031-3/+0
| | | | | | | | | | | | | | | | | | | Bison -o parameter expects a .c file. The corresponding .h filename is obtained by removing the extension of the initial .c. This was breaking compilation on Ubuntu 12.04 libmesa_dricore_intermediates/libmesa_dricore.a(program_parse.tab.o): In function `_mesa_parse_arb_program': external/mesa/src/mesa/program/program_parse.y:2682: multiple definition of `_mesa_parse_arb_program' libmesa_dricore_intermediates/libmesa_dricore.a(lex.yy.o):external/mesa/src/mesa/program/program_parse.y:2682: first defined here Signed-off-by: Adrian Marius Negreanu <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-and-tested-by: Chad Versace <[email protected]>
* Remove OpenVMS supportMatt Turner2012-11-162-104/+0
| | | | | | | | | | Not maintained since 2008. Doubtful that it's worked in quite a while. Also see commit 32ac8cb05 which removed VMS stuff from Makefile in 2009. Cc: Jouk Jansen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Andreas Boll <[email protected]>
* mesa: Fix gallium build since 6991c2922fEric Anholt2012-11-121-1/+1
| | | | | | | Looks like I screwed up and didn't test gallium again after tweaking the Makefile. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57044
* automake,android: Build program/ into a helper lib (v2)Eric Anholt2012-11-123-0/+142
| | | | | | | | | | While simplifying mesa/Makefile.am, the more important feature of this commit is allowing a file with the same name to appear in both main/ and program/. v2: [chadv] Add changes to Android makefiles. Reviewed-by: Kenneth Graunke <[email protected]> (v1) Signed-off-by: Chad Versace <[email protected]> (v2)
* mesa: Remove PROG_EMIT_VERTEX and PROG_END_PRIMITIVE opcodes.Kenneth Graunke2012-11-073-10/+0
| | | | | | | | These were only used for geometry shader support back in the days before the new GLSL compiler. Future geometry shader support will not use these. Reviewed-by: Ian Romanick <[email protected]>
* mesa: silence MSVC signed/unsigned comparision warnings in hash_table.cBrian Paul2012-10-291-1/+1
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* mesa: bump MAX_VARYING to 32Marek Olšák2012-10-291-2/+34
| | | | | | | | | | | | | | | | | We're starting to get apps utilizing more than 16 varyings and most current hardware supports 32 anyway. Tested with r600g. swrast, softpipe and llvmpipe still advertise 16 varyings. This fixes a WebGL crash after launching this demo: https://developer.mozilla.org/en-US/demos/detail/falling-cubes Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54402 NOTE: This is a candidate for the stable branches. Acked-by: Kenneth Graunke <[email protected]>
* mesa: Remove PROGRAM_WRITE_ONLY register type.Kenneth Graunke2012-10-162-5/+0
| | | | | | | More dead code. I'm not sure what it was for. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Remove dead _mesa_num_parameters_of_type() function.Kenneth Graunke2012-10-162-23/+0
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Remove dead _mesa_add_attribute() function.Kenneth Graunke2012-10-162-34/+0
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Remove remnants of PROGRAM_VARYING.Kenneth Graunke2012-10-163-11/+3
| | | | | | | | The previous patch removed the producer of things in this file. Since there aren't any, we can remove it. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Remove dead _mesa_add_varying() function.Kenneth Graunke2012-10-162-26/+0
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Remove dead program_parameter::Flags field.Kenneth Graunke2012-10-164-19/+12
| | | | | | | All flags are now gone, so we can stop storing and passing this around. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* st/mesa: Remove the PROG_PARAM_BIT_CYL_WRAP flag. [v2]Kenneth Graunke2012-10-161-8/+0
| | | | | | | | | Nobody ever set the flag, which makes this dead code. v2: Leave the ureg_DECL_fs_input_cyl function in place, even though it's unused, since VMWare uses it for their internal projects. Reviewed-by: Eric Anholt <[email protected]>
* mesa: Remove GLSL-related PROG_PARAM_BIT flags.Kenneth Graunke2012-10-162-12/+0
| | | | | | | | GLSL doesn't use the program code anymore. Accordingly, there were no consumers of these flags, so there's no need to define them. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Remove support for named parameters.Kenneth Graunke2012-10-165-26/+1
| | | | | | | | | | | These were only part of NV_fragment_program, so we can kill them. The fact that PROGRAM_NAMED_PARAM appears in r200_vertprog.c is rather comedic, but also demonstrates that people just spam the various types of parameters everywhere because they're confusing. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Remove yet more remnants of NV_fragment_program.Kenneth Graunke2012-10-161-8/+5
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Remove prog_print support for NV programs.Kenneth Graunke2012-10-162-56/+5
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Remove support for parsing NV fragment programs.Kenneth Graunke2012-10-162-1638/+0
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Remove the gl_program::Resident flag.Kenneth Graunke2012-10-161-1/+0
| | | | | | | It apparently was only used for NV programs. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Remove miscellaneous remains of NV_vertex_program.Eric Anholt2012-10-151-1/+0
| | | | | | v2: Rebase on top of get.c changes. Reviewed-by: Brian Paul <[email protected]> (v1)
* mesa: Remove prog_instruction.h field for never-supported NV_vertex_program3.Eric Anholt2012-10-153-15/+0
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Remove support for GL_VERTEX_STATE_PROGRAMs and their execution.Eric Anholt2012-10-151-1/+0
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Remove support for NV_vertex_program's tracked matrices.Eric Anholt2012-10-153-100/+0
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Remove Mesa IR opcodes that existed only for NV_vertex_program.Eric Anholt2012-10-155-84/+0
| | | | | | v2: Remove dead positive() function, caught by Matt. Reviewed-by: Brian Paul <[email protected]> (v1)
* mesa: Remove support for parsing NV vertex programs.Eric Anholt2012-10-152-1505/+0
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Note that OPCODE_RFL is not part of ARB_fp (it's NV_fp only).Eric Anholt2012-10-081-1/+1
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* register_allocate: don't consider trivially colorable registers for spilling.Paul Berry2012-10-031-0/+7
| | | | | | | | | | | | | | | | | Previously, we considered all registers as candidates for spilling. This was counterproductive--for any registers that have already been removed from the interference graph, there is no benefit to spilling them, since they don't contribute to register pressure. This patch ensures that we will only try to spill registers that are still in the interference graph after register allocation has failed. This is consistent with the recommendations of the paper "Retargetable Graph-Coloring Register Allocation for Irregular Architectures", on which our register allocator is based. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* ra: Add q_values parameter to ra_set_finalize()Tom Stellard2012-09-192-2/+15
| | | | | | This allows the user to pass precomputed q values to the allocator. Reviewed-by: Kenneth Graunke <[email protected]>
* ra: Clarify usage of ra_set_node_reg()Tom Stellard2012-09-191-0/+2
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: remove FEATURE_ATI_fragment_shader define.Oliver McFadden2012-09-151-6/+2
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_NV_(fragment|vertex)_program defines.Oliver McFadden2012-09-151-12/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_ARB_shader_objects and related defines.Oliver McFadden2012-09-151-6/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_es2_glsl and related defines.Oliver McFadden2012-09-151-4/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* ir_to_mesa: make some global variable staticDave Airlie2012-09-151-3/+3
| | | | | | | | nothing outside this file uses these. Reviewed-by: Matt Turner <[email protected]> Acked-by: Kenneth Graunke <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: make global perm variable static constDave Airlie2012-09-151-1/+1
| | | | | | | | this array doesn't look like it needs to be global or unconst. Reviewed-by: Matt Turner <[email protected]> Acked-by: Kenneth Graunke <[email protected]> Signed-off-by: Dave Airlie <[email protected]>