-
Notifications
You must be signed in to change notification settings - Fork 575
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2394 from KhronosGroup/msl-bary-decoration-fix
MSL: Allow Centroid and Sample decorations on bary coord.
- Loading branch information
Showing
9 changed files
with
239 additions
and
20 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
reference/shaders-msl-no-opt/asm/frag/barycentric-centroid-noperspective.msl22.asm.frag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include <metal_stdlib> | ||
#include <simd/simd.h> | ||
|
||
using namespace metal; | ||
|
||
struct main0_out | ||
{ | ||
float3 value [[color(0)]]; | ||
}; | ||
|
||
struct main0_in | ||
{ | ||
float3 gl_BaryCoordNoPerspEXT [[barycentric_coord, centroid_no_perspective]]; | ||
}; | ||
|
||
fragment main0_out main0(main0_in in [[stage_in]]) | ||
{ | ||
main0_out out = {}; | ||
out.value = in.gl_BaryCoordNoPerspEXT; | ||
return out; | ||
} | ||
|
22 changes: 22 additions & 0 deletions
22
reference/shaders-msl-no-opt/asm/frag/barycentric-centroid-perspective.msl22.asm.frag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include <metal_stdlib> | ||
#include <simd/simd.h> | ||
|
||
using namespace metal; | ||
|
||
struct main0_out | ||
{ | ||
float3 value [[color(0)]]; | ||
}; | ||
|
||
struct main0_in | ||
{ | ||
float3 gl_BaryCoordEXT [[barycentric_coord, centroid_perspective]]; | ||
}; | ||
|
||
fragment main0_out main0(main0_in in [[stage_in]]) | ||
{ | ||
main0_out out = {}; | ||
out.value = in.gl_BaryCoordEXT; | ||
return out; | ||
} | ||
|
22 changes: 22 additions & 0 deletions
22
reference/shaders-msl-no-opt/asm/frag/barycentric-sample-noperspective.msl22.asm.frag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include <metal_stdlib> | ||
#include <simd/simd.h> | ||
|
||
using namespace metal; | ||
|
||
struct main0_out | ||
{ | ||
float3 value [[color(0)]]; | ||
}; | ||
|
||
struct main0_in | ||
{ | ||
float3 gl_BaryCoordNoPerspEXT [[barycentric_coord, sample_no_perspective]]; | ||
}; | ||
|
||
fragment main0_out main0(main0_in in [[stage_in]]) | ||
{ | ||
main0_out out = {}; | ||
out.value = in.gl_BaryCoordNoPerspEXT; | ||
return out; | ||
} | ||
|
22 changes: 22 additions & 0 deletions
22
reference/shaders-msl-no-opt/asm/frag/barycentric-sample-perspective.msl22.asm.frag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include <metal_stdlib> | ||
#include <simd/simd.h> | ||
|
||
using namespace metal; | ||
|
||
struct main0_out | ||
{ | ||
float3 value [[color(0)]]; | ||
}; | ||
|
||
struct main0_in | ||
{ | ||
float3 gl_BaryCoordEXT [[barycentric_coord, sample_perspective]]; | ||
}; | ||
|
||
fragment main0_out main0(main0_in in [[stage_in]]) | ||
{ | ||
main0_out out = {}; | ||
out.value = in.gl_BaryCoordEXT; | ||
return out; | ||
} | ||
|
34 changes: 34 additions & 0 deletions
34
shaders-msl-no-opt/asm/frag/barycentric-centroid-noperspective.msl22.asm.frag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
; SPIR-V | ||
; Version: 1.0 | ||
; Generator: Khronos Glslang Reference Front End; 11 | ||
; Bound: 13 | ||
; Schema: 0 | ||
OpCapability Shader | ||
OpCapability FragmentBarycentricKHR | ||
OpExtension "SPV_KHR_fragment_shader_barycentric" | ||
%1 = OpExtInstImport "GLSL.std.450" | ||
OpMemoryModel Logical GLSL450 | ||
OpEntryPoint Fragment %main "main" %value %gl_BaryCoordEXT | ||
OpExecutionMode %main OriginUpperLeft | ||
OpSource GLSL 450 | ||
OpSourceExtension "GL_EXT_fragment_shader_barycentric" | ||
OpName %main "main" | ||
OpName %value "value" | ||
OpName %gl_BaryCoordEXT "gl_BaryCoordEXT" | ||
OpDecorate %value Location 0 | ||
OpDecorate %gl_BaryCoordEXT BuiltIn BaryCoordNoPerspKHR | ||
OpDecorate %gl_BaryCoordEXT Centroid | ||
%void = OpTypeVoid | ||
%3 = OpTypeFunction %void | ||
%float = OpTypeFloat 32 | ||
%v3float = OpTypeVector %float 3 | ||
%_ptr_Output_v3float = OpTypePointer Output %v3float | ||
%value = OpVariable %_ptr_Output_v3float Output | ||
%_ptr_Input_v3float = OpTypePointer Input %v3float | ||
%gl_BaryCoordEXT = OpVariable %_ptr_Input_v3float Input | ||
%main = OpFunction %void None %3 | ||
%5 = OpLabel | ||
%12 = OpLoad %v3float %gl_BaryCoordEXT | ||
OpStore %value %12 | ||
OpReturn | ||
OpFunctionEnd |
34 changes: 34 additions & 0 deletions
34
shaders-msl-no-opt/asm/frag/barycentric-centroid-perspective.msl22.asm.frag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
; SPIR-V | ||
; Version: 1.0 | ||
; Generator: Khronos Glslang Reference Front End; 11 | ||
; Bound: 13 | ||
; Schema: 0 | ||
OpCapability Shader | ||
OpCapability FragmentBarycentricKHR | ||
OpExtension "SPV_KHR_fragment_shader_barycentric" | ||
%1 = OpExtInstImport "GLSL.std.450" | ||
OpMemoryModel Logical GLSL450 | ||
OpEntryPoint Fragment %main "main" %value %gl_BaryCoordEXT | ||
OpExecutionMode %main OriginUpperLeft | ||
OpSource GLSL 450 | ||
OpSourceExtension "GL_EXT_fragment_shader_barycentric" | ||
OpName %main "main" | ||
OpName %value "value" | ||
OpName %gl_BaryCoordEXT "gl_BaryCoordEXT" | ||
OpDecorate %value Location 0 | ||
OpDecorate %gl_BaryCoordEXT BuiltIn BaryCoordKHR | ||
OpDecorate %gl_BaryCoordEXT Centroid | ||
%void = OpTypeVoid | ||
%3 = OpTypeFunction %void | ||
%float = OpTypeFloat 32 | ||
%v3float = OpTypeVector %float 3 | ||
%_ptr_Output_v3float = OpTypePointer Output %v3float | ||
%value = OpVariable %_ptr_Output_v3float Output | ||
%_ptr_Input_v3float = OpTypePointer Input %v3float | ||
%gl_BaryCoordEXT = OpVariable %_ptr_Input_v3float Input | ||
%main = OpFunction %void None %3 | ||
%5 = OpLabel | ||
%12 = OpLoad %v3float %gl_BaryCoordEXT | ||
OpStore %value %12 | ||
OpReturn | ||
OpFunctionEnd |
35 changes: 35 additions & 0 deletions
35
shaders-msl-no-opt/asm/frag/barycentric-sample-noperspective.msl22.asm.frag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
; SPIR-V | ||
; Version: 1.0 | ||
; Generator: Khronos Glslang Reference Front End; 11 | ||
; Bound: 13 | ||
; Schema: 0 | ||
OpCapability Shader | ||
OpCapability SampleRateShading | ||
OpCapability FragmentBarycentricKHR | ||
OpExtension "SPV_KHR_fragment_shader_barycentric" | ||
%1 = OpExtInstImport "GLSL.std.450" | ||
OpMemoryModel Logical GLSL450 | ||
OpEntryPoint Fragment %main "main" %value %gl_BaryCoordEXT | ||
OpExecutionMode %main OriginUpperLeft | ||
OpSource GLSL 450 | ||
OpSourceExtension "GL_EXT_fragment_shader_barycentric" | ||
OpName %main "main" | ||
OpName %value "value" | ||
OpName %gl_BaryCoordEXT "gl_BaryCoordEXT" | ||
OpDecorate %value Location 0 | ||
OpDecorate %gl_BaryCoordEXT BuiltIn BaryCoordNoPerspKHR | ||
OpDecorate %gl_BaryCoordEXT Sample | ||
%void = OpTypeVoid | ||
%3 = OpTypeFunction %void | ||
%float = OpTypeFloat 32 | ||
%v3float = OpTypeVector %float 3 | ||
%_ptr_Output_v3float = OpTypePointer Output %v3float | ||
%value = OpVariable %_ptr_Output_v3float Output | ||
%_ptr_Input_v3float = OpTypePointer Input %v3float | ||
%gl_BaryCoordEXT = OpVariable %_ptr_Input_v3float Input | ||
%main = OpFunction %void None %3 | ||
%5 = OpLabel | ||
%12 = OpLoad %v3float %gl_BaryCoordEXT | ||
OpStore %value %12 | ||
OpReturn | ||
OpFunctionEnd |
35 changes: 35 additions & 0 deletions
35
shaders-msl-no-opt/asm/frag/barycentric-sample-perspective.msl22.asm.frag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
; SPIR-V | ||
; Version: 1.0 | ||
; Generator: Khronos Glslang Reference Front End; 11 | ||
; Bound: 13 | ||
; Schema: 0 | ||
OpCapability Shader | ||
OpCapability SampleRateShading | ||
OpCapability FragmentBarycentricKHR | ||
OpExtension "SPV_KHR_fragment_shader_barycentric" | ||
%1 = OpExtInstImport "GLSL.std.450" | ||
OpMemoryModel Logical GLSL450 | ||
OpEntryPoint Fragment %main "main" %value %gl_BaryCoordEXT | ||
OpExecutionMode %main OriginUpperLeft | ||
OpSource GLSL 450 | ||
OpSourceExtension "GL_EXT_fragment_shader_barycentric" | ||
OpName %main "main" | ||
OpName %value "value" | ||
OpName %gl_BaryCoordEXT "gl_BaryCoordEXT" | ||
OpDecorate %value Location 0 | ||
OpDecorate %gl_BaryCoordEXT BuiltIn BaryCoordKHR | ||
OpDecorate %gl_BaryCoordEXT Sample | ||
%void = OpTypeVoid | ||
%3 = OpTypeFunction %void | ||
%float = OpTypeFloat 32 | ||
%v3float = OpTypeVector %float 3 | ||
%_ptr_Output_v3float = OpTypePointer Output %v3float | ||
%value = OpVariable %_ptr_Output_v3float Output | ||
%_ptr_Input_v3float = OpTypePointer Input %v3float | ||
%gl_BaryCoordEXT = OpVariable %_ptr_Input_v3float Input | ||
%main = OpFunction %void None %3 | ||
%5 = OpLabel | ||
%12 = OpLoad %v3float %gl_BaryCoordEXT | ||
OpStore %value %12 | ||
OpReturn | ||
OpFunctionEnd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters