summaryrefslogtreecommitdiff
path: root/src/mesa/main/texparam.c
AgeCommit message (Collapse)AuthorFilesLines
2023-09-26mesa: Ensure that the baselevel will never exceed the maximal supported numberCorentin Noël1-8/+5
GL_TEXTURE_BASE_LEVEL is only supported up to MAX_TEXTURE_LEVELS Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25332>
2023-09-15mesa: some cleanups for texparam extension checksTapani Pälli1-33/+13
Patch removes some redudant _mesa_is_desktop_gl checks, these extensions are available only in desktop context. Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Eric Engestrom <eric@igalia.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25202>
2023-09-06Do explicit cast to suppress clang warningsVignesh Raman1-7/+7
Do explicit cast to suppress the below clang warnings, ../src/mesa/main/get.c:86:31: error: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Werror,-Wimplicit-const-int-float-conversion] return ( ((F) * 65536.0f > INT_MAX) ? INT_MAX : ../src/mesa/main/texparam.c:967:27: error: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Werror,-Wimplicit-const-int-float-conversion] ((param > INT_MAX) ? INT_MAX : (GLint) (param + 0.5)) : ../src/mesa/main/texparam.c:2609:65: error: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Werror,-Wimplicit-const-int-float-conversion] *params = LCLAMPF(obj->Sampler.Attrib.MinLod, INT_MIN, INT_MAX); ../src/mesa/main/texparam.c:2624:65: error: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Werror,-Wimplicit-const-int-float-conversion] *params = LCLAMPF(obj->Sampler.Attrib.MaxLod, INT_MIN, INT_MAX); ../src/mesa/main/texparam.c:2648:72: error: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Werror,-Wimplicit-const-int-float-conversion] *params = LCLAMPF(obj->Sampler.Attrib.MaxAnisotropy, INT_MIN, INT_MAX); ../src/mesa/main/texparam.c:2693:66: error: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Werror,-Wimplicit-const-int-float-conversion] *params = LCLAMPF(obj->Sampler.Attrib.LodBias, INT_MIN, INT_MAX); ../src/gallium/drivers/freedreno/a3xx/fd3_emit.c:731:43: error: implicit conversion from 'unsigned int' to 'float' changes value from 4294967295 to 4294967296 [-Werror,-Wimplicit-const-int-float-conversion] OUT_RING(ring, (uint32_t)(zmin * 0xffffffff)); ../src/gallium/drivers/freedreno/a3xx/fd3_emit.c:732:43: error: implicit conversion from 'unsigned int' to 'float' changes value from 4294967295 to 4294967296 [-Werror,-Wimplicit-const-int-float-conversion] OUT_RING(ring, (uint32_t)(zmax * 0xffffffff)); ../src/nouveau/codegen/nv50_ir_peephole.cpp:1647:30: error: implicit conversion from 'unsigned int' to 'float' changes value from 4294967295 to 4294967296 [-Werror,-Wimplicit-const-int-float-conversion] CASE(TYPE_U32, u32, 0, UINT32_MAX, 0, INT32_MAX, 0, UINT32_MAX); ../src/nouveau/codegen/nv50_ir_peephole.cpp:1648:38: error: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Werror,-Wimplicit-const-int-float-conversion] CASE(TYPE_S32, s32, INT32_MIN, INT32_MAX, INT32_MIN, INT32_MAX, 0, INT32_MAX); ../src/gallium/drivers/radeonsi/si_nir_lower_vs_inputs.c:400:51: error: implicit conversion from 'unsigned long long' to 'double' changes value from 18446744073709551615 to 18446744073709551616 [-Werror,-Wimplicit-const-int-float-conversion] loads[chan] = nir_fmul_imm(b, tmp, 1.0 / BITFIELD64_MASK(bits)); ../src/gallium/drivers/radeonsi/si_nir_lower_vs_inputs.c:408:43: error: implicit conversion from 'unsigned long long' to 'double' changes value from 18446744073709551615 to 18446744073709551616 [-Werror,-Wimplicit-const-int-float-conversion] tmp = nir_fmul_imm(b, tmp, 1.0 / BITFIELD64_MASK(bits - 1)); Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com> Acked-by: Helen Koike <helen.koike@collabora.com> Acked-by: David Heidelberg <david.heidelberg@collabora.com> Acked-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24362>
2023-08-24mesa: fix some TexParameter and SamplerParameter casesTapani Pälli1-2/+3
EXT extension was added without tests so these functions did not work properly. Fixes: 799710be889 ("mesa: Add EXT_texture_mirror_clamp_to_edge to extension table") Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24845>
2023-02-17mesa: make more use of the new _mesa_is_gles1() helperEric Engestrom1-3/+3
Signed-off-by: Eric Engestrom <eric@igalia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>
2023-02-17mesa: make use of the new _mesa_is_desktop_gl_compat() helperEric Engestrom1-2/+2
Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>
2022-11-03mesa: Move glheader.h from mesa/main/glheader.h to util/glheader.hYonggang Luo1-1/+1
So it's can be accessed in broader places Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Acked-by: Brian Paul brianp@vmware.com Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>
2022-08-12mesa: track gl_texture_object swizzle internallyMike Blumenkrantz1-2/+8
this moves updating of swizzles to the points at which it could possibly change Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17687>
2022-08-12mesa: track format swizzles on teximage objectsMike Blumenkrantz1-0/+4
this will only very rarely change, so stop calculating it during sampler update Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17687>
2022-07-15mesa: track which sampler wrap params use GL_CLAMPMike Blumenkrantz1-6/+3
this adds a bitmask to sampler objects for tracking whether GL_CLAMP is active Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17459>
2022-07-15mesa: move is_wrap_gl_clamp() to samplerobj.h and deduplicateMike Blumenkrantz1-6/+0
Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17459>
2022-01-21mesa: OpenGL 1.4 feature GL_ARB_depth_texture is not optionalIan Romanick1-5/+3
Cheatsheet: _mesa_has_ARB_depth_texture() becomes (true && ctx->Extensions.Version >= _mesa_extension_table[...].version[ctx->API]). The last value is 0 when ctx->API is API_OPENGL_COMPAT and ~0 otherwise. The whole function effectively becomes (ctx->API == API_OPENGL_COMPAT). _mesa_has_OES_depth_texture() becomes (true && ctx->Extensions.Version >= _mesa_extension_table[...].version[ctx->API]). The last value is 0 when ctx->API is API_OPENGLES2 and ~0 otherwise. The whole function effectively becomes (ctx->API == API_OPENGLES2). Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14213>
2022-01-21mesa/st: move st_TexParameter into mesaDave Airlie1-4/+40
Some places this just passes an always true pname, so just call sampler view invalidate directly Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>
2022-01-18mesa/main: allow multi sample sparse textureQiang Yu1-1/+7
Reviewed-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Qiang Yu <yuq825@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14362>
2022-01-13mesa/st: do not expose ARB_shader_image_load_store if not fully implementedJuan A. Suarez Romero1-2/+4
So far we were checking ARB_shader_image_load_store is supported as requirement to expose GLES 3.1. But when this extension functionality was added in GLES 3.1 spec, it was relaxed, and one of its requirements, the support for formatless writing, was not included. So this means that a driver that support all the extension functionality except formatless writing, could expose GLES 3.1, but it couldn't expose the extension itself (nor GL 4.2, which requires fully implementation of the extension). v2: - Add the same exposure treatment to ARB_shader_image_size (Ilia). v3: - Remove dependency for OES_texture_buffer (Ilia). - Check image resources for GLES 3.1 (Ilia). v4: - Check for MaxImageUniforms in compute shader (Ilia). - Check for max combined image uniforms/ssbo (Ilia). v5: - Remove ARB_shader_image_load_store from check (Ilia). - ARB_shader_image_store and ARB_shader_image required for ARB_ES3_1_compatibility (Ilia). Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14288>
2021-12-30mesa: add ARB_sparse_texture texture param set/getQiang Yu1-0/+74
Reviewed-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Qiang Yu <yuq825@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14223>
2021-12-15mesa: OpenGL 1.3 feature GL_ARB_texture_cube_map is not optionalIan Romanick1-3/+2
Cheatsheet: _mesa_has_ARB_texture_cube_map() becomes (true && ctx->Extensions.Version >= _mesa_extension_table[...].version[ctx->API]). The last value is 0 when ctx->API is API_OPENGL_COMPAT and ~0 otherwise. The whole function effectively becomes (ctx->API == API_OPENGL_COMPAT). _mesa_has_OES_texture_cube_map() becomes (true && ctx->Extensions.Version >= _mesa_extension_table[...].version[ctx->API]). The last value is 0 when ctx->API is API_OPENGLES and ~0 otherwise. The whole function effectively becomes (ctx->API == API_OPENGLES). Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14203>
2021-12-15mesa: OpenGL 1.3 feature GL_ARB_texture_border_clamp is not optionalIan Romanick1-11/+4
Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14203>
2021-12-14mesa: remove all GL func forward declarations because they are autogeneratedMarek Olšák1-0/+1
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-08mesa/st: move texture APIs to direct st callsDave Airlie1-8/+10
This is a bit more spreadout, but is still pretty straightforward Acked-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14100>
2021-12-03mesa: allow TEXTURE_BUFFER target for ARB_texture_buffer_rangeJuan A. Suarez Romero1-1/+5
While TEXTURE_BUFFER do not support texture parameters in ARB_texture_buffer_object specification, it does in ARB_texture_buffer_range, specifically TEXTURE_BUFFER_OFFSET and TEXTURE_BUFFER_SIZE. Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13409>
2021-08-06mesa: Add EXT_texture_mirror_clamp_to_edge to extension tableGert Wollny1-4/+5
This is the OpenGL ES version of ARB_texture_mirror_clamp_to_edge. v2: fix TexParameter validation (Erik) v3: Use modernized extension test (Erik) Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10325>
2021-06-27mesa: lower GL_CLAMP in texture and sampler functions instead of st/mesaMarek Olšák1-0/+6
This moves the GL_CLAMP translation out of st/mesa. This should be faster assuming constant sampler states. Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11339>
2021-06-27mesa: add IsBorderColorNonZero to skip border color update for st/mesa fasterMarek Olšák1-0/+3
0.8% less overhead. Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11339>
2021-06-27mesa: add LodBias quantization from st/mesaMarek Olšák1-1/+1
Apparently the quantization math isn't cheap. This further reduces overhead by 2% for drawoverhead/8 textures. The improvement is measured by looking at the sysprof percentage delta and multiplying by 2 (because we have the frontend and gallium threads with equal overhead, so the benefit is doubled compared to 1 thread). Both per-sampler and per-unit lod bias values are quantized. The difference in behavior is that both values are quantized separately and then added up, instead of first added up and then quantized. The worst case error is +- 1/256 in the reduced precision, i.e. off by one in a fixed-point representation, which should be fine. Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11339>
2021-06-27mesa: translate into pipe_sampler_state in GL functionsMarek Olšák1-23/+37
- pipe_sampler_state is added into gl_sampler_attrib. - The border color field is redundant, so the non-gallium field is removed. - Other GL fields are still tracked because of glGet. - Some fields are not set by GL functions because they are always derived from multiple states. - The behavior in GL functions is the same as st_convert_sampler. This reduces overhead by 2% for drawoverhead/8 textures, and more is going to be done. Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11339>
2021-04-16mesa: texparam: Add a clamping macro to handle out-of-range floats returned ↵Alexander Shi1-4/+8
as integers. The parameters GL_TEXTURE_MIN_LOD, GL_TEXTURE_MAX_LOD, GL_TEXTURE_MAX_ANISOTROPY_EXT, GL_TEXTURE_LOD_BIAS are stored as floats but returned as integers. Setting their values outside of the integer range results has undefined behaviour when the c-runtime method lroundf converts the value back to an integer. Fixes: 53c36dfc('replace IROUND with util functions') Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10244>
2021-04-15gallium: split PIPE_CAP_SAMPLER_REDUCTION_MINMAX into modesMike Blumenkrantz1-3/+6
this enables detection for the EXT vs the ARB extension, which have different specifications regarding which formats must be supported Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10030>
2021-03-12mesa: add tracking of reduction modeIlia Mirkin1-0/+31
This is used to expose ARB/EXT_texture_filter_minmax. Note that only the EXT_* enable is provided since the ARB one would require proper handling of some formats not being supported. For now this is force-enabled for everything. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9487>
2021-02-18mesa/st: add PIPE_CAP_GL_CLAMPMike Blumenkrantz1-0/+12
when this is not set, this triggers shader and sampler state updates any time a sampler starts or stops using GL_CLAMP, applying bitmasks needed to run nir_lower_tex and setting CLAMP_TO_BORDER/CLAMP_TO_EDGE as necessary to mimic the behavior Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8756>
2021-01-30mesa: for every state change, remember states we changed for glPopAttribMarek Olšák1-5/+5
The idea is to restore only those states in glPopAttrib that have been changed. This will reduce glPopAttrib overhead a lot. This is based on the state tables in the OpenGL 4.6 Compatibility Profile specification and many extension specifications. This code might superfluously flag GL_TEXTURE_BIT for texture and sampler functions that don't have effect on states popped by glPopAttrib, but I don't wanna test my luck and make a mistake. Thus, if _NEW_TEXTURE_OBJECT if flagged, GL_TEXTURE_BIT is usually flagged too. This has no effect on glPopAttrib yet. glPopAttrib will use this in a later commit. This only adds attrib masks into FLUSH_VERTICES based on specs. Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com> Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8181>
2021-01-30mesa: flush glBegin/End before changing GL_DEPTH_STENCIL_TEXTURE_MODEMarek Olšák1-0/+2
Fixes: 23e81b93bbe3 "mesa: Add core API support for GL_ARB_stencil_texturing (from 4.3)." Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com> Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8181>
2021-01-30mesa: fix glPopAttrib for many texture fieldsMarek Olšák1-18/+18
Move the fields that should be restored by glPopAttrib into the Attrib structure, which is the only portion of texture objects that is restored by glPopAttrib. Also moves fields that should not be restored by glPopAttrib out of the Attrib structure. This is based on the GL 4.6 Compatibility spec. Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com> Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8181>
2020-12-01mesa: reorganize gl_texture and sampler structures for glPush/PopAttribMarek Olšák1-109/+109
Put the fields saved by glPush/PopAttrib into the sub-structure declared as Attrib. This will make glPush/PopAttrib much faster because it will only save and restore that structure. Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01src/mesa: update fallthrough commentsPierre-Eric Pelloux-Prayer1-2/+2
clang doesn't support /* fallthrough */ so switch to fallthrough attribute. Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7747>
2020-08-18st: Pass TextureTiling option from texture to memory objEduardo Lima Mitev1-2/+2
If tiling is linear, also adds the corresponding pipe bind flag to the resource template when creating a new resource from the memory object. Modified TexParameteri to update the TextureTiling option only when the texObj is not immutable (before TexStorageMem*DEXT is called to create the texture from external memory). v2: Ensure that memory object is not NULL before setting the TextureTiling option (fixes TexStorage*D). v3: Also add flag PIPE_SHARED to bindings (needed for some gallium drivers). v4: Use PIPE_BIND_LINEAR instead of adding a new PIPE_RESOURCE_FLAG (Marek Olšák) Co-authored-by: Eduardo Lima Mitev <elima@igalia.com> Co-authored-by: Eleni Maria Stea <estea@igalia.com> Co-authored-by: Hyunjun Ko <zzoon@igalia.com> Reviewed-by: Rohan Garg <rohan.garg@collabora.com> Reviewed-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4565>
2020-07-16mesa: change dsa texture error codes for GL 4.6Dave Airlie1-15/+25
GL 4.6 changed error code for when the effective target of the texture is illegal. Since it's not an illegal enum they modified it to be an illegal operation. However the CTS test for this is missing support for two cases, I'm chasing that up, but I expect this will cause a CTS regression for anyone who runs this test. I'm leaning on the side of being compliant rather than passing the test until the test is fixed. Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5896>
2020-04-30mesa: don't call _mesa_update_state for _mesa_get_clamp_fragment_colorMarek Olšák1-2/+0
It's not needed. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
2020-04-29mesa: Follow OpenGL conversion rules for values that exceed storage sizeDylan Baker1-4/+33
Section 2.2.2 (Data Conversions For State Query Commands) of the OpenGL 4.5 spec says: Following these steps, if a value is so large in magnitude that it cannot be represented by the returned data type, then the nearest value representable using that type is returned. The current code doesn't do the correct thing, because it truncates a long (potentially a 64bit values) to an int. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2828 Fixes: 53c36dfcfe3eb3749a53267f054870280afb0d71 ("replace IROUND with util functions") Reviewed-by: Matt Turner <mattst88@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4673>
2020-04-21replace IROUND with util functionsDylan Baker1-5/+5
This adds two new util functions to rounding.h, _mesa_iroundf and mesa_lround, which are just wrappers around roundf and round, that cast to int and long int respectively. This is possible since mesa recently dropped support for VC2013, since 2015 and 2017 support roundf. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>
2020-02-26mesa: remove leftovers from ARB_shadow_ambientMarek Olšák1-2/+0
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3947>
2019-10-18mesa: add EXT_dsa + EXT_texture_integer functionsPierre-Eric Pelloux-Prayer1-0/+127
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-08-19mesa: add ext_dsa GetMultiTexLevelParameterEXTPierre-Eric Pelloux-Prayer1-0/+45
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-08-06mesa: add EXT_dsa glGetMultiTexParameteriv/fvEXTPierre-Eric Pelloux-Prayer1-1/+41
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-08-06mesa: add EXT_dsa glMultiTexParameter* functionsPierre-Eric Pelloux-Prayer1-0/+87
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-08-06mesa: add new helper _mesa_get_texobj_by_target_and_texunitPierre-Eric Pelloux-Prayer1-43/+40
Based on the 'static get_texobj_by_target' function from texparam.c, but extended to also take the texunit as a parameter. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-07-19mesa: add EXT_dsa glGetTextureLevelParameter*vEXT functionsPierre-Eric Pelloux-Prayer1-0/+42
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-06-28mesa: add glTextureParameteri/iv/f/fvEXTPierre-Eric Pelloux-Prayer1-0/+112
Reviewed-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2019-06-28mesa: extract helper function for glTexParameter*Pierre-Eric Pelloux-Prayer1-13/+24
Reviewed-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2018-09-11mesa/texture: Also check for LA texture when querying intensity component sizeGert Wollny1-0/+5
Gallium may pick L16A16_FLOAT to represent GL_INTENSITY16F if no intensity format is provided by the driver. However, when calling glGetTexLevelParameteriv(..., GL_TEXTURE_INTENSITY_SIZE, ...) mesa will return a zero size because the actually used format has no intensity channel and as a fallback only the sizes of the red/green channels are checked. Also checking for LA sizes in the allocated texture resolves this problem. v2: Only check alpha channel size and return it (Marek) L and A size are always the same in this case. Fixes (on virgl): ext_framebuffer_multisample-fast-clear GL_ARB_texture_float * Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107832 Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>