summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa/formats: only do type and component lookup for uncompressed formatsNanley Chery2015-08-244-49/+46
| | | | | | | | | | | | Only uncompressed formats have a non-void type and actual components per pixel. Rename _mesa_format_to_type_and_comps to _mesa_uncompressed_format_to_type_and_comps and require callers to check if the format is not compressed. v2. include compressed format cases to avoid gcc warnings (Chad). Reviewed-by: Chad Versace <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa/arb_gpu_shader_fp64: add support for glGetUniformdvDave Airlie2015-08-232-16/+14
| | | | | | | | | This was missed when I did fp64, I've sent a piglit test to cover the case as well. Reviewed-by: Timothy Arceri <[email protected]> Cc: "11.0" <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: update fbo state in glTexStorageTapani Pälli2015-08-211-0/+15
| | | | | | | | | | We have to re-validate FBOs rendering to the texture like is done with TexImage and CopyTexImage. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Anuj Phogat <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91673 Cc: "10.6" <[email protected]>
* Revert "mesa/formats: refactor by collapsing cases in switch statement by type"Nanley Chery2015-08-201-17/+135
| | | | | | | | | | | This reverts commit ffe6c6ad5f719dedd1b6b95e8590e3f20b23d340. _mesa_format_num_components() does not include the padding bits in mesa formats containing 'X' channels. This could cause mipmap generation for certain uncompressed formats to underestimate the number of channels in the source image by 1. Signed-off-by: Nanley Chery <[email protected]>
* main: add extension GL_ARB_shader_image_sizeMartin Peres2015-08-202-0/+2
| | | | | | Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Signed-off-by: Martin Peres <[email protected]>
* mesa: Add ES31 API tag for the extension table.Francisco Jerez2015-08-201-0/+7
| | | | | | | | | | I'll mark the OES_shader_image_atomic extension entry with this tag to make sure that we don't expose it on earlier GLES API versions accidentally, because according to the extension: "OpenGL ES 3.1 and GLSL ES 3.10 are required." Reviewed-by: Tapani Pälli <[email protected]>
* mesa: Refuse to bind image uniforms using glUniform in GLES.Francisco Jerez2015-08-201-1/+3
| | | | | | | | The GLES 3.1 spec removed support for updating the image unit bound to an image uniform using glUniform1i() calls. Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Refuse to bind a mutable texture object to an image unit in GLES.Francisco Jerez2015-08-201-0/+12
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: Initialize image unit state to different defaults in GLES.Francisco Jerez2015-08-201-2/+3
| | | | | | | | | There is no GL_R8 image format in GLES, according to the state table 20.32 of the GLES 3.1 spec the default value should be GL_R32UI. The ES31-CTS.shader_image_load_store.basic-api-bind Khronos conformance test checks that this is the case. Reviewed-by: Ian Romanick <[email protected]>
* mesa: Reset image unit state to the default values when a bound image is ↵Francisco Jerez2015-08-203-7/+23
| | | | | | | | | | | | | | | deleted. The ES31-CTS.shader_image_load_store.basic-api-bind conformance test expects the whole image unit state to be reset when the bound texture object is deleted. The ARB_shader_image_load_store extension is rather vague regarding what should happen with image unit state other than the texture object in that case, but the GL 4.2 and GLES 3.1 specifications (section "Automatic Unbinding of Deleted Objects") explicitly require it to be reset to the default values. Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Reject image formats not supported by GLES.Francisco Jerez2015-08-201-2/+65
| | | | | | Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Don't lose track of the shader image layer originally specified by the ↵Francisco Jerez2015-08-202-6/+13
| | | | | | | | | | | | | | | | user. The spec requires that all layers of the image starting from the 0-th are bound to the image unit regardless of the Layer parameter when Layered is true, so I was setting gl_image_unit::Layer to zero in that case for the convenience of the driver back-end. However the ES31-CTS.shader_image_load_store.basic-api-bind conformance test checks that the layer value returned by glGetInteger is the same that was originally specified, regardless of the value of layered. Rename Layer to _Layer as is usual for other derived state and keep track of the original layer value as gl_image_unit::Layer. Reviewed-by: Ian Romanick <[email protected]>
* mesa: Rename MaxCombinedImageUnitsAndFragmentOutputs to ↵Francisco Jerez2015-08-202-2/+2
| | | | | | | | | | | | | MaxCombinedShaderOutputResources. The name of both the GLSL built-in variable and the glGetInteger param with the same value changed in GLSL ES 3.1 and GL 4.5. Its semantics also changed slightly, since the limit now also takes into account the number of SSBs in use. Switch our internal data structures to the up-to-date name. Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa/formats: refactor by collapsing cases in switch statement by typeNanley Chery2015-08-191-135/+17
| | | | | | | Combine the adjacent cases which have the same GL type in the switch statemnt. Reviewed-by: Chad Versace <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa/formats: add more MESA_FORMAT_LAYOUTsNanley Chery2015-08-194-33/+19
| | | | | | | | | | Add the classes of compressed formats as layouts. This allows the detection of compressed formats belonging to a certain category of compressed formats. v2. simplify layout name construction (Ilia). Reviewed-by: Chad Versace <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa/main: Add GL_IMAGE_FORMAT_COMPATIBILITY_TYPE to glGetTexParameterfvMarta Lofstedt2015-08-191-0/+6
| | | | | | | | | According to Open GL ES 3.1 specification, section 8.10.2 GL_IMAGE_FORMAT_COMPATIBILITY_TYPE should be supported by glGetTexParameterfv. Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* mesa: validate size parameters for glTexStorage*MultisampleTapani Pälli2015-08-191-0/+26
| | | | | | | | v2: code cleanup v3: check only dimensions, samples is checked separately later Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: expose dimension check for glTex*Storage functionsTapani Pälli2015-08-192-1/+22
| | | | | | | | | | | | This is done so that following patch can use it to verify dimensions for multisample variants of glTex*Storage. v2: move function to header, use bool instead GLboolean v3: small changes, cleanup Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: Move varying slots and FS output names to shader_enums.hEric Anholt2015-08-181-106/+4
| | | | | | | | | | They're used by glsl_to_nir.cpp, and I want to use them in TGSI-to-NIR as well (our use of the var->index slot to store slot properties no longer works since it got truncated). The *_MAX defines are left in mtypes.h, because they depend on config.h. Acked-by: Kenneth Graunke <[email protected]>
* mesa: undo split out of create shader codeTimothy Arceri2015-08-191-59/+50
| | | | | | | | This code was split out into a separate function to be used also by GL_EXT_separate_shader_objects which has since been removed from Mesa, so move it back. Reviewed-by: Ian Romanick <[email protected]>
* mesa: move non-generic samples validationTimothy Arceri2015-08-182-9/+10
| | | | | | | | | The previous patch replaces the other use case. V2: remove the validation from it old location. Cc: Tapani Pälli <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa: check samples > 0 for glTex*MultisampleTimothy Arceri2015-08-181-0/+5
| | | | | | | | | | | | | The GL 4.5 spec says its an GL_INVALID_VALUE error if samples equals 0 for glTexImage*Multisample and an GL_INVALID_VALUE error if samples < 1 for glTexStorage*Multisample. The spec says its undefined what happens if glTexImage*Multisample is passed a samples value < 0 but we currently already produced a GL_INVALID_VALUE error in this case, this is also consistent with the Nvidia binary. Cc: Tapani Pälli <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa: Raise INVALID_VALUE from glCreateShaderProgramv if count < 0Marta Lofstedt2015-08-171-0/+9
| | | | | | | | | | According to OpenGL version 4.5 and OpenGL ES 3.1 standards, section 7.3: GL_INVALID_VALUE should be generated, if count is less than 0. V2: Changed title, eased Open GL ES 3.1 restriction and added comments. Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: AtomicBufferBindings should be initialized to zero.Marta Lofstedt2015-08-171-2/+2
| | | | | | | | | | According to OpenGL specification version 4.5 table 23.46 and OpenGL ES specification version 3.1 table 20.31: ATOMIC_COUNTER_BUFFER_START and ATOMIC_COUNTER_BUFFER_SIZE should have the initial value of zero. Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Erik Faye-Lund <[email protected]>
* mesa: fix target error checking in glGetTexLevelParameterTapani Pälli2015-08-171-7/+25
| | | | | | | | | | | | | | | With non-dsa functions we need to do target error checking before _mesa_get_current_tex_object which would just call _mesa_problem without raising GL_INVALID_ENUM error. In other places of Mesa, target gets checked before this call. Fixes failures in: ES31-CTS.texture_storage_multisample.APIGLGetTexLevelParameterifv.* v2: do the target check also for dsa functions (Timothy) Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: rename texture function now that its staticTimothy Arceri2015-08-171-31/+31
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Implement glMemoryBarrierByRegionMarta Lofstedt2015-08-173-2/+50
| | | | | | | | The function glMemoryBarrierByRegion is part of OpenGL ES 3.1 and OpenGL 4.5 core and compatibility profiles. Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: set correct error for non-renderable multisample texturesTapani Pälli2015-08-141-3/+10
| | | | | | | | | v2: same common error on gles31 and desktop OpenGL (spotted by Erik Faye-Lund) Signed-off-by: Marta Lofstedt <[email protected]> Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: remove extern from texture functionTimothy Arceri2015-08-132-10/+1
| | | | Reviewed-by: Tapani Pälli <[email protected]>
* mesa: update MaxShaderStorageBlockSize to 2^27Tapani Pälli2015-08-131-1/+1
| | | | | | | | | | | | Extension spec originally required 2^24 but 2^27 is the minimum value required by OpenGL 4.5 and OpenGL ES 3.1 specifications. Fixes: ES31-CTS.shader_storage_buffer_object.basic-max Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* mesa: fix name returned for XFB varyingsTapani Pälli2015-08-131-4/+16
| | | | | | | | | | | | | | | _mesa_get_program_resource_name has logic to append '[0]' in name if variable is an array, this should be skipped for XFB varyings that have array index already appended. v2: fix comment, change also GL_NAME_LENGTH query to match the behaviour Fixes: ES31-CTS.program_interface_query.transform-feedback-types Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Martin Peres <[email protected]>
* mesa: Fix printf format specifier warn of the ptrdiff_tEdward O'Callaghan2015-08-131-1/+1
| | | | | | | See §7.19.6.1, paragraph 7 of the ISO C specification. Signed-off-by: Edward O'Callaghan <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: add NV_read_{depth,stencil,depth_stencil} extensionsRob Clark2015-08-122-9/+42
| | | | | | | | These extensions allow reading depth/stencil for GLES contexts, which is useful for tools like apitrace. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/teximage: report the correct function which triggered the errorNanley Chery2015-08-121-4/+4
| | | | | | | | | This function would always report that a dimension or size error occurred in glTexImage even when it was called from glCompressedTexImage. Replace the static string with the dynamically determined caller name. Reviewed-by: Tapani Palli <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa/formats: don't byteswap when building array formatsOded Gabbay2015-08-121-11/+3
| | | | | | | | | | | | | Because we build here an array format, we don't need to swap the bytes for big endian. If it isn't an array format, the bytes will be swapped in _mesa_format_convert. v2: remove temp variable Signed-off-by: Oded Gabbay <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Cc: "10.5 10.6" <[email protected]>
* mesa/formats: Don't flip channels of null array formatsJason Ekstrand2015-08-121-1/+2
| | | | | | | | | | Before, if we encountered an array format of 0 on a BE system, we would flip all the channels even though it's an invalid format. This would result in a mostly invalid format with a swizzle of yyyy or wwww. Instead, we should just return 0 if the array format stashed in the format info is invalid. Cc: "10.6 10.5" <[email protected]>
* mesa/formats: Fix swizzle flipping for big-endian targetsJason Ekstrand2015-08-121-4/+12
| | | | | | | | | | | | | The swizzle defines where in the format you should look for any given channel. When we flip the format around for BE targets, we need to change the destinations of the swizzles, not the sources. For example, say the format is an RGBX format with a swizzle of xyz1 on LE. Then it should be wzy1 on BE; however, the code as it was before, would have made it 1zyx on BE which is clearly wrong. Reviewed-by: Iago Toral <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Cc: "10.6 10.5" <[email protected]>
* mesa/formats: Only do byteswapping for packed formatsJason Ekstrand2015-08-121-3/+3
| | | | | Reviewed-by: Iago Toral <[email protected]> Cc: "10.6 10.5" <[email protected]>
* mesa/format_utils: Add src_bits == dst_bits cases to unorm_to_unormJason Ekstrand2015-08-101-1/+3
| | | | | | | This better ensures that the src_bits == dst_bits case gets optimized away. Reviewed-by: Neil Roberts <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* mesa/es3.1: Allow Multisampled FrameBufferTexturesMarta Lofstedt2015-08-101-2/+3
| | | | | | | GLES 3.1 must be allowed to use multisampled framebuffer textures. Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/es3.1: Pass sample count check for multisampled texturesMarta Lofstedt2015-08-101-1/+4
| | | | | | | v3 : Removed space in comment. Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: clear existing swizzle info before bitwise-OROded Gabbay2015-08-091-0/+5
| | | | | | | | | | | | | | This patch fixes a bug in big-endian treatment, where the previous swizzle info wasn't cleared before a new swizzle info was inserted into the format field using a bitwise-OR operation. v2: use MESA_ARRAY_FORMAT_SWIZZLE_*_MASK instead of numeric constants v3: align according to coding style Signed-off-by: Oded Gabbay <[email protected]> CC: "10.5 10.6" <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: NULL check InfoLogMarta Lofstedt2015-08-071-2/+2
| | | | | | | | | When a program is compiled, but linking failed the sh->InfoLog could be NULL. This is expoloited by OpenGL ES 3.1 conformance tests. Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: save which transform feedback buffer is associated with which streamMarek Olšák2015-08-061-0/+5
| | | | Reviewed-by: Dave Airlie <[email protected]>
* mesa: handle no-op cases sooner in _mesa_[Client]ActiveTexture()Brian Paul2015-08-061-10/+10
| | | | | | | If the new texture unit is the current texture unit, we can return before error checking. Reviewed-by: Eric Anholt <[email protected]>
* mesa: Add missing check of format and type in glTexSubImageXD on GLES 3.0Eduardo Lima Mitev2015-08-051-47/+69
| | | | | | | | | | | | | | | | Argument validation for glTexSubImageXD is missing a check of format and type against texture object's internal format when profile is OpenGL-ES 3.0+. This patch also groups together all format and type checks on GLES into a new function texture_format_error_check_gles(), to factorize similar code in texture_format_error_check(). Fixes 2 dEQP tests: * dEQP-GLES3.functional.negative_api.texture.texsubimage2d * dEQP-GLES3.functional.negative_api.texture.texsubimage3d Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Fix error returned by glCopyTexImage2D() upon an invalid internal formatEduardo Lima Mitev2015-08-051-9/+9
| | | | | | | | | | | | | | | | | | | | | | | Page 161 of the OpenGL-ES 3.1 (PDF) spec, and page 207 of the OpenGL 4.5 (PDF), both on section '8.6. ALTERNATE TEXTURE IMAGE SPECIFICATION COMMANDS', states: "An INVALID_ENUM error is generated if an invalid value is specified for internalformat". It is currently returning INVALID_OPERATION error because _mesa_get_read_renderbuffer_for_format() is called before the internalformat argument has been validated. To fix this, we move this call down the validation process, after _mesa_base_tex_format() has been called. _mesa_base_tex_format() effectively serves as a validator for the internal format. Fixes 1 dEQP test: * dEQP-GLES3.functional.negative_api.texture.copyteximage2d_invalid_format Fixes 1 piglit test: * spec@oes_compressed_etc1_rgb8_texture@basic Reviewed-by: Ian Romanick <[email protected]> Cc: 10.6 <[email protected]>
* mesa: Validate target before resolving tex obj in glTex(ture)SubImageXDEduardo Lima Mitev2015-08-051-15/+14
| | | | | | | | | | | | | | | Currently, glTexSubImageXD attempt to resolve the texture object (by calling _mesa_get_current_tex_object()) before validating the given target. However, that method explicitly states that target must have been validated before calling it, so it never returns a user error. The target validation occurs later when texsubimage_error_check() is called. This patch reorganizes target validation, taking it out from the error check function and into a point before the texture object is resolved. Reviewed-by: Ian Romanick <[email protected]> Cc: 10.6 <[email protected]>
* mesa: Fix errors values returned by glShaderBinary()Eduardo Lima Mitev2015-08-051-3/+14
| | | | | | | | | | | | | | | | | Page 68, section 7.2 'Shader Binaries" of the of the OpenGL ES 3.1, and page 88 of the OpenGL 4.5 specs state: "An INVALID_VALUE error is generated if count or length is negative. An INVALID_ENUM error is generated if binaryformat is not a supported format returned in SHADER_BINARY_FORMATS." Currently, an INVALID_OPERATION error is returned for all cases. Fixes 1 dEQP test: * dEQP-GLES3.functional.negative_api.shader.shader_binary Reviewed-by: Ian Romanick <[email protected]> Cc: 10.6 <[email protected]>
* mesa: do not modify args when errors with GetProgramResourceNameTapani Pälli2015-08-051-6/+0
| | | | | | | | | | | | Original purpose of these lines was to be more friendly against GUI tools using the extension. However conformance suite explicitly checks that buffers are not modified in error conditions. Fixes: ES31-CTS.program_interface_query.buff-length Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>