summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Group gl_system_value values by the stage where they existIan Romanick2014-08-072-9/+35
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* glsl_to_tgsi: Assert that the _mesa_sysval_to_semantic mapping is correctIan Romanick2014-08-071-0/+15
| | | | | | | | | | | | | Future patches will rearrange the values in gl_system_value, and I want to catch errors. Designated initializers would make all of this unnecessary. v2: Don't use STATIC_ASSERT. Not only does it not work, but GCC doesn't tell you that it's not going to work. Thanks for nothing! Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* mesa/st: Only one copy of mesa_sysval_to_semanticIan Romanick2014-08-073-11/+5
| | | | | | | | | Future patches will necessitate changes to the table, and I only want to update one. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* glsl_to_tgsi: Constify mesa_sysval_to_semanticIan Romanick2014-08-071-1/+1
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* i965/clip: Fix brw_clip_unfilled.c/compute_offset's assembly.Kenneth Graunke2014-08-071-3/+3
| | | | | | | | | | | | | | Due to the destination register width of 1 or 2, these instructions get ExecSize 1 or 2. But dir and offset (used as src0) are both registers of width 4, violating the execsize >= width assertion. I honestly don't think this could have ever worked. Fixes Piglit's polygon-offset and polygon-mode-offset tests on Gen4-5. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70441 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
* mesa/formats: Fix the size of ETC2_SRGB8_PUNCHTHROUGH_ALPHA1Jason Ekstrand2014-08-061-1/+1
| | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa/formats: Use the correct swizzle parameter for the 11-bit EAC formatsJason Ekstrand2014-08-061-4/+4
| | | | | | | Red-only formats should be x001 and RG formats should be xy01. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* dri/xmlconfig: s/uint/unsigned int/Vinson Lee2014-08-051-2/+2
| | | | | | | | | | | | | | | | This patch fixes this build error on Mac OS X. ./xmlconfig.h:61:5: error: unknown type name 'uint'; did you mean 'int'? uint nRanges; /**< \brief Number of ranges */ ^~~~ int ./xmlconfig.h:79:5: error: unknown type name 'uint'; did you mean 'int'? uint tableSize; ^~~~ int Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa include stdint.h in formats.hBrian Paul2014-08-051-0/+1
| | | | | To get uint8_t type, to fix MSVC build. Trivial.
* mesa/texstore: Add a generic rgba integer texture upload pathJason Ekstrand2014-08-051-479/+73
| | | | | | | | | | Again, we delete a lot of functions that aren't really doing anything interesting anymore. v2: Comment the texstore_rgba_integer function Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/texstore: Add a generic float/normalized rgba texture upload pathJason Ekstrand2014-08-051-1906/+98
| | | | | | | | | | This commit also removes a bunch of functions which aren't doing anything more interesting than the general path does. v2: Better comment the texstore_via_float function Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/texstore: Use _mesa_swizzle_and_convert when possibleJason Ekstrand2014-08-051-15/+171
| | | | | | | | | | This should be both faster and more accurate than our general slow-path of converting everything to float. v2: Add a comment to top of the texstore_swizzle function Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* main/texstore: Split texture storage into three functionsJason Ekstrand2014-08-051-71/+100
| | | | | | | | | | | | This commit splits the texture storage into three functions: texstore_depth_stencil, texstore_compressed, and texstore_rgba. Right now this split seems artificial since we just have one function pointer per format and there is no difference between these three categories. However, this split makes it much easier to write a more general function upload path for one of these categories than the current function pointers. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/format_utils: Add a function to convert a mesa_format to an array formatJason Ekstrand2014-08-052-0/+111
| | | | | | | | | | | | | This commits adds the _mesa_format_to_array function that determines if the given format can be represented as an array format and computes the array format parameters. This is a direct helper function for using _mesa_swizzle_and_convert v2: Better documentation and commit message v3: Fixed a potential segfault from an invalid endianness swizzle Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/format_utils: Add a general format conversion functionJason Ekstrand2014-08-053-0/+912
| | | | | | | | | | | | | | | | | | Most format conversion operations required by GL can be performed by converting one channel at a time, shuffling the channels around, and optionally filling missing channels with zeros and ones. This adds a function to do just that in a general, yet efficient, way. v2: * Add better comments including full docs for functions * Don't use __typeof__ * Use inline helpers instead of writing out conversions by hand, * Force full loop unrolling for better performance v3: Add another set of parens around the MAX_INT macro Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/imports: Add a _mesa_half_is_negative helper functionJason Ekstrand2014-08-051-0/+5
| | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/formats: Add layout and swizzle informationJason Ekstrand2014-08-053-0/+86
| | | | | | | v2: Move the MESA_FORMAT_SWIZZLE enum to the top of the file Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/formats: Remove IndexBitsJason Ekstrand2014-08-052-3/+2
| | | | | | | | Mesa hasn't supported color-indexed textures for some time. This is 0 for all texture formats, so we don't need to store it. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/formats: Autogenerate the format_info structure from a CSV fileJason Ekstrand2014-08-054-1738/+19
| | | | | | | | | | | | | | | Instead of a having all of the format metadata in a gigantic hard-to-edit array of type struct format_info, we now have a human-readable CSV file. The CSV file also contains more format information than the format_info struct contained so we can potentially make format_info more detailed later. The python to generate the format information was added the previous commit. This commit turns it on in both automake and scons builds. v2: Split into two commits and stuff to generate format_info.c from scons Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/main: Add python code to generate the format_info structureJason Ekstrand2014-08-051-0/+181
| | | | | | | | This adds a python script called format_info.py that is used to generate a single format_info.c file that contains the filled-out format_info array. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add python to parse the formats CSV fileJason Ekstrand2014-08-051-0/+521
| | | | | | | | | | | | | | | The basic concept for the format parser was taken from the format CSV parser in gallium/auxilliary/util. However, this one has been altered in a number of ways: * Removed big endian vs. little endian stuff (mesa doesn't need it) * Better documentation: Almost every method has a full docstring * An actual Swizzle class with methods for composition and inverses * Over-all cleaner (in my opinion) implementation and class interactions * A few bug fixes Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add a format description CSV fileJason Ekstrand2014-08-051-0/+282
| | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: adjust Z coordinates for quad clearingBrian Paul2014-08-051-2/+5
| | | | | | | | | | | | | | | | | | | | | | Specify the quad's Z position in clip coordinate space, not normalized Z space. Use viewport scale, translation = 0.5, 0.5. Before, we were specifying the quad's Z position in [0,1] and using viewport scale=1.0, translate=0.0. That works fine, unless your driver needs to work in clip coordinate space and needs to reconstruct viewport near/far values from the scale/translation factors. The VMware svga driver falls into that category. When we did that reconstruction we wound up with near=-1 and far=1 which are outside the limits of [0,1]. In some cases, this caused the quad to be drawn at the wrong depth. In other cases it was clipped away. Fixes some scissored depth clears with VMware driver. This should have no effect on other drivers. We're already using these values for the glBitmap and glDraw/CopyPixels code. Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: make vertex array type error checking a little more efficientBrian Paul2014-08-052-30/+59
| | | | | | | Compute the bitmask of supported array types once instead of every time we call a GL vertex array function. Reviewed-by: Matthew McClure <[email protected]>
* glsl_to_tgsi: Fix typo shader_program -> shaderMichel Dänzer2014-08-051-2/+1
| | | | | | | | | | | This was a regression introduced by commit f4b0ab7afd83c811329211eae8167c9bf238870c ('st/mesa: fix incorrect size of UBO declarations') which caused an assertion failure while compiling shaders of e.g. UE4 demos. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81834 Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* meta: Disable dithering during glBlitFramebufferNeil Roberts2014-08-051-0/+3
| | | | | | | | | | | | | | | According to the GL spec the only fragment operations that should affect glBlitFramebuffer are “the pixel ownership test, the scissor test, and sRGB conversion”. That implies that dithering should not be performed so we need to disable it when implementing the blit with a render. Before commit 05b52efbc97731 the dithering state would be left as whatever the application picks (the default being GL_TRUE) and after that commit it was explicitly enabled. Neither of these were correct. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81828 Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* meta: Fix datatype computation in get_temp_image_type()Anuj Phogat2014-08-041-5/+4
| | | | | | | | | | | | | | Changes in the patch will cause datatype to be computed correctly for 8 and 16 bit integer formats. For example: GL_RG8I, GL_RG16I etc. Fixes many failures in gles3 Khronos CTS test: copy_tex_image_conversions_required copy_tex_image_conversions_forbidden Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* meta: Move the call to _mesa_get_format_datatype() out of switchAnuj Phogat2014-08-041-7/+3
| | | | | Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* meta: Use _mesa_get_format_bits() to get the GL_RED_BITSAnuj Phogat2014-08-041-2/+3
| | | | | | | | | | | | | We currently get red bits from ctx->DrawBuffer->Visual.redBits by making a false assumption that the texture we're writing to (in glCopyTexImage2D()) is used as a DrawBuffer. Fixes many failures in gles3 Khronos CTS test: copy_tex_image_conversions_required Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* meta: Initialize the variable in declaration statementAnuj Phogat2014-08-041-3/+1
| | | | | | | Saves one line of code :) Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* mesa: Allow GL_TEXTURE_CUBE_MAP target with compressed internal formatsAnuj Phogat2014-08-041-0/+1
| | | | | | | | | GL_TEXTURE_CUBE_MAP is an allowed texture target in glTexStorage2D() and is allowed to be used (like GL_TEXTURE_2D) with compressed internal formats. Cc: <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Add gles3 condition for normalized internal formats in glCopyTexImage*()Anuj Phogat2014-08-041-0/+15
| | | | | | | | Fixes many failures in gles3 Khronos CTS test: packed_pixels Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Add utility function _mesa_is_enum_format_unorm()Anuj Phogat2014-08-042-0/+74
| | | | | | | | V2: Add missing formats. Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Add gles3 error condition for GL_RGBA10_A2 buffer format in ↵Anuj Phogat2014-08-041-18/+29
| | | | | | | | | | | glCopyTexImage*() Fixes many failures in gles3 Khronos CTS test: packed_pixels Khronos bug# 9807 Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Add a gles3 error condition for sized internalformat in glCopyTexImage*()Anuj Phogat2014-08-041-0/+46
| | | | | | | | | | Fixes many failures in gles3 Khronos CTS test: packed_pixels V2: Add the check for alpha bits to avoid confusion. Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Add a helper function _mesa_is_enum_format_unsized()Anuj Phogat2014-08-042-0/+59
| | | | | | | | | | Function is utilized by next patch in the series. V2: Add missing formats. Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Don't allow snorm internal formats in glCopyTexImage*() in GLES3Anuj Phogat2014-08-041-0/+11
| | | | | | | | Fixes few failures in gles3 Khronos CTS test: packed_pixels Cc: "10.2" <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Add utility function _mesa_is_enum_format_snorm()Anuj Phogat2014-08-042-0/+40
| | | | | | Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Fix condition for using compressed internalformat in ↵Anuj Phogat2014-08-041-1/+8
| | | | | | | | glCompressedTexImage3D() Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Add error condition for using compressed internalformat in ↵Anuj Phogat2014-08-041-0/+18
| | | | | | | | | | glTexStorage3D() Fixes gles3 Khronos CTS test: texture_storage_texture_internal_formats Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Turn target_can_be_compressed() in to a utility functionAnuj Phogat2014-08-042-6/+9
| | | | | | | | V2: Declare the function in teximage.h Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Fix error condition for valid texture targets in glTexStorage* functionsAnuj Phogat2014-08-041-0/+7
| | | | | | | | Fixes gles3 Khronos CTS test: texture_storage_texture_targets Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* glsl: Make it possible to ignore built-ins when matching signatures.Kenneth Graunke2014-08-044-4/+4
| | | | | | | | | | | | | | | | | | Historically, we've implemented the rules for overriding built-in functions by creating multiple ir_functions and relying on the symbol table to hide the one containing built-in functions. That works, but has a few drawbacks, so the next patch will change it. Instead, we'll have a single ir_function for a particular name, which will contain both built-in and user-defined signatures. Passing an extra parameter to matching_signature makes it easy to ignore built-ins when they're supposed to be hidden. I didn't add the parameter to exact_matching_signature since it wasn't necessary. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Actually use the Mesa IR optimizer for ARB programs.Kenneth Graunke2014-08-041-0/+7
| | | | | | | | | | | | On Haswell, this cuts 1-3 instructions from 183 vertex shaders in "Shadowrun Returns", "Shatter", and "Trine 2." It adds 2 instructions to a single fragment shader in "Closure." total instructions in shared programs: 278803 -> 278546 (-0.09%) instructions in affected programs: 41930 -> 41673 (-0.61%) Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Do not list inactive block members as activeIan Romanick2014-08-041-6/+26
| | | | | | | | | | | | | | | | Fixes gles3conform failures in: ES3-CTS.shaders.uniform_block.single_nested_struct.per_block_buffer_packed ES3-CTS.shaders.uniform_block.single_nested_struct_array.per_block_buffer_packed ES3-CTS.shaders.uniform_block.random.scalar_types.7 ES3-CTS.shaders.uniform_block.random.basic_arrays.4 ES3-CTS.shaders.uniform_block.random.basic_arrays.6 ES3-CTS.shaders.uniform_block.random.basic_instance_arrays.2 ES3-CTS.shaders.uniform_block.random.nested_structs.9 ES3-CTS.shaders.uniform_block.random.all_shared_buffer.3 Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* wmesa: link with mesautilBrian Paul2014-08-041-0/+2
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* osmesa: link with mesautilBrian Paul2014-08-041-0/+1
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* mesa/x86: put code in braces to silence declarations after code warningBrian Paul2014-08-041-7/+9
| | | | Reviewed-by: Matt Turner <[email protected]>
* xlib: fix missing mesautil build breakageBrian Paul2014-08-041-0/+1
| | | | | | Fixes the non-DRI build. Reviewed-by: Jason Ekstrand <[email protected]>
* mesa/main: Use the RGB <-> sRGB conversion functions in libmesautilJason Ekstrand2014-08-047-185/+97
| | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Marek Olšák <[email protected]>