Commit graph

16188 commits

Author SHA1 Message Date
Brian Paul
ee3da89b19 mesa: add Flags field to gl_program_parameter
Only one flag defined so far: PROG_PARAM_CENTROID_BIT

(cherry picked from commit 0f228d7ab3)
2009-01-06 08:51:45 -07:00
Brian Paul
716ccb11a2 mesa: issue error, don't crash, when calling a prototyped, but undefined function
Bug #18659.

(cherry picked from commit 4f05893415)
2009-01-06 08:51:24 -07:00
Brian Paul
db2cde413c mesa: better variable name: s/aux/store/
(cherry picked from commit b63a31b36f)
2009-01-06 08:51:00 -07:00
Brian Paul
515a43da16 mesa: minor comment reformattting
(cherry picked from commit bab4e78734)
2009-01-06 08:50:33 -07:00
Brian Paul
620a2bad22 mesa: glsl compiler debug code
RETURN0 macro reports file/line before returning zero.

(cherry picked from commit bf7f9d2143)
2009-01-06 08:50:14 -07:00
Brian Paul
e779e33261 mesa: rework GLSL array code generation
We now express arrays in terms of indirect addressing.  For example:
  dst = a[i];
becomes:
  MOV dst, TEMP[1 + TEMP[2].y];
At instruction-emit time indirect addressing is converted into ARL/
ADDR-relative form:
  ARL ADDR.x, TEMP[2].y;
  MOV dst, TEMP[1 + ADDR.x];
This fixes a number of array-related issues.  Arrays of arrays and complex
array/struct nesting works now.
There may be some regressions, but more work is coming.

(cherry picked from commit ae0ff8097b)
2009-01-06 08:49:40 -07:00
Brian Paul
ef4bd18a50 mesa: don't realloc instruction buffer so often
(cherry picked from commit e709d68d92)
2009-01-06 08:49:27 -07:00
Brian Paul
2a6c12cf53 mesa: updated comment
(cherry picked from commit d9fa9e3290)
2009-01-06 08:49:08 -07:00
Brian Paul
def84fac39 mesa: fix merge conflict left-overs 2009-01-06 08:48:27 -07:00
Brian Paul
ebcf06702c mesa: no longer need Writemask field in GLSL IR nodes
The Swizzle and Size fields carry all the info we need now.

(cherry picked from commit 80d6379722)
2009-01-06 08:47:40 -07:00
Brian Paul
9681119bbb mesa: revamp GLSL instruction emit code
This is a step toward better array handling code.  In particular, when more
than one operand of an instruction uses indirect addressing, we'll need some
temporary instructions and registers.  By converting IR storage to instruction
operands all in one place (emit_instruction()) we can be smarter about this.

Also, somewhat better handling of dst register swizzle/writemask handling.
This results in tighter writemasks on some instructions which is good for
SOA execution.

And, cleaner instruction commenting with inst_comment().

Next: remove some more dead code and additional clean-ups...

(cherry picked from commit 3a7ed9779b)
2009-01-06 08:47:21 -07:00
Brian Paul
e8fa7e500c mesa: make writemask_string() non-static
(cherry picked from commit 610c2461ce)

Conflicts:

	src/mesa/shader/prog_print.c
2009-01-06 08:47:05 -07:00
Brian Paul
2bdf076554 mesa: remove some do-nothing GLSL code
(cherry picked from commit 4c167f8fc1)
2009-01-06 08:46:12 -07:00
Brian Paul
ed8f857792 mesa: fix accidental regression in GLSL built-in texture matrix lookup
Was broken by commit 9aca9a4b72b2a7b378e50bd88f9c3324d07375ec.

(cherry picked from commit fe984aed5a)

Conflicts:

	src/mesa/shader/slang/slang_builtin.c
