diff --git a/qrenderdoc/Code/BufferFormatter.cpp b/qrenderdoc/Code/BufferFormatter.cpp index db5ea0f70..2a2cde596 100644 --- a/qrenderdoc/Code/BufferFormatter.cpp +++ b/qrenderdoc/Code/BufferFormatter.cpp @@ -539,7 +539,7 @@ QString BufferFormatter::GetTextureFormatString(const TextureDescription &tex) } else { - if(tex.format.compType == CompType::Float || tex.format.compType == CompType::Double) + if(tex.format.compType == CompType::Float) baseType = lit("double"); else if(tex.format.compType == CompType::SInt) baseType = lit("long"); @@ -1527,10 +1527,6 @@ QVariantList GetVariants(ResourceFormat format, const ShaderVariableDescriptor & ret.push_back(f / (float)0x0000ffff); } } - else if(format.compType == CompType::Double) - { - ret.push_back(readObj(data, end, ok)); - } else { // unorm/snorm diff --git a/qrenderdoc/Windows/BufferViewer.cpp b/qrenderdoc/Windows/BufferViewer.cpp index 268060b78..caa4ae0f9 100644 --- a/qrenderdoc/Windows/BufferViewer.cpp +++ b/qrenderdoc/Windows/BufferViewer.cpp @@ -1444,7 +1444,7 @@ static void ConfigureColumnsForShader(ICaptureContext &ctx, const ShaderReflecti ShaderConstant &el = columns[i]; uint numComps = el.type.descriptor.columns; - uint elemSize = prop.format.compType == CompType::Double ? 8U : 4U; + uint elemSize = prop.format.compByteWidth > 4 ? 8U : 4U; if(ctx.CurPipelineState().HasAlignedPostVSData( shader->stage == ShaderStage::Vertex ? MeshDataStage::VSOut : MeshDataStage::GSOut)) diff --git a/qrenderdoc/Windows/PerformanceCounterViewer.cpp b/qrenderdoc/Windows/PerformanceCounterViewer.cpp index bc0ca71c6..64d6a366f 100644 --- a/qrenderdoc/Windows/PerformanceCounterViewer.cpp +++ b/qrenderdoc/Windows/PerformanceCounterViewer.cpp @@ -52,11 +52,10 @@ struct SortValue { case CompType::Float: type = Float; - val.d = result.value.f; - break; - case CompType::Double: - type = Float; - val.d = result.value.d; + if(description.resultByteWidth == 8) + val.d = result.value.d; + else + val.d = result.value.f; break; case CompType::UInt: @@ -146,19 +145,19 @@ QTableWidgetItem *PerformanceCounterViewer::MakeCounterResultItem(const CounterR switch(description.resultType) { - case CompType::Float: returnValue += Formatter::Format(mul * result.value.f); break; - - case CompType::Double: returnValue += Formatter::Format(mul * result.value.d); break; + case CompType::Float: + if(description.resultByteWidth == 8) + returnValue += Formatter::Format(mul * result.value.d); + else + returnValue += Formatter::Format(mul * result.value.f); + break; case CompType::UInt: if(description.resultByteWidth == 8) - { returnValue += Formatter::Format(result.value.u64); - } else - { returnValue += Formatter::Format(result.value.u32); - } + break; default: // assert (false) diff --git a/renderdoc/api/replay/renderdoc_tostr.inl b/renderdoc/api/replay/renderdoc_tostr.inl index 102052347..de12ba0fb 100644 --- a/renderdoc/api/replay/renderdoc_tostr.inl +++ b/renderdoc/api/replay/renderdoc_tostr.inl @@ -160,7 +160,6 @@ rdcstr DoStringise(const CompType &el) STRINGISE_ENUM_CLASS(UScaled); STRINGISE_ENUM_CLASS(SScaled); STRINGISE_ENUM_CLASS_NAMED(Depth, "Depth/Stencil"); - STRINGISE_ENUM_CLASS(Double); STRINGISE_ENUM_CLASS_NAMED(UNormSRGB, "sRGB"); } END_ENUM_STRINGISE(); diff --git a/renderdoc/api/replay/replay_enums.h b/renderdoc/api/replay/replay_enums.h index 1cd41ecf9..2e9695a0c 100644 --- a/renderdoc/api/replay/replay_enums.h +++ b/renderdoc/api/replay/replay_enums.h @@ -279,8 +279,7 @@ DOCUMENT(R"(Represents the component type of a channel in a texture or element i .. data:: Float - A single-precision (32-bit) floating point value. This is an IEEE float with 1 sign bit, - 8 bits of exponent and 23 bits of mantissa. + An IEEE floating point value of 64-bit, 32-bit or 16-bit size. .. data:: UNorm @@ -321,12 +320,8 @@ DOCUMENT(R"(Represents the component type of a channel in a texture or element i .. data:: Depth - An opaque value storing depth information, either :data:`unsigned normalised ` or - :data:`floating point `. - -.. data:: Double - - A double-precision (64-bit) floating point value. + An opaque value storing depth information, either :data:`floating point ` for 32-bit depth + values or else :data:`unsigned normalised ` for other bit sizes. .. data:: UNormSRGB @@ -344,7 +339,6 @@ enum class CompType : uint8_t UScaled, SScaled, Depth, - Double, UNormSRGB, }; @@ -361,9 +355,7 @@ constexpr CompType VarTypeCompType(VarType type) // temporarily disable clang-format to make this more readable. // Ideally we'd use a simple switch() but VS2015 doesn't support that :(. // clang-format off - return (type == VarType::Double) ? CompType::Double - - : (type == VarType::Float || type == VarType::Half) ? CompType::Float + return (type == VarType::Double || type == VarType::Float || type == VarType::Half) ? CompType::Float : (type == VarType::ULong || type == VarType::UInt || type == VarType::UShort || type == VarType::UByte || type == VarType::Bool) ? CompType::UInt diff --git a/renderdoc/driver/d3d11/d3d11_counters.cpp b/renderdoc/driver/d3d11/d3d11_counters.cpp index 1aeb3e4cd..4cda2a441 100644 --- a/renderdoc/driver/d3d11/d3d11_counters.cpp +++ b/renderdoc/driver/d3d11/d3d11_counters.cpp @@ -116,7 +116,7 @@ CounterDescription D3D11Replay::DescribeCounter(GPUCounter counterID) desc.description = "Time taken for this event on the GPU, as measured by delta between two GPU timestamps."; desc.resultByteWidth = 8; - desc.resultType = CompType::Double; + desc.resultType = CompType::Float; desc.unit = CounterUnit::Seconds; break; case GPUCounter::InputVerticesRead: diff --git a/renderdoc/driver/d3d12/d3d12_counters.cpp b/renderdoc/driver/d3d12/d3d12_counters.cpp index ff7d1a67d..24c2d91a5 100644 --- a/renderdoc/driver/d3d12/d3d12_counters.cpp +++ b/renderdoc/driver/d3d12/d3d12_counters.cpp @@ -87,7 +87,7 @@ CounterDescription D3D12Replay::DescribeCounter(GPUCounter counterID) desc.description = "Time taken for this event on the GPU, as measured by delta between two GPU timestamps."; desc.resultByteWidth = 8; - desc.resultType = CompType::Double; + desc.resultType = CompType::Float; desc.unit = CounterUnit::Seconds; break; case GPUCounter::InputVerticesRead: diff --git a/renderdoc/driver/gl/gl_counters.cpp b/renderdoc/driver/gl/gl_counters.cpp index f6a3decdd..4623b3e66 100644 --- a/renderdoc/driver/gl/gl_counters.cpp +++ b/renderdoc/driver/gl/gl_counters.cpp @@ -122,7 +122,7 @@ CounterDescription GLReplay::DescribeCounter(GPUCounter counterID) desc.description = "Time taken for this event on the GPU, as measured by delta between two GPU timestamps."; desc.resultByteWidth = 8; - desc.resultType = CompType::Double; + desc.resultType = CompType::Float; desc.unit = CounterUnit::Seconds; break; case GPUCounter::InputVerticesRead: diff --git a/renderdoc/driver/gl/gl_overlay.cpp b/renderdoc/driver/gl/gl_overlay.cpp index a266d6761..fadf486bc 100644 --- a/renderdoc/driver/gl/gl_overlay.cpp +++ b/renderdoc/driver/gl/gl_overlay.cpp @@ -1419,36 +1419,43 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, Debug postvs.format.compType == CompType::UNorm || postvs.format.compType == CompType::SNorm) { - GLenum fmttype = eGL_UNSIGNED_INT; + if(postvs.format.compByteWidth == 8) + { + drv.glVertexAttribLFormat(0, postvs.format.compCount, eGL_DOUBLE, 0); + } + else + { + GLenum fmttype = eGL_UNSIGNED_INT; - if(postvs.format.compByteWidth == 4) - { - if(postvs.format.compType == CompType::Float) - fmttype = eGL_FLOAT; - else if(postvs.format.compType == CompType::UNorm) - fmttype = eGL_UNSIGNED_INT; - else if(postvs.format.compType == CompType::SNorm) - fmttype = eGL_INT; - } - else if(postvs.format.compByteWidth == 2) - { - if(postvs.format.compType == CompType::Float) - fmttype = eGL_HALF_FLOAT; - else if(postvs.format.compType == CompType::UNorm) - fmttype = eGL_UNSIGNED_SHORT; - else if(postvs.format.compType == CompType::SNorm) - fmttype = eGL_SHORT; - } - else if(postvs.format.compByteWidth == 1) - { - if(postvs.format.compType == CompType::UNorm) - fmttype = eGL_UNSIGNED_BYTE; - else if(postvs.format.compType == CompType::SNorm) - fmttype = eGL_BYTE; - } + if(postvs.format.compByteWidth == 4) + { + if(postvs.format.compType == CompType::Float) + fmttype = eGL_FLOAT; + else if(postvs.format.compType == CompType::UNorm) + fmttype = eGL_UNSIGNED_INT; + else if(postvs.format.compType == CompType::SNorm) + fmttype = eGL_INT; + } + else if(postvs.format.compByteWidth == 2) + { + if(postvs.format.compType == CompType::Float) + fmttype = eGL_HALF_FLOAT; + else if(postvs.format.compType == CompType::UNorm) + fmttype = eGL_UNSIGNED_SHORT; + else if(postvs.format.compType == CompType::SNorm) + fmttype = eGL_SHORT; + } + else if(postvs.format.compByteWidth == 1) + { + if(postvs.format.compType == CompType::UNorm) + fmttype = eGL_UNSIGNED_BYTE; + else if(postvs.format.compType == CompType::SNorm) + fmttype = eGL_BYTE; + } - drv.glVertexAttribFormat(0, postvs.format.compCount, fmttype, - postvs.format.compType != CompType::Float, 0); + drv.glVertexAttribFormat(0, postvs.format.compCount, fmttype, + postvs.format.compType != CompType::Float, 0); + } } else if(postvs.format.compType == CompType::UInt || postvs.format.compType == CompType::SInt) @@ -1479,10 +1486,6 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, Debug drv.glVertexAttribIFormat(0, postvs.format.compCount, fmttype, 0); } - else if(postvs.format.compType == CompType::Double) - { - drv.glVertexAttribLFormat(0, postvs.format.compCount, eGL_DOUBLE, 0); - } GLuint vb = m_pDriver->GetResourceManager()->GetCurrentResource(postvs.vertexResourceId).name; diff --git a/renderdoc/driver/gl/gl_rendermesh.cpp b/renderdoc/driver/gl/gl_rendermesh.cpp index 58cc7ec7e..2daa77e96 100644 --- a/renderdoc/driver/gl/gl_rendermesh.cpp +++ b/renderdoc/driver/gl/gl_rendermesh.cpp @@ -207,36 +207,45 @@ void GLReplay::RenderMesh(uint32_t eventId, const rdcarray &secondar meshData[i]->format.compType == CompType::UNorm || meshData[i]->format.compType == CompType::SNorm) { - GLenum fmttype = eGL_UNSIGNED_INT; + if(meshData[i]->format.compByteWidth == 8) + { + drv.glVertexAttribLFormat(i, meshData[i]->format.compCount, eGL_DOUBLE, 0); - if(meshData[i]->format.compByteWidth == 4) - { - if(meshData[i]->format.compType == CompType::Float) - fmttype = eGL_FLOAT; - else if(meshData[i]->format.compType == CompType::UNorm) - fmttype = eGL_UNSIGNED_INT; - else if(meshData[i]->format.compType == CompType::SNorm) - fmttype = eGL_INT; + progidx |= (1 << i); } - else if(meshData[i]->format.compByteWidth == 2) + else { - if(meshData[i]->format.compType == CompType::Float) - fmttype = eGL_HALF_FLOAT; - else if(meshData[i]->format.compType == CompType::UNorm) - fmttype = eGL_UNSIGNED_SHORT; - else if(meshData[i]->format.compType == CompType::SNorm) - fmttype = eGL_SHORT; - } - else if(meshData[i]->format.compByteWidth == 1) - { - if(meshData[i]->format.compType == CompType::UNorm) - fmttype = eGL_UNSIGNED_BYTE; - else if(meshData[i]->format.compType == CompType::SNorm) - fmttype = eGL_BYTE; - } + GLenum fmttype = eGL_UNSIGNED_INT; - drv.glVertexAttribFormat(i, meshData[i]->format.compCount, fmttype, - meshData[i]->format.compType != CompType::Float, 0); + if(meshData[i]->format.compByteWidth == 4) + { + if(meshData[i]->format.compType == CompType::Float) + fmttype = eGL_FLOAT; + else if(meshData[i]->format.compType == CompType::UNorm) + fmttype = eGL_UNSIGNED_INT; + else if(meshData[i]->format.compType == CompType::SNorm) + fmttype = eGL_INT; + } + else if(meshData[i]->format.compByteWidth == 2) + { + if(meshData[i]->format.compType == CompType::Float) + fmttype = eGL_HALF_FLOAT; + else if(meshData[i]->format.compType == CompType::UNorm) + fmttype = eGL_UNSIGNED_SHORT; + else if(meshData[i]->format.compType == CompType::SNorm) + fmttype = eGL_SHORT; + } + else if(meshData[i]->format.compByteWidth == 1) + { + if(meshData[i]->format.compType == CompType::UNorm) + fmttype = eGL_UNSIGNED_BYTE; + else if(meshData[i]->format.compType == CompType::SNorm) + fmttype = eGL_BYTE; + } + + drv.glVertexAttribFormat(i, meshData[i]->format.compCount, fmttype, + meshData[i]->format.compType != CompType::Float, 0); + } } else if(meshData[i]->format.compType == CompType::UInt || meshData[i]->format.compType == CompType::SInt) @@ -267,12 +276,6 @@ void GLReplay::RenderMesh(uint32_t eventId, const rdcarray &secondar drv.glVertexAttribIFormat(i, meshData[i]->format.compCount, fmttype, 0); } - else if(meshData[i]->format.compType == CompType::Double) - { - drv.glVertexAttribLFormat(i, meshData[i]->format.compCount, eGL_DOUBLE, 0); - - progidx |= (1 << i); - } GLintptr offs = (GLintptr)meshData[i]->vertexByteOffset; diff --git a/renderdoc/driver/gl/gl_replay.cpp b/renderdoc/driver/gl/gl_replay.cpp index 4e80a1724..e684ccf96 100644 --- a/renderdoc/driver/gl/gl_replay.cpp +++ b/renderdoc/driver/gl/gl_replay.cpp @@ -912,7 +912,7 @@ void GLReplay::SavePipelineState(uint32_t eventId) break; case eGL_DOUBLE: fmt.compByteWidth = 8; - fmt.compType = CompType::Double; + fmt.compType = CompType::Float; break; case eGL_HALF_FLOAT: fmt.compByteWidth = 2; diff --git a/renderdoc/driver/gl/wrappers/gl_emulated.cpp b/renderdoc/driver/gl/wrappers/gl_emulated.cpp index d00a4a116..b22696b33 100644 --- a/renderdoc/driver/gl/wrappers/gl_emulated.cpp +++ b/renderdoc/driver/gl/wrappers/gl_emulated.cpp @@ -3247,8 +3247,8 @@ void APIENTRY _glGetTexImage(GLenum target, GLint level, const GLenum format, co case eGL_BYTE: readFmt.compType = CompType::SNorm; break; case eGL_HALF_FLOAT_OES: case eGL_HALF_FLOAT: - case eGL_FLOAT: readFmt.compType = CompType::Float; break; - case eGL_DOUBLE: readFmt.compType = CompType::Double; break; + case eGL_FLOAT: + case eGL_DOUBLE: readFmt.compType = CompType::Float; break; default: RDCERR("Unexpected readType %s", ToStr(readType).c_str()); readFmt.compType = CompType::UNorm; diff --git a/renderdoc/driver/ihv/amd/amd_counters.cpp b/renderdoc/driver/ihv/amd/amd_counters.cpp index 5b4801c7b..ba00376c5 100644 --- a/renderdoc/driver/ihv/amd/amd_counters.cpp +++ b/renderdoc/driver/ihv/amd/amd_counters.cpp @@ -356,7 +356,7 @@ CounterDescription AMDCounters::InternalGetCounterDescription(uint32_t internalI switch(type) { case GPA_DATA_TYPE_FLOAT64: ///< Result will be a 64-bit float - desc.resultType = CompType::Double; + desc.resultType = CompType::Float; desc.resultByteWidth = sizeof(double); break; case GPA_DATA_TYPE_UINT64: ///< Result will be a 64-bit unsigned int @@ -611,7 +611,7 @@ rdcarray AMDCounters::GetCounterData(uint32_t sessionID, uint32_t ret.push_back(CounterResult(eventIDs[s], counters[c], (uint64_t)value)); } break; - case CompType::Double: + case CompType::Float: { double value = 0.0; memcpy(&value, (double *)(pSampleResult) + c, sizeof(double)); diff --git a/renderdoc/driver/ihv/arm/arm_counters.cpp b/renderdoc/driver/ihv/arm/arm_counters.cpp index 1301446f4..c6c3b97e4 100644 --- a/renderdoc/driver/ihv/arm/arm_counters.cpp +++ b/renderdoc/driver/ihv/arm/arm_counters.cpp @@ -47,10 +47,12 @@ static CounterDescription ARMCreateCounterDescription(GPUCounter index, else desc.description = lzdDesc.description; + desc.resultByteWidth = 8; + switch(lzdDesc.result_type) { case LZD_TYPE_INT: desc.resultType = CompType::UInt; break; - case LZD_TYPE_DOUBLE: desc.resultType = CompType::Double; break; + case LZD_TYPE_DOUBLE: desc.resultType = CompType::Float; break; default: desc.resultType = CompType::UInt; break; } @@ -192,7 +194,7 @@ void ARMCounters::EndSample() { data.u64 = m_Api->ReadCounterInt(m_Ctx, counterId); } - else if(desc.resultType == CompType::Double) + else if(desc.resultType == CompType::Float) { data.d = m_Api->ReadCounterDouble(m_Ctx, counterId); } @@ -217,7 +219,7 @@ rdcarray ARMCounters::GetCounterData(const rdcarray &ev { result.push_back(CounterResult(eventId, counter, data.u64)); } - else if(desc.resultType == CompType::Double) + else if(desc.resultType == CompType::Float) { result.push_back(CounterResult(eventId, counter, data.d)); } diff --git a/renderdoc/driver/ihv/intel/intel_counters.cpp b/renderdoc/driver/ihv/intel/intel_counters.cpp index 14713eba1..aaaa88642 100644 --- a/renderdoc/driver/ihv/intel/intel_counters.cpp +++ b/renderdoc/driver/ihv/intel/intel_counters.cpp @@ -167,7 +167,7 @@ rdcarray IntelCounters::EnumerateCounters() counterDesc.description = metricParams->LongName; counterDesc.category = metricParams->GroupName; counterDesc.resultByteWidth = 8; - counterDesc.resultType = CompType::Double; + counterDesc.resultType = CompType::Float; switch(metricParams->ResultType) { case RESULT_UINT32: diff --git a/renderdoc/driver/ihv/intel/intel_gl_counters.cpp b/renderdoc/driver/ihv/intel/intel_gl_counters.cpp index 41885c564..d2eb657d8 100644 --- a/renderdoc/driver/ihv/intel/intel_gl_counters.cpp +++ b/renderdoc/driver/ihv/intel/intel_gl_counters.cpp @@ -67,7 +67,7 @@ static CompType glToRdcCounterType(GLuint glDataType) case GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL: return CompType::UInt; case GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL: return CompType::UInt; case GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL: return CompType::Float; - case GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL: return CompType::Double; + case GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL: return CompType::Float; case GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL: return CompType::UInt; default: RDCERR("Wrong counter data type: %u", glDataType); } @@ -291,18 +291,21 @@ rdcarray IntelGlCounters::GetCounterData(uint32_t maxSampleIndex, const IntelGlCounter &counter = m_Counters[GPUCounterToCounterIndex(c)]; switch(counter.desc.resultType) { - case CompType::Double: - { - double r; - CopyData(&r, counter, s, maxSampleIndex); - ret.push_back(CounterResult(eventIDs[s], counter.desc.counter, r)); - break; - } case CompType::Float: { - float r; - CopyData(&r, counter, s, maxSampleIndex); - ret.push_back(CounterResult(eventIDs[s], counter.desc.counter, r)); + if(counter.desc.resultByteWidth == 8) + { + double r; + CopyData(&r, counter, s, maxSampleIndex); + ret.push_back(CounterResult(eventIDs[s], counter.desc.counter, r)); + break; + } + else + { + float r; + CopyData(&r, counter, s, maxSampleIndex); + ret.push_back(CounterResult(eventIDs[s], counter.desc.counter, r)); + } break; } case CompType::UInt: diff --git a/renderdoc/driver/ihv/nv/nv_counters.cpp b/renderdoc/driver/ihv/nv/nv_counters.cpp index 5adda1e81..973611e34 100644 --- a/renderdoc/driver/ihv/nv/nv_counters.cpp +++ b/renderdoc/driver/ihv/nv/nv_counters.cpp @@ -111,7 +111,7 @@ int NvPmGatherCounters(NVPMCounterID unCounterID, const char *pcCounterName, voi // because sometimes they could be `percents` and sometimes 'ratios' (avg. instructions per // shader invocation, for example) desc.unit = CounterUnit::Ratio; - desc.resultType = CompType::Double; + desc.resultType = CompType::Float; desc.resultByteWidth = sizeof(double); } else @@ -132,7 +132,7 @@ int NvPmGatherCounters(NVPMCounterID unCounterID, const char *pcCounterName, voi // Same problem as for counters with 'ratio' display type but: // don't know for sure if a counter should be displayed as is or annotated with `%` symbol desc.unit = CounterUnit::Ratio; - desc.resultType = CompType::Double; + desc.resultType = CompType::Float; desc.resultByteWidth = sizeof(double); } diff --git a/renderdoc/driver/vulkan/vk_counters.cpp b/renderdoc/driver/vulkan/vk_counters.cpp index def2fce92..59d152459 100644 --- a/renderdoc/driver/vulkan/vk_counters.cpp +++ b/renderdoc/driver/vulkan/vk_counters.cpp @@ -52,7 +52,7 @@ static void GetKHRUnitDescription(const VkPerformanceCounterUnitKHR khrUnit, const VkPerformanceCounterStorageKHR khrStorage, CounterUnit &unit, CompType &type, uint32_t &byteWidth) { - type = isFloatKhrStorage(khrStorage) ? CompType::Double : CompType::UInt; + type = isFloatKhrStorage(khrStorage) ? CompType::Float : CompType::UInt; byteWidth = 8; switch(khrUnit) @@ -209,7 +209,7 @@ CounterDescription VulkanReplay::DescribeCounter(GPUCounter counterID) // Special chase for time units. if(khrCounter.unit == VK_PERFORMANCE_COUNTER_UNIT_NANOSECONDS_KHR) - rdcDesc.resultType = CompType::Double; + rdcDesc.resultType = CompType::Float; return rdcDesc; } @@ -229,7 +229,7 @@ CounterDescription VulkanReplay::DescribeCounter(GPUCounter counterID) desc.description = "Time taken for this event on the GPU, as measured by delta between two GPU timestamps."; desc.resultByteWidth = 8; - desc.resultType = CompType::Double; + desc.resultType = CompType::Float; desc.unit = CounterUnit::Seconds; break; case GPUCounter::InputVerticesRead: diff --git a/renderdoc/driver/vulkan/vk_postvs.cpp b/renderdoc/driver/vulkan/vk_postvs.cpp index 216326614..c45840798 100644 --- a/renderdoc/driver/vulkan/vk_postvs.cpp +++ b/renderdoc/driver/vulkan/vk_postvs.cpp @@ -509,15 +509,16 @@ static void ConvertToMeshOutputCompute(const ShaderReflection &refl, const SPIRV else if(compType == CompType::Float) { io.tbuffer = tbuffer_float; - } - else if(compType == CompType::Double) - { - // doubles are loaded packed from a uint tbuffer - io.tbuffer = tbuffer_uint; + + if(refl.inputSignature[i].varType == VarType::Double) + { + // doubles are loaded packed from a uint tbuffer + io.tbuffer = tbuffer_uint; + } } // doubles are loaded as uvec4 and then packed in pairs, so we need to declare vec4ID as uvec4 - if(compType == CompType::Double) + if(refl.inputSignature[i].varType == VarType::Double) io.vec4ID = editor.DeclareType(rdcspv::Vector(rdcspv::scalar(), 4)); else io.vec4ID = editor.DeclareType(rdcspv::Vector(scalarType, 4)); diff --git a/renderdoc/driver/vulkan/vk_resources.cpp b/renderdoc/driver/vulkan/vk_resources.cpp index de8db1df6..32be72aa1 100644 --- a/renderdoc/driver/vulkan/vk_resources.cpp +++ b/renderdoc/driver/vulkan/vk_resources.cpp @@ -2289,11 +2289,11 @@ ResourceFormat MakeResourceFormat(VkFormat fmt) case VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT: case VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT: case VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT: - case VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT: ret.compType = CompType::Float; break; + case VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT: case VK_FORMAT_R64_SFLOAT: case VK_FORMAT_R64G64_SFLOAT: case VK_FORMAT_R64G64B64_SFLOAT: - case VK_FORMAT_R64G64B64A64_SFLOAT: ret.compType = CompType::Double; break; + case VK_FORMAT_R64G64B64A64_SFLOAT: ret.compType = CompType::Float; break; case VK_FORMAT_S8_UINT: case VK_FORMAT_D16_UNORM: case VK_FORMAT_X8_D24_UNORM_PACK32: @@ -2908,7 +2908,7 @@ VkFormat MakeVkFormat(ResourceFormat fmt) } else if(fmt.compByteWidth == 8) { - if(fmt.compType == CompType::Float || fmt.compType == CompType::Double) + if(fmt.compType == CompType::Float) ret = VK_FORMAT_R64G64B64A64_SFLOAT; else if(fmt.compType == CompType::SInt) ret = VK_FORMAT_R64G64B64A64_SINT; @@ -2977,7 +2977,7 @@ VkFormat MakeVkFormat(ResourceFormat fmt) } else if(fmt.compByteWidth == 8) { - if(fmt.compType == CompType::Float || fmt.compType == CompType::Double) + if(fmt.compType == CompType::Float) ret = VK_FORMAT_R64G64B64_SFLOAT; else if(fmt.compType == CompType::SInt) ret = VK_FORMAT_R64G64B64_SINT; @@ -3046,7 +3046,7 @@ VkFormat MakeVkFormat(ResourceFormat fmt) } else if(fmt.compByteWidth == 8) { - if(fmt.compType == CompType::Float || fmt.compType == CompType::Double) + if(fmt.compType == CompType::Float) ret = VK_FORMAT_R64G64_SFLOAT; else if(fmt.compType == CompType::SInt) ret = VK_FORMAT_R64G64_SINT; @@ -3115,7 +3115,7 @@ VkFormat MakeVkFormat(ResourceFormat fmt) } else if(fmt.compByteWidth == 8) { - if(fmt.compType == CompType::Float || fmt.compType == CompType::Double) + if(fmt.compType == CompType::Float) ret = VK_FORMAT_R64_SFLOAT; else if(fmt.compType == CompType::SInt) ret = VK_FORMAT_R64_SINT; diff --git a/renderdoc/maths/formatpacking.cpp b/renderdoc/maths/formatpacking.cpp index 990278cc8..11b0a0ff9 100644 --- a/renderdoc/maths/formatpacking.cpp +++ b/renderdoc/maths/formatpacking.cpp @@ -440,7 +440,7 @@ FloatVector DecodeFormattedComponents(const ResourceFormat &fmt, const byte *dat const uint64_t *u64 = (const uint64_t *)data; const int64_t *i64 = (const int64_t *)data; - if(compType == CompType::Double || compType == CompType::Float) + if(compType == CompType::Float) { *comp = float(*(const double *)u64); } @@ -683,7 +683,7 @@ void EncodeFormattedComponents(const ResourceFormat &fmt, FloatVector v, byte *d uint64_t *u64 = (uint64_t *)data; int64_t *i64 = (int64_t *)data; - if(compType == CompType::Double || compType == CompType::Float) + if(compType == CompType::Float) { *d = *comp; } diff --git a/renderdoc/replay/entry_points.cpp b/renderdoc/replay/entry_points.cpp index 1146a6bb6..c885427b3 100644 --- a/renderdoc/replay/entry_points.cpp +++ b/renderdoc/replay/entry_points.cpp @@ -838,8 +838,7 @@ static rdcstr ResourceFormatName(const ResourceFormat &fmt) switch(fmt.compType) { case CompType::Typeless: return ret + "_TYPELESS"; - case CompType::Float: - case CompType::Double: return ret + "_FLOAT"; + case CompType::Float: return ret + "_FLOAT"; case CompType::UNorm: return ret + "_UNORM"; case CompType::SNorm: return ret + "_SNORM"; case CompType::UInt: return ret + "_UINT"; diff --git a/util/test/rdtest/analyse.py b/util/test/rdtest/analyse.py index 5336d31f3..ab2fa9f72 100644 --- a/util/test/rdtest/analyse.py +++ b/util/test/rdtest/analyse.py @@ -188,7 +188,7 @@ def get_postvs_attrs(controller: rd.ReplayController, mesh: rd.MeshFormat, data_ # while others will tightly pack fmt = attrs[i].mesh.format - elem_size = (8 if fmt.compType == rd.CompType.Double else 4) + elem_size = (8 if fmt.compByteWidth > 4 else 4) alignment = elem_size if fmt.compCount == 2: @@ -224,7 +224,6 @@ def unpack_data(fmt: rd.ResourceFormat, data: bytes, data_offset: int): format_chars[rd.CompType.UScaled] = format_chars[rd.CompType.UInt] format_chars[rd.CompType.SNorm] = format_chars[rd.CompType.SInt] format_chars[rd.CompType.SScaled] = format_chars[rd.CompType.SInt] - format_chars[rd.CompType.Double] = format_chars[rd.CompType.Float] # We need to fetch compCount components vertex_format = '=' + str(fmt.compCount) + format_chars[fmt.compType][fmt.compByteWidth]