summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Add decoding functions for GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2Anuj Phogat2012-12-075-25/+171
| | | | | | | | Data in GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 format is decoded and stored in MESA_FORMAT_RGBA8888_REV. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add decoding functions for GL_COMPRESSED_SIGNED_RG11_EACAnuj Phogat2012-12-075-3/+98
| | | | | | | | Data in GL_COMPRESSED_SIGNED_RG11_EAC format is decoded and stored in MESA_FORMAT_SIGNED_GR1616. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add decoding functions for GL_COMPRESSED_SIGNED_R11_EACAnuj Phogat2012-12-075-3/+126
| | | | | | | | | | | | | | | | | | | | | | | | | Data in GL_COMPRESSED_SIGNED_R11_EAC format is decoded and stored in MESA_FORMAT_SIGNED_R16. v2: 16 bit signed data is converted to 16 bit unsigned data by adding 2 ^ 15 and stored in an unsigned texture format. v3: 1. Handle a corner case when base code word value is -128. As per OpenGL ES 3.0 specification -128 is not an allowed value and should be truncated to -127. 2. Converting a decoded 16 bit signed data to 16 bit unsigned data by adding 2 ^ 15 gives us an output which matches the decompressed image (.ppm) generated by ericsson's etcpack tool. ericsson is also doing this conversion in their tool because .ppm image files don't support signed data. But gles 3.0 specification doesn't suggest this conversion. We need to keep the decoded data in signed format. Both signed format tests in gles3 conformance pass with these changes. Signed-off-by: Anuj Phogat <[email protected]> Tested-by: Matt Turner <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add decoding functions for GL_COMPRESSED_RG11_EACAnuj Phogat2012-12-075-4/+98
| | | | | | | | Data in GL_COMPRESSED_RG11_EAC format is decoded and stored in MESA_FORMAT_RG1616. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add decoding functions for GL_COMPRESSED_R11_EACAnuj Phogat2012-12-075-6/+128
| | | | | | | | Data in GL_COMPRESSED_R11_EAC format is decoded and stored in MESA_FORMAT_R16. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add decoding functions for GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EACAnuj Phogat2012-12-075-3/+91
| | | | | | | | Data in GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC format is decoded and stored in MESA_FORMAT_SARGB8. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add decoding functions for GL_COMPRESSED_RGBA8_ETC2_EACAnuj Phogat2012-12-075-7/+151
| | | | | | | | Data in GL_COMPRESSED_RGBA8_ETC2_EAC format is decoded and stored in MESA_FORMAT_RGBA8888_REV. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add decoding functions for GL_COMPRESSED_SRGB8_ETC2Anuj Phogat2012-12-075-7/+89
| | | | | | | | Data in GL_COMPRESSED_SRGB8_ETC2 format is decoded and stored in MESA_FORMAT_SARGB8. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add decoding functions for GL_COMPRESSED_RGB8_ETC2Anuj Phogat2012-12-075-13/+469
| | | | | | | | | Data in GL_COMPRESSED_RGB8_ETC2 format is decoded and stored in MESA_FORMAT_RGBX8888_REV. v2: Use CLAMP macro and stdbool.h Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Make nonlinear_to_linear() function available outside fileAnuj Phogat2012-12-073-52/+29
| | | | | | | | | This patch changes nonlinear_to_linear() function to non static inline and makes it available outside format_unpack.c. Also, removes the duplicate copies in other files. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add new MESA_FORMATs for ETC2 compressed texturesAnuj Phogat2012-12-079-1/+468
| | | | | | | | | | | | | | | | | | | | | | | | | | | It is required by OpenGL ES 3.0 to support ETC2 textures. This patch adds new MESA_FORMATs for following etc2 texture formats: GL_COMPRESSED_RGB8_ETC2 GL_COMPRESSED_SRGB8_ETC2 GL_COMPRESSED_RGBA8_ETC2_EAC GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC GL_COMPRESSED_R11_EAC GL_COMPRESSED_RG11_EAC GL_COMPRESSED_SIGNED_R11_EAC GL_COMPRESSED_SIGNED_RG11_EAC MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1 MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1 Above formats are currently available in only gles 3.0. v2: Add entries in texfetch_funcs[] array. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]> v3 (Paul Berry <[email protected]>): comment out symbols that are not implemented yet, so that this commit compiles on its own; future commits will uncomment the symbols as they become available.
* meta: Use #version 300 es for _mesa_glsl_Clear's integer shaders on ES3.Kenneth Graunke2012-12-071-17/+27
| | | | | | | Fixes es3conform's color_buffer_float_clamp_(fixed|on|off) tests. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* meta: Use #version 300 es in GenerateMipmap shaders on ES3.Kenneth Graunke2012-12-071-11/+13
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* Set es_version to false when using FF fragment shading in meta opsPaul Berry2012-12-071-0/+1
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Use the new hash table for the variable refcount visitor.Eric Anholt2012-12-077-22/+45
| | | | | | | Reviewed-by: Jordan Justen <[email protected]> [[email protected]: open_hash_table => hash_table] Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* program/hash_table.c: rename to program/prog_hash_table.cJordan Justen2012-12-078-10/+10
| | | | | | | | 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]>
* mesa: Ignore size and offset parameters for BindBufferRange when buffer is 0Matt Turner2012-12-071-10/+12
| | | | | | | | | | | | The ES 3 conformance suite unbinds buffers (by binding buffer 0) and passes zero for the size and offset, which the spec explicitly disallows. Otherwise, this seems like a reasonable thing to do. Khronos will be changing the spec to allow this (bug 9765). Fixes es3conform's transform_feedback_init_defaults test. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* nv50,nvc0: fix shader evictionChristoph Bumiller2012-12-072-2/+19
|
* nv50,nvc0: add support for cube map arraysChristoph Bumiller2012-12-0716-37/+88
| | | | NOTE: nv50 support not enabled, someone with nva3/8 please fix.
* r300: Don't disable destination read if the src blend factor needs itStefan Dösinger2012-12-071-2/+10
| | | | | | | | | | | The read can remain disabled if the src alpha factor needs it because the result would still be zero. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57984 NOTE: This is a candidate for stable release branches. Signed-off-by: Marek Olšák <[email protected]>
* gallium/egl-static: Fix unresolved symbol 'clock_gettime'.Michel Dänzer2012-12-071-2/+2
| | | | | Reviewed-by: Jose Fonseca <[email protected]> Signed-off-by: Michel Dänzer <[email protected]>
* gallivm: Rudimentary native integer support.José Fonseca2012-12-072-5/+20
| | | | | | | | | Just enough for draw module to work ok. This improves "piglit attribs GL3", though something fishy is still happening with certain unsigned integer values. Reviewed-by: Brian Paul <[email protected]>
* draw: Dump LLVM shader key.José Fonseca2012-12-072-1/+33
| | | | | | Just like we do in llvmpipe for the fragment shader compilation key. Reviewed-by: Brian Paul <[email protected]>
* gallivm: Allow indirection from TEMP registers too.José Fonseca2012-12-071-3/+18
| | | | | | | | The ADDR file is cumbersome for native integer capable drivers. We should consider deprecating it eventually, but this just adds support for indirection from TEMP registers. Reviewed-by: Brian Paul <[email protected]>
* gallivm,llvmpipe,draw: Support multiple constant buffers.José Fonseca2012-12-0713-61/+103
| | | | | | | | | | | Support 16 (defined in LP_MAX_TGSI_CONST_BUFFERS) as opposed to 32 (as defined by PIPE_MAX_CONSTANT_BUFFERS) because that would make the jit context become unnecessarily large. v2: Bump limit from 4 to 16 to cover ARB_uniform_buffer_object needs, per Dave Airlie. Reviewed-by: Brian Paul <[email protected]>
* st/dri: implement MSAA for GLX/DRI2 framebuffersMarek Olšák2012-12-075-13/+112
| | | | | | | | | | | | | All MSAA buffers are allocated privately and resolved into the DRI-provided back and front buffers. If an MSAA visual is chosen, the buffers st/mesa receives are all multi-sample. st/mesa doesn't have access to the single-sample buffers in that case. This makes MSAA work in games like Nexuiz. Reviewed-by: Brian Paul <[email protected]>
* gallium: pass the current context to the flush_front state tracker functionMarek Olšák2012-12-0710-13/+24
| | | | | | I will later use the context to resolve an MSAA front buffer. Reviewed-by: Brian Paul <[email protected]>
* st/dri: don't expose MSAA configs with accumulation bufferMarek Olšák2012-12-071-1/+13
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/dri: refactor dri_fill_in_modesMarek Olšák2012-12-074-109/+45
| | | | | | | | | | - We can use a single loop for adding new configs. - The useless parameter depth_bits is removed. - The maximum number of samples is bumped to 32. - We can support Z16_UNORM and Z32_UNORM unconditionally since the zbuffers are private. Reviewed-by: Brian Paul <[email protected]>
* st/dri: always allocate private depth-stencil buffersMarek Olšák2012-12-071-59/+49
| | | | | | | | | | | | This disables DRI2 sharing of zbuffers. The window zbuffer is allocated just like any other texture - through resource_create. The idea of allocating a zbuffer through DRI2 isn't very useful with MSAA, where a single-sample zbuffer is useless. IIRC, the Intel driver does the same thing. Reviewed-by: Brian Paul <[email protected]>
* st/mesa: implement CopyTexSubImage for MSAA framebuffersMarek Olšák2012-12-071-66/+113
| | | | | | | | | | Reviewed-by: Brian Paul <[email protected]> Just use pipe->blit, which can do resolve, flipping, and format conversions. The util_blit_pixels codepath is still there for the cases where we have to force alpha to 1. This also turns on acceleration for copying GL_DEPTH_STENCIL.
* gallium/u_blitter: fix conflict with u_memory.hMarek Olšák2012-12-073-1/+7
| | | | Reviewed-by: Brian Paul <[email protected]>
* r600g: transfers of MSAA color textures should do the resolveMarek Olšák2012-12-071-5/+32
| | | | | | so that ReadPixels and various fallbacks work. Reviewed-by: Brian Paul <[email protected]>
* trace: dump pipe_resource::nr_samplesMarek Olšák2012-12-071-0/+1
| | | | Reviewed-by: Brian Paul <[email protected]>
* glx/dri2: set the __DRI2_FLUSH_DRAWABLE flag where it should be setMarek Olšák2012-12-071-2/+4
| | | | | | | | Sorry, I accidentally omitted this. It only broke MLAA. Reviewed-by: Brian Paul <[email protected]>
* build: Fix GLES linkage without libglapiAndreas Boll2012-12-072-2/+10
| | | | | | | | | | fixes a regression introduced with fc9ea7c74dc5cb996c3d9fe6663fd6da080e8360 NOTE: This is a candidate for the 9.0 branch. Reported-by: Brian Paul <[email protected]> Acked-by: Matt Turner <[email protected]>
* llvmpipe: fix regression in gears speed.Dave Airlie2012-12-071-2/+4
| | | | | | | This fixes the gears regression since transform feedback. Reported-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* glsl: Add missing semicolon in the grammarKenneth Graunke2012-12-061-0/+1
| | | | | | | | | This may not be strictly necessary, but every other rule in the grammar ends with a semicolon. It also appears that this was supposed to be commited with the original patch that changed this rule, but the wrong version of the patch was accidentally pushed. Reviewed-by: Ian Romanick <[email protected]>
* glsl: Allow layout qualifiers in GLSL 3.00 ESIan Romanick2012-12-063-1/+7
| | | | | | | | | | Note that while 'packed' is a reserved word in GLSL ES, row_major is not. This means that we have to use the string-based matching for that. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Acked-by: Carl Worth <[email protected]>
* glsl: Create builtin function profiles for GLSL 3.00 ES.Paul Berry2012-12-063-0/+834
| | | | | | | | | | | | | | | | Nearly all of the builtin functions in GLSL 3.00 ES are already implemented in Mesa; this patch enables them. A few functions are not implemented yet; those have been commented out, with a FIXME comment to act as a reminder of what still needs to be implemented. Here is the complete list: packSnorm2x16, unpackSnorm2x16, packUnorm2x16, unpackUnorm2x16, packHalf2x16, unpackHalf2x16. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Acked-by: Carl Worth <[email protected]>
* glsl: add determinant() functions.Paul Berry2012-12-061-0/+70
| | | | | | | | | | | | These functions are defined in GLSL 1.50 and GLES 3.00 ES. The formulas have been extracted from the existing implementation of inverse(). Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Acked-by: Carl Worth <[email protected]>
* glsl: Make builtin function profiles for GLSL ES use "es" in the filename.Paul Berry2012-12-064-1/+5
| | | | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Acked-by: Carl Worth <[email protected]>
* glsl: Add builtin variables for GLSL 3.00 ES.Paul Berry2012-12-061-42/+151
| | | | | | | | | | | | This patch also adds assertions so that when we add new GLSL versions, we'll notice that we need to update the builtin variables. [v2, idr]: s/Frab/Frag/ Noticed by Eric. Reviewed-by: Ian Romanick <[email protected]> [v1] Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Acked-by: Carl Worth <[email protected]>
* glsl: Populate built-in types correctly for GLSL 3.00 ES.Paul Berry2012-12-063-45/+103
| | | | | | | | | | | | | | | | | | | | | | | This patch implements all of the built-in types for GLSL 3.00 ES. This is almost exactly the same as the set of built-in types for GLSL 1.30, except ate 1D samplers are skipped, and samplerCubeShadow is added. This patch also addes an assertion so that when we add new GLSL versions, we'll notice that we need to update the types. In review, Eric noted: "This change looks correct. The overall interaction of profiles is getting ugly, though. I'm imagining a restructure of the symbol table population so that there's a big list of types, and each #version has a nice list of strings of type names copy and pasted out of its spec." Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Acked-by: Carl Worth <[email protected]>
* glsl: Make {Min,Max}ProgramTexelOffset available to compiler.Paul Berry2012-12-062-0/+6
| | | | | | | | | These constants need to be made available to shaders in GLSL 3.00 ES. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Acked-by: Carl Worth <[email protected]>
* glsl: Fix linker checks for GLSL ES 3.00.Paul Berry2012-12-061-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch updates the following linker checks to do the right thing in GLSL 3.00 ES: - Failing to write to gl_Position is allowed in GLSL 1.40+ as well as GLSL 3.00 ES. - It is an error to write to both gl_ClipVertex and gl_ClipDistance in GLSL 1.30+. This does not apply to GLSL 3.00 ES. - GLSL 3.00 ES uses the same varying counting rules as GLSL 1.00 ES. - In GLSL 1.30 and GLSL 3.00 ES, "discard" terminates the shader. - In GLSL 1.00 ES and GLSL 3.00 ES, both a fragment and a vertex shader must be present. [v2, idr]: Fix minro typo in a comment. Noticed by Ken. [v3, idr]: s/IsEs(Shader|Prog)/IsES/ Suggested by Ken and Eric. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Carl Worth <[email protected]>
* glsl: Record in gl_shader_program whether the program uses GLSL ES.Paul Berry2012-12-062-0/+2
| | | | | | | | | | | | Previously we recorded just the GLSL version (or the max version, if GLSL 1.10 and GLSL 1.20 programs were linked together). [v2, idr]: s/IsEs(Shader|Prog)/IsES/ Suggested by Ken and Eric. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Acked-by: Carl Worth <[email protected]>
* glsl: Clean up shading language mixing check for GLSL 3.00 ES.Paul Berry2012-12-061-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we prohibited mixing of shading language versions if min_version == 100 or max_version >= 130. This was technically correct (since desktop GLSL 1.30 and beyond prohibit mixing of shading language versions, as does GLSL 1.00 ES), but it was confusing. Also, we asserted that all shading language versions were between 1.00 and 1.40, which was unnecessary (since the parser already checks shading language versions) and doesn't work for GLSL 3.00 ES. This patch changes the code to explicitly check that (a) ES shaders aren't mixed with desktop shaders, (b) shaders aren't mixed between ES versions, and (c) shaders aren't mixed between desktop GLSL versions when at least one shader is GLSL 1.30 or greater. Also, it removes the unnecessary assertion. [v2, idr]: Slightly tweak the is_es_prog detection to occur outside the loop instead of doing something special on the first loop iteration. Suggested by Ken. [v3, idr]: s/IsEs(Shader|Prog)/IsES/ Suggested by Ken and Eric. Reviewed-by: Ian Romanick <[email protected]> [v1] Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Carl Worth <[email protected]>
* glsl: Record in gl_shader whether the shader uses GLSL ES.Paul Berry2012-12-062-0/+2
| | | | | | | | | | | | | | | | | | Previously we recorded just the GLSL version, with the knowledge that 100 means GLSL 1.00 ES. With the advent of GLSL 3.00 ES, this is going to get more complex, and eventually will probably become ambiguous (GLSL 4.00 already exists, and GLSL 4.00 ES is likely to be created some day). To reduce confusion, this patch simply records whether the shader is GLSL ES as an explicit boolean. [v2, idr]: s/IsEs(Shader|Prog)/IsES/ Suggested by Ken and Eric. Reviewed-by: Ian Romanick <[email protected]> [v1] Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Acked-by: Carl Worth <[email protected]>
* glsl/parser: Handle "#version 300 es" directive.Paul Berry2012-12-063-28/+86
| | | | | | | | | | | | | | | Note that GLSL 1.00 is selected using "#version 100", so "#version 100 es" is prohibited. v2: Check for GLES3 before allowing '#version 300 es' v3: Make sure a correct language_version is set in _mesa_glsl_parse_state::process_version_directive. Signed-off-by: Paul Berry <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Carl Worth <[email protected]>