2009-01-06 08:45:53 -07:00
Brian Paul
5b66bc1a83 mesa: remove unused/obsolete __NormalMatrixTranspose matrix
(cherry picked from commit e556cc82f8)
2009-01-06 08:43:55 -07:00
Brian Paul
1ad6daf3a9 mesa: tweak program register printing for RelAddr case
(cherry picked from commit 557fde9531)
2009-01-06 08:43:14 -07:00
Brian Paul
20156ce5da mesa: allow relative indexing into all register files and indirect dst register indexing
(cherry picked from commit f4361540f8)

Conflicts:

	src/mesa/shader/prog_execute.c
2009-01-06 08:42:40 -07:00
Brian Paul
6b05708ce2 mesa: track initialization status of uniform variables. Plus, asst clean-ups.
(cherry picked from commit 2d76a0d77a)
2009-01-06 08:39:06 -07:00
Brian Paul
de44547891 mesa: initial support for uniform variable initializers.
This lets one specify initial values for uniforms in the code, avoiding
the need to call glUniform() in some cases.

(cherry picked from commit 379ff8c956)
2009-01-06 08:38:29 -07:00
Brian Paul
c478a1baca mesa: allows 'f' suffix on GLSL float literals
(cherry picked from commit 80c8017a64)
2009-01-06 08:37:13 -07:00
Brian Paul
45c8d996f6 mesa: add support for 'centroid' qualifier in GLSL 1.20
(cherry picked from commit 87d1a26ba3)

Conflicts:

	src/mesa/shader/slang/library/slang_vertex_builtin_gc.h
2009-01-06 08:36:30 -07:00
Brian Paul
2e77a39d2f mesa: add support for 'invariant' keyword for GLSL 1.20
(cherry picked from commit 448156f769)

Conflicts:

	src/mesa/shader/slang/library/slang_vertex_builtin_gc.h
2009-01-06 08:35:16 -07:00
Brian Paul
4adeac5af1 mesa: reformat comments, rewrap lines, etc for a little better readability
(cherry picked from commit b632e5aa7f)
2009-01-06 08:32:44 -07:00
Brian Paul
62bf6cf6c7 gallium: Fix typeo in mipmap filter for GL_UNSIGNED_SHORT_1_5_5_5_REV
This is copied from Ian's commit a330933bb7
2009-01-06 08:08:26 -07:00
José Fonseca
8ee1df0652 scons: Specify C99 throughout all the tree.
MSVC may not support full C99, but supports more than plain C90. And
-pedantic without -std=c99 generates too many spurious warnings
(specially C++ style comments) to be of any use.

Note that using certain C99 features in the cross-platform parts of Gallium
is still not possible; namely mid-of-scope variable declarations and named
structure initializers will break MSVC builds.
2009-01-05 15:24:56 +00:00
Brian Paul
49c40b10c7 gallium: implement TGSI_OPCODE_DP2A, add sqrt to NRM3/NRM4 2008-12-24 14:14:07 +01:00
Keith Whitwell
fc4cea08fe tgsi: fix incomplete rename of loop counter variable 2008-12-23 18:16:49 +00:00
Keith Whitwell
f5d4274b4a draw: allow driver-override of draw_need_pipeline() 2008-12-23 15:11:41 +00:00
Michal Krol
ed7ba03256 tgsi: Dump indirect register swizzle. 2008-12-23 15:13:59 +01:00
Michal Krol
4b3c74b4d6 tgsi: Return 0.0 for negative constant register indices. 2008-12-22 21:43:07 +01:00
Michal Krol
b8e68f2e55 tgsi: Keep address register as a floating point. 2008-12-22 21:43:05 +01:00
José Fonseca
417a78bdad softpipe: Don't fill surfaces's winsys fields.
This is sometimes checked to distinguish between texture views and
(deprecated) standalone surfaces.
2008-12-22 20:23:59 +00:00
José Fonseca
fc16ba8553 softpipe: Call surface_alloc_storage to get the pipebuffer for display targets.
Otherwise blitting from display target surfaces to front screen fails in
several platforms.
2008-12-22 20:20:58 +00:00
Jerome Glisse
5f36c5b2c5 softpipe: initialize refcount and winsys 2008-12-22 18:56:20 +00:00
Jerome Glisse
85bc49a6f1 softpipe: convert to use texture instead of surface 2008-12-22 18:56:09 +00:00
José Fonseca
ae7e75d610 gallium: const correctness. 2008-12-22 16:55:27 +00:00
José Fonseca
229424b2d7 Ignore new tests executables. 2008-12-21 13:48:43 +00:00
José Fonseca
9127a03bcb gallium: Fix typo in define name. 2008-12-20 12:59:51 +00:00
José Fonseca
b901e1f212 gallium: Simple and efficient cache.
Fixed size hash table. Collisions are handled by simply destroying the
previous entry.

