Questions tagged [spir-v]

SPIR-V is an intermediate representation language designed by the Khronos Group for use by OpenCL (2.0+), OpenGL (4.6+), and Vulkan (all versions). Do not use this tag for questions about SPIR, the earlier standard used with OpenCL before 2.0.

SPIR-V (Standard, Portable, Intermediate Representation-V) is an intermediate representation language for parallel compute and graphics programs. It is intended to be a target for higher-level languages to be compiled into, and is consumed by compute/graphics APIs like OpenCL, OpenGL, and Vulkan.

For Vulkan, SPIR-V is the only option for providing shaders (though there is an extension to directly send a version of GLSL to the Vulkan compiler, it is not widely implemented). OpenGL supports SPIR-V only in version 4.6 (and as an extension). OpenCL 2.0 and above support versions of SPIR-V.

The current version of SPIR-V is 1.3.

Note that SPIR-V is quite distinct from the older SPIR. SPIR was just a way of translating OpenCL C into LLVM's IR language.

102 questions
0
votes
1 answer

getting 'location' : too large for fragment output error while using glslang

Iam using glslang SDK in my code to compile shader programs online, however i get the following errors for my fragment shader: GLSL Parsing Failed for: Text.frag ERROR: 0:6: 'location' : too large for fragment output ERROR: 1 compilation errors. …
BulBul
  • 1,159
  • 3
  • 24
  • 37
0
votes
1 answer

How to read a SPIR-V file?

I am experiencing issues with compilation of some GLSL code to SPIR-V as such I want to check through the SPIR-V code. I want to be able to read through the assembly. How can I do this?
Jonathan Woollett-light
  • 2,813
  • 5
  • 30
  • 58
0
votes
1 answer

What is the problem with generated SPIR-V code and how to verify it?

I have some generated SPIR-V code which I want to use with the vulkan API. But I get an Exception thrown at 0x00007FFB68D933CB (nvoglv64.dll) in vulkanCompute.exe: 0xC0000005: Access violation reading location 0x0000000000000008. when trying to…
tade
  • 1
  • 1
0
votes
0 answers

Vec3 storage buffer not a valid layout despite the scalar qualifier

As far as I understand, the scalar layout qualifier in vulkan GLSL should allow a simple array of vec3 values to work, apparently with out any physical device features to be specified. I've tried with and with out specifying scalar layout features…
Krupip
  • 4,404
  • 2
  • 32
  • 54
0
votes
1 answer

read-only storage buffer in OpenGL ES and Spir-V

In OpenGL ES Shading Language, the shader storage buffer object (SSBO) can be decorated with qualifier readonly or writeonly. Section 4.9 (Memory Access Qualifiers) of OpenGL ES Shading Language version 3.1 specification: Shader storage blocks,…
dudu
  • 801
  • 1
  • 10
  • 32
0
votes
1 answer

Query existence of GLSL extension in SPIR-V shader

In regular GLSL I can do something like this to conditionally enable a GLSL extension: #if defined(GL_ARB_shader_viewport_layer_array) #extension GL_ARB_shader_viewport_layer_array : enable // Some other stuff here #endif My question is,…
JustSid
  • 25,168
  • 7
  • 79
  • 97
0
votes
1 answer

SPIR-V error with InterlockedMax after upgrading to LunarG SDK 1.0.68.0

My compute shader (written in HLSL) compiled and worked with the earlier SDK 1.0.65.0. I updated to 1.0.68.0 and recompiled it, now I get this error when calling vkCreateShaderModule: Vulkan error: [SC], code: 5: SPIR-V module not valid:…
SurvivalMachine
  • 7,946
  • 15
  • 57
  • 87
0
votes
1 answer

How to process FLT_MAX in GLSL for Vulkan

I have an algorithm which I try to implement in GLSL for Vulkan. That algorithm uses FLT_MAX. Now I could define that to an arbitrary high float value but I really would be interested in how to actually e.g. process that value on runtime in GLSL.
abergmeier
  • 13,224
  • 13
  • 64
  • 120
0
votes
1 answer

SPIR-V require locations on user in/out in Vulkan 1.0.51.1 +

i installed the latest Vulkan SDK on my computer how ever whenever i want to generate the SPIR-V files for my shaders through glslValidator.exe it fails and returns the following errors ERROR: Shader.vert:17: 'location' : SPIR-V requires location…
BulBul
  • 1,159
  • 3
  • 24
  • 37
0
votes
1 answer

Should generated SPIR-V code be optimized?

I'm currently considering porting some code that I have from OpenGL/GLSL to Vulkan/SPIR-V, and part of that code generates GLSL at runtime, so I'll have to generate SPIR-V instead. What I'm wondering is how I should relate to optimizations in the…
Dolda2000
  • 25,216
  • 4
  • 51
  • 92
-1
votes
0 answers

Is it possible to compile HLSL shaders to SPIRV using the Visual Studio HLSL Compiler?

I was looking at the HLSL documentation page from Khronos Group's GitHub and I was wondering if it was possible to implement their section on runtime compilation with the built in HLSL compiler for Visual Studio? The built-in compiler runs when…
-1
votes
1 answer

How to obtain version of installed Vulkan API in Linux?

2018-03-07, the new version of API (Vulkan 1.1) was released. I want to know: which console command can display currently installed API version. $ /usr/bin/vulkaninfo | head -n 5 =========== VULKAN INFO =========== Vulkan Instance Version:…
xsp-server-hater
  • 55
  • 1
  • 1
  • 9
1 2 3 4 5 6
7