Vulkan-Docs/doc/specs/vulkan/appendices/VK_NV_glsl_shader.txt

67 lines
1.7 KiB
Plaintext
Raw Normal View History

Change log for August 26, 2016 Vulkan 1.0.25 spec update: * Bump API patch number and header version number to 25 for this update. * Structurally change the specification so that multiple extensions are included in the +1.0+ git branch, and specifications will include or not include those extensions at build time based on options passed to the Makefile. See +doc/specs/vulkan/README.html+ and the ``Layers and Extensions'' section of the ``Vulkan Documentation and Extensions'' document for more information on this change. * Register and publish new extensions in the single-branch form: ** +VK_NV_external_memory_capabilities+ ** +VK_NV_external_memory+ ** +VK_NV_external_memory_win32+ ** +VK_NV_win32_keyed_mutex+ Github Issues: * Clarify description of GetInstanceProcAddr and GetDeviceProcAddr (public issue 212). * Add SPIR-V <<textures-operation-validation, instruction validation>> for single-sampled images (public issue 316). * Fix spelling of ``tesselation'' in a few places and note it as an exception to the American spelling rules convention (public issue 327). * Fix Makefile to create output directory for ``styleguide'' target (public issue 329). * Fix numerous minor issues with incorrectly tags on enumerant names and table titles (public issue 330). * Generate specversion.txt date in UTC time and RFC 2822 format (public issue 335). * Convert link to the SPIR-V Specification for flink:VkShaderModuleCreateInfo into an internal link to the normative reference (public issue 336). * Add ename:VK_ERROR_OUT_OF_MEMORY error code to flink:vkCreateDebugReportCallbackEXT (public issue 337). Internal Issues: * Update style guide regarding use of code:NULL and dname:VK_NULL_HANDLE (internal issue 393). * Change the definition of latexmath:[$q$] in the <<textures-image-level-selection,texture image level selection>> section to be the index of the maximum defined level for the view, not the number of levels in the view (internal issue 406). * Allow developers to override dname:VK_DEFINE_NON_DISPATCHABLE_HANDLE with their own binary-compatible definition (internal issue 439). * Fix +vk_platform.h+ conditional logic causing compile failure with some Android compilers (internal issue 441). * Implement the single-branch model as described above (internal issue 461). Other Issues:
2016-08-28 10:47:19 +00:00
== VK_NV_glsl_shader
*Name String*:: VK_NV_glsl_shader
*Extension Type*:: Device extension
*Registered Extension Number*:: 13
*Status*:: Draft.
*Last Modified Date*:: 14/02/2016
*Revision*:: 1
*IP Status*:: No known IP claims.
*Dependencies*::
- This extension is written against version 1.0. of the Vulkan API.
*Contributors*::
- Piers Daniell, NVIDIA
*Contacts*::
- Piers Daniell (pdaniell 'at' nvidia.com)
This extension allows GLSL shaders written to the GL_KHR_vulkan_glsl
extension specification to be used instead of SPIR-V. The implementation
will automatically detect which the shader is SPIR-V or GLSL and
compile it appropriatly.
=== New Object Types
=== New Enum Constants
* Extending ename:VkResult:
** ename:VK_ERROR_INVALID_SHADER_NV
=== New Enums
=== New Structures
=== New Functions
=== Issues
=== Examples
**Example 1**
Passing in GLSL code
[source,{basebackend@docbook:C++:cpp}]
----------------------------------------
char const vss[] =
"#version 450 core\n"
"layout(location = 0) in vec2 aVertex;\n"
"layout(location = 1) in vec4 aColor;\n"
"out vec4 vColor;\n"
"void main()\n"
"{\n"
" vColor = aColor;\n"
" gl_Position = vec4(aVertex, 0, 1);\n"
"}\n"
;
VkShaderModuleCreateInfo vertexShaderInfo = { VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO };
vertexShaderInfo.codeSize = sizeof vss;
vertexShaderInfo.pCode = vss;
VkShaderModule vertexShader;
vkCreateShaderModule(device, &vertexShaderInfo, 0, &vertexShader);
----------------------------------------
=== Version History
* Revision 1, 2016-02-14 (Piers Daniell)
- Initial draft