mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 09:00:44 +00:00
Remove CompType::Double
* This is a leftover artifact from before we had general extended type support and double was the only non-32 bit type we handled. Now we support most type formats so doubles are just CompType::Float with 8 byte width
This commit is contained in:
@@ -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<double>(data, end, ok));
|
||||
}
|
||||
else
|
||||
{
|
||||
// unorm/snorm
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 <UNorm>` or
|
||||
:data:`floating point <float>`.
|
||||
|
||||
.. data:: Double
|
||||
|
||||
A double-precision (64-bit) floating point value.
|
||||
An opaque value storing depth information, either :data:`floating point <float>` for 32-bit depth
|
||||
values or else :data:`unsigned normalised <UNorm>` 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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -207,36 +207,45 @@ void GLReplay::RenderMesh(uint32_t eventId, const rdcarray<MeshFormat> &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<MeshFormat> &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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<CounterResult> 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));
|
||||
|
||||
@@ -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<CounterResult> ARMCounters::GetCounterData(const rdcarray<uint32_t> &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));
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ rdcarray<CounterDescription> 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:
|
||||
|
||||
@@ -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<CounterResult> 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:
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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<uint32_t>(), 4));
|
||||
else
|
||||
io.vec4ID = editor.DeclareType(rdcspv::Vector(scalarType, 4));
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user