X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fcompiler%2Fshader_info.h;h=c49fed923e28427747312c51e6f5a15a579926c6;hb=de36b5b805be1732e6798afd1a12743df8d32718;hp=8e7b81a13ab031915be50af6e64825afdd4f9152;hpb=84a1a2578dab10ddb7ada831b598db5f7bc6a859;p=mesa.git diff --git a/src/compiler/shader_info.h b/src/compiler/shader_info.h index 8e7b81a13ab..c49fed923e2 100644 --- a/src/compiler/shader_info.h +++ b/src/compiler/shader_info.h @@ -42,7 +42,9 @@ struct spirv_supported_capabilities { bool descriptor_indexing; bool device_group; bool draw_parameters; + bool float32_atomic_add; bool float64; + bool float64_atomic_add; bool fragment_shader_sample_interlock; bool fragment_shader_pixel_interlock; bool geometry_streams; @@ -53,7 +55,9 @@ struct spirv_supported_capabilities { bool int16; bool int64; bool int64_atomics; + bool integer_functions2; bool kernel; + bool kernel_image; bool min_lod; bool multiview; bool physical_storage_buffer_address; @@ -78,9 +82,13 @@ struct spirv_supported_capabilities { bool vk_memory_model; bool vk_memory_model_device_scope; bool float16; + bool amd_fragment_mask; bool amd_gcn_shader; bool amd_shader_ballot; bool amd_trinary_minmax; + bool amd_image_read_write_lod; + bool amd_shader_explicit_vertex_parameter; + bool amd_image_gather_bias_lod; }; typedef struct shader_info { @@ -103,12 +111,14 @@ typedef struct shader_info { uint8_t num_ubos; /* Number of atomic buffers used by this shader */ uint8_t num_abos; - /* Number of shader storage buffers used by this shader */ + /* Number of shader storage buffers (max .driver_location + 1) used by this + * shader. In the case of nir_lower_atomics_to_ssbo being used, this will + * be the number of actual SSBOs in gl_program->info, and the lowered SSBOs + * and atomic counters in nir_shader->info. + */ uint8_t num_ssbos; /* Number of images used by this shader */ uint8_t num_images; - /* Index of the last MSAA image. */ - int8_t last_msaa_image; /* Which inputs are actually read */ uint64_t inputs_read; @@ -126,12 +136,28 @@ typedef struct shader_info { /* Which patch outputs are read */ uint32_t patch_outputs_read; + /* Which inputs are read indirectly (subset of inputs_read) */ + uint64_t inputs_read_indirectly; + /* Which outputs are read or written indirectly */ + uint64_t outputs_accessed_indirectly; + /* Which patch inputs are read indirectly (subset of patch_inputs_read) */ + uint64_t patch_inputs_read_indirectly; + /* Which patch outputs are read or written indirectly */ + uint64_t patch_outputs_accessed_indirectly; + /** Bitfield of which textures are used */ uint32_t textures_used; /** Bitfield of which textures are used by texelFetch() */ uint32_t textures_used_by_txf; + /** Bitfield of which images are used */ + uint32_t images_used; + /** Bitfield of which images are buffers. */ + uint32_t image_buffers; + /** Bitfield of which images are MSAA. */ + uint32_t msaa_images; + /* SPV_KHR_float_controls: execution mode for floating point ops */ uint16_t float_controls_execution_mode; @@ -168,6 +194,17 @@ typedef struct shader_info { /* Whether flrp has been lowered. */ bool flrp_lowered:1; + /* Whether nir_lower_io has been called to lower derefs. + * nir_variables for inputs and outputs might not be present in the IR. + */ + bool io_lowered:1; + + /* Whether the shader writes memory, including transform feedback. */ + bool writes_memory:1; + + /* Whether gl_Layer is viewport-relative */ + bool layer_viewport_relative:1; + union { struct { /* Which inputs are doubles */ @@ -203,12 +240,13 @@ typedef struct shader_info { /** Whether or not this shader uses EndPrimitive */ bool uses_end_primitive:1; - /** Whether or not this shader uses non-zero streams */ - bool uses_streams:1; + /** The streams used in this shaders (max. 4) */ + uint8_t active_stream_mask:4; } gs; struct { bool uses_discard:1; + bool uses_demote:1; /** * True if this fragment shader requires helper invocations. This @@ -270,6 +308,17 @@ typedef struct shader_info { /** gl_FragDepth layout for ARB_conservative_depth. */ enum gl_frag_depth_layout depth_layout:3; + + /** + * Interpolation qualifiers for drivers that lowers color inputs + * to system values. + */ + unsigned color0_interp:3; /* glsl_interp_mode */ + bool color0_sample:1; + bool color0_centroid:1; + unsigned color1_interp:3; /* glsl_interp_mode */ + bool color1_sample:1; + bool color1_centroid:1; } fs; struct { @@ -309,6 +358,16 @@ typedef struct shader_info { /** Is the vertex order counterclockwise? */ bool ccw:1; bool point_mode:1; + + /* Bit mask of TCS per-vertex inputs (VS outputs) that are used + * with a vertex index that is NOT the invocation id + */ + uint64_t tcs_cross_invocation_inputs_read; + + /* Bit mask of TCS per-vertex outputs that are used + * with a vertex index that is NOT the invocation id + */ + uint64_t tcs_cross_invocation_outputs_read; } tess; }; } shader_info;