23 const auto blendStateToString = [](
const BlendingSettings& state) ->
string {
24 if (!state.enabled()) {
28 return Util::StringFormat(
"Blend Src[ {} ], Blend Dest[ {} ], Blend Op[ {} ], Blend Src Alpha[ {} ], Blend Dest Alpha[ {} ], Blend Op alpha[ {} ]",
37 const auto attributeDescriptorToString = [](
const U8 idx,
const AttributeDescriptor& desc) ->
string {
43 return Util::StringFormat(
"Index [ {} ], Binding [ {} ], Components per element [ {} ], Component format [ {} ], Normalised [ {} ], Stride in bytes [ {} ]",
45 desc._vertexBindingIndex,
46 desc._componentsPerElement,
48 desc._normalized ?
"True" :
"False",
52 const auto vertexFormatToString = [](
const U8 idx,
const VertexBinding& binding ) ->
string
54 return Util::StringFormat(
"Index [ {} ] Binding [ {} ], Stride in bytes [ {} ], Per Vertex Input Rate [ {} ]",
56 binding._bufferBindIndex,
57 binding._strideInBytes,
58 binding._perVertexInputRate ?
"True" :
"False");
62 for (
U16 j = 0; j < indent; ++j) {
65 ret.append(
Util::StringFormat(
"Shader handle : {} - {}\n", cmd.
_pipeline->descriptor()._shaderProgramHandle._index, cmd.
_pipeline->descriptor()._shaderProgramHandle._generation));
67 for (
U16 j = 0; j < indent; ++j) {
72 for (
U16 j = 0; j < indent; ++j) {
79 for (
U16 j = 0; j < indent; ++j) {
84 ret.append(
"Blending states: \n");
88 for (
U16 j = 0; j < indent; ++j) {
96 for (
U16 j = 0; j < indent; ++j) {
105 for (
U16 j = 0; j < indent; ++j) {
108 ret.append(
"Vertex format: \n");
114 for (
U16 j = 0; j < indent; ++j) {
117 ret.append(
Util::StringFormat(
"{}: {}\n", idx, attributeDescriptorToString(idx, desc)));
124 for (
U16 j = 0; j < indent; ++j )
128 ret.append(
Util::StringFormat(
"{}: {}\n", idx, vertexFormatToString( idx, binding ) ) );
145 for (
U16 j = 0; j < indent; ++j) {
148 ret.append(
Util::StringFormat(
"Constant binding: {} Type: {} Data range: [ {} - {} ]\n", it._bindingHash,
to_base(it._type), it._range._startOffset, it._range._startOffset + it._range._length));
152 for (
U16 j = 0; j < indent; ++j) {
155 ret.append(cmd.
_fastData.
set() ?
"Has push constants specified: \n" :
"No push constant data specified");
159 for (
U8 d = 0u; d < 2u; ++d ) {
161 for (
U16 j = 0; j < indent; ++j )
170 for (
U8 r = 0u; r < 4; ++r )
173 for (
U16 j = 0; j < indent; ++j )
178 ret.append(
Util::StringFormat(
" {:.2f} {:.2f} {:.2f} {:.2f}\n", datad.
m[r][0], datad.
m[r][1], datad.
m[r][2] , datad.
m[r][3]));
193 for (
U16 j = 0; j < indent; ++j) {
215 for (
U16 j = 0; j < indent; ++j )
225 for (
U16 j = 0; j < indent; ++j )
229 ret.append(
Util::StringFormat(
"Draw Mask[ {} ]: {}\n", k++, draw ?
"TRUE" :
"FALSE") );
236 for (
U16 j = 0; j < indent; ++j )
247 for (
U16 j = 0; j < indent; ++j )
251 ret.append(
Util::StringFormat(
"Clear Colour [ {:.2f}, {:.2f}, {:.2f}, {:.2f} ] (Enabled: {})\n", clear._colour.r, clear._colour.g, clear._colour.b, clear._colour.a, clear._enabled ?
"TRUE" :
"FALSE") );
270 for (
U16 j = 0; j < indent; ++j) {
274 const vec4<F32>& eq = planes[i]._equation;
276 ret.append(
Util::StringFormat(
"Plane [{}] [ {:5.2f} {:5.2f} {:5.2f} - {:5.2f} ]\n", i, eq.
x, eq.
y, eq.
z, eq.
w));
309 string ret =
Util::StringFormat(
" [ Buffers: {}, Images: {} ]\n", bufferCount, imageCount);
319 for (
U16 j = 0; j < indent; ++j)
324 ret.append(
Util::StringFormat(
"Buffer [ {} - {} ] Range [{} - {}] Read Index [ {} ]\n",
346 for (
U16 j = 0; j < indent; ++j)
356 ret.append(
Util::StringFormat(
"Texture [ {} - {} - {} - {} ] Layers: [ {} - {} ] MipRange: [ {} - {} ]\n",
358 srcTex !=
nullptr ? srcTex->
getGUID() : 0u,
359 srcTex !=
nullptr ? srcTex->resourceName().c_str() :
"no-name",
371 ret.append(
Util::StringFormat(
"Image binds: Slot [{}] - Src GUID [ {} ] - Src Name [ {} ] - Layers [{} - {}] - Levels [{} - {}] - Flag [ {} ]",
373 srcTex !=
nullptr ? srcTex->
getGUID() : 0u,
374 srcTex !=
nullptr ? srcTex->resourceName().c_str() :
"no-name",
395 for (
U16 j = 0; j < indent; ++j) {
399 ret.append(
" [ " +
string(cmd.
_msg.c_str()) +
" ]");
409 string ret =
Util::StringFormat(
" [ Buffer locks: {} ] [ Texture layout changes: {} ]\n",
415 for (
U16 j = 0; j < indent; ++j) {
419 const I64 guid = it._buffer !=
nullptr ? it._buffer->getGUID() : -1;
426 for (
U16 j = 0; j < indent; ++j) {
436 string ret =
" Bit Mask: ";
437 ret.append( std::bitset<32>(cmd.
_queryMask).to_string() );
443 return cmd.
_waitForResults ?
" Wait for results: TRUE" :
" Wait for results: FALSE";
452 for (
U16 j = 0; j < indent; ++j )
457 ret.append(
Util::StringFormat(
"Input: [l: {} m: {} i: {}] Output: [l: {} m: {} i: {}] Layer count: [ {} ] Mip Count: [ {} ]\n", it._input._layerOffset, it._input._mipOffset, it._input._index, it._output._layerOffset, it._output._mipOffset, it._output._index, it._layerCount, it._mipCount ) );
499 string ret(indent,
' ');
FORCE_INLINE I64 getGUID() const noexcept
An API-independent representation of a texture.
static const char * commandType[]
void ToString(const CommandBase &cmd, const CommandType type, I32 &crtIndent, string &out)
CommandBuffer * Get(Handle< CommandBuffer > handle)
static constexpr const char * blendProperty[]
static constexpr const char * bufferUpdateUsage[]
static constexpr const char * imageUsage[]
static constexpr const char * GFXDataFormat[]
static constexpr const char * primitiveType[]
static constexpr const char * blendOperation[]
Str StringFormat(const char *fmt, Args &&...args)
Handle console commands that start with a forward slash.
size_t GetHash(const PropertyDescriptor< T > &descriptor) noexcept
constexpr U8 INVALID_TEXTURE_BINDING
constexpr U8 to_U8(const T value)
std::basic_string< char, std::char_traits< char >, dvd_allocator< char > > string
constexpr auto to_base(const Type value) -> Type
const std::array< bool, N > & planeState() const noexcept
const PlaneList< N > & planes() const noexcept
SamplerDescriptor _sampler
DescriptorImageView _imageView
ShaderBufferEntry _buffer
DescriptorSetBindingType _type
DescriptorCombinedImageSampler _sampledImage
DescriptorSetBindingData _data
std::array< DescriptorSetBinding, MAX_BINDINGS_PER_DESCRIPTOR_SET > _bindings
U8 _cubeFace
Ignored for non cube textures.
RTDrawDescriptor _descriptor
RTClearDescriptor _clearDescriptor
const Pipeline * _pipeline
RenderTargetID _destination
vec3< U32 > _computeGroupSize
GenericDrawCommandContainer _drawCommands
TextureLayoutChanges _textureLayoutChanges
PushConstantsStruct _fastData
UniformData * _uniformData
CameraSnapshot _cameraSnapshot
FrustumClipPlanes _clippingPlanes
IndirectIndexedDrawCommand _cmd
const Texture * _srcTexture
bool set() const noexcept
std::array< BlendingSettings, to_base(RTColourAttachmentSlot::COUNT)> _settings
DrawLayerEntry _writeLayers[RT_MAX_ATTACHMENT_COUNT]