summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Add ARB_ES3_compatibility flag.Paul Berry2012-12-062-0/+2
| | | | | | | | | | | | | Adding this now makes it easier to develop and test GLES3 features, since we can do initial development and testing using desktop GL. Later GLSL compiler patches check for either ctx->Extensions.ARB_ES3_compatibility or _mesa_is_gles3 to allow certain features (i.e., "#version 300 es"). [v2, idr]: Just edits to the commit message. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Carl Worth <[email protected]>
* mesa: use rand() instead of random()Brian Paul2012-12-061-1/+1
| | | | | | | As Vinson Lee did in commit bb284669f85a32900bfec648d68ba4c4300772f4 in hash_table.c Signed-off-by: Brian Paul <[email protected]>
* mesa: validate that sync objects were created by mesaJordan Justen2012-12-063-15/+26
| | | | | | | | | | | | | | Previously, the user could send in a pointer that was not created by mesa. When we dereferenced that pointer, there would be an exception. Now we keep a set of pointers and verify that the pointer exists in that set before dereferencing it. Note: This fixes several crashing gles3conform tests. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* main/syncobj: return GL_INVALID_VALUE for invalid sync objectsJordan Justen2012-12-061-4/+4
| | | | | | | | Note: The GL/GLES3 web man pages don't seem to properly document glWaitSync's error when the sync object is invalid. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add set support (stores a set of pointers)Eric Anholt2012-12-064-0/+444
| | | | | | | | | From: git://people.freedesktop.org/~anholt/hash_table Reviewed-by: Jordan Justen <[email protected]> [[email protected]: minor rework for mesa] Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* meta: Disable GL_FRAGMENT_SHADER_ATI in MESA_META_SHADERStefan Dösinger2012-12-061-0/+11
| | | | | | | | | Fixes clears in Wine on r200. NOTE: This is a candidate for stable release branches. Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* radeon: Initialize swrast before setting limitsStefan Dösinger2012-12-061-9/+9
| | | | | | NOTE: This is a candidate for stable release branches. Signed-off-by: Alex Deucher <[email protected]>
* r200: Initialize swrast before setting limitsStefan Dösinger2012-12-061-10/+9
| | | | | | | | | Otherwise the driver announces 4096 vertex shader constants and other way too high limits. NOTE: This is a candidate for stable release branches. Signed-off-by: Alex Deucher <[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]>
* i965: Add a debug flag for counting cycles spent in each compiled shader.Eric Anholt2012-12-0517-9/+524
| | | | | | | | | | | | | | | | | | | | | | This can be used for two purposes: Using hand-coded shaders to determine per-instruction timings, or figuring out which shader to optimize in a whole application. Note that this doesn't cover the instructions that set up the message to the URB/FB write -- we'd need to convert the MRF usage in these instructions to GRFs so that our offsets/times don't overwrite our shader outputs. Reviewed-by: Kenneth Graunke <[email protected]> (v1) v2: Check the timestamp reset flag in the VS, which is apparently getting set fairly regularly in the range we watch, resulting in negative numbers getting added to our 32-bit counter, and thus large values added to our uint64_t. v3: Rebase on reladdr changes, removing a new safety check that proved impossible to satisfy. Add a comment to the AOP defs from Ken's review, and put them in a slightly more sensible spot. v4: Check timestamp reset in the FS as well.
* i965: Add a flag for instructions with normal writemasking disabled.Eric Anholt2012-12-054-0/+4
| | | | | For getting values from the new timestamp register, the channels we load have nothing to do with the pixels dispatched.
* mesa: expose ARB_texture_cube_map_array in core contexts as wellChris Forbes2012-12-051-1/+1
| | | | | | | | Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* i965/fs: Add support for uniform array access with a variable index.Eric Anholt2012-12-044-24/+216
| | | | | | | | | | | | | Serious Sam 3 had a shader hitting this path, but it's used rarely so it didn't show a significant performance difference (n=7). It does reduce compile time massively, though -- one shader goes from 14s compile time and 11723 instructions generated to .44s and 499 instructions. Note that some shaders lose 16-wide mode because we don't support 16-wide and pull constants at the moment (generally, things looping over a few-element array where the loop isn't getting unrolled). Given that those shaders are being generated with 15-20% fewer instructions, it probably outweighs the loss of 16-wide.
* i965/fs: Conditionalize constant-index UBO load code and add comments.Eric Anholt2012-12-041-28/+33
| | | | | I wanted to separate this step for easier reviewing when I add the variable-index case next.
* i965/fs: Restrict optimization that would fail for gen7's SENDs from GRFsEric Anholt2012-12-043-8/+28
| | | | | | v2: Fix SNB math bug in register_coalesce() where I was looking at the instruction to be removed, not the instruction to be copy propagated into.
* i965/fs: Allow source mods on gen7+ math.Eric Anholt2012-12-041-1/+1
| | | | | This gen6 restriction was removed in gen7 as the mathbox merge to act more like a normal instruction was finished in the hardware.
* i965/fs: Add instruction emit for varying-index reads of uniforms.Eric Anholt2012-12-044-0/+105
| | | | | | | The gen7 send-from-GRF path is sufficiently different from the perspective of IR generation and optimization that I just made it a separate opcode. v2: fix whitespace, rebase on Ken's recent refactor.
* i965/fs: Rename the existing pull constant load opcode.Eric Anholt2012-12-046-14/+16
| | | | | We're going to use another send message for handling loads with a varying per-fragment array index.
* i965: Add a header_present flag for setting up dp read messages.Eric Anholt2012-12-043-1/+7
| | | | | | As of gen7, we can skip the header on some messages, and this can make optimization on those messages much nicer when you've got GRFs instead of MRFs as the source.
* i965/gen7: Add some safety checks for send messages from GRFs.Eric Anholt2012-12-041-0/+15
|
* intel: Always enable GL_ARB_framebuffer_objectIan Romanick2012-12-031-2/+1
| | | | | | | | | | | | | | | Now that _mesa_BindFramebuffer does the right thing in ES contexts when the gl_extensions::ARB_framebuffer_object bit is set, the Intel driver doesn't need this hack. No piglit or GLES2 conformance regressions observed on IVB, and this patch (and the previous) fix es3conform's framebuffer_srgb_draw and transform_feedback_misc tests. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Only require Gen'ed name for glBind{Framebuffer,Renderbuffer} on desktopIan Romanick2012-12-031-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Desktop OpenGL implementations that support either GL_ARB_framebuffer_object or OpenGL 3.0 must require names from glGenFramebuffers for glBindFramebuffer. We have enforced this rule for quite some time. However, OpenGL ES 1.0, 2.0, and 3.0 implementations are required to allow user-defined names (e.g., not from glGenFramebuffers{OES,}). The Intel drivers have hacked around this by not enabling GL_ARB_framebuffer_object in an ES context. Instead, just pick the correct behavior in _mesa_BindFramebuffer based on the context API. Chad pointed out in a review e-mail: "I'd like to point out, though, that glBindFramebufferEXT and glBindRenderbufferEXT are still broken on desktop GL because they don't accept user-genned names. But that fix belongs to a different series." Currently glBindFramebufferEXT is an alias for glBindFramebuffer. Unalising two functions presents some difficulty, so we'll have to revisit this eventually. v2: Perform same check in _mesa_BindRenderbuffer too. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> [v1]
* mesa: fix uint64 printing in syncobj.cBrian Paul2012-12-031-1/+3
| | | | | | | | | To silence printf format warnings. v2: insert "0x" prefix Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa: Disable GL_NV_primitive_restart extension in core contexts.Kenneth Graunke2012-12-031-1/+1
| | | | | | | | | | | | | | | | The NV formulation of primitive restart is turned on/off with glEnableClientState/glDisableClientState. These two functions don't exist in core contexts, which mean that GL_NV_primitive_restart is essentially useless...even broken. However, leaving it on causes oglconform's primitive-restart-nv tests to run in OpenGL 3.1 contexts, which results in them all failing. This patch causes 29 subtests to go from "fail" to "not run". NOTE: This is a candidate for stable branches. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: Allow INTEL_DEBUG=fs as a synonym for INTEL_DEBUG=wm.Kenneth Graunke2012-12-031-0/+1
| | | | | | | | | | | I keep accidentally trying to use it. "fs" is a sensible name for fragment shader debugging, and "wm" is...not. It's also more symmetric with "vs". Leave INTEL_DEBUG=wm because old habits die hard. Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Include codegen time in the INTEL_DEBUG=perf stall detection.Eric Anholt2012-12-032-12/+18
| | | | | | | In the VS case, we were missing the entire compile time in the stall detection! Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Don't leak the IR annotation into later instructions.Eric Anholt2012-12-032-0/+2
| | | | | | | | | After walking our IR instructions (Mesa or GLSL), we don't want to also mark the start of the FB/URB writes or whatever as being that IR. This can end up being misleading when the end of the IR visit got copy propagated out to a later instruction in the URB writes. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vp: Fix crashes with INTEL_DEBUG=vs.Eric Anholt2012-12-031-0/+1
| | | | | | | The VP generation doesn't set up the output reg strings, so if you didn't happen to get these values as 0 on the stack, you'd lose. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vs: Fix uninitialized shader pointer used in debug output.Eric Anholt2012-12-031-0/+2
| | | | Reviewed-by: Kenneth Graunke <[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]>
* st/mesa: add null pointer check in st_renderbuffer_delete()Brian Paul2012-12-031-4/+4
| | | | | | | In my testing I haven't found any cases where we get a null context pointer, but it might still be possible. Check for null just to be safe. Note: This is a candidate for the stable branches.
* mesa: remove warning message in _mesa_reference_renderbuffer_()Brian Paul2012-12-031-4/+1
| | | | | | | | | | | | We were warning when there was no current context and we're about to delete a renderbuffer, but that happens fairly often and isn't really a problem. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=57754 Note: This is a candidate for the stable branches. Tested-by: Ian Romanick <[email protected]>
* st/mesa: make st_flush do what glFlush doesMarek Olšák2012-12-021-0/+1
|
* glx/dri2: add and use new driver hook flush_with_flagsMarek Olšák2012-12-023-3/+3
|
* radeon: Fix memory leak in radeonCreateScreen2.Vinson Lee2012-11-301-1/+3
| | | | | | | Fixes a memory leak defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* nouveau: Fix build.Brian Paul2012-11-301-1/+1
| | | | | | | | Fixes nouveau build failure introduced at c73245882c7ff1277b190b97f093f7b423a22f10. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57746 Signed-off-by: Vinson Lee <[email protected]>
* i965/fs: Add fs_reg::is_zero() and is_one(); use for opt_algebraic().Kenneth Graunke2012-11-302-7/+24
| | | | | | | | | | | | | | | | | | These helper macros save you from writing nasty expressions like: if ((inst->src[1].type == BRW_REGISTER_TYPE_F && inst->src[1].imm.f == 1.0) || ((inst->src[1].type == BRW_REGISTER_TYPE_D || inst->src[1].type == BRW_REGISTER_TYPE_UD) && inst->src[1].imm.u == 1)) { Instead, you simply get to write inst->src[1].is_one(). Simple. Also, this makes the FS backend match the VS backend (which has these). This patch also converts opt_algebraic to use the new helper functions. As a consequence, it will now also optimize integer-typed expressions. Reviewed-by: Eric Anholt <[email protected]>
* st/mesa: fix context use-after-free problem in st_renderbuffer_delete()Brian Paul2012-11-301-3/+5
| | | | | | | | | | The use-after-free happened when the renderbuffer was shared by multiple contexts and we tried to delete the renderbuffer using a context which was previously deleted. Note: this is a candidate for the stable branches. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: pass context parameter to gl_renderbuffer::Delete()Brian Paul2012-11-3015-24/+29
| | | | | | | | | | We sometimes need a rendering context when deleting renderbuffers. Pass it explicitly instead of trying to grab a current context (which might be NULL). The next patch will make use of this. Note: this is a candidate for the stable branches. Reviewed-by: Jose Fonseca <[email protected]>
* i965/fp: Fix segfault on gen4 TXB instructions.Eric Anholt2012-11-291-0/+2
| | | | | | | | | | The gen4 simd16 workaround looks at ir->type to determine how much storage to allocate for the simd16 value. In fragment programs, texturing only ever returns float vec4s (unlike GLSL, which can also have scalar floats or vector integers), so this is the right type. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56962 Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Fix GL_LUMINANCE handling for textures in glGetTexImageAnuj Phogat2012-11-292-14/+41
| | | | | | | | | | | | | | | | | | | | | | | | | We need to rebase colors (ex: set G=B=0) when getting GL_LUMINANCE textures in following cases: 1. If the luminance texture is actually stored as rgba 2. If getting a luminance texture, but returning rgba 3. If getting an rgba texture, but returning luminance A similar fix was pushed by Brian Paul for uncompressed textures in commit: f5d0ced. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=47220 Observed no regressions in piglit and ogles2conform due to this fix. This patch will cause failures in intel oglconform pxconv-gettex, pxstore-gettex and pxtrans-gettex test cases. The cause of failures is a bug in test cases. Expected luminance value is calculted incorrectly in test cases: L = R+G+B. V2: Set G = 0 when getting a RG texture but returning luminance. Note: This is a candidate for stable branches. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* Revert "meta: Don't try to glOrtho when the draw buffer isn't initialized."Kenneth Graunke2012-11-291-5/+3
| | | | | This reverts commit 9947470655bbf8f4a9c98fe6d93ff5c3486f1124. Apparently it caused a lot of Piglit regressions.
* mesa: Rename API_OPENGL to API_OPENGL_COMPAT.Paul Berry2012-11-2944-253/+253
| | | | | | | | | | This should help avoid confusion now that we're using the gl_api enum to distinguishing between core and compatibility API's. The corresponding enum value for core API's is API_OPENGL_CORE. Acked-by: Eric Anholt <[email protected]> Acked-by: Matt Turner <[email protected]> Acked-by: Kenneth Graunke <[email protected]>
* gallium/postprocess: share pipe_context and cso_context with the state trackerMarek Olšák2012-11-291-0/+2
| | | | | | | Using one context instead of two is more efficient and we can skip another context flush. Reviewed-by: Brian Paul <[email protected]>
* mesa: move some helper functions from fboobject.c to glformats.cMarek Olšák2012-11-293-119/+127
| | | | Reviewed-by: Brian Paul <[email protected]>
* android: include api_exec.c in generated files listTapani Pälli2012-11-291-0/+1
| | | | | Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965/vs: Move struct brw_compile (p) entirely inside vec4_generator.Kenneth Graunke2012-11-283-4/+3
| | | | | | | | | | | | | | The brw_compile structure contains the brw_instruction store and the brw_eu_emit.c state tracking fields. These are only useful for the final assembly generation pass; the earlier compilation stages doesn't need them. This also means that the code generator for future hardware won't have access to the brw_compile structure, which is extremely desirable because it prevents accidental generation of Gen4-7 code. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* i965/vs: Split final assembly code generation out of vec4_visitor.Kenneth Graunke2012-11-284-53/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Compiling shaders requires several main steps: 1. Generating VS IR from either GLSL IR or Mesa IR 2. Optimizing the IR 3. Register allocation 4. Generating assembly code This patch splits out step 4 into a separate class named "vec4_generator." There are several reasons for doing so: 1. Future hardware has a different instruction encoding. Splitting this out will allow us to replace vec4_generator (which relies heavily on the brw_eu_emit.c code and struct brw_instruction) with a new code generator that writes the new format. 2. It reduces the size of the vec4_visitor monolith. (Arguably, a lot more should be split out, but that's left for "future work.") 3. Separate namespaces allow us to make helper functions for generating instructions in both classes: ADD() can exist in vec4_visitor and create IR, while ADD() in vec4_generator() can create brw_instructions. (Patches for this upcoming.) Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* i965/vs: Abort on unsupported opcodes rather than failing.Kenneth Graunke2012-11-281-3/+4
| | | | | | | | | | Final code generation should never fail. This is a bug, and there should be no user-triggerable cases where this could occur. Also, we're not going to have a fail() method after the split. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* i965/vs: Move uses of brw_compile from do_vs_prog to brw_vs_emit.Kenneth Graunke2012-11-283-14/+19
| | | | | | | | | | | | The brw_compile structure is closely tied to the Gen4-7 hardware encoding. However, do_vs_prog is very generic: it just calls out to get a compiled program and then uploads it. This isn't ultimately where we want it, but it's a step in the right direction: it's now closer to the code generator. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>