Jesse Natalie
f36921effe
wgl: Refactor drivers to a libgallium_wgl.dll
...
I'd like to support EGL on Windows, using the same architecture as Linux.
On Linux, libgallium_dri.so is a "megadriver," containing the Mesa Gallium
state tracker, plus the actual driver implementations.
Now, on Windows, libgallium_wgl.dll is a proper OpenGL ICD, and OpenGL32.dll
is just a stub DLL which implements the wgl* APIs in terms of that ICD.
This is the more "architecturally clean" way to share the state tracker
between EGL and WGL.
Reviewed By: Bill Kristiansen <billkris@microsoft.com >
Reviewed-by: Charmaine Lee >charmainel@vmware.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677 >
2021-09-08 07:22:39 -07:00
Jesse Natalie
e2bb111e02
wgl: Make overridden entrypoints local to stw_ext_context
...
Reviewed By: Bill Kristiansen <billkris@microsoft.com >
Reviewed-by: Charmaine Lee >charmainel@vmware.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677 >
2021-09-08 07:22:35 -07:00
Jesse Natalie
739fb1057d
wgl: Move wgl* non-extension definitions to libgl-gdi
...
Reviewed By: Bill Kristiansen <billkris@microsoft.com >
Reviewed-by: Charmaine Lee >charmainel@vmware.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677 >
2021-09-08 07:22:24 -07:00
Jesse Natalie
a153c78d6e
wgl: Move opengl32.def to target instead of frontend
...
Reviewed By: Bill Kristiansen <billkris@microsoft.com >
Reviewed-by: Charmaine Lee >charmainel@vmware.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677 >
2021-09-08 07:22:13 -07:00
Jesse Natalie
675775b140
wgl: Don't use BUILD_GL32 for wgl frontend
...
The set of GL exports from OpenGL32.dll is controlled by a .def file,
there's no need to also use __declspec(dllexport) for all of them.
Reviewed By: Bill Kristiansen <billkris@microsoft.com >
Reviewed-by: Charmaine Lee >charmainel@vmware.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677 >
2021-09-08 07:22:00 -07:00
Jesse Natalie
2a76c976d1
static-glapi: Fix MSVC preprocessor definitions
...
Previously, any DLL which links any function from libglapi-static would
end up exporting the entire GL API surface area, due to the dllexport
introduced by BUILD_GL32. This fix allows DLLs to internally include
definitions of gl* APIs without having to export the entire surface.
Also, remove unreachable with_shared_glapi branch already in an else block.
Reviewed By: Bill Kristiansen <billkris@microsoft.com >
Reviewed-by: Charmaine Lee >charmainel@vmware.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677 >
2021-09-08 07:21:53 -07:00
Jesse Natalie
03006926de
wgl: Fix unit test when using shared glapi
...
Reviewed By: Bill Kristiansen <billkris@microsoft.com >
Reviewed-by: Charmaine Lee >charmainel@vmware.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677 >
2021-09-08 07:21:48 -07:00
Jesse Natalie
92f515ad6e
mapi: Fix shared-glapi build with MSVC
...
Reviewed By: Bill Kristiansen <billkris@microsoft.com >
Reviewed-by: Charmaine Lee >charmainel@vmware.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677 >
2021-09-08 07:21:26 -07:00
Corentin Noël
d326d32e24
glx: Prevent crashes when an extension isn't found
...
Avoid a NULL-pointer dereference.
Fixes: 2c8a85b712
("glx: Stash a copy of the XExtCodes in the glx_display")
Signed-off-by: Corentin Noël <corentin.noel@collabora.com >
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12751 >
2021-09-08 11:46:51 +00:00
Rob Clark
20ec247cb8
freedreno/ir3: Update physical_predecessors for streamout block
...
Caught by newly added ir3_validate checks.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12742 >
2021-09-08 08:53:39 +00:00
Rob Clark
137471ca89
freedreno/ir3: Improve error msg for block level validation
...
Printing whatever happened to be the last instruction is misleading.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12742 >
2021-09-08 08:53:39 +00:00
Rob Clark
ac5df8c5c9
freedreno/ir3: Validate physical successors
...
Each block's physical successors should be a superset of the logical
successors.
Also validate that the successors are sane (ie. we shouldn't have the
2nd one if we don't have the first)
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12742 >
2021-09-08 08:53:39 +00:00
Rob Clark
d2efcd3f06
freedreno/ir3: Fix double printing of branch suffix
...
print_instr_name() already prints the suffix.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12742 >
2021-09-08 08:53:39 +00:00
Rob Clark
c343fa9ecd
freedreno/ir3: Fix physical successors for break out of loop
...
We can't just clobber the existing successor[0] which is based on
logical successor[0]
Suggested-by: Connor Abbott <cwabbott0@gmail.com >
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12742 >
2021-09-08 08:53:39 +00:00
Rob Clark
f472949b24
freedreno/ir3: Update physical_successors after retargetting jumps
...
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12742 >
2021-09-08 08:53:39 +00:00
Marcin Ślusarz
30b2cc423c
glsl: break out early if compound assignment's operand errored out
...
Fixes compiler crashes on:
struct Foo
{
float does_exist_member;
};
in vec2 tex;
out vec4 color;
void
main(void)
{
Foo foo;
foo.does_not_exist_member %= 3; /* or any of: <<=, >>=, &=, |=, ^= */
color = vec4(tex.xy, tex.xy);
}
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com >
CC: mesa-stable
Reviewed-by: Matt Turner <mattst88@gmail.com >
Reviewed-by: Tapani Pälli <tapani.palli@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12717 >
2021-09-08 06:59:34 +00:00
Marcin Ślusarz
26302ccdc1
glsl: propagate errors from *=, /=, +=, -= operators
...
Fixes compiler crash on:
void main()
{
gl_FragColor = a += 1;
}
(a is not declared anywhere)
Found with AFL++.
Fixes: d1fa69ed61
("glsl: do not attempt assignment if operand type not parsed correctly")
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com >
Reviewed-by: Matt Turner <mattst88@gmail.com >
Reviewed-by: Tapani Pälli <tapani.palli@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12717 >
2021-09-08 06:59:34 +00:00
Mike Blumenkrantz
0edbdc671f
zink: fix some pipe caps for max instructions
...
all shaders are supported now
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12760 >
2021-09-08 04:45:28 +00:00
Mike Blumenkrantz
ad584ed34e
zink: use dispatch table for (almost) all vulkan calls
...
try to avoid hitting the loader when possible
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12757 >
2021-09-08 04:31:24 +00:00
Icecream95
2777d4f69d
lima: Improve error messages for unsupported GP operations
...
Reviewed-by: Erico Nunes <nunes.erico@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12738 >
2021-09-08 04:19:56 +00:00
Icecream95
4ad4aa38fa
lima: Fix crashes for GPUs with more than four cores
...
Reviewed-by: Erico Nunes <nunes.erico@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12738 >
2021-09-08 04:19:56 +00:00
Icecream95
c1f40c762c
lima: Enable PIPE_CAP_VERTEX_COLOR_UNCLAMPED
...
Fixes lighting being too bright in Neverball.
Reviewed-by: Erico Nunes <nunes.erico@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12738 >
2021-09-08 04:19:56 +00:00
Timothy Arceri
52893327fb
glsl: fix variable scope for do-while loops
...
Without this the following code was successfully compiling.
void main()
{
do
int var_1 = 0;
while (false);
var_1++;
}
Fixes: a87ac255cf
("Initial commit. lol")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12465 >
2021-09-08 03:56:59 +00:00
Timothy Arceri
174c057926
glsl: handle scope correctly when inlining loop expression
...
We need to clone the previously evaluated loop expression when
inlining otherwise we will have conflicts with shadow variables
defined in deeper scopes.
Fixes: 5c02e2e2de
("glsl: Generate IR for switch statements")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5255
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12465 >
2021-09-08 03:56:59 +00:00
Timothy Arceri
8bbbbb02cd
glsl: fix variable scope for loop-expression
...
We need to evaluate the loop-expression of a for loop before
we evaluate the loop body otherwise we will find the wrong
variable for the following loop.
int var_0 = 0;
for(; var_0 < 10; var_0++) {
const float var_0 = 1.0;
gl_FragColor = vec4(0.0, var_0, 0.0, 0.0);
}
Fixes: a87ac255cf
("Initial commit. lol")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5262
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12465 >
2021-09-08 03:56:59 +00:00
Timothy Arceri
732cd9db44
mesa: fix mesa_problem() call in _mesa_program_state_flags()
...
Previously STATE_INTERNAL returned 0 for the unhandled states
but the outer switch throws the error for unhandled states.
Fixes: b4f3497786
("mesa: remove STATE_INTERNAL")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5316
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12746 >
2021-09-08 03:33:59 +00:00
Mike Blumenkrantz
c5059915ee
zink: use EXT_primitive_topology_list_restart where available
...
this also fixes an error where PATCHES was reported as supported
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12626 >
2021-09-08 03:08:39 +00:00
Mike Blumenkrantz
c96e854db3
zink: hook up VK_EXT_primitive_topology_list_restart
...
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12626 >
2021-09-08 03:08:39 +00:00
Mike Blumenkrantz
ff6ccbf5f0
lavapipe: fix primitive restart with indexed indirect draws
...
restart index needs to be set
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12761 >
2021-09-07 22:45:07 -04:00
Mike Blumenkrantz
5bb747abd9
util/primconvert: force restart rewrites if original primtype wasn't supported
...
if we're doing a primtype change, the restart needs to be eliminated to
avoid losing restart data after the rewrite
Fixes: 583070748c
("util/primconvert: handle rewriting of prim-restart draws with unsupported primtype")
Acked-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12625 >
2021-09-08 01:50:46 +00:00
Michael Tang
f7e575ce0d
microsoft/spirv_to_dxil: Add install : true
to spirv_to_dxil library.
...
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12758 >
2021-09-08 00:00:42 +00:00
pal1000
90faabc0ee
ci: Add osmesa to Windows GitLab CI
...
osmesa CI coverage on Windows was lost when Windows CI with
Meson build was migrated from AppVeyor to GitLab CI
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8672 >
2021-09-07 20:39:02 +00:00
Italo Nicola
5d02cbfcb5
main: don't always clamp pixels read from snorm buffers
...
From the OpenGL 4.6 spec, section 18.2.8:
"For a signed normalized fixed-point color buffer, each component is
clamped to [0,1] if read color clamping is enabled, or if type
represents un- signed integer components; otherwise type represents
signed integer components, and each component is clamped to [−1,1]."
Signed-off-by: Italo Nicola <italonicola@collabora.com >
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12749 >
2021-09-07 20:18:33 +00:00
Mike Blumenkrantz
dda0bb0b32
zink: clamp query results to 500 per qbo on 32bit
...
this makes 4000byte qbos instead of 40000, which avoids bypassing slab
allocation and makes the buffers more reusable to avoid exploding 32bit
address space
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12752 >
2021-09-07 19:38:35 +00:00
Emma Anholt
a2dfb49961
llvmpipe: memcpy user_buffers at set_constant_buffer time.
...
The data in the user buffer is only valid for a short period of time, and
we could use-after-free it if rendering hadn't been flushed by shader
deletion time.
Fixes : #5254
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12724 >
2021-09-07 19:16:32 +00:00
Emma Anholt
a83a2b980c
llvmpipe: Fix leak of CS local memory with 0 threads.
...
Fixes: bde08ce4d7
("llvmpipe: handle compute shader launch with 0 threads")
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12724 >
2021-09-07 19:16:32 +00:00
Emma Anholt
dee8b50cad
llvmpipe: Free CS shader images on context destroy.
...
Cc: mesa-stable
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12724 >
2021-09-07 19:16:32 +00:00
Paulo Zanoni
26364c6347
iris: signal the syncobj after a failed batch
...
When a batch fails we either recreate our context (in case we got -EIO
or -ENOMEM) or we abort() (every other error). If we don't abort and a
later batch has a dependency on the batch that failed, then this newer
batch will fail with -EINVAL since it requires a syncobj that was
never submitted, which means we'll abort().
To avoid this problem, in this patch we simply signal syncobjs of
failed batches. This means we may be breaking our dependency tracking,
but IMHO it's better than simply letting it abort() later.
In other words, this moves the situation for some apps from "app
causes a GPU hang and then aborts" to "app causes a GPU hang but keeps
running".
Note: on some older Kernels (like today's Debian 5.10 Kernel) I see X
simply freezing after the GPU hang when the app doesn't decide to
abort(). Switching to a more recent Kernel fixes this issue for me, so
in case it happens to you make sure you have the most recent stable
trees.
v2:
- Fix coding style (Ken).
- Use the big comment block provided by Ken (Ken).
- Adjust the commit message so avoid saying we retry (Ken).
- Rebase after the syncobj ownership changes.
- Drive-by add a missing white space in the header.
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12657 >
2021-09-07 19:03:03 +00:00
Emma Anholt
db35acafa9
ci/freedreno: Skip slow SizedDeclarationsPrimitive in CI.
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12753 >
2021-09-07 18:42:19 +00:00
Emma Anholt
52f65551d2
ci/freedreno: Mark a630 basic-glsl-misc-fs as flaky.
...
My branch mostly fixed it, but apparently it's not stable yet.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12753 >
2021-09-07 18:42:19 +00:00
Emma Anholt
f5f446f3ec
ci/freedreno: Fix typo in glx-tfp flake annotation.
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12753 >
2021-09-07 18:42:19 +00:00
Emma Anholt
edfff331b3
freedreno/a6xx: Emit a WFI after event writes flushing CCU.
...
Following on from !12475 , do the same CCU workaround for freedreno as
turnip is doing, so that we flush CCU correctly for when color/depth is
next read under a different cache domain from where it was written.
Fixes instability (particularly if the GPU is clocked up) on
dEQP-GLES3.functional.fbo.blit.depth_stencil.depth32f_stencil8* in bypass
mode on a630.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11481 >
2021-09-07 18:14:30 +00:00
Marek Olšák
69e96cfc0d
ac,radv: remove unused inputs array and VS input code
...
The previous commit stopped using "inputs".
"load_layer_id" has always been broken and it was probably unused anyway.
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12570 >
2021-09-07 17:51:41 +00:00
Marek Olšák
3fb229e010
ac,radeonsi: load VS inputs at the call site of nir_intrinsic_load_input
...
to match ACO
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12570 >
2021-09-07 17:51:41 +00:00
Marek Olšák
bce7c7f3fc
ac/llvm: implement nir_intrinsic_elect
...
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12570 >
2021-09-07 17:51:41 +00:00
Marek Olšák
e0f07483d0
ac/llvm: implement nir_intrinsic_overwrite_*_arguments_amd
...
This should work if the intrinsics are not called from conditional blocks.
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12570 >
2021-09-07 17:51:41 +00:00
Marek Olšák
1e178f7a37
ac: make ac_shader_abi::inputs an array instead of a pointer
...
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12570 >
2021-09-07 17:51:41 +00:00
Marek Olšák
6df5f268db
ac: remove needless parameters from ac_shader_abi::emit_outputs
...
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12570 >
2021-09-07 17:51:41 +00:00
Marek Olšák
2e95ad1433
ac/llvm: implement a bunch of NIR AMD intrinsics for NGG
...
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12570 >
2021-09-07 17:51:41 +00:00
Marek Olšák
a33602b1f9
ac/llvm: remove load_tess_coord callback
...
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12570 >
2021-09-07 17:51:41 +00:00