aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa/format_utils: Add a general format conversion functionJason Ekstrand2014-08-052-0/+911
| | | | | | | | | | | | | | | | | | 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-052-1738/+2
| | | | | | | | | | | | | | | 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]>
* 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]>
* 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]>
* 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]>
* mesa/main: Use the RGB <-> sRGB conversion functions in libmesautilJason Ekstrand2014-08-045-139/+79
| | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* util: Gather some common macrosJason Ekstrand2014-08-042-91/+5
| | | | | | | | | | This gathers macros that have been included across components into util so that the include chain can be more vertical. In particular, this makes util stand on its own without any dependence whatsoever on the rest of mesa. Signed-off-by: "Jason Ekstrand" <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* util: Move the open-addressing linear-probing hash_table to src/util.Kenneth Graunke2014-08-0421-1279/+6
| | | | | | | | | | | | | | | | | This hash table is used in core Mesa, the GLSL compiler, and the i965 driver, which makes it a good candidate for the new src/util module. It's much faster than program/hash_table.[ch] (see commit 6991c2922f5 for data), and José's u_hash_table.c has a comment saying Gallium should probably consider switching to a linear probing hash table at some point. So this seems like the best candidate for a shared data structure. Signed-off-by: Kenneth Graunke <[email protected]> v2 (Jason Ekstrand): Pick up another hash_table use and patch up scons Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* util: Move ralloc to a new src/util directory.Kenneth Graunke2014-08-047-6/+7
| | | | | | | | | | | | | | | | | | For a long time, we've wanted a place to put utility code which isn't directly tied to Mesa or Gallium internals. This patch creates a new src/util directory for exactly that purpose, and builds the contents as libmesautil.la. ralloc seemed like a good first candidate. These days, it's directly used by mesa/main, i965, i915, and r300g, so keeping it in src/glsl didn't make much sense. Signed-off-by: Kenneth Graunke <[email protected]> v2 (Jason Ekstrand): More realloc uses and some scons fixes Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Add missing atomic buffer bindings and unbindingsAditya Atluri2014-08-011-0/+31
| | | | Reviewed-by: Marek Olšák <[email protected]>
* main/get_hash_params: Add GL_SAMPLE_SHADING_ARBJason Ekstrand2014-07-291-0/+1
| | | | | | | | | | | GL_SAMPLE_SHADING is specified as a valid pname for glGet in the GL_ARB_sample_shading extension. It seems as if we forgot to add it to the table of pnames. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: [email protected]
* glapi: add indexed blend functions (GL 4.0)Tapani Pälli2014-07-281-5/+5
| | | | | | | | | | | This makes some of the UE4 engine demos (Stylized, Mobile Temple) render correctly, tested on Intel Haswell machine. Signed-off-by: Tapani Pälli <[email protected]> Acked-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78716
* main/cs: Add additional compute shader constant valuesJordan Justen2014-07-272-0/+18
| | | | | | | | With MESA_EXTENSION_OVERRIDE=GL_ARB_compute_shader, this fixes piglit: * arb_compute_shader-minmax Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
* Add an accelerated version of F_TO_I for x86_64Jason Ekstrand2014-07-241-1/+5
| | | | | | | | | | | | | According to a quick micro-benchmark, this new version is 20% faster on my Haswell laptop. v2: Removed the XXX note about x86_64 from the comment v3: Use an intrinsic instead of an __asm__ block. This should give us MSVC support for free. v4: Enable it for all x86_64 builds, not just with USE_X86_64_ASM Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: add ARB_clear_texture.xml to file list, remove duplicate declsIlia Mirkin2014-07-241-12/+0
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* mesa: Fix the name in the error messageIan Romanick2014-07-231-1/+1
| | | | | | | Obvious copy-and-paste bug. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* texstore: Add a generic implementation of GL_ARB_clear_textureNeil Roberts2014-07-232-0/+79
| | | | | | | | | Adds an implmentation of the ClearTexSubImage driver entry point that just maps the texture and writes the values in. The extension is not yet enabled by default because it doesn't work with multisample textures as they don't have a simple linear layout. Reviewed-by: Jason Ekstrand <[email protected]>
* mesa/main: Add generic bits of ARB_clear_texture implementationNeil Roberts2014-07-233-1/+271
| | | | | | | | | This adds the driver entry point for glClearTexSubImage and fills in the _mesa_ClearTexImage and _mesa_ClearTexSubImage functions that call it. v2: Don't clear some of the images if only one of them makes an error Reviewed-by: Jason Ekstrand <[email protected]>
* teximage: Add utility func for format/internalFormat compatibility checkNeil Roberts2014-07-231-21/+38
| | | | | | | In texture_error_check() there was a snippet of code to check whether the given format and internal format are basically compatible. This has been split out into its own static helper function so that it can be used by an implementation of glClearTexImage too.
* mesa/main: add ARB_clear_texture entrypointsIlia Mirkin2014-07-235-0/+32
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Neil Roberts <[email protected]>
* mesa: Don't use memcpy() in _mesa_texstore() for float depth texture dataAnuj Phogat2014-07-211-0/+15
| | | | | | | | | | | | | | | | because float depth texture data needs clamping to [0.0, 1.0]. Let the _mesa_texstore() fallback to slower path. Fixes Khronos GLES3 CTS tests: shadow_execution_vert shadow_execution_frag V2: Move the check to _mesa_texstore_can_use_memcpy() function. Add check for floating point data types. Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* main/format_pack: Fix a wrong datatype in pack_ubyte_R8G8_UNORMJason Ekstrand2014-07-181-1/+1
| | | | | | | | Before it was only storing one of the color components due to truncation. With this patch it now properly stores all of them. Reviewed-by: Brian Paul <[email protected]> Cc: "10.2" <[email protected]>
* glsl: add a mechanism to allow #extension directives in the middle of shadersMarek Olšák2014-07-181-0/+5
| | | | | | | | | | | This is needed to make Unigine Heaven 4.0 and Unigine Valley 1.0 work with sample shading. Also, if this is disabled, the error message at least makes sense now. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix regression introduced by commit "mesa: fix packing of float texels ↵Pavel Popov2014-07-181-8/+8
| | | | | | | | | | | | | | | to GL_SHORT/GL_BYTE". This commit "mesa: fix packing of float texels to GL_SHORT/GL_BYTE" replaced *_TO_BYTE to *_TO_BYTE_TEX because *_TO_FLOAT_TEX are used to unpack the texels to floats. In this case *_TO_FLOATZ in function extract_float_rgba also should be replaced to *_TO_FLOAT_TEX. Underline that these macros automatically preserve zero when converting. The regression was observed on 3 oglconform tests: snorm-textures basic.getTexImage snorm-textures advanced.mipmap.manual.getTex snorm-textures advanced.mipmap.upload.getTex Signed-off-by: Pavel Popov <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
* mesa: Don't allow GL_TEXTURE_{LUMINANCE,INTENSITY}_* queries outside compat ↵Ian Romanick2014-07-151-2/+7
| | | | | | | | | | | | | | | | | | profile There are no queries for GL_TEXTURE_LUMINANCE_SIZE, GL_TEXTURE_INTENSITY_SIZE, GL_TEXTURE_LUMINANCE_TYPE, or GL_TEXTURE_INTENSITY_TYPE in any version of OpenGL ES or desktop OpenGL core profile. NOTE: Without changes to piglit, this regresses required-sized-texture-formats. v2: Rebase on different initial change. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Cc: "10.2 <[email protected]>
* mesa: Don't allow GL_TEXTURE_BORDER queries outside compat profileIan Romanick2014-07-151-0/+2
| | | | | | | | | | | | | There are no texture borders in any version of OpenGL ES or desktop OpenGL core profile. Fixes piglit's gl-3.2-texture-border-deprecated. v2: Rebase on different initial change. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Cc: "10.2 <[email protected]>
* mesa: Handle uninitialized textures like other textures in ↵Ian Romanick2014-07-151-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | get_tex_level_parameter_image Instead of catching the special case early, handle it by constructing a fake gl_texture_image that will cause the values required by the OpenGL 4.0 spec to be returned. Previously, calling glGenTextures(1, &t); glBindTexture(GL_TEXTURE_2D, t); glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, 0xDEADBEEF, &value); would not generate an error. Anuj: Can you verify this does not regress proxy_textures_invalid_size? Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Suggested-by: Brian Paul <[email protected]> Cc: "10.2" <[email protected]> Cc: Anuj Phogat <[email protected]>
* mesa: fix crash in st/mesa after deleting a VAOMarek Olšák2014-07-112-0/+29
| | | | | | | | | | This happens when glGetMultisamplefv (or any other non-draw function) is called, which doesn't invoke the VBO module to update _DrawArrays and the pointer is invalid at that point. However st/mesa still dereferences it to setup vertex buffers ==> crash. Reviewed-by: Brian Paul <[email protected]>
* ff_fragment_shader: Access glsl_types directly.Kenneth Graunke2014-07-091-15/+15
| | | | | | | | | Originally, we didn't have direct accessors for all of the GLSL types, so the only way to get at them was to use the symbol table. Now, we can just get at them directly, which is simpler and faster. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ben Widawsky <[email protected]>
* mesa: fix geometry shader memory leaksBrian Paul2014-07-092-0/+4
| | | | | | | Spotted by Charmaine Lee. Cc: "10.2" <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: use float to silence MSVC warning in _mesa_GetMultisamplefv()Brian Paul2014-07-091-1/+1
|
* mesa: add support for AMD_vertex_shader_viewport_indexIlia Mirkin2014-07-022-0/+2
| | | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Chris Forbes <[email protected]> Tested-by: Tobias Droste <[email protected]>
* mesa: Make unreachable macro take a string argument.Matt Turner2014-07-011-3/+11
| | | | | | To aid in debugging. Reviewed-by: Ian Romanick <[email protected]>