summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* llvmpipe: add NV_conditional_render support.Dave Airlie2011-11-107-0/+43
| | | | | | | | This ports the softpipe NV_conditional_render support to llvmpipe. This passes the nv_conditional_render-* piglit tests. Signed-off-by: Dave Airlie <[email protected]>
* r600g: remove useless texture barrierMarek Olšák2011-11-101-2/+0
|
* r600g: flush the whole context when CS is full, not just hw_contextMarek Olšák2011-11-103-1/+6
| | | | Because we disable render condition in r600_flush, but not in r600_context_flush.
* r600g: turn some CS overflow checks into assertionsMarek Olšák2011-11-102-12/+2
| | | | They're not really exhaustive and not so useful either.
* r600g: put the rest of CS overflow checks in r600_need_cs_spaceMarek Olšák2011-11-103-18/+9
|
* r600g: flush caches regardless of render conditionMarek Olšák2011-11-101-5/+5
| | | | What if somebody enables render condition just before we flush...
* r600g: disable render condition at the end of CS, re-enable at the beginningMarek Olšák2011-11-102-0/+19
|
* r600g: don't suspend queries if they have already been suspended by blitterMarek Olšák2011-11-101-2/+11
| | | | And add some assertions.
* r600g: properly reserve CS space for queries_suspendMarek Olšák2011-11-103-21/+18
|
* r600g: reserve CS space for a draw command in begin_query and render_conditionMarek Olšák2011-11-103-11/+25
| | | | There's no point in emitting those if you can't emit a draw command too.
* r600g: consolidate checking whether CS is fullMarek Olšák2011-11-103-31/+28
| | | | | | This adds a new function r600_need_cs_space. Currently, it's easy to overflow the CS - queries are not counted in. I guess that's not the only case where the driver may crap out.
* radeon: fix tex1d-border2dDave Airlie2011-11-101-31/+33
| | | | | | Fixes pigit test with T wrap usage. Signed-off-by: Dave Airlie <[email protected]>
* radeon: fix 3-coordinate swtcl emissionDave Airlie2011-11-101-0/+8
| | | | | | This fixes mipmap generation on swtcl rv100. Signed-off-by: Dave Airlie <[email protected]>
* swrast: Add support for glReadPixels() to integer types.Eric Anholt2011-11-091-6/+13
| | | | | | | With this change, i965 passes GL_EXT_texture_integer/fbo_integer_precision_clear Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add support for unpacking 32-bit integer formats to int spans.Eric Anholt2011-11-092-0/+128
| | | | | | | | | This is the inverse operation to _mesa_pack_rgba_span_int. The 16-bit code isn't done because of lack of testing and not being sure how sign extension/clamping should be handled between, say, 16-bit int and 32-bit int or uint. Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Add support for glClear() to integer color buffers.Eric Anholt2011-11-091-4/+109
| | | | | | | | | | This requires using a new fragment shader to get the integer color output, and a new vertex shader because #version has to match between the two. v2: Clarify that there's no need for BindFragDataLocation. Reviewed-by: Kenneth Graunke <[email protected]> (v1)
* i965: Claim to support rendering to integer FBOs.Eric Anholt2011-11-092-1/+13
| | | | | | | | | | | | We're missing support for the software paths still, but basic rendering is working. v2: Override RGB_INT32/UINT32 to not be renderable, since the hardware can't do it but we do allow texturing from it now. Drop the DataType override, since the _mesa_problem() isn't in that path any more. Reviewed-by: Kenneth Graunke <[email protected]> (v1)
* i965/fs: Add support for user-defined out variables.Eric Anholt2011-11-092-35/+39
| | | | | | | | | | | | Before, I was tracking the ir_variable * found for gl_FragColor or gl_FragData[]. Instead, when visiting those variables, set up an array of per-render-target fs_regs to copy the output data from. This cleans up the color emit path, while making handling of multiple user-defined out variables easier. v2: incorporate idr's feedback about ir->location (changes by Kenneth Graunke) Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Preserve the source register type when doing color writes.Eric Anholt2011-11-091-4/+7
| | | | | | | When rendering to integer color buffers, we need to be careful to use MRFs of the correct type when emitting color writes. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Make brw_type_for_base_type return the element type for arrays.Eric Anholt2011-11-091-0/+1
| | | | | | | | | | | | | | | | Previously, brw_type_for_base_type returned UD for array variables, similar to structures. For structures, each field may have a different type, so every field access must explicitly override the register's type with that field's type. We chose to return UD in this case since it was the least common, so errors would be more obvious. For arrays, it makes far more sense to return the type corresponding to an element of the array. This allows normal array access to work without the hassle of explicitly overriding the register's type. This should obsolete a bunch of type overrides throughout the code. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Enable ChooseTexFormat for supported GL_EXT_texture_integer formats.Eric Anholt2011-11-091-0/+30
| | | | | | | v2: s/GL_TRUE/true/, and re-enable RGB_INT32 based on discussion yesterday about required RB formats vs texture formats. Reviewed-by: Kenneth Graunke <[email protected]> (v1)
* i965: Add mapping from MESA_FORMAT to BRW_SURFACEFORMAT for integer.Eric Anholt2011-11-091-0/+24
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Expose GL_EXT_texture_integer when GL 3.0 override is set.Eric Anholt2011-11-091-0/+10
| | | | | | | This will let the feature be incrementally developed, hidden behind the flag we're all using as we work on GL 3.0 support. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Add support for 16-bit unorm L, A, and I textures.Eric Anholt2011-11-092-1/+8
| | | | | | | | | | | | While not required by any particular spec version, mplayer was asking for L16 and hoping for actual L16 without checking. The 8 bits allocated led to 10-bit planar video data stored in the lower 10 bits giving only 2 bits of precision in video. While it was an amusing effect, give them what they actually wanted instead. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41461 Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Don't _mesa_problem when asked for an RB of a texturing-only type.Eric Anholt2011-11-092-2/+11
| | | | | | | | We want to be able to support some formats for texturing that we can't render to, which means that some choices for RenderbufferStorage end up being incomplete (for example, L8 currently). For these, where we don't render to them, we don't want to have to make up an rb->DataType that's only used for GetRow()/PutRow().
* r200: remove dangling radeon.h symlink.Paul Berry2011-11-091-1/+0
| | | | | | | | | | | | Commit 1401b96b (radeon: cleanup radeon shared code after r300 and r600 classic drivers removal) removed the file src/mesa/drivers/dri/radeon/server/radeon.h, but it left behind the symlink which was used to share that file into the src/mesa/drivers/dri/r200/server directory. This patch removes the dangling symlink. Reviewed-by: Alex Deucher <[email protected]>
* glsl: Assign transform feedback varying slots in linker.Paul Berry2011-11-092-63/+503
| | | | | | | | | | | | | | | | | | | | This patch modifies the GLSL linker to assign additional slots for varying variables used by transform feedback, and record the varying slots used by transform feedback for use by the driver back-end. This required modifying assign_varying_locations() so that it assigns a varying location if either (a) the varying is used by the next stage of the GL pipeline, or (b) the varying is required by transform feedback. In order to avoid duplicating the code to assign a single varying location, I moved it into its own function, assign_varying_location(). In addition, to support transform feedback in the case where there is no fragment shader, it is now possible to call assign_varying_locations() with a consumer of NULL. Reviewed-by: Marek Olšák <[email protected]> Tested-by: Marek Olšák <[email protected]>
* glsl: Clamp vector indices when lowering to swizzlesIan Romanick2011-11-091-2/+20
| | | | | | | | | | | | | This prevents other code from seeing a swizzle of the 16th component of a vector, for example. NOTE: This is a candidate for the 7.11 branch. Signed-off-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42517 Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]> Tested-by: Christian Holler <[email protected]>
* mesa,glsl,mapi: Put extern "C" { ... } where appropriate.José Fonseca2011-11-0920-33/+158
| | | | | Probably a several places missing, but enough to cover all headers (in)directly included by uniform_query.cpp, and fix the MSVC build.
* scons: Don't list m_xform.c twice.José Fonseca2011-11-091-5/+0
|
* glu: Fix deprecated conversion from string constant to ‘char*’ warning.José Fonseca2011-11-092-2/+2
|
* r600g: clarify meaning of one variable in shader codegenMarek Olšák2011-11-091-1/+1
| | | | It's easier to read now.
* r600g: cosmetic changes in query codeMarek Olšák2011-11-092-10/+7
| | | | Mainly updating comments and removing one use of a magic number.
* r600g: use modulo for computing index into query (ring) buffersMarek Olšák2011-11-091-14/+5
|
* r600g: make r600_query_result more genericMarek Olšák2011-11-091-15/+37
| | | | | We'll soon start adding new query types, maybe even querying more than one value per query.
* Remove tgsi_sse2.José Fonseca2011-11-0820-7048/+3
| | | | tgsi_exec is simple. llvm is fast. tgsi_sse2 ends up being neither.
* mesa: fix signed/unsigned integer comparison warningsBrian Paul2011-11-082-5/+9
| | | | Reviewed-by: Ian Romanick <[email protected]>
* glsl: remove trailing comma to silence warningBrian Paul2011-11-081-1/+1
|
* mesa: Implement glGetFragDataLocationIan Romanick2011-11-082-20/+56
| | | | | | | | Fixes piglit's getfragdatalocation test. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* linker: Use app-specified fragment data location during linkingIan Romanick2011-11-084-8/+25
| | | | | | | | Fixes piglit's bindfragdata-link-error. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Stub implementation of glBindFragDataLocationIan Romanick2011-11-082-18/+37
| | | | | | | | | | This just validates the input parameters so far. Fixes piglit's bindfragdata-invalid-parameters test. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* softpipe: don't clamp or do logical operations on floating-point buffers.Morgan Armand2011-11-081-22/+54
| | | | Signed-off-by: Brian Paul <[email protected]>
* st/mesa: Fix memory leak on error path.Vinson Lee2011-11-071-1/+3
| | | | | | Fixes Coverity resource leak defect. Reviewed-by: José Fonseca <[email protected]>
* st/dri: Fix memory leak on error path.Vinson Lee2011-11-071-1/+3
| | | | | | Fixes Coverity resource leak defect. Reviewed-by: José Fonseca <[email protected]>
* glsl: Generate IR for switch statementsDan McCabe2011-11-073-45/+254
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until now modifying the GLSL compiler has been pretty straightforward. This is where things get interesting. But still pretty straightforward. Switch statements can be thought of a series of if/then/else statements. Case labels are compared with the value of a test expression and the case statements are executed if the comparison is true. There are a couple of aspects of switch statements that complicate this simple view of the world. The primary one is that cases can fall through sequentially to subsequent case, unless a break statement is encountered, in which case, the switch statement exits completely. But break handling is further complicated by the fact that a break statement can impact the exit of a loop. Thus, we need to coordinate break processing between switch statements and loop statements. The code generated by a switch statement maintains three temporary state variables: int test_value; bool is_fallthru; bool is_break; test_value is initialized to the value of the test expression at the head of the switch statement. This is the value that case labels are compared against. is_fallthru is used to sequentially fall through to subsequent cases and is initialized to false. When a case label matches the test expression, this state variable is set to true. It will also be forced to false if a break statement has been encountered. This forcing to false on break MUST be after every case test. In practice, we defer that forcing to immediately after the last case comparison prior to executing a case statement, but that is an optimization. is_break is used to indicate that a break statement has been executed and is initialized to false. When a break statement is encountered, it is set to true. This state variable is then used to conditionally force is_fallthru to to false to prevent subsequent case statements from executing. Code generation for break statements depends on whether the break statement is inside a switch statement or inside a loop statement. If it inside a loop statement is inside a break statement, the same code as before gets generated. But if a switch statement is inside a loop statement, code is emitted to set the is_break state to true. Just as ASTs for loop statements are managed in a stack-like manner to handle nesting, we also add a bool to capture the innermost switch or loop condition. Note that we still need to maintain a loop AST stack to properly handle for-loop code generation on a continue statement. Technically, we don't (yet) need a switch AST stack, but I am using one for orthogonality with loop statements, in anticipation of future use. Note that a simple boolean stack would have sufficed. We will illustrate a switch statement with its analogous conditional code that a switch statement corresponds to by examining an example. Consider the following switch statement: switch (42) { case 0: case 1: gl_FragColor = vec4(1.0, 2.0, 3.0, 4.0); case 2: case 3: gl_FragColor = vec4(4.0, 3.0, 2.0, 1.0); break; case 4: default: gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); } Note that case 0 and case 1 fall through to cases 2 and 3 if they occur. Note that case 4 and the default case must be reached explicitly, since cases 2 and 3 break at the end of their case. Finally, note that case 4 and the default case don't break but simply fall through to the end of the switch. For this code, the equivalent code can be expressed as: int test_val = 42; // capture value of test expression bool is_fallthru = false; // prevent initial fall through bool is_break = false; // capture the execution of a break stmt is_fallthru |= (test_val == 0); // enable fallthru on case 0 is_fallthru |= (test_val == 1); // enable fallthru on case 1 is_fallthru &= !is_break; // inhibit fallthru on previous break if (is_fallthru) { gl_FragColor = vec4(1.0, 2.0, 3.0, 4.0); } is_fallthru |= (test_val == 2); // enable fallthru on case 2 is_fallthru |= (test_val == 3); // enable fallthru on case 3 is_fallthru &= !is_break; // inhibit fallthru on previous break if (is_fallthru) { gl_FragColor = vec4(4.0, 3.0, 2.0, 1.0); is_break = true; // inhibit all subsequent fallthru for break } is_fallthru |= (test_val == 4); // enable fallthru on case 4 is_fallthru = true; // enable fallthru for default case is_fallthru &= !is_break; // inhibit fallthru on previous break if (is_fallthru) { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); } The code generate for |= and &= uses the conditional assignment capabilities of the IR. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Reference data structure ctors in grammarDan McCabe2011-11-073-16/+193
| | | | | | | | | | | | | | | | | We now tie the grammar to the ctors of the ASTs they reference. This requires that we actually have definitions of the ctors. In addition, we also need to define "print" and "hir" methods for the AST classes. The Print methods are pretty simple to flesh out. However, at this stage of the development, we simply stub out the "hir" methods and flesh them out later. Also, since actual class instances get returned by the productions in the grammar, we also need to designate the type of the productions that reference those instances. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Create AST structs corresponding to new productions in grammarDan McCabe2011-11-071-0/+59
| | | | | | | | | | | Previously we added productions for: switch_body case_label_list case_statement case_statement_list Now add AST structs corresponding to those productions. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Add productions to GLSL grammar for switch statementDan McCabe2011-11-071-3/+61
| | | | | | | | | | | | | The grammar is modified to support switch statements. Rather than follow the grammar in the appendix, which allows case labels to be placed ANYWHERE as a regular statement, we follow the development of the grammar as described in the body of the GLSL spec. In this variation, the switch statement has a body which consists of a list of case statements. A case statement is preceded by a list of case labels and ends with a list of statements. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Create AST data structures for switch statement and case labelDan McCabe2011-11-071-4/+20
| | | | | | | Data structures for switch statement and case label are created that parallel the structure of other AST data. Reviewed-by: Kenneth Graunke <[email protected]>
* util: add log2f for AndroidChia-I Wu2011-11-071-0/+11
| | | | | | | | | It is needed for nv50's new shader backend. With this change, both u_math.h and imports.h in core mesa define the same function. I have to #undef log2f here to avoid the conflict. Not sure if there is a better way to deal with the situation. Acked-by: José Fonseca <[email protected]>