It hasn't received much testing yet.
2008-12-19 20:06:11 +00:00
Brian Paul
030a7a320c gallium: replace #elif with #else 2008-12-19 07:33:17 -07:00
Brian Paul
59a168d5c9 tgsi: scan for additional info: uses_fogcoord, uses_frontfacing 2008-12-18 18:08:32 -07:00
Brian Paul
78a204f507 gallium: fix two-sided lighting test in state tracker
This fixes two-sided lighting for vertex shaders.
2008-12-18 16:12:08 -07:00
Robert Ellison
36c7bb697d Gallium: fix for conform test
The following construction in util_surface_copy() in
gallium/auxiliary/util/u_rect.c, introduced in commit
d177c9ddda, incorrectly inverts
the Y coordinate in the last parameter to pipe_copy_rect().

      /* If do_flip, invert src_y position and pass negative src stride
*/
      pipe_copy_rect(dst_map,
                     &dst->block,
                     dst->stride,
                     dst_x, dst_y,
                     w, h,
                     src_map,
                     do_flip ? -(int) src->stride : src->stride,
                     src_x,
                     do_flip ? w - src_y : src_y);

The intention is to start at the last Y coordinate line and move
backwards, in the case of a flip; in that case, the correct
calculation is "src_y + h - 1", not "w - src_y".

This fixes a Gallium assertion failure in the conformance tests:

      u_rect.c:65:pipe_copy_rect: Assertion `src_y >= 0' failed.
      debug_get_bool_option: GALLIUM_ABORT_ON_ASSERT = TRUE
      Trace/breakpoint trap
2008-12-18 11:25:27 -07:00
Michal Krol
97d08366aa glsl: Fix handling of nested parens in macro actual arguments. 2008-12-18 11:14:11 -07:00
Eric Anholt
a402d48f84 mesa: Pass the context to query object delete cb to avoid null dereference. 2008-12-18 09:47:49 -07:00
José Fonseca
92dc8ffa71 gallium: Enable memory debugging on all windows platforms. 2008-12-18 14:59:42 +00:00
Brian Paul
f9c76750a7 mesa: choose GLSL vertex shader over ARB/internal vertex program in get_fp_input_mask()
This is a work-around the for the fact that we do fragment shader state
validation before vertex shader validation (see comments in state.c) so in
get_fp_input_mask() we can't rely on ctx->VertexProgram._Current being up to
date yet.

This fixes a glean glsl1 test failure.
2008-12-17 19:05:26 -07:00
Brian Paul
b890fffbf4 gallium: fix memory corruption in u_gen_mipmap.c
Remove the old/initial vbuf allocation in util_create_gen_mipmap().
We were allocating a small vbuf at this point so get_next_slot() didn't have
as large of buffer as it expected.  So all but the first set_vertex_data()
was writing out of bounds.

Also added some comments.
2008-12-17 19:05:14 -07:00
Brian Paul
947d04d08b mesa: fix fixed-function test in get_fp_input_mask() - again.
The problem we're solving only occured when there was a user-defined
vertex shader but no fragment shader.  Check for that case now.
Fixes glean api2 vertex array failure.
2008-12-17 14:06:56 -07:00
Brian Paul
35bb2aa96a mesa: add missing cases for texture array targets 2008-12-17 14:06:34 -07:00