Hi,
sorry, I realized that you sent first this email to me privately, but
didn't have time to reply.
On 1/3/24 14:33, Macoy Madson wrote:
Hello,
I have been looking at the code in Gallium/drivers/v3d related to
texture conversion, specifically v3dx_tfu.c.
I have been trying to find how
Hi,
On 24/10/23 0:44, Thomas Erbesdobler wrote:
Hi everyone,
I'm currently working on a very simple OpenCL runtime for Intel GPUs,
which I would like to make available as open source project (and maybe
also distribute it). To generate the ring-commands (the command stream
which controls the
On 20/2/23 16:53, Neil Roberts wrote:
Hi folks,
Hi Neil!
Does anybody remember VkRunner? It’s a little tool to help write
shader-based tests for Vulkan. It’s the same concept as Piglit’s
shader_runner but for Vulkan instead of OpenGL. There are a couple of
tests using it in Piglit but
For newcomers to gitlab, it is not evident that it is better to press
the "Resolve Discussion" button when you update your branch handling
feedback.
---
As the commit message says, it is not always evident. I was pointed to
do that when I started to use gitlab, and just today I mentioned it to
Added with commit 0161691f3518, still checked on shaderapi.c
_mesa_get_shader_flag method.
---
docs/shading.html | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/shading.html b/docs/shading.html
index 9e3c7218e31..76f25316f86 100644
--- a/docs/shading.html
+++ b/docs/shading.html
@@ -59,6
Those builtins need to fill origin_upper_left and pixel_center_integer
on the nir variable. Those depends on the execution mode, that moved
recently to be handled after creating the variables. This commit adds
a pass over the fragment shader inputs to set the proper value once we
have all the
Note that the two patches are independent. Are two possible solutions
for the same problem. Details below.
As mentioned on the following MR:
https://gitlab.freedesktop.org/mesa/mesa/merge_requests/144
changing the order of how ExecutionModes are handled affected handling
OriginUpperLeft and
Although on GLSL those are set using a layout qualifier to
gl_FragCoord builtin, they are basically a global mode. In fact, on
SPIR-V they are set as an global ExecutionMode, not as a decoration
for the builtin. With this change, we are just mapping them more
similar to SPIR-V, instead of more
Those builtins need to fill origin_upper_left and pixel_center_integer
on the nir variable. Those depends on the execution mode, that moved
recently to be handled after creating the variables. This commit adds
a pass over the fragment shader inputs to set the proper value once we
have all the
To avoid the following warning:
./src/compiler/nir/nir_loop_analyze.c:807:16: warning: unused variable ‘ns’
[-Wunused-variable]
nir_shader *ns = impl->function->shader;
---
Perhaps this is solved on any of the loop analysis patches pending to
be reviewed, but just in case, sending it.
This is needed due how the types get rearranged after the struct
splitting.
So for example, this array of blocks:
layout(location = 0) out block {
vec4 v;
vec3 v2;
} x[2];
Would be splitted on two nir variables with the following types:
* vec4 v[2]
* vec3 v2[2]
So we need to
Instead of a custom ARB_gl_spirv xfb gather info pass.
In fact, this is not only about reusing code, but the current custom
code was not handling properly how many varyings are enumerated from
some complex types. So this change is also about fixing some corner
cases.
---
On OpenGL, a array of a simple type adds just one varying. So
gl_transform_feedback_varying_info struct defined at mtypes.h includes
the parameters Type (base_type) and Size (number of elements).
This commit checks this when the recursive add_var_xfb_outputs call
handles arrays, to ensure that
In order to allow nir_gather_xfb_info to be used on OpenGL,
specifically ARB_gl_spirv.
So, from OpenGL 4.6 spec, section 11.1.2.1, "Output Variables":
"outputs specifying both an *XfbBuffer* and an *Offset* are
captured, while outputs not specifying both of these are not
captured.
In order to be used for OpenGL (right now for ARB_gl_spirv).
This commit adds two new structures:
* nir_xfb_varying_info: that identifies each individual varying. For
each one, we need to know the type, buffer and xfb_offset
* nir_xfb_buffer_info: as now for each buffer, in addition to
Current code assumes that if the type is an struct it would behave as
a block. That is not always the case (like xfb_offset/xfb_buffer
assignment on arrays of structs vs arrays of blocks), so we need to
differentiate.
---
src/compiler/spirv/vtn_variables.c | 17 +
1 file changed,
From GLSL 4.60 spec, Section 4.4.2. Output Layout Qualifiers,
subsection Transform Feedback Layout Qualifiers:
"When a block is declared as an array, all members of block
array-element 0 are captured, as previously described, by the
declared or inherited xfb_buffer. Generally, an array
In the same way that just a struct is not a interface block, and array
of structs is not an array of interface blocks.
At least at the NIR level.
---
src/compiler/spirv/vtn_variables.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/compiler/spirv/vtn_variables.c
GLSLang computes the xfb_offset for struct members. In fact, for basic
structs, the xfb nir gathering pass expect those to be filled, as one
struct variable is lowered to several nir variables, and those need to
have the xfb offset already set. See [1].
But, as one existing comments at spirv to
, regresses) here:
https://github.com/Igalia/piglit/tree/apinheiro/xfb
Alejandro Piñeiro (13):
spirv/nir: update Xfb decoration comment
nir: don't assert when xfb_buffer/stride is present but not xfb_offset
nir: fix output offset compute for dvec3/4
nir: add component_offset at nir_xfb_info
Where component_offset here is the offset when accessing components of
a packed variable. Or in other words, location_frac on
nir.h. Different places of mesa use different names for it.
Technically nir_xfb_info consumer can get the same from the
component_mask, it seems somewhat forced to make it
Now Vulkan radv driver, and ARB_gl_spirv implementation supports
transform feedback. Having said so, those decorations are handled
elsewhere.
Reviewed-by: Jason Ekstrand
---
src/compiler/spirv/spirv_to_nir.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
The offset compute was working fine for the case of attrib_slots=1,
and updating the offset for the following varying.
But in the case of attrib_slots=2 (so dvec3/4), we are basically
splitting the comp_slots needed in two outputs. In that case we can't
add to the offset the full size of the
This commit removes several of the checks when assigning the
array_element as the interface_type. Reading the comment, and what
commit bb04b84114d2780307f9cbd04447216c3f2d1c0c added on top, this is
done conservatively, for only the builtin cases that makes sense at
that moment. But even if those
Equivalent to previous patch (so comments applies), but implemented on
a different place. We would need to chose in which one.
---
src/compiler/nir/nir_gather_xfb_info.c | 23 +++
1 file changed, 23 insertions(+)
diff --git a/src/compiler/nir/nir_gather_xfb_info.c
of code reuse, or should
ARB_gl_spirv stick to their own gathering pass?
On 10/11/18 12:13, Alejandro Piñeiro wrote:
> On 09/11/18 16:58, Jason Ekstrand wrote:
>> On November 9, 2018 06:39:25 Alejandro Piñeiro
>> wrote:
>>> On 08/11/18 23:14, Jason Ekstrand wrote:
>&
I was tempted to suggest to add a comment somewhere mentioning this
policy change, but there are so many functions that Im not sure what
would be that somewhere. Ramblings apart:
Reviewed-by: Alejandro Piñeiro
On 10/11/18 09:17, Kenneth Graunke wrote:
> This moves nir_shader_cl
Reviewed-by: Alejandro Piñeiro
On 10/11/18 09:17, Kenneth Graunke wrote:
> It's shorter and will also be useful when I adjust cloning soon.
> ---
> src/mesa/drivers/dri/i965/brw_cs.c | 6 +++---
> src/mesa/drivers/dri/i965/brw_gs.c | 11 ++-
> src/mesa/drivers/dri/i965
On 09/11/18 16:58, Jason Ekstrand wrote:
> On November 9, 2018 06:39:25 Alejandro Piñeiro
> wrote:
>> On 08/11/18 23:14, Jason Ekstrand wrote:
>>> On Thu, Nov 8, 2018 at 7:22 AM Alejandro Piñeiro
>>> mailto:apinhe...@igalia.com>> wrote:
>>>
>>
The offset compute was working fine for the case of attrib_slots=1,
and updating the offset for the following varying.
But in the case of attrib_slots=2 (so dvec3/4), we are basically
splitting the comp_slots needed in two outputs. In that case we can't
add to the offset the full size of the
On 08/11/18 22:42, Jason Ekstrand wrote:
> On Thu, Nov 8, 2018 at 7:22 AM Alejandro Piñeiro <mailto:apinhe...@igalia.com>> wrote:
>
> In order to allow nir_gather_xfb_info to be used on OpenGL,
> specifically ARB_gl_spirv.
>
> So, from OpenGL 4.6 spec
On 08/11/18 23:14, Jason Ekstrand wrote:
> On Thu, Nov 8, 2018 at 7:22 AM Alejandro Piñeiro <mailto:apinhe...@igalia.com>> wrote:
>
> On OpenGL, a array of a simple type adds just one varying. So
> gl_transform_feedback_varying_info struct defined at mtypes.h includes
The offset compute was working fine for the case of attrib_slots=1,
and updating the offset for the following varying.
But in the case of attrib_slots=2 (so dvec3/4), we are basically
splitting the comp_slots needed in two outputs. In that case we can't
add to the offset the full size of the
Instead of a custom ARB_gl_spirv xfb gather info pass.
In fact, this is not only about reusing code, but the current custom
code was not handling properly how many varyings are enumerated from
some complex types. So this change is also about fixing some corner
cases.
---
Where component_offset here is the offset when accessing components of
a packed variable. Or in other words, location_frac on
nir.h. Different places of mesa use different names for it.
Technically nir_xfb_info consumer can get the same from the
component_mask, it seems somewhat forced to make it
Although it is true that Vulkan doesn't support transform feedback
yet, spirv to nir is handling it due ARB_gl_spirv support. Having said
so, those decorations are handled elsewhere.
---
src/compiler/spirv/spirv_to_nir.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
In order to be used for OpenGL (right now for ARB_gl_spirv).
This commit adds two new structures:
* nir_xfb_varying_info: that identifies each individual varying. For
each one, we need to know the type, buffer and xfb_offset
* nir_xfb_buffer_info: as now for each buffer, in addition to
d too much info, or needed to change too much that
pass. So I focused on modifying the code as less as possible. But that
lead to some debatable decisions. It is more detailed on the patches
with RFC.
BR
Alejandro Piñeiro (7):
spirv/nir: update Xfb decoration comment
nir: don't assert when
In order to allow nir_gather_xfb_info to be used on OpenGL,
specifically ARB_gl_spirv.
So, from OpenGL 4.6 spec, section 11.1.2.1, "Output Variables":
"outputs specifying both an *XfbBuffer* and an *Offset* are
captured, while outputs not specifying both of these are not
captured.
On OpenGL, a array of a simple type adds just one varying. So
gl_transform_feedback_varying_info struct defined at mtypes.h includes
the parameters Type (base_type) and Size (number of elements).
This commit checks this when the recursive add_var_xfb_outputs call
handles arrays, to ensure that
vnt_variables uses interface_type on several use cases, but on nir
variable it is more limited. From nir.h:
/**
* For variables that are in an interface block or are an instance of an
* interface block, this is the \c GLSL_TYPE_INTERFACE type for that block.
*
* \sa
Since commit "intel/compiler: Stop assuming the entrypoint is called
"main"" there is no need to force the entrypoint name to be "main".
---
src/mesa/main/glspirv.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/mesa/main/glspirv.c b/src/mesa/main/glspirv.c
index 98b7ea77348..04e46ba571e
---
src/compiler/glsl/gl_nir_linker.c | 14 ++
1 file changed, 14 insertions(+)
diff --git a/src/compiler/glsl/gl_nir_linker.c
b/src/compiler/glsl/gl_nir_linker.c
index 547549bc4e0..138a12e532d 100644
--- a/src/compiler/glsl/gl_nir_linker.c
+++ b/src/compiler/glsl/gl_nir_linker.c
@@
When using a SPIR-V shader. Note that needs to be done before linking
uniforms, so when creating the uniform storage entries, block_index
could be filled properly (among other things).
---
src/mesa/drivers/dri/i965/brw_link.cpp | 4
1 file changed, 4 insertions(+)
diff --git
Since ARB_gl_spirv it is possible to miss a lot of name reflection
information, so it is needed to add NULL name checks for several
queries, and return a specific value on those cases. This commit add
them for ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH,
ACTIVE_ATTRIBUTE_MAX_LENGTH and
This can happens if we are running an SPIR-V shader (ARB_gl_spirv).
---
src/mesa/main/shader_query.cpp | 30 --
1 file changed, 20 insertions(+), 10 deletions(-)
diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp
index
From: Antia Puentes
---
src/compiler/glsl/gl_nir_linker.c | 79 +++
1 file changed, 79 insertions(+)
diff --git a/src/compiler/glsl/gl_nir_linker.c
b/src/compiler/glsl/gl_nir_linker.c
index 138a12e532d..acec0fe1f03 100644
---
The function had a mix of true/GL_TRUE and false/GL_FALSE
returns. Using GL_TRUE/GL_FALSE as the function returns a GLboolean.
---
src/mesa/drivers/dri/i965/brw_link.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp
Until now, we were using the uniform explicit location to check if the
current nir variable already was processed, and entries on the uniform
storage added. But for UBOs/SSBOs, entries are added but we lack a
explicit location.
For those we need to rely on the UBO/SSBO binding (to the nir
Specifically, offset, array_stride, matrix_stride and row_major.
On GLSL, most of that info is computed, but on ARB_gl_spirv they are
explicit, and for Mesa, included on the glsl_type.
From ARB_gl_spirv spec:
"Mapping of layouts
std140/std430 -> explicit *Offset*, *ArrayStride*, and
From: Antia Puentes
Binding comparison is used to determine the block the uniform is part
of. To do the binding comparison we need the information in
UniformBlocks[] and ShaderStorageBlocks[] to be available, so we have
to call gl_nir_link_uniform_blocks() before linking the uniforms.
---
For this interfaces, the inner members are added only once as uniforms
or resources, in opposite to other cases, like a uniform array of
structs.
For those guessing why a issue (16) from ARB_program_interface_query
was used, instead of a quote of the core spec: The core spec is not
really clear
From ARB_gl_spirv spec:
"7.6.2.spv SPIR-V Uniform Offsets and Strides
The SPIR-V decorations *GLSLShared* or *GLSLPacked* must not be
used. A variable in the *Uniform* Storage Class decorated as a
*Block* must be explicitly laid out using the *Offset*,
*ArrayStride*, and
---
src/compiler/spirv/spirv_to_nir.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/src/compiler/spirv/spirv_to_nir.c
b/src/compiler/spirv/spirv_to_nir.c
index 52c3c968bb7..1201143d2f4 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -816,6
From ARB_gl_spirv:
"Mapping of layouts
std140/std430 -> explicit *Offset*, *ArrayStride*, and *MatrixStride*
Decoration on struct members"
That means that we would not have available any kind of layout info,
and we should use explicit array strides.
This
From: Neil Roberts
When linking a program using ARB_gl_spirv it now lowers the
vulkan_resource_index intrinsic as an extra pass on the nir shader.
Unlike Vulkan this can be done without waiting for the extra state
from the pipeline layout.
It also adds the call to this lowering on the i965
---
src/compiler/glsl/gl_nir_link_uniforms.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/compiler/glsl/gl_nir_link_uniforms.c
b/src/compiler/glsl/gl_nir_link_uniforms.c
index 1a491dc2e5d..00995fb3f76 100644
--- a/src/compiler/glsl/gl_nir_link_uniforms.c
+++
of the vulkan_resource_index is determined by
searching for an intrinsic which uses the result. Unfortunately some
other lower passes can add instructions to perform arithmetic on the
result so the search needs to be performed recursively on the result
of those.
Signed-off-by: Neil Roberts
Signed-off-by: Alejandro Piñeiro
Equivalent to the already existing ir_variable is_in_buffer_block and
is_in_shader_storage_block, adding the uniform buffer object one. I'm
using the short forms (ssbo, ubo) to avoid having method names too
long.
---
src/compiler/nir/nir.h | 22 ++
1 file changed, 22
-by: Alejandro Piñeiro
Signed-off-by: Neil Roberts
---
src/compiler/Makefile.sources | 1 +
src/compiler/glsl/gl_nir_link_uniform_blocks.c | 713 +
src/compiler/glsl/gl_nir_linker.h | 3 +
src/compiler/glsl/meson.build | 1
We need all the info when asking for the type, so we needed to call
type_decoration_cb earlier, in order to get the ArrayStride.
It is somewhat ugly to do this only for Array types, but we can't do
it before the switch as type_decoration_cb have some asserts to ensure
that the type and the
b0c643d, where spirv_to_nir stopped to do
struct member splitting, done it later in NIR (Alejandro Piñeiro)
Signed-off-by: Neil Roberts
Signed-off-by: Alejandro Piñeiro
---
src/compiler/spirv/vtn_private.h | 6
src/compiler/spirv/vtn_variables.c | 62
To already existing fields on glsl_types. Specifically:
* glsl_get_struct_field_offset
* glsl_get_struct_field_matrix_layout
* glsl_type_arrays_of_arrays_size
---
src/compiler/nir_types.cpp | 21 +
src/compiler/nir_types.h | 8
2 files changed, 29
They are supported by SPIR-V for OpenGL. OpenGL codepath expect nir to
include the ssbo as nir variables.
---
src/compiler/spirv/vtn_variables.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/compiler/spirv/vtn_variables.c
b/src/compiler/spirv/vtn_variables.c
index
From ARB_gl_spirv spec:
"Mapping of layouts
std140/std430 -> explicit *Offset*, *ArrayStride*, and
*MatrixStride* Decoration on struct members"
and
"A variable in the *Uniform* Storage Class decorated as a *Block*
must be explicitly laid out using the
---
src/compiler/spirv/spirv_to_nir.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/compiler/spirv/spirv_to_nir.c
b/src/compiler/spirv/spirv_to_nir.c
index 28f4716b40e..52c3c968bb7 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -743,6 +743,7
Some nir variables are only filled up for some specific modes. We
found to need the binding for ubos/ssbos.
The comment before that code (starts with XXX) points that binding
still needs to be filled up for uniform variables at that point, and
that should be fixed, although it doesn't specify why
/piglit/tree/arb_gl_spirv-series5-ubo-ssbo-v3
Thanks in advance.
Alejandro Piñeiro (23):
spirv/nir: translate uniform blocks
spirv/nir: translate ssbo
spirv/nir: setting interface type for ubos/ssbos
spirv/nir: fill up nir variable info for ubos and ssbo
spirv/nir: include SPIR-V explicit
vnt_variables uses interface_type on several use cases, but on nir
variable it is more limited. From nir.h:
/**
* For variables that are in an interface block or are an instance of an
* interface block, this is the \c GLSL_TYPE_INTERFACE type for that block.
*
* \sa
They are supported by SPIR-V for ARB_gl_spirv.
---
src/compiler/spirv/vtn_variables.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/compiler/spirv/vtn_variables.c
b/src/compiler/spirv/vtn_variables.c
index cc3438bff23..3eb1e4e9c97 100644
---
Right now, a type is considered a ubo/ssbo if the mode is
uniform/shader_storage and the interface_type is different to
NULL. See ir_variable::in_in_buffer_block as an example.
---
src/compiler/spirv/vtn_variables.c | 11 ++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git
Just in case you missed my Rb the first time you sent this patch:
Reviewed-by: Alejandro Piñeiro
On 13/10/18 15:09, Jason Ekstrand wrote:
> This is different from the GL_ARB_spirv pass because it generates a much
> simpler data structure that isn't tied to OpenGL and mtypes.h.
> -
this patch:
Reviewed-by: Alejandro Piñeiro
On 05/10/18 16:13, Jason Ekstrand wrote:
> This is different from the GL_ARB_spirv pass because it generates a much
> simpler data structure that isn't tied to OpenGL and mtypes.h.
> ---
> src/compiler/Makefile.sources | 4 +-
> s
I was not able to finish trying to get ARB_gl_spirv using this pass. The
major difference is that on ARB_gl_spirv (and afaiu on GLSL too) we are
merging the info of all the available xfb varyings from all the stages,
while this pass gathers info from a individual nir shader (so one
individual
On 05/10/18 17:44, Jason Ekstrand wrote:
> On Fri, Oct 5, 2018 at 10:34 AM Alejandro Piñeiro
> mailto:apinhe...@igalia.com>> wrote:
>
> On 05/10/18 16:13, Jason Ekstrand wrote:
> > This is different from the GL_ARB_spirv pass because it
> generates a much
>
On 05/10/18 16:13, Jason Ekstrand wrote:
> This is different from the GL_ARB_spirv pass because it generates a much
> simpler data structure that isn't tied to OpenGL and mtypes.h.
I have just skimmed it (don't have time right now for a full check, will
take a deeper look next Monday), but FWIW,
Reviewed-by: Alejandro Piñeiro
On 05/10/18 02:00, Dave Airlie wrote:
> From: Dave Airlie
>
> Found by coverity
> ---
> src/mesa/main/glspirv.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/src/mesa/main/glspirv.c b/src/mesa/main/glspirv.c
> index fecf
From ARB_gl_spirv:
"Mapping of layouts
std140/std430 -> explicit *Offset*, *ArrayStride*, and *MatrixStride*
Decoration on struct members"
That means that we would not have available any kind of layout info,
and we should use explicit array strides.
This
This can happens if we are running an SPIR-V shader (ARB_gl_spirv).
---
src/mesa/main/shader_query.cpp | 30 --
1 file changed, 20 insertions(+), 10 deletions(-)
diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp
index
From: Antia Puentes
---
src/compiler/glsl/gl_nir_linker.c | 79 +++
1 file changed, 79 insertions(+)
diff --git a/src/compiler/glsl/gl_nir_linker.c
b/src/compiler/glsl/gl_nir_linker.c
index 138a12e532d..acec0fe1f03 100644
---
Since ARB_gl_spirv it is possible to miss a lot of name reflection
information, so it is needed to add NULL name checks for several
queries, and return a specific value on those cases. This commit add
them for ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH,
ACTIVE_ATTRIBUTE_MAX_LENGTH and
From: Antia Puentes
Binding comparison is used to determine the block the uniform is part
of. To do the binding comparison we need the information in
UniformBlocks[] and ShaderStorageBlocks[] to be available, so we have
to call gl_nir_link_uniform_blocks() before linking the uniforms.
---
The function had a mix of true/GL_TRUE and false/GL_FALSE
returns. Using GL_TRUE/GL_FALSE as the function returns a GLboolean.
---
src/mesa/drivers/dri/i965/brw_link.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp
When using a SPIR-V shader. Note that needs to be done before linking
uniforms, so when creating the uniform storage entries, block_index
could be filled properly (among other things).
---
src/mesa/drivers/dri/i965/brw_link.cpp | 4
1 file changed, 4 insertions(+)
diff --git
---
src/compiler/glsl/gl_nir_linker.c | 14 ++
1 file changed, 14 insertions(+)
diff --git a/src/compiler/glsl/gl_nir_linker.c
b/src/compiler/glsl/gl_nir_linker.c
index 547549bc4e0..138a12e532d 100644
--- a/src/compiler/glsl/gl_nir_linker.c
+++ b/src/compiler/glsl/gl_nir_linker.c
@@
Until now, we were using the uniform explicit location to check if the
current nir variable already was processed, and entries on the uniform
storage added. But for UBOs/SSBOs, entries are added but we lack a
explicit location.
For those we need to rely on the UBO/SSBO binding (to the nir
From ARB_gl_spirv:
"Mapping of layouts
std140/std430 -> explicit *Offset*, *ArrayStride*, and *MatrixStride*
Decoration on struct members"
That means that we would not have available any kind of layout info,
and we should use explicit array strides.
This
---
src/compiler/glsl/gl_nir_link_uniforms.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/compiler/glsl/gl_nir_link_uniforms.c
b/src/compiler/glsl/gl_nir_link_uniforms.c
index 1a491dc2e5d..00995fb3f76 100644
--- a/src/compiler/glsl/gl_nir_link_uniforms.c
+++
For this interfaces, the inner members are added only once as uniforms
or resources, in opposite to other cases, like a uniform array of
structs.
For those guessing why a issue (16) from ARB_program_interface_query
was used, instead of a quote of the core spec: The core spec is not
really clear
---
src/compiler/spirv/spirv_to_nir.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/src/compiler/spirv/spirv_to_nir.c
b/src/compiler/spirv/spirv_to_nir.c
index 101e2b0bf02..02de2f640c1 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -798,6
From: Neil Roberts
When linking a program using ARB_gl_spirv it now lowers the
vulkan_resource_index intrinsic as an extra pass on the nir shader.
Unlike Vulkan this can be done without waiting for the extra state
from the pipeline layout.
It also adds the call to this lowering on the i965
Equivalent to the already existing ir_variable is_in_buffer_block and
is_in_shader_storage_block, adding the uniform buffer object one. I'm
using the short forms (ssbo, ubo) to avoid having method names too
long.
---
src/compiler/nir/nir.h | 22 ++
1 file changed, 22
Specifically, offset, array_stride, matrix_stride and row_major.
On GLSL, most of that info is computed, but on ARB_gl_spirv they are
explicit, and for Mesa, included on the glsl_type.
From ARB_gl_spirv spec:
"Mapping of layouts
std140/std430 -> explicit *Offset*, *ArrayStride*, and
We need all the info when asking for the type, so we needed to call
type_decoration_cb earlier, in order to get the ArrayStride.
It is somewhat ugly to do this only for Array types, but we can't do
it before the switch as type_decoration_cb have some asserts to ensure
that the type and the
-by: Alejandro Piñeiro
Signed-off-by: Neil Roberts
---
src/compiler/Makefile.sources | 1 +
src/compiler/glsl/gl_nir_link_uniform_blocks.c | 713 +
src/compiler/glsl/gl_nir_linker.h | 3 +
src/compiler/glsl/meson.build | 1
of the vulkan_resource_index is determined by
searching for an intrinsic which uses the result. Unfortunately some
other lower passes can add instructions to perform arithmetic on the
result so the search needs to be performed recursively on the result
of those.
Signed-off-by: Neil Roberts
Signed-off-by: Alejandro Piñeiro
ned, with this series would pass the CTS ARB_gl_spirv
tests on i965.
Alejandro Piñeiro (23):
spirv/nir: translate uniform blocks
spirv/nir: translate ssbo
spirv/nir: setting interface type for ubos/ssbos
spirv/nir: fill up nir variable info for ubos and ssbo
spirv/nir: include SPIR-V
They are supported by SPIR-V for OpenGL. OpenGL codepath expect nir to
include the ssbo as nir variables.
---
src/compiler/spirv/vtn_variables.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/compiler/spirv/vtn_variables.c
b/src/compiler/spirv/vtn_variables.c
index
From ARB_gl_spirv spec:
"7.6.2.spv SPIR-V Uniform Offsets and Strides
The SPIR-V decorations *GLSLShared* or *GLSLPacked* must not be
used. A variable in the *Uniform* Storage Class decorated as a
*Block* must be explicitly laid out using the *Offset*,
*ArrayStride*, and
---
src/compiler/spirv/spirv_to_nir.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/compiler/spirv/spirv_to_nir.c
b/src/compiler/spirv/spirv_to_nir.c
index 15a3e8cce9a..101e2b0bf02 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -725,6 +725,7
1 - 100 of 939 matches
Mail list